[
  {
    "path": ".circleci/config.yml",
    "content": "# Configuration file for https://circleci.com/gh/angular/material\n\n# Note: YAML anchors allow an object to be re-used, reducing duplication.\n# The ampersand declares an alias for an object, then later the `<<: *name`\n# syntax dereferences it.\n# See http://blog.daemonl.com/2016/02/yaml.html\n# To validate changes, use an online parser, eg. http://yaml-online-parser.appspot.com/\n\n# Find the latest version and SHA here: https://hub.docker.com/r/circleci/node/tags\nvar_1: &docker_image circleci/node:14.16.1-browsers\nvar_2: &cache_key angularjs-material-{{ checksum \"package-lock.json\" }}\n\n# Settings common to each job\nvar_3: &job_defaults\n  working_directory: ~/ng\n  docker:\n    - image: *docker_image\n\n# Restores the cache that could be available for the current lock file. The cache\n# includes the node modules.\nvar_4: &restore_cache\n  restore_cache:\n    key: *cache_key\n\n# Saves the cache for the current lock file. We store the node modules cache in order to make\n#  subsequent builds faster.\nvar_5: &save_cache\n  save_cache:\n    key: *cache_key\n    paths:\n      - \"node_modules\"\n      - \"$HOME/.npm\"\n      - \"tmp/angular.js\"\n\n# Job step that ensures that the node module dependencies are installed and up-to-date. We use\n# NPM with the frozen lockfile option in order to make sure that lock file and package.json are\n# in sync. Unlike in Travis, we don't need to manually purge the node modules if stale because\n# CircleCI automatically discards the cache if the checksum of the lock file has changed.\nvar_6: &npm_install\n  run: npm ci\n\nvar_7: &store_junit_test_results\n  store_test_results:\n    path: ./artifacts/junit\n\n# Branch filter that we can specify for jobs that should only run on publish branches. This filter\n# is used to ensure that not all upstream branches will be published as GitHub builds\n# (e.g. revert branches, feature branches)\nvar_8: &publish_branches_filter\n  branches:\n    only:\n      - master\n\n# -----------------------------\n# Container version of CircleCI\n# -----------------------------\nversion: 2.1\n\norbs:\n  build-tools: circleci/build-tools@2.9.0\n\ncommands:\n  # Command for checking out the source code from GitHub. This also ensures that the source code\n  # can be merged to the master branch without conflicts.\n  checkout_and_rebase:\n    description: Checkout and verify clean merge with master\n    steps:\n      - checkout\n      - run:\n          name: Set git user.name and user.email for rebase.\n          # User is required for rebase.\n          command: |\n            git config user.name \"angular-ci\"\n            git config user.email \"angular-ci\"\n      - build-tools/merge-with-parent:\n          parent: master\n\n# -----------------------------------------------------------------------------------------\n# Job definitions. Jobs which are defined just here, will not run automatically. Each job\n# must be part of a workflow definition in order to run for PRs and push builds.\n# -----------------------------------------------------------------------------------------\njobs:\n\n  # ----------------------------------\n  # Lint job. Runs the lint task.\n  # ----------------------------------\n  lint:\n    <<: *job_defaults\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: npm run lint\n\n  # -----------------------------------\n  # Build and test job.\n  # -----------------------------------\n  build:\n    <<: *job_defaults\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: npm run build\n      - *save_cache\n\n  build_js_modules:\n    <<: *job_defaults\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: npm run build:modules\n      - *save_cache\n\n  build_closure_modules:\n    <<: *job_defaults\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: npm run build:closure\n      - *save_cache\n\n  # ------------------------------------------------------------------------------------------\n  # Jobs that run the unit tests on locally installed browsers (Chrome and Firefox headless).\n  # The available browsers are included in the Docker image.\n  # ------------------------------------------------------------------------------------------\n  test_angularjs_1_7:\n    <<: *job_defaults\n    environment:\n      NG_VERSION: \"1.7\"\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: ./scripts/circleci/run-tests.sh\n      - *store_junit_test_results\n\n  test_angularjs_1_8:\n    <<: *job_defaults\n    environment:\n      NG_VERSION: \"1.8\"\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: ./scripts/circleci/run-tests.sh\n      - *store_junit_test_results\n\n  test_angularjs_snapshot:\n    <<: *job_defaults\n    environment:\n      NG_VERSION: \"snapshot\"\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: ./scripts/circleci/run-tests.sh\n      - *store_junit_test_results\n\n  # ------------------------------------------------------------------------------------------\n  # Jobs that snapshot the `master` branch and update the docs on commits to master\n  # ------------------------------------------------------------------------------------------\n  update_and_snapshot_docs:\n    <<: *job_defaults\n    steps:\n      - checkout_and_rebase\n      - *restore_cache\n      - *npm_install\n      - run: sudo npm i -g gulp@3.9\n      - run: git config --global --unset url.ssh://git@github.com.insteadof\n      - run: ./scripts/circleci/update-snapshot-and-docs.sh --sha=${CIRCLE_SHA1}\n\n# ----------------------------------------------------------------------------------------\n# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if\n# one job depends on another.\n# ----------------------------------------------------------------------------------------\nworkflows:\n  version: 2\n\n  # Lint workflow. As we want to lint in one job, this is a workflow with just one job.\n  lint:\n    jobs:\n      - lint\n\n  # Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs\n  # that build and test source code should be part of this workflow.\n  build_and_test:\n    jobs:\n      - build\n      - test_angularjs_1_7:\n          requires:\n            - build\n      - test_angularjs_1_8:\n          requires:\n            - build\n      - test_angularjs_snapshot:\n          requires:\n            - build\n      - build_js_modules:\n          requires:\n            - build\n      - build_closure_modules:\n          requires:\n            - build\n      - update_and_snapshot_docs:\n            filters: *publish_branches_filter\n            requires:\n              - test_angularjs_1_7\n              - test_angularjs_1_8\n              - test_angularjs_snapshot\n              - build_js_modules\n              - build_closure_modules\n"
  },
  {
    "path": ".clang-format",
    "content": "Language:        JavaScript\nBasedOnStyle:    Google\nColumnLimit:     100\n\nTabWidth:                2\nContinuationIndentWidth: 4\nMaxEmptyLinesToKeep    : 2\n\nAllowShortBlocksOnASingleLine:              false\nAllowShortIfStatementsOnASingleLine:        false\nAllowShortLoopsOnASingleLine:               false\nAllowShortFunctionsOnASingleLine:           Empty\n\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".eslintignore",
    "content": "# Ignore miscellaneous folders\n.github/\n.idea/\nnode_modules/\ndist/\ntmp/\nbower-material/\ncode.material.angularjs.org/\n\n# Ignore certain project files\nsrc/core/services/compiler/compiler.spec.js\ndocs/config/template/*.js\ndocs/app/js/highlight.pack.js\n"
  },
  {
    "path": ".eslintrc.json",
    "content": "{\n  \"extends\": \"eslint:recommended\",\n  \"parserOptions\": {\n    \"ecmaVersion\": 2021\n  },\n  \"rules\": {\n    \"accessor-pairs\": \"error\",\n    \"array-bracket-newline\": \"off\",\n    \"array-bracket-spacing\": [\"error\", \"never\"],\n    \"array-callback-return\": \"error\",\n    \"array-element-newline\": \"off\",\n    \"arrow-body-style\": \"error\",\n    \"arrow-parens\": [\n      \"error\",\n      \"as-needed\"\n    ],\n    \"arrow-spacing\": \"error\",\n    \"block-scoped-var\": \"off\",\n    \"block-spacing\": \"off\",\n    \"brace-style\": \"off\",\n    \"callback-return\": \"off\",\n    \"camelcase\": \"off\",\n    \"capitalized-comments\": \"off\",\n    \"class-methods-use-this\": \"error\",\n    \"comma-dangle\": \"off\",\n    \"comma-spacing\": \"off\",\n    \"comma-style\": [\n      \"error\",\n      \"last\"\n    ],\n    \"complexity\": \"off\",\n    \"computed-property-spacing\": \"off\",\n    \"consistent-return\": \"off\",\n    \"consistent-this\": \"off\",\n    \"curly\": \"off\",\n    \"default-case\": \"off\",\n    \"dot-location\": \"off\",\n    \"dot-notation\": \"off\",\n    \"eol-last\": \"off\",\n    \"eqeqeq\": \"off\",\n    \"for-direction\": \"error\",\n    \"func-call-spacing\": \"off\",\n    \"func-name-matching\": \"off\",\n    \"func-names\": \"off\",\n    \"func-style\": \"off\",\n    \"generator-star-spacing\": \"error\",\n    \"getter-return\": \"error\",\n    \"global-require\": \"off\",\n    \"guard-for-in\": \"off\",\n    \"handle-callback-err\": \"error\",\n    \"id-denylist\": [\"error\"],\n    \"id-length\": \"off\",\n    \"id-match\": \"error\",\n    \"indent\": \"off\",\n    \"indent-legacy\": \"off\",\n    \"init-declarations\": \"off\",\n    \"jsx-quotes\": \"error\",\n    \"key-spacing\": \"off\",\n    \"keyword-spacing\": [\"error\", {\"before\":  true, \"after\":  true}],\n    \"line-comment-position\": \"off\",\n    \"linebreak-style\": \"off\",\n    \"lines-around-comment\": \"off\",\n    \"lines-around-directive\": \"off\",\n    \"max-depth\": \"error\",\n    \"max-len\": \"off\",\n    \"max-lines\": \"off\",\n    \"max-nested-callbacks\": \"error\",\n    \"max-params\": \"off\",\n    \"max-statements\": \"off\",\n    \"max-statements-per-line\": \"off\",\n    \"multiline-ternary\": \"off\",\n    \"new-parens\": \"error\",\n    \"newline-after-var\": \"off\",\n    \"newline-before-return\": \"off\",\n    \"newline-per-chained-call\": \"off\",\n    \"no-alert\": \"off\",\n    \"no-array-constructor\": \"error\",\n    \"no-await-in-loop\": \"error\",\n    \"no-bitwise\": \"off\",\n    \"no-buffer-constructor\": \"error\",\n    \"no-caller\": \"error\",\n    \"no-catch-shadow\": \"error\",\n    \"no-confusing-arrow\": \"error\",\n    \"no-console\": [\n      \"off\"\n    ],\n    \"no-constant-condition\": [\n      \"error\",\n      {\n        \"checkLoops\": false\n      }\n    ],\n    \"no-continue\": \"off\",\n    \"no-div-regex\": \"off\",\n    \"no-duplicate-imports\": \"error\",\n    \"no-else-return\": \"off\",\n    \"no-empty-function\": \"off\",\n    \"no-eq-null\": \"off\",\n    \"no-eval\": \"error\",\n    \"no-extend-native\": \"off\",\n    \"no-extra-bind\": \"off\",\n    \"no-extra-label\": \"error\",\n    \"no-extra-parens\": \"off\",\n    \"no-floating-decimal\": \"error\",\n    \"no-implicit-coercion\": [\n      \"error\",\n      {\n        \"boolean\": false,\n        \"number\": false,\n        \"string\": false\n      }\n    ],\n    \"no-implicit-globals\": \"off\",\n    \"no-implied-eval\": \"error\",\n    \"no-inline-comments\": \"off\",\n    \"no-inner-declarations\": [\n      \"error\",\n      \"functions\"\n    ],\n    \"no-invalid-this\": \"off\",\n    \"no-iterator\": \"error\",\n    \"no-label-var\": \"error\",\n    \"no-labels\": \"error\",\n    \"no-lone-blocks\": \"error\",\n    \"no-lonely-if\": \"off\",\n    \"no-loop-func\": \"error\",\n    \"no-magic-numbers\": \"off\",\n    \"no-mixed-operators\": \"off\",\n    \"no-mixed-requires\": \"error\",\n    \"no-multi-assign\": \"off\",\n    \"no-multi-spaces\": \"off\",\n    \"no-multi-str\": \"off\",\n    \"no-multiple-empty-lines\": \"off\",\n    \"no-native-reassign\": \"error\",\n    \"no-negated-condition\": \"off\",\n    \"no-negated-in-lhs\": \"error\",\n    \"no-nested-ternary\": \"off\",\n    \"no-new\": \"error\",\n    \"no-new-func\": \"error\",\n    \"no-new-object\": \"error\",\n    \"no-new-require\": \"error\",\n    \"no-new-wrappers\": \"error\",\n    \"no-octal-escape\": \"error\",\n    \"no-param-reassign\": \"off\",\n    \"no-path-concat\": \"error\",\n    \"no-plusplus\": \"off\",\n    \"no-process-env\": \"off\",\n    \"no-process-exit\": \"error\",\n    \"no-proto\": \"error\",\n    \"no-prototype-builtins\": \"off\",\n    \"no-restricted-globals\": \"error\",\n    \"no-restricted-imports\": \"error\",\n    \"no-restricted-modules\": \"error\",\n    \"no-restricted-properties\": \"error\",\n    \"no-restricted-syntax\": \"error\",\n    \"no-return-assign\": \"off\",\n    \"no-return-await\": \"error\",\n    \"no-script-url\": \"error\",\n    \"no-self-compare\": \"error\",\n    \"no-sequences\": \"off\",\n    \"no-shadow\": \"off\",\n    \"no-shadow-restricted-names\": \"error\",\n    \"no-spaced-func\": \"off\",\n    \"no-sync\": \"off\",\n    \"no-tabs\": \"off\",\n    \"no-template-curly-in-string\": \"error\",\n    \"no-ternary\": \"off\",\n    \"no-throw-literal\": \"off\",\n    \"no-trailing-spaces\": [\"error\"],\n    \"no-undef-init\": \"error\",\n    \"no-undefined\": \"off\",\n    \"no-underscore-dangle\": \"off\",\n    \"no-unmodified-loop-condition\": \"error\",\n    \"no-unneeded-ternary\": \"off\",\n    \"no-unused-expressions\": \"off\",\n    \"no-use-before-define\": \"off\",\n    \"no-useless-call\": \"error\",\n    \"no-useless-computed-key\": \"error\",\n    \"no-useless-concat\": \"off\",\n    \"no-useless-constructor\": \"error\",\n    \"no-useless-rename\": \"error\",\n    \"no-useless-return\": \"error\",\n    \"no-var\": \"off\",\n    \"no-void\": \"off\",\n    \"no-warning-comments\": \"off\",\n    \"no-whitespace-before-property\": \"error\",\n    \"no-with\": \"error\",\n    \"nonblock-statement-body-position\": [\n      \"error\",\n      \"any\"\n    ],\n    \"object-curly-newline\": \"off\",\n    \"object-curly-spacing\": \"off\",\n    \"object-property-newline\": \"off\",\n    \"object-shorthand\": \"off\",\n    \"one-var\": \"off\",\n    \"one-var-declaration-per-line\": \"off\",\n    \"operator-assignment\": \"off\",\n    \"operator-linebreak\": \"off\",\n    \"padded-blocks\": \"off\",\n    \"padding-line-between-statements\": \"error\",\n    \"prefer-arrow-callback\": \"off\",\n    \"prefer-const\": \"error\",\n    \"prefer-destructuring\": \"off\",\n    \"prefer-numeric-literals\": \"error\",\n    \"prefer-promise-reject-errors\": \"error\",\n    \"prefer-reflect\": \"off\",\n    \"prefer-rest-params\": \"off\",\n    \"prefer-spread\": \"off\",\n    \"prefer-template\": \"off\",\n    \"quote-props\": \"off\",\n    \"quotes\": \"off\",\n    \"radix\": \"off\",\n    \"require-await\": \"error\",\n    \"require-jsdoc\": \"off\",\n    \"rest-spread-spacing\": \"error\",\n    \"semi\": \"off\",\n    \"semi-spacing\": \"off\",\n    \"semi-style\": \"off\",\n    \"sort-imports\": \"error\",\n    \"sort-keys\": \"off\",\n    \"sort-vars\": \"off\",\n    \"space-before-blocks\": \"off\",\n    \"space-before-function-paren\": \"off\",\n    \"space-in-parens\": [\"error\", \"never\"],\n    \"space-infix-ops\": \"off\",\n    \"space-unary-ops\": \"off\",\n    \"spaced-comment\": [\"error\", \"always\", { \"exceptions\": [\"*\"] }],\n    \"strict\": \"off\",\n    \"switch-colon-spacing\": \"off\",\n    \"symbol-description\": \"error\",\n    \"template-curly-spacing\": \"error\",\n    \"template-tag-spacing\": \"error\",\n    \"unicode-bom\": [\n      \"error\",\n      \"never\"\n    ],\n    \"valid-jsdoc\": \"off\",\n    \"vars-on-top\": \"off\",\n    \"wrap-iife\": \"off\",\n    \"wrap-regex\": \"off\",\n    \"yield-star-spacing\": \"error\",\n    \"yoda\": \"off\",\n    \"no-unused-vars\": \"off\",\n    \"no-cond-assign\": \"off\",\n    \"no-unexpected-multiline\": \"off\"\n  },\n  \"env\": {\n    \"node\": true\n  },\n  \"globals\": {\n    \"angular\": true,\n    \"moment\": true\n  },\n  \"overrides\": [\n    {\n      \"files\": [\n        \"docs/app/js/**/*\",\n        \"src/**/*\"\n      ],\n      \"parserOptions\": {\n        \"ecmaVersion\": 5\n      },\n      \"env\": {\n        \"browser\": true\n      },\n      \"rules\": {\n        \"arrow-parens\": \"error\",\n        \"global-require\": \"error\",\n        \"no-console\": [\n          \"error\"\n        ],\n        \"no-process-env\": \"error\",\n        \"no-sync\": \"error\"\n      },\n      \"globals\": {\n        \"angular\": true,\n        \"CryptoJS\": true,\n        \"hljs\": true\n      }\n    },\n    {\n      \"files\": [\n        \"scripts/**/*\"\n      ],\n      \"rules\": {\n        \"no-process-env\": \"off\"\n      }\n    },\n    {\n      \"files\": [\n        \"**/*.spec.js\",\n        \"test/*.js\"\n      ],\n      \"env\": {\n        \"jasmine\": true,\n        \"browser\": true\n      },\n      \"rules\": {\n        \"no-native-reassign\": \"off\",\n        \"no-global-assign\": \"off\"\n      },\n      \"globals\": {\n        \"module\": true,\n        \"inject\": true,\n        \"disableAnimations\": true,\n        \"createMockStyleSheet\": true,\n        \"$mdUtil\": false,\n        \"$timeout\": false,\n        \"$animate\": false,\n        \"$material\": false\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing to AngularJS Material\n\n - [Code of Conduct](#coc)\n - [Signing the CLA](#cla)<br/><br/>\n - [Question or Problem?](#question)\n - [Issues and Bugs](#bug)\n   - [Enhancement Requests](#feature)\n   - [Issue Guidelines](#submit)\n - [Git Commit Guidelines](#commit)\n - [Developer Commits Levels](#pr_forks)\n - [Submission Guidelines](#submit)\n\n## AngularJS Material has reached end-of-life\n\nWe are no longer accepting changes into this project as\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n\n## <a name=\"coc\"></a> Code of Conduct\n\nPlease help us keep AngularJS Material open and inclusive by reading and following our\n[Code of Conduct](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md).\n\nPlease note that by using GitHub, you have also agreed to follow the\n[GitHub Terms of Service](https://help.github.com/en/articles/github-terms-of-service#) which\ninclude [guidelines on conduct](https://help.github.com/en/articles/github-terms-of-service#3-conduct-restrictions). \n\nWe are care deeply about our inclusive community and diverse group of members. As part of this,\nwe do take time away from development to enforce this policy through interventions in heated\ndiscussions, one-on-one discussions to explain the policy to violators, and bans for repeat\nviolators.\n\n## <a name=\"question\"></a> Have a Question, Problem, or Idea?\n\nIf you have questions or ideas regarding AngularJS Material, please direct these to the\n[AngularJS Material Forum](https://groups.google.com/forum/#!forum/ngmaterial).\n\nOtherwise, do you:\n\n- [Want to report a Bug?](#bug)\n- [Want to request an Enhancement?](#feature)\n\n#### <a name=\"bug\"></a> 1. Want to report a Bug or Issue?\n\nIf you find a bug in the source code or a mistake in the documentation, we recommend that you first\nreview the latest `master` version of the [Online Documentation](https://material.angularjs.org/HEAD/)\nand use one of the Demos to create a CodePen that reproduces the issue.\n\nIf the issue can be reproduced in the latest `master` version, you can help us by submitting an issue\nto our [GitHub Repository](https://github.com/angular/material/issues/new/choose). After we triage the\nissue and apply labels to it, we invite you to submit a **Pull Request** with a proposed fix.\nYour custom changes can be crafted in a repository fork and submitted\nto the [GitHub Repository](https://github.com/angular/material/compare) as a Pull Request.\n\n\n**Important**: Please review the [Submission Guidelines](#submit) below, before contributing to the\n  project.\n\n#### <a name=\"feature\"></a> 2. Want to request an Enhancement?\n\nYou can request an enhancement by\n[submitting an issue](https://github.com/angular/material/issues/new/choose). After submitting an issue,\nif you would like to implement an enhancement then consider what kind of change it is:\n\n* **Major Changes** that you wish to contribute to the project should be discussed first on our\n  [AngularJS Material Forum](https://groups.google.com/forum/#!forum/ngmaterial), so that we can better\n  coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is\n  successfully accepted into the project.\n* **Small Changes** can be crafted and submitted to the\n  [GitHub Repository](https://github.com/angular/material/compare) as a Pull Request.\n\n## <a name=\"submit\"></a> Issue Guidelines\n\nPlease note, this project is mature and stable with thousands of projects depending upon it.\n\nWe welcome your enhancement requests, doc improvements, and issue reports.\nHowever, we are not accepting major feature requests at this time.\n \nIf you're thinking of contributing code or documentation to the\nproject, please review [Submitting Pull Requests](#submitpr) before beginning any work.\n\n#### Submitting an Issue\n\nBefore you submit an issue,\n**[search](https://github.com/angular/material/issues?q=is%3Aissue+is%3Aopen)** the issues archive;\nmaybe the issue has already been submitted or considered. If the issue appears to be a bug,\nand hasn't been reported, open a [new issue](https://github.com/angular/material/issues/new/choose).\n\n> Please **do not report duplicate issues**; help us maximize the effort we can spend fixing\nissues and adding enhancements.\n\nProviding the following information will increase our ability to resolve your issue efficiently:\n\n* **Issue Title** - provide a concise issue title prefixed with a snake-case name of the\n                    associated service or component (if any): `<component>: <issue title>`.\n                    Adding the `md-` prefix should be avoided.\n\n  > e.g.\n  > *  menu-bar: does not support dark mode themes [#11238](https://github.com/angular/material/issues/11238)\n  > *  tooltip: memory leak on destroy [#11133](https://github.com/angular/material/issues/11133)\n\n* **Complete the full Issue Template** - GitHub now supports issue templates and AngularJS Material\n    provides options to make submitting an issue with the required information more straightforward.\n\n* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be\n  causing the problem (line of code or commit).\n\n#### <a name=\"submitpr\"></a>Submitting Pull Requests\n\n**Important**: We are not accepting major feature requests or PRs that contain major new features\n or breaking changes at this time.\n\nPlease check with us via [the discussion forum](https://groups.google.com/forum/#!forum/ngmaterial)\nbefore investing significant effort in a planned Pull Request submission; it's possible that we are\nalready working on a related PR or have decided that the enhancement does not belong in the core\nAngularJS Material project.\n\n* All contributions must be consistent with the AngularJS Material [Coding Conventions](../docs/guides/CODING.md).\n* Submit proposed changes or additions as GitHub pull requests that follow the\n  [Pull Request Guidelines](../docs/guides/PULL_REQUESTS.md).\n\n<br/>\n\n## <a name=\"commit\"></a> Git Commit Guidelines\n\nWe have very precise rules over how our git commit messages can be formatted. This leads to **more\nreadable messages** that are easy to follow when looking through the **project history**. \n\nIt is important to note that we use the git commit messages to **generate** the AngularJS Material\n[CHANGELOG](../../CHANGELOG.md) document. Improperly formatted commit messages may result in your\nchange not appearing in the CHANGELOG of the next release.\n\n### <a name=\"commit-message-format\"></a> Commit Message Format\n\nEach commit message consists of a **header**, a **body** and a **footer**. The header has a special\nformat that includes a **type**, a **scope**, and a **subject**:\n\n```html\n<type>(<scope>): <subject>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n<footer>\n```\n\n> Any line of the commit message cannot be longer 100 characters!<br/>\n  This allows the message to be easier to read on GitHub as well as in various Git tools.\n\n##### Type\n\nMust be one of the following:\n\n* **feat**: A new feature\n* **fix**: A bug fix\n* **docs**: Documentation only changes\n* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing\n  semi-colons, etc)\n* **refactor**: A code change that neither fixes a bug nor adds a feature\n* **perf**: A code change that improves performance\n* **test**: Adding missing tests\n* **chore**: Changes to the auxiliary tools such as release scripts\n* **build**: Changes to the dependencies, devDependencies, or build tooling\n* **ci**: Changes to our Continuous Integration configuration\n\n##### Scope\n\nThe scope could be anything that helps specify the scope (or feature) that is changing.\n\nExamples\n- fix(select): \n- docs(menu): \n\n##### Subject\n\nThe subject contains a succinct description of the change:\n\n* use the imperative, present tense: \"change\" not \"changed\" nor \"changes\"\n* don't capitalize first letter\n* no period (.) at the end\n\n##### Body\n\nJust as in the **subject**, use the imperative, present tense: \"change\" not \"changed\" nor \"changes\".\nThe body should include the motivation for the change and contrast this with previous behavior.\n\n##### Footer\n\nThe footer should contain any information about **Breaking Changes** and is also the place to\nreference GitHub issues that this commit **Closes**, **Fixes**, or **Relates to**.\n\n> We highlight Breaking Changes in the ChangeLog. These are as changes that will require\n  community users to modify their code after updating to a version that contains this commit.\n\n##### Sample Commit messages\n\n```text\nfix(autocomplete): don't show the menu panel when readonly\n\n- this could sometimes happen when no value was selected\n\nFixes #11231\n```\n```text\nfeat(chips): trigger ng-change on chip addition/removal\n\n- add test of `ng-change` for `md-chips`\n- add docs regarding `ng-change` for `md-chips` and `md-contact-chips`\n- add demo for ng-change on `md-chips`\n- add demo for ng-change on `md-contact-chips`\n\nFixes #11161 Fixes #3857\n```\n\n```text\nrefactor(content): prefix mdContent scroll- attributes\n\n    BREAKING CHANGE: md-content's `scroll-` attributes are now prefixed with `md-`.\n\n    Change your code from this:\n    ```html\n    <md-content scroll-x scroll-y scroll-xy>\n    ```\n\n    To this:\n    ```html\n    <md-content md-scroll-x md-scroll-y md-scroll-xy>\n    ```\n```\n<br/>\n\n## <a name=\"pr_forks\"></a> Guidelines for Developer Commit Authorizations\n\nPlease review the [Commit Level and Authorization Guidelines](../docs/guides/COMMIT_LEVELS.md) for\ndetails on how to implement and submit your fixes, changes, or enhancements to AngularJS Material.\n\nThis guideline provides details on creating a repository Fork of the AngularJS Material repository\nand how to submit Pull Requests.\n\n<br/>\n\n## <a name=\"cla\"></a> Signing the CLA\n\nPlease sign our Contributor License Agreement (CLA) before sending pull requests. For any code\nchanges to be accepted, the CLA must be signed. It's a quick process, we promise!\n\nTo learn more and sign the CLA, visit [cla.developers.google.com](http://cla.developers.google.com).\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.md",
    "content": "---\nname: Bug Report\nabout: Report a bug in AngularJS Material\nlabels: \"type: bug, needs triage\"\n---\n<!--\n\n---------------------------------------------------------------------\nThis repo is for AngularJS Material, not Angular Material or the CDK.\n---------------------------------------------------------------------\n\nPlease submit Angular Material and CDK questions\n[here](https://groups.google.com/forum/#!forum/angular-material2)\nand issues [here](https://github.com/angular/components/issues).\n-->\n## AngularJS Material has reached end-of-life\n\nWe are no longer accepting changes into this project as\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: AngularJS Material on StackOverflow\n    url: https://stackoverflow.com/unanswered/tagged/angularjs-material\n    about: Please ask and answer questions about your app or usage here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/docs.md",
    "content": "---\nname: Documentation\nabout: Suggest an improvement to our documentation at material.angularjs.org\nlabels: \"type: docs, needs triage\"\n---\n<!--\n\n-------------------------------------------------------------------------\nThis repo is for AngularJS Material, not Angular Material or Angular CDK.\n-------------------------------------------------------------------------\n\nPlease submit Angular Material and Angular CDK questions\n[here](https://groups.google.com/forum/#!forum/angular-material2)\nand issues [here](https://github.com/angular/components/issues).\n-->\n# AngularJS Material has reached end-of-life\n\nWe are no longer accepting changes into this project as\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "# AngularJS Material has reached end-of-life\n\nWe are no longer accepting changes into this project as\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n"
  },
  {
    "path": ".github/workflows/codeql-analysis.yml",
    "content": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# You may wish to alter this file to override the set of languages analyzed,\n# or to provide custom queries or build logic.\n#\n# ******** NOTE ********\n# We have attempted to detect the languages in your repository. Please check\n# the `language` matrix defined below to confirm you have the correct set of\n# supported CodeQL languages.\n# ******** NOTE ********\n\nname: \"CodeQL\"\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    # The branches below must be a subset of the branches above\n    branches: [ master ]\n  schedule:\n    - cron: '45 16 * * 2'\n\njobs:\n  analyze:\n    name: Analyze\n    runs-on: ubuntu-latest\n\n    strategy:\n      fail-fast: false\n      matrix:\n        language: [ 'javascript' ]\n        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]\n        # Learn more:\n        # https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v2\n\n    # Initializes the CodeQL tools for scanning.\n    - name: Initialize CodeQL\n      uses: github/codeql-action/init@v1\n      with:\n        languages: ${{ matrix.language }}\n        # If you wish to specify custom queries, you can do so here or in a config file.\n        # By default, queries listed here will override any specified in a config file.\n        # Prefix the list here with \"+\" to use these queries and those in the config file.\n        # queries: ./path/to/local/query, your-org/your-repo/queries@main\n\n    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).\n    # If this step fails, then you should remove it and run the build manually (see below)\n    - name: Autobuild\n      uses: github/codeql-action/autobuild@v1\n\n    # ℹ️ Command-line programs to run using the OS shell.\n    # 📚 https://git.io/JvXDl\n\n    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines\n    #    and modify them (or add more) to build your code if your project\n    #    uses a compiled language\n\n    #- run: |\n    #   make bootstrap\n    #   make release\n\n    - name: Perform CodeQL Analysis\n      uses: github/codeql-action/analyze@v1\n"
  },
  {
    "path": ".gitignore",
    "content": "*.log\n.DS_Store\nnode_modules\ndist\n/.idea/\ntmp/\nbower-material/\ncode.material.angularjs.org/\n"
  },
  {
    "path": ".jshintrc",
    "content": "{\n  \"sub\": true,\n  \"multistr\": true,\n  \"-W018\": true,\n  \"expr\": true,\n  \"boss\": true,\n  \"laxbreak\": true,\n  \"predef\": [\"angular\"]\n}\n"
  },
  {
    "path": ".mailmap",
    "content": "\n"
  },
  {
    "path": ".nvmrc",
    "content": "14\n"
  },
  {
    "path": ".vscode/README.md",
    "content": "# Visual Studio Code Configuration\n\nThis folder contains opt-out [Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings)\nand [Extension recommendations](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions)\nthat the Angular team recommends.\n\n## Installation\n\nTo use the configuration follow the steps below:\n\n- To show the recommended extensions, select \"Extensions: Show recommended extensions\"\n  in the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).\n- Install the recommended extensions of [extensions.json](extensions.json)\n- Restart the editor\n\n## Editing `.vscode/settings.json`\n\nIf you want to add additional configuration items, please note that any configuration you\nadd here will be used by many users.\n\nTry to restrict these settings to things that help ease the development process and\navoid altering the user workflow whenever possible.\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n  // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.\n  // Extension identifier format: ${publisher}.${name}. Example: firefox-devtools.vscode-firefox-debug\n\n  // List of extensions which should be recommended for users of this workspace.\n  \"recommendations\": [\n    \"editorconfig.editorconfig\",\n    \"dbaeumer.vscode-eslint\",\n    \"christian-kohler.path-intellisense\",\n    \"eg2.vscode-npm-script\",\n    \"firefox-devtools.vscode-firefox-debug\",\n    \"dbaeumer.jshint\",\n    \"msjsdiag.debugger-for-chrome\",\n    \"pkief.material-icon-theme\"\n  ]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"editor.tabCompletion\": \"on\",\n  \"files.eol\": \"\\n\",\n  \"files.exclude\": {\n    \"**/.git\": true,\n    \"**/.DS_Store\": true\n  },\n  // Exclude third-party modules and generated artifacts from watcher/editor searches.\n  \"files.watcherExclude\": {\n    \"**/.git/objects/**\": true,\n    \"**/.git/subtree-cache/**\": true,\n    \"**/node_modules/**\": true,\n    \"**/dist/**\": true\n  },\n  \"search.exclude\": {\n    \"**/node_modules\": true,\n    \"**/bower_components\": true,\n    \"**/dist\": true\n  },\n  \"git.ignoreLimitWarning\": true,\n  // Wrap attributes.\n  //  - auto: Wrap attributes only when line length is exceeded.\n  //  - force: Wrap each attribute except first.\n  //  - force-aligned: Wrap each attribute except first and keep aligned.\n  //  - force-expand-multiline: Wrap each attribute.\n  //  - aligned-multiple: Wrap when line length is exceeded, align attributes vertically.\n  //  - preserve: Preserve wrapping of attributes\n  //  - preserve-aligned: Preserve wrapping of attributes but align.\n  \"html.format.wrapAttributes\": \"auto\",\n  // Maximum amount of characters per line (0 = disable).\n  \"html.format.wrapLineLength\": 100\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## [1.2.5](https://github.com/angular/material/compare/v1.2.4...v1.2.5) (2022-04-11)\n\nOne final release of AngularJS in order to update package README files on npm.\n\n## [1.2.4](https://github.com/angular/material/compare/v1.2.3...v1.2.4) (2021-12-16)\n\n\n### Bug Fixes\n\n* **panel, select:** fix Trusted Types violations during initialization ([#12128](https://github.com/angular/material/issues/12128)) ([4e354a6](https://github.com/angular/material/commit/4e354a6ef15362920f23167194e52fb40cb70ea9))\n\n### Code Refactoring\n\n* **sass:** migrate from node-sass to sass ([5e2d213](https://github.com/angular/material/commit/5e2d21350cd0278f210c1e2bb951786c4047bbb6))\n    * If you consume our `.scss` files directly in your build, you will need to switch\n      from the deprecated `node-sass` package to the `sass` package for compiling your Sass.\n* **sass:** fix division deprecation warnings ([b5a1a02](https://github.com/angular/material/commit/b5a1a026202f9544847f2fba8e039c3abf1cdb1c))\n\n### Documentation\n\n* fix API docs issues related to `marked` Markdown rendering ([441a912](https://github.com/angular/material/commit/441a9127676ba4a28aa0c5bc18a70c09815c7221))\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.4 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"bjarkler\" src=\"https://avatars.githubusercontent.com/u/66124740?v=4&s=117\" width=\"117\">](https://github.com/bjarkler) |[<img alt=\"superheri\" src=\"https://avatars.githubusercontent.com/u/30275781?v=4&s=117\" width=\"117\">](https://github.com/superheri) |\n:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[bjarkler](https://github.com/bjarkler) |[superheri](https://github.com/superheri) |\n\n\n## [1.2.3](https://github.com/angular/material/compare/v1.2.2...v1.2.3) (2021-07-14)\n\n\n### Bug Fixes\n\n* **datepicker:** ISO 8601 dates decorated as invalid in forms ([0a06f99](https://github.com/angular/material/commit/0a06f995be1f9cbaf963d60e848f2006309fcf12)), closes [#12075](https://github.com/angular/material/issues/12075)\n\n\n### Features\n\n* **menu:** add a new backdropParent option ([78b1073](https://github.com/angular/material/commit/78b107331e9903874cbb71404683f191f9172f7e))\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.3 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"atfzls\" src=\"https://avatars2.githubusercontent.com/u/55975318?v=4&s=117\" width=\"117\">](https://github.com/atfzls) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[atfzls](https://github.com/atfzls) |\n\n\n## [1.2.2](https://github.com/angular/material/compare/v1.2.1...v1.2.2) (2020-12-17)\n\n\n### Bug Fixes\n\n* **aria:** radio buttons throw argument not optional errors in IE11 ([eab5c81](https://github.com/angular/material/commit/eab5c815846c91fdda3cf2a369aee28169ca6272))\n* **autocomplete:** prevent flashing of invalid state ([#12064](https://github.com/angular/material/issues/12064)) ([a4732a9](https://github.com/angular/material/commit/a4732a9808db5ccaf062ec50ef314bf124ee2feb)), closes [#10975](https://github.com/angular/material/issues/10975)\n* **checkbox:** aria-checked state is not computed correctly in all cases ([c609385](https://github.com/angular/material/commit/c60938552c1a007b24b0cd2de5248453161ae012)), closes [#12046](https://github.com/angular/material/issues/12046)\n* **datepicker:** null model with timezone throws exception ([7856883](https://github.com/angular/material/commit/78568835c283ac327c85016f5d43f5ec57ff9c73)), closes [#12025](https://github.com/angular/material/issues/12025)\n* **datepicker:** time is modified before even selecting a date ([b406623](https://github.com/angular/material/commit/b406623f08cd229ea76cc06298eea764bd51ab84)), closes [#12028](https://github.com/angular/material/issues/12028) [#12026](https://github.com/angular/material/issues/12026)\n* **dialog:** shift+tab does not cycle through tabbable elements ([7d5e262](https://github.com/angular/material/commit/7d5e262b5606f0e83faac86966aa6947bc6125c0)), closes [#10963](https://github.com/angular/material/issues/10963)\n* **fab-speed-dial:** action items are in tab order when closed ([da86e62](https://github.com/angular/material/commit/da86e6282ce01c6ec31758350946b9ee1e8536f5)), closes [#10101](https://github.com/angular/material/issues/10101)\n* **fab-speed-dial:** keyboard navigation issues with tab and shift+tab ([41c71ed](https://github.com/angular/material/commit/41c71ed1eb7826c1927902f19dc8d8ea5bbfda22)), closes [#12043](https://github.com/angular/material/issues/12043)\n* **fab-speed-dial:** opens when trigger button is disabled ([e7dfcc1](https://github.com/angular/material/commit/e7dfcc166a8dbb7cb07d5c5f339a41e396025733)), closes [#9467](https://github.com/angular/material/issues/9467)\n* **input:** check that containerCtrl.label is defined before accessing it ([f79186f](https://github.com/angular/material/commit/f79186faaca9ff477720a976bd9cf10b8047a4ec)), closes [#10831](https://github.com/angular/material/issues/10831)\n* **menu:** menu focus is lost when menu-item has custom content ([6391b13](https://github.com/angular/material/commit/6391b13af979e63430b0c5f162cc1389bccdef0c)), closes [#12054](https://github.com/angular/material/issues/12054)\n* **select:** floating label hidden w/ placeholder and no value ([3ea5630](https://github.com/angular/material/commit/3ea56303a284d1c3987ec760a9b781895b39ca00)), closes [#10116](https://github.com/angular/material/issues/10116)\n* **select:** form remains valid after empty option is selected ([61412b4](https://github.com/angular/material/commit/61412b4b73a05c384c86fcd272d6e7d1ce78623c)), closes [#10005](https://github.com/angular/material/issues/10005)\n* **tabs:** md-align-tabs should only affect the current component ([d77fbc4](https://github.com/angular/material/commit/d77fbc4dad198e22cb4ada396b15512f3daa3b03)), closes [#10541](https://github.com/angular/material/issues/10541)\n* **theming:** fix CSS with nested rules parsing when registering a theme ([71dc4eb](https://github.com/angular/material/commit/71dc4eb38d8120ba1e49a9420debfe7aaf0c8e34)), closes [#9869](https://github.com/angular/material/issues/9869)\n\n\n### Features\n\n* **autocomplete:** allow localization of query result announcements ([5157f94](https://github.com/angular/material/commit/5157f94f192f64cc948adafe033361539d945408)), closes [#11789](https://github.com/angular/material/issues/11789)\n* **chips:** md-max-chips support for md-contact-chips ([e6b5482](https://github.com/angular/material/commit/e6b5482231520a69ab196a2e508f1c1dc1f3a081)), closes [#10827](https://github.com/angular/material/issues/10827)\n* **datepicker:** add input-aria-describedby and input-aria-labelledby ([5f8472c](https://github.com/angular/material/commit/5f8472c433d175c39019acc271f80344d6a58ed3)), closes [#11762](https://github.com/angular/material/issues/11762)\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.2 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"FreedCapybara\" src=\"https://avatars2.githubusercontent.com/u/7003723?v=4&s=117\" width=\"117\">](https://github.com/FreedCapybara) |[<img alt=\"shishkinilya\" src=\"https://avatars0.githubusercontent.com/u/20458127?v=4&s=117\" width=\"117\">](https://github.com/shishkinilya) |[<img alt=\"kylekatarnls\" src=\"https://avatars1.githubusercontent.com/u/5966783?v=4&s=117\" width=\"117\">](https://github.com/kylekatarnls) |[<img alt=\"natete\" src=\"https://avatars2.githubusercontent.com/u/4098303?v=4&s=117\" width=\"117\">](https://github.com/natete) |\n:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[FreedCapybara](https://github.com/FreedCapybara) |[shishkinilya](https://github.com/shishkinilya) |[kylekatarnls](https://github.com/kylekatarnls) |[natete](https://github.com/natete) |\n\n\n<a name=\"1.2.1\"></a>\n## [1.2.1](https://github.com/angular/material/compare/v1.2.0...v1.2.1) (2020-09-23)\n\n\n### Bug Fixes\n\n* **calendar:** allow tabbing out when in standalone mode ([93518bb](https://github.com/angular/material/commit/93518bb05306e0a9d70c890a150a8c06d0fbad5b)), closes [#9794](https://github.com/angular/material/issues/9794)\n* **calendar, datepicker:** fix issues with GMT+X timezones ([90d24cf](https://github.com/angular/material/commit/90d24cfa2914e78bbbd43e9523400f2755ed0754)), closes [#12000](https://github.com/angular/material/issues/12000)\n* **calendar, datepicker:** fix MomentJS custom format support ([8f9e213](https://github.com/angular/material/commit/8f9e21318f21713f1f47bd35e4742919321a9e99)), closes [#12003](https://github.com/angular/material/issues/12003) [#11949](https://github.com/angular/material/issues/11949)\n* **datepicker:** min-date validation is incorrect in GMT+X timezones ([7395914](https://github.com/angular/material/commit/73959142c9ed327d6218fe90c6335bc88f8c5ddf)), closes [#11963](https://github.com/angular/material/issues/11963)\n* **dialog:** remove focus trap focus listeners onRemove ([33e8bac](https://github.com/angular/material/commit/33e8bac352522bf38b23ff2a4d2c281f2c14dc5f)), closes [#12010](https://github.com/angular/material/issues/12010)\n* **icon:** providing empty alt or aria-label attributes do not hide them from a11y ([37f1535](https://github.com/angular/material/commit/37f15357089a87b0e3f94467a93c6511ff71d481)), closes [#10721](https://github.com/angular/material/issues/10721)\n* **list:** case where list items are read twice by screen readers ([5c455d3](https://github.com/angular/material/commit/5c455d30b8bcf4902add2c1ed0a6e9216147b43c)), closes [#11582](https://github.com/angular/material/issues/11582)\n* **radio-button:** Cannot read property 'nodeName' of null ([f43ff63](https://github.com/angular/material/commit/f43ff639a678edeb387a43b28faa10ca0c8b881f)), closes [#10546](https://github.com/angular/material/issues/10546)\n* **radio-button:** support selection using the space key ([3cf78a7](https://github.com/angular/material/commit/3cf78a7d7ed7ff2682c88eaf9e547144225e41d5)), closes [#11960](https://github.com/angular/material/issues/11960)\n* **select:** respect theme color when select has focus ([4afba57](https://github.com/angular/material/commit/4afba571c8a91e17a354c61a1ab7d711d9f9f3b6))\n* **select:** in popup, hover and focus background colors are the same ([d5863b8](https://github.com/angular/material/commit/d5863b8bc4a3a4666310ea03963d87537a27a69e)), closes [#000](https://github.com/angular/material/issues/000) [#9851](https://github.com/angular/material/issues/9851)\n* **select:** md-select-header closes on mouse click when not using multiple ([f2fca2e](https://github.com/angular/material/commit/f2fca2eea9d01be9f72e1dc2a275f1fdbc40764e)), closes [#11969](https://github.com/angular/material/issues/11969)\n* **typography:** enable iOS long-press context menus ([3d98b6e](https://github.com/angular/material/commit/3d98b6e276ea65417aeba0df398cbd4a6fb8fb58)), closes [#10622](https://github.com/angular/material/issues/10622)\n\n\n### Documentation\n\n* **mdSticky:** update and clarify the usage and behavior ([0d431e0](https://github.com/angular/material/commit/0d431e07330f1ea42c933ae80400adfae79b60d9))\n* **a11y:** add a list of supported screen readers ([8ce0813](https://github.com/angular/material/commit/8ce08134c4f305832a96a2edbe24204802a9d881)), closes [#11449](https://github.com/angular/material/issues/11449)\n* **home:** simplify and clarify that browser support policy is for major versions ([1babe8c](https://github.com/angular/material/commit/1babe8c83b79702a5a980d5c602da659b88db739))\n* **icon:** documentation refinement and cleanup ([c644d6a](https://github.com/angular/material/commit/c644d6a29ce4d05e0bfb4588d62340157a98df52))\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.1 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |[<img alt=\"josephperrott\" src=\"https://avatars2.githubusercontent.com/u/10864441?v=4&s=117\" width=\"117\">](https://github.com/josephperrott) |[<img alt=\"cgx\" src=\"https://avatars2.githubusercontent.com/u/1088448?v=4&s=117\" width=\"117\">](https://github.com/cgx) |\n:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[mmalerba](https://github.com/mmalerba) |[josephperrott](https://github.com/josephperrott) |[cgx](https://github.com/cgx) |\n\n\n<a name=\"1.1.26\"></a>\n## [1.1.26](https://github.com/angular/material/compare/v1.1.25...v1.1.26) (2020-09-01)\n\n\n### Bug Fixes\n\n* **calendar, datepicker:** fix MomentJS custom format support ([667a78f](https://github.com/angular/material/commit/667a78f955b0980735aab744eeb5a2b22f6fbfa1)), closes [#12003](https://github.com/angular/material/issues/12003) [#11949](https://github.com/angular/material/issues/11949)\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.26 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"mmalerba\" src=\"https://avatars0.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[mmalerba](https://github.com/mmalerba) |\n\n\n<a name=\"1.1.25\"></a>\n## [1.1.25](https://github.com/angular/material/compare/v1.1.24...v1.1.25) (2020-08-31)\n\n\n### Bug Fixes\n\n* **calendar, datepicker:** fix date selection issues with GMT+X timezones ([a897a67](https://github.com/angular/material/commit/a897a67cf1eee6f524dce91c5e0d31b1ad8601b3)), closes [#12000](https://github.com/angular/material/issues/12000)\n* **datepicker:** min-date validation is incorrect in GMT+X timezones ([dd150fa](https://github.com/angular/material/commit/dd150fa780c78177521c99ed50f9fb0916fab8c8)), closes [#11963](https://github.com/angular/material/issues/11963)\n* **select:** md-select-header closes on mouse click when not using multiple ([b32b473](https://github.com/angular/material/commit/b32b473ffbc645ea921f650cc425c82ba9d42bf0)), closes [#11969](https://github.com/angular/material/issues/11969)\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.25 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"jelbourn\" src=\"https://avatars3.githubusercontent.com/u/838736?v=4&s=117\" width=\"117\">](https://github.com/jelbourn) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[jelbourn](https://github.com/jelbourn) |\n\n\n<a name=\"1.2.0\"></a>\n# [1.2.0](https://github.com/angular/material/compare/v1.1.24...v1.2.0) (2020-08-03)\n\n\n### Bug Fixes\n\n* **autocomplete:** change md-escape-options default to 'clear' ([47106ba](https://github.com/angular/material/commit/47106ba036eac11d4417fd2066b26d2a02283954)), closes [#11767](https://github.com/angular/material/issues/11767)\n* **button:** horizontal padding should match the spec ([3205b33](https://github.com/angular/material/commit/3205b33b57bc08ef92aae28ac2fb898f307c0ac1)), closes [#10535](https://github.com/angular/material/issues/10535) [#10535](https://github.com/angular/material/issues/10535)\n* **checkbox:** handle links in transcluded label in an a11y-friendly way ([4d36fd2](https://github.com/angular/material/commit/4d36fd27be8960c9a5fceed5b8750e201668e4a0)), closes [#11134](https://github.com/angular/material/issues/11134)\n* **checkbox:** update CSS to match spec ([c893050](https://github.com/angular/material/commit/c8930506996a56adb1cbce20a236b7c2f76cbe93)), closes [#9351](https://github.com/angular/material/issues/9351) [#9927](https://github.com/angular/material/issues/9927) [#8713](https://github.com/angular/material/issues/8713)\n* **checkbox, date-picker, input, radio-button, select, switch:** md-inline-form support ([b3e9ffe](https://github.com/angular/material/commit/b3e9ffec50cdfb560fa4bf0a32df3ad22d553291))\n* **chips:** chip remove icon isn't sized to match the spec ([#10491](https://github.com/angular/material/issues/10491)) ([29c0a4a](https://github.com/angular/material/commit/29c0a4a7fb53bb92ef97422df8e5c9fa7199d6b1)), closes [#9619](https://github.com/angular/material/issues/9619)\n* **chips:** placeholder is truncated even though there is room ([aa4e29b](https://github.com/angular/material/commit/aa4e29b8a1b382ccf524abe4e654196813703412)), closes [#10630](https://github.com/angular/material/issues/10630)\n* **chips:** update to latest Material Design spec (2017) updates ([01351b1](https://github.com/angular/material/commit/01351b11754fdd661f3314b00d94e76a9de1c068)), closes [#9883](https://github.com/angular/material/issues/9883)\n* **datepicker:** support ng-model-options timezone w/ Moment ([e24d09c](https://github.com/angular/material/commit/e24d09c68ce255ed82cac68361c8ee3dfeeb56e4)), closes [#11945](https://github.com/angular/material/issues/11945) [#10598](https://github.com/angular/material/issues/10598)\n* **input-container:** align indentation with spec ([31a596f](https://github.com/angular/material/commit/31a596f484fa32b07f42e116abad91999c4385d3)), closes [#10105](https://github.com/angular/material/issues/10105) [#11421](https://github.com/angular/material/issues/11421)\n* **list:** fix checkbox alignment and match dense heights to spec ([a13722e](https://github.com/angular/material/commit/a13722ee69ab01babefe1f0bcc5af77f55a3f76c)), closes [#11966](https://github.com/angular/material/issues/11966)\n* **nav-bar:** throws exception when indexing null tabs variable ([b1c7154](https://github.com/angular/material/commit/b1c7154bfe684c92497fb08dea6ce98af94ed1a8)), closes [#11964](https://github.com/angular/material/issues/11964)\n* **panel:** demos need to access locals in controller's $onInit ([6e91c62](https://github.com/angular/material/commit/6e91c621393cd2f5260689cec2c799eef3056a2c))\n* **panel:** don't throw exceptions when the groupName is a string ([4178459](https://github.com/angular/material/commit/4178459c4251f92fac44e4eb9f182704085a2ab9))\n* **radio-button:** when no value selected, first button not announced on focus ([9159384](https://github.com/angular/material/commit/91593844b772db77c81b32461e9c5361689e7733)), closes [#11973](https://github.com/angular/material/issues/11973) [#11923](https://github.com/angular/material/issues/11923) [#11974](https://github.com/angular/material/issues/11974)\n* **select:** support for md-inline-form, more configurable SCSS ([0d4d37f](https://github.com/angular/material/commit/0d4d37f079c44979be934c5babd4ed1c62383762)), closes [#8712](https://github.com/angular/material/issues/8712) [#8716](https://github.com/angular/material/issues/8716)\n* **select:** md-select-header closes on mouse click when not using multiple ([f2fca2e](https://github.com/angular/material/commit/f2fca2eea9d01be9f72e1dc2a275f1fdbc40764e)), closes [#11969](https://github.com/angular/material/issues/11969)\n* **tabs:** update min-width to follow the spec ([693ecca](https://github.com/angular/material/commit/693eccad4e0c1605513e9b9f747cff53fef6d62a)), closes [#10406](https://github.com/angular/material/issues/10406) [#11432](https://github.com/angular/material/issues/11432)\n* **tabs:** align theming with spec updates ([d237715](https://github.com/angular/material/commit/d237715ff5cdd9238a36853ed4590c5e2f64e3b6)), closes [#7685](https://github.com/angular/material/issues/7685)\n* **theming:** dark contrast used incorrectly when only contrastStrongLightColors defined ([4e3f7a7](https://github.com/angular/material/commit/4e3f7a7e0839d9adce8327e67bdb9237e1e91f78))\n* **theming:** update palette contrast types to current spec ([d716fde](https://github.com/angular/material/commit/d716fde69983273940cf67c641c003ba3ffc32c7)), closes [#8992](https://github.com/angular/material/issues/8992) [#10164](https://github.com/angular/material/issues/10164)\n* **theming, toolbar, subheader, input:** align color palettes and contrasts with AA standards ([3a291ac](https://github.com/angular/material/commit/3a291ac6f6ae52093375f4c3dab5f15c4cf476b8)), closes [#8992](https://github.com/angular/material/issues/8992) [#10164](https://github.com/angular/material/issues/10164) [#8993](https://github.com/angular/material/issues/8993)\n* **toast:** improve position handling to better align with docs ([96ec741](https://github.com/angular/material/commit/96ec741e69bfb3d2637a00366e05c11d9538371f)), closes [#11843](https://github.com/angular/material/issues/11843)\n* **toolbar:** input placeholders and ink need more contrast ([a82fc93](https://github.com/angular/material/commit/a82fc93d54793472878da18a64ac8780295fac1f)), closes [#7987](https://github.com/angular/material/issues/7987) [#11376](https://github.com/angular/material/issues/11376)\n* **toolbar:** default to 500 hue and contrasts when using accent/warn palettes ([98a94db](https://github.com/angular/material/commit/98a94db8b4ad3ff6ec8c38b7e848574defe4f43f)), closes [#7685](https://github.com/angular/material/issues/7685)\n\n\n### Code Refactoring\n\n* **autofocus:** remove deprecated md-auto-focus attribute ([bf0ec8c](https://github.com/angular/material/commit/bf0ec8c853c17cd60547ead11b2c1e9310ca8377))\n* **card:** remove styles for md-actions class ([75aa734](https://github.com/angular/material/commit/75aa734674324df42b3e5e57508281f60d576090))\n* **chips:** remove deprecated md-on-append attribute ([1a2e3d0](https://github.com/angular/material/commit/1a2e3d0b424fec4d2e3f68071b6520a5477284c8))\n* **chips:** remove deprecated MdChipsCtrl.selectAndFocusChip ([01d2cde](https://github.com/angular/material/commit/01d2cde76fdc127bef4d52027c143b33dc0666c0))\n* **dialog:** remove deprecated content options and methods ([e3b52a0](https://github.com/angular/material/commit/e3b52a0c84134faaa7371041b732ee4c3f1ec713))\n* **dialog:** remove styles for deprecated md-actions class ([93e2081](https://github.com/angular/material/commit/93e20819053117fa2b8679178840bbb65c97a301))\n* **layout:** remove deprecated *-lt-* (\"less than\") attributes ([e8e785e](https://github.com/angular/material/commit/e8e785e5a3a118026ca8e10e087bc76aa8db745a))\n* **$mdCompilerProvider:** remove deprecated $mdCompilerProvider.respectPreAssignBindingsEnabled() ([579a327](https://github.com/angular/material/commit/579a3271698381c49803210c2efaa3b1f9e802bb))\n* **menu:** removed deprecated $mdOpenMenu API ([f023ce7](https://github.com/angular/material/commit/f023ce766a816035fb3de8c1a47f9d089cb2f11d))\n* **panel:** remove deprecated MdPanelRef.addClass/removeClass/toggleClass ([bafbd96](https://github.com/angular/material/commit/bafbd96905a016878fb45f5c6ff9992d0d743e6d)), closes [#9310](https://github.com/angular/material/issues/9310)\n* **select:** rename ngMultiple to mdMultiple ([4c75858](https://github.com/angular/material/commit/4c758589f5ff8ad1b6fc1c990ffbbfd5dba913f7))\n* **sidenav:** remove deprecated access to $media in md-is-locked-open ([baa7563](https://github.com/angular/material/commit/baa7563fc9ef32c179add7071e794771f729c991))\n* **sidenav:** remove md-sidenav-focus directive ([8fc36d4](https://github.com/angular/material/commit/8fc36d4a7ce1f15cb1398a31e5ea6cea36bcfcda))\n* **theming:** remove support for deprecated $mdThemingProviderTheme.primaryColor() and related APIs ([00a50de](https://github.com/angular/material/commit/00a50deb39997c73c89e5567b76b028f0cf6e16c))\n* **tabs:** remove deprecated md-no-disconnect ([05bee8f](https://github.com/angular/material/commit/05bee8fb2350b066a778052db08a6009c0465ee1))\n* **toast:** remove deprecated content() method and option and updateContent() method ([cf3d56c](https://github.com/angular/material/commit/cf3d56c74fe28b7500bd1d8bc312c132ba06d2b9))\n\n\n### Features\n\n* **layout:** add mixin for responsive support of rows ([c2c336b](https://github.com/angular/material/commit/c2c336b946b8c017c12dcb80955767339da3eb3b)), closes [#9112](https://github.com/angular/material/issues/9112) [#9220](https://github.com/angular/material/issues/9220)\n* **theming:** add contrast opacity values for all color types and hues ([68c1d02](https://github.com/angular/material/commit/68c1d02fb40951ea95bf3a136e12e0ff66b2a780))\n\n\n### Documentation\n\n* **theming, colors:** md-colors demo was broken. improve JSDoc and fix lint issues ([01917b3](https://github.com/angular/material/commit/01917b37ec6a8b6a913f9594130b841912e37244))\n\n\n### BREAKING CHANGES\n\n* **autocomplete:** The default behavior of `md-autocomplete`, when the options panel is visible and the Escape key is pressed, has changed. `md-escape-options` now defaults to `'clear'` instead of `'blur clear'`. This better aligns with the [WAI-ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.0pattern/combobox-autocomplete-list.html) as the focus is not sent to another element (like the `<body>`) when the Escape key is pressed.\n\nIf you want to restore the previous behavior, add the following to your `md-autocomplete` components:\n```html\nmd-escape-options=\"blur clear\"\n```\n* **autofocus:** Removed the deprecated `md-auto-focus` directive. It was deprecated in favor of `md-autofocus`. Please see the [md-autofocus Docs](https://material.angularjs.org/latest/api/directive/mdAutofocus) for examples.\n* **button:** `md-button`'s internal horizontal padding has changed from `6px` to `8px` to match the Material Design spec. This may affect the layout of portions of your application where `md-button`, `md-datepicker`, or `md-toast` with actions are used.\n\nIf you are using our SCSS files, you can override this back to the default, or another value, in your app's SCSS files:\n```scss\n$button-left-right-padding: rem(0.600); // For 6px horizontal padding\n```\n* **card:** Removed support for the `class=\"md-actions\"` inside of an `md-card` template. This is deprecated in favor of using the `<md-card-actions>` element.\n* **checkbox:** If you've created a custom solution to style links within `md-checkbox` labels, then you may need to remove or change that code now. This is because we automatically detect `<a>` tags in these labels and re-render them in an accessible way.\n* **checkbox:** The default size and spacing for `md-checkbox` has been updated to align with the Material Design specification. Additionally, many new Sass variables have been added for customizing the size and spacing of `md-checkbox`. The `md-dense` class is now supported. After updating to this version, you may need to adjust the layout of your app due to the larger touch-friendly size of checkbox. You may also want to make use of `md-dense` in cases where space is limited.\n* **chips:** Chips have been updated to latest Material Design spec (2017). `$chip-font-size` was reduced to `13px` from `16px`. `$chip-remove-padding-right` was increased to `28px` from `22px`. These changes may cause your chips to have a smaller, denser layout now. In certain scenarios, this may require minor changes to your app's layout. You can change these variables back to their old values if your app consumes Sass. Additionally, the remove chip icon has been changed, but you can use the custom chip template demo as a guide to changing back to the old icon, if desired.\n* **chips:** Removed the deprecated, since 2015, `md-on-append` attribute. It was deprecated in favor of `md-transform-chip` or the simple notifier `md-on-add`. Please see the [md-chips Demos](https://material.angularjs.org/latest/demo/chips) for examples of using `md-transform-chip`.\n* **chips:** The deprecated `MdChipsCtrl.selectAndFocusChip()` function has been removed.\n`MdChipsCtrl.selectAndFocusChipSafe()` should be used instead.\n* **dialog:** Removed support for the deprecated `class=\"md-actions\"` inside of an `md-dialog` template. This was deprecated in favor of using the `<md-dialog-actions>` element.\n* **dialog:** Removed support for the deprecated `.content('string')` methods and options. These were deprecated in favor of `.textContent('string')` and `.htmlContent('sanitized-string')'` methods and their associated options. Please note that use of `.htmlContent` requires that the `ngSanitize` module be loaded.\n\nIf you have\n```js\n  alert = $mdDialog.alert()\n    .content('This is an example.');\n```\nIt needs to be changed to\n```js\n  alert = $mdDialog.alert()\n    .textContent('This is an example.');\n```\nIf you have\n```js\n  alert = $mdDialog.alert({\n    content: 'This is an example.'\n  });\n```\nIt needs to be changed to\n```js\n  alert = $mdDialog.alert({\n    textContent: 'This is an example.'\n  });\n```\n* **input-container:** `md-input` and `md-select` inside of `md-input-container`s have been updated to use indentation that is consistent with the spec (aligned to the left in LTR and the right in RTL). This may cause some minor layout issues in apps that depended upon the previous `2px` padding inside of `md-input-container`.\n* **layout:** The way that margins are applied to `md-checkbox`, `md-input-container`, `md-radio-group`, and `md-select` has been changed. You can now use the `$default-horizontal-margin` Sass variable to override the default `16px` horizontal margin size. As part of this, `md-radio-button`s inside of `layout=\"row\"` containers are now aligned vertically with other content as they no longer have a `16px` `margin-bottom`. If you have previously added custom styles, to your components inside of a row layout, in order to give them extra `margin-right` in LTR or `margin-left` in RTL, you will need to re-evaluate those styles. In most cases, they can now be removed.\n* **layout:** Removed the deprecated, undocumented `*-lt-*` layout attributes and classes. This includes the following attributes and their matching classes, which have been giving deprecation warnings since 2015:\n    - layout-lt-md\n    - layout-lt-lg\n    - flex-lt-md\n    - flex-lt-lg\n    - layout-align-lt-md\n    - layout-align-lt-lg\n    - flex-order-lt-md\n    - flex-order-lt-lg\n    - flex-offset-lt-md\n    - flex-offset-lt-lg\n    - hide-lt-md\n    - hide-lt-lg\n    - show-lt-md\n    - show-lt-lg\n\n* **list:** `md-list` with the `md-dense` class has been updated to align with the Material Design specification. This means that `md-list-item`s heights have changed when using `md-dense`. The `md-dense-disabled` class is now supported on `md-list`. After updating to this version, you may need to adjust the layout of your app if you use `md-dense` with `md-list` or customize the layout of `md-checkbox`s within `md-list-item`s.\n* **$mdCompilerProvider:** The deprecated `$mdCompilerProvider.respectPreAssignBindingsEnabled()` API has been removed.\nWe no longer respect AngularJS's `$compileProvider.preAssignBindingsEnabled()` value as this API was removed\nin AngularJS `1.7.0`.\n\nIf you had the recommended configuration for AngularJS 1.6.x:\n```js\n  $compileProvider.preAssignBindingsEnabled(false);\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(true);\n```\nThen you should remove both of these calls as they are now the defaults in AngularJS `1.7.0`\nand AngularJS Material `1.2.0`.\n\nIf you had the recommended configuration for AngularJS 1.7+:\n```js\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(true);\n```\nThen you should remove this call as it is now the default in AngularJS Material `1.2.0`.\n\nIf you were using a backwards-compatible configuration for AngularJS 1.6+:\n```js\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(false);\n```\nThen you will need to remove this call and may need to refactor your Controllers for\nAngularJS Material components like `$mdDialog`, `$mdPanel`, `$mdToast`, or `$mdBottomSheet`.\n\nFor example:\n```js\n $mdDialog.show({\n   locals: {\n     myVar: true\n   },\n   controller: MyController,\n   bindToController: true\n }\n  function MyController() {\n   // No locals from Angular Material are available. e.g myVar is undefined.\n   // You would need to move anything accessing locals in here to $onInit().\n }\n  MyController.prototype.$onInit = function() {\n   // Bindings are now available in the $onInit lifecycle hook.\n }\n```\n* **menu:** Removed the deprecated `$mdOpenMenu` API. It was deprecated in favor of `$mdMenu.open`.\n* **panel:** The deprecated `MdPanelRef.addClass()`, `MdPanelRef.removeClass()`, and `MdPanelRef.toggleClass()` functions have been removed. These were deprecated in 2016 in favor of using the `panelContainer` or `panelEl` JQLite elements that are referenced in the [MdPanelRef](https://material.angularjs.org/latest/api/type/MdPanelRef) object.\n* **select:** `ngMultiple` has been renamed to `mdMultiple` to make it clear that this\nAPI is provided by AngularJS Material and not by AngularJS.\n\nIf you had:\n```html\n  <md-select ng-multiple=\"expression\">...</md-select>\n```\nYou need to change to:\n```html\n  <md-select md-multiple=\"expression\">...</md-select>\n```\n* **sidenav:** Removed access for the deprecated `$media` service in `md-is-locked-open`. This was deprecated in favor of the `$mdMedia` service. The functionality is the same and only a rename to the current name of the service is required.\n* **sidenav:** Removed the `md-sidenav-focus` directive. It was deprecated in favor of `md-autofocus`. Please see the [md-autofocus Docs](https://material.angularjs.org/latest/api/directive/mdAutofocus) and [md-sidenav Basic Usage Demo](https://material.angularjs.org/latest/demo/sidenav#basic-usage) for examples.\n* **tabs:** Tab items now have a `min-width` and `padding` which matches the Material Design specification. For width, this is `72px` on `xs` screens and `160px` on all other screens. For left and right `padding`, this is now `12px` instead of `24px`. If your app needs to have tabs which are smaller than the spec, you will need to override `md-tab-item`'s `min-width` and `md-tab`'s `padding` styles.\n* **theming:** Removed support for the deprecated `$mdThemingProviderTheme.primaryColor()` and the related accent/warn/background APIs. These were deprecated in favor of `$mdThemingProviderTheme.primaryPalette()` (and accent/warn/background) in 2015 and they have been logging warnings when used since then.\n* **theming, toolbar, subheader, input:** The contrast colors (the text or icon color, for example on a raised button) of many of our default palettes have been updated to meet the [AA level of the contrast guidelines](https://www.w3.org/TR/WCAG21/#contrast-minimum) for web accessibility. If you are using our default palettes directly, the accessibility of your application should be improved. However, we recommend that you evaluate this after updating to `1.2.0`. There may be edge cases in your app or custom styles that need to be updated to meet accessibility guidelines.\n\nIf you find significant accessibility issues after updating, please report them to us. In `1.2.x`, we have a lot more control over our component theming in regards to hues and opacities.\n\nIf your app is using a custom palette, whether based on a copy of default palette or not, we encourage you to evaluate that your contrast configuration meets the WebAIM guidelines. Please review our guide on [Defining Custom Palettes](https://material.angularjs.org/latest/Theming/03_configuring_a_theme#defining-custom-palettes) for details.\n* **toast:** `$mdToast.show()`'s position behavior has been updated to be consistent with the documentation. If you relied on the previously undocumented behavior where it defaulted to `top left` instead of `bottom left`, you will need to update your app.\n\nChange your code from this:\n\n```js\n    $mdToast.show(\n      $mdToast.simple()\n      .textContent('Simple Toast!'))\n    .then(...\n```\n\nTo this:\n\n```js\n    $mdToast.show(\n      $mdToast.simple()\n      .textContent('Simple Toast!')\n      .position('top left'))\n    .then(...\n```\n* **toast:** The deprecated `content()` and `updateContent()` methods have been removed.\n\nIf you had:\n```js\n  $mdToast.show($mdToast.simple().content('This no longer works.'));\n```\nYou will need to change to:\n```js\n  $mdToast.show($mdToast.simple().textContent('This works.'));\n```\n\nIf you had:\n```js\n  $mdToast.updateContent('This no longer works.');\n```\nYou will need to change to:\n```js\n  $mdToast.updateTextContent('This works.');\n```\n\nIf you had:\n```js\n  $mdToast.show($mdToast.simple({parent: parent, content: 'This no longer works.', theme: 'some-theme', capsule: true}));\n```\nYou will need to change to:\n```js\n  $mdToast.show($mdToast.simple({parent: parent, textContent: 'This works.', theme: 'some-theme', capsule: true}));\n```\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.0 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"jelbourn\" src=\"https://avatars3.githubusercontent.com/u/838736?v=4&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"clshortfuse\" src=\"https://avatars3.githubusercontent.com/u/9271155?v=4&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"batsauto\" src=\"https://avatars3.githubusercontent.com/u/17678174?v=4&s=117\" width=\"117\">](https://github.com/batsauto) |[<img alt=\"wagnermaciel\" src=\"https://avatars1.githubusercontent.com/u/25158423?v=4&s=117\" width=\"117\">](https://github.com/wagnermaciel) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[jelbourn](https://github.com/jelbourn) |[clshortfuse](https://github.com/clshortfuse) |[oliversalzburg](https://github.com/oliversalzburg) |[batsauto](https://github.com/batsauto) |[wagnermaciel](https://github.com/wagnermaciel) |\n\n[<img alt=\"tomaszgrabowski\" src=\"https://avatars0.githubusercontent.com/u/6688790?v=4&s=117\" width=\"117\">](https://github.com/tomaszgrabowski) |\n:---: |\n[tomaszgrabowski](https://github.com/tomaszgrabowski) |\n\n\n<a name=\"1.2.0-rc.2\"></a>\n# [1.2.0-rc.2](https://github.com/angular/material/compare/v1.2.0-rc.1...v1.2.0-rc.2) (2020-07-28)\n\n\n### Bug Fixes\n\n* **checkbox, date-picker, input, radio-button, select, switch:** md-inline-form support ([b3e9ffe](https://github.com/angular/material/commit/b3e9ffec50cdfb560fa4bf0a32df3ad22d553291))\n* **select:** support for md-inline-form, more configurable SCSS ([0d4d37f](https://github.com/angular/material/commit/0d4d37f079c44979be934c5babd4ed1c62383762)), closes [#8712](https://github.com/angular/material/issues/8712) [#8716](https://github.com/angular/material/issues/8716)\n\n\n### Code Refactoring\n\n* **autofocus:** remove deprecated md-auto-focus attribute ([bf0ec8c](https://github.com/angular/material/commit/bf0ec8c853c17cd60547ead11b2c1e9310ca8377))\n* **card:** remove styles for md-actions class ([75aa734](https://github.com/angular/material/commit/75aa734674324df42b3e5e57508281f60d576090))\n* **chips:** remove deprecated md-on-append attribute ([1a2e3d0](https://github.com/angular/material/commit/1a2e3d0b424fec4d2e3f68071b6520a5477284c8))\n* **dialog:** remove deprecated content options and methods ([e3b52a0](https://github.com/angular/material/commit/e3b52a0c84134faaa7371041b732ee4c3f1ec713))\n* **dialog:** remove styles for deprecated md-actions class ([93e2081](https://github.com/angular/material/commit/93e20819053117fa2b8679178840bbb65c97a301))\n* **layout:** remove deprecated *-lt-* (\"less than\") attributes ([e8e785e](https://github.com/angular/material/commit/e8e785e5a3a118026ca8e10e087bc76aa8db745a))\n* **menu:** removed deprecated $mdOpenMenu API ([f023ce7](https://github.com/angular/material/commit/f023ce766a816035fb3de8c1a47f9d089cb2f11d))\n* **panel:** remove deprecated MdPanelRef.addClass/removeClass/toggleClass ([bafbd96](https://github.com/angular/material/commit/bafbd96905a016878fb45f5c6ff9992d0d743e6d)), closes [#9310](https://github.com/angular/material/issues/9310)\n* **sidenav:** remove deprecated access to $media in md-is-locked-open ([baa7563](https://github.com/angular/material/commit/baa7563fc9ef32c179add7071e794771f729c991))\n* **sidenav:** remove md-sidenav-focus directive ([8fc36d4](https://github.com/angular/material/commit/8fc36d4a7ce1f15cb1398a31e5ea6cea36bcfcda))\n* **theming:** remove support for deprecated $mdThemingProviderTheme.primaryColor() and related APIs ([00a50de](https://github.com/angular/material/commit/00a50deb39997c73c89e5567b76b028f0cf6e16c))\n* **tabs:** remove deprecated md-no-disconnect ([05bee8f](https://github.com/angular/material/commit/05bee8fb2350b066a778052db08a6009c0465ee1))\n\n### Features\n\n* **layouts:** add mixin for responsive support of rows ([c2c336b](https://github.com/angular/material/commit/c2c336b946b8c017c12dcb80955767339da3eb3b)), closes [#9112](https://github.com/angular/material/issues/9112) [#9220](https://github.com/angular/material/issues/9220)\n\n\n### BREAKING CHANGES\n\n* **layouts:** The way that margins are applied to `md-checkbox`, `md-input-container`, `md-radio-group`, and `md-select` has been changed. You can now use the `$default-horizontal-margin` Sass variable to override the default `16px` horizontal margin size. As part of this, `md-radio-button`s inside of `layout=\"row\"` containers are now aligned vertically with other content as they no longer have a `16px` `margin-bottom`. If you have previously added custom styles, to your components inside of a row layout, in order to give them extra `margin-right` in LTR or `margin-left` in RTL, you will need to re-evaluate those styles. In most cases, they can now be removed.\n* **sidenav:** Removed access for the deprecated `$media` service in `md-is-locked-open`. This was deprecated in favor of the `$mdMedia` service. The functionality is the same and only a rename to the current name of the service is required.\n* **dialog:** Removed support for the deprecated `.content('string')` methods and options. These were deprecated in favor of `.textContent('string')` and `.htmlContent('sanitized-string')'` methods and their associated options. Please note that use of `.htmlContent` requires that the `ngSanitize` module be loaded.\n\nIf you have\n```js\n  alert = $mdDialog.alert()\n    .content('This is an example.');\n```\nIt needs to be changed to\n```js\n  alert = $mdDialog.alert()\n    .textContent('This is an example.');\n```\nIf you have\n```js\n  alert = $mdDialog.alert({\n    content: 'This is an example.'\n  });\n```\nIt needs to be changed to\n```js\n  alert = $mdDialog.alert({\n    textContent: 'This is an example.'\n  });\n```\n* **theming:** Removed support for the deprecated `$mdThemingProviderTheme.primaryColor()` and the related accent/warn/background APIs. These were deprecated in favor of `$mdThemingProviderTheme.primaryPalette()` (and accent/warn/background) in 2015 and they have been logging warnings when used since then.\n* **layout:** Removed the deprecated, undocumented `*-lt-*` layout attributes and classes. This includes the following attributes and their matching classes, which have been giving deprecation warnings since 2015:\n- layout-lt-md\n- layout-lt-lg\n- flex-lt-md\n- flex-lt-lg\n- layout-align-lt-md\n- layout-align-lt-lg\n- flex-order-lt-md\n- flex-order-lt-lg\n- flex-offset-lt-md\n- flex-offset-lt-lg\n- hide-lt-md\n- hide-lt-lg\n- show-lt-md\n- show-lt-lg\n\n* **autofocus:** Removed the deprecated `md-auto-focus` directive. It was deprecated in favor of `md-autofocus`. Please see the [md-autofocus Docs](https://material.angularjs.org/latest/api/directive/mdAutofocus) for examples.\n* **sidenav:** Removed the `md-sidenav-focus` directive. It was deprecated in favor of `md-autofocus`. Please see the [md-autofocus Docs](https://material.angularjs.org/latest/api/directive/mdAutofocus) and [md-sidenav Basic Usage Demo](https://material.angularjs.org/latest/demo/sidenav#basic-usage) for examples.\n* **menu:** Removed the deprecated `$mdOpenMenu` API. It was deprecated in favor of `$mdMenu.open`.\n* **chips:** Removed the deprecated, since 2015, `md-on-append` attribute. It was deprecated in favor of `md-transform-chip` or the simple notifier `md-on-add`. Please see the [md-chips Demos](https://material.angularjs.org/latest/demo/chips) for examples of using `md-transform-chip`.\n* **card:** Removed support for the `class=\"md-actions\"` inside of an `md-card` template. This is deprecated in favor of using the `<md-card-actions>` element.\n* **dialog:** Removed support for the deprecated `class=\"md-actions\"` inside of an `md-dialog` template. This was deprecated in favor of using the `<md-dialog-actions>` element.\n* **panel:** The deprecated `MdPanelRef.addClass()`, `MdPanelRef.removeClass()`, and `MdPanelRef.toggleClass()` functions have been removed. These were deprecated in 2016 in favor of using the `panelContainer` or `panelEl` JQLite elements that are referenced in the [MdPanelRef](https://material.angularjs.org/latest/api/type/MdPanelRef) object.\n\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.0-rc.2 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"clshortfuse\" src=\"https://avatars3.githubusercontent.com/u/9271155?v=4&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"wagnermaciel\" src=\"https://avatars1.githubusercontent.com/u/25158423?v=4&s=117\" width=\"117\">](https://github.com/wagnermaciel) |\n:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[clshortfuse](https://github.com/clshortfuse) |[wagnermaciel](https://github.com/wagnermaciel) |\n\n\n<a name=\"1.2.0-rc.1\"></a>\n# [1.2.0-rc.1](https://github.com/angular/material/compare/v1.1.24...v1.2.0-rc.1) (2020-07-23)\n\n\n### Bug Fixes\n\n* **button:** horizontal padding should match the spec ([3205b33](https://github.com/angular/material/commit/3205b33b57bc08ef92aae28ac2fb898f307c0ac1)), closes [#10535](https://github.com/angular/material/issues/10535) [#10535](https://github.com/angular/material/issues/10535)\n* **checkbox:** handle links in transcluded label in an a11y-friendly way ([4d36fd2](https://github.com/angular/material/commit/4d36fd27be8960c9a5fceed5b8750e201668e4a0)), closes [#11134](https://github.com/angular/material/issues/11134)\n* **checkbox:** update CSS to match spec ([c893050](https://github.com/angular/material/commit/c8930506996a56adb1cbce20a236b7c2f76cbe93)), closes [#9351](https://github.com/angular/material/issues/9351) [#9927](https://github.com/angular/material/issues/9927) [#8713](https://github.com/angular/material/issues/8713)\n* **chips:** chip remove icon isn't sized to match the spec ([#10491](https://github.com/angular/material/issues/10491)) ([29c0a4a](https://github.com/angular/material/commit/29c0a4a7fb53bb92ef97422df8e5c9fa7199d6b1)), closes [#9619](https://github.com/angular/material/issues/9619)\n* **datepicker:** support ng-model-options timezone w/ Moment ([e24d09c](https://github.com/angular/material/commit/e24d09c68ce255ed82cac68361c8ee3dfeeb56e4)), closes [#11945](https://github.com/angular/material/issues/11945) [#10598](https://github.com/angular/material/issues/10598)\n* **input-container:** align indentation with spec ([31a596f](https://github.com/angular/material/commit/31a596f484fa32b07f42e116abad91999c4385d3)), closes [#10105](https://github.com/angular/material/issues/10105) [#11421](https://github.com/angular/material/issues/11421)\n* **list:** fix checkbox alignment and match dense heights to spec ([a13722e](https://github.com/angular/material/commit/a13722ee69ab01babefe1f0bcc5af77f55a3f76c)), closes [#11966](https://github.com/angular/material/issues/11966)\n* **nav-bar:** throws exception when indexing null tabs variable ([b1c7154](https://github.com/angular/material/commit/b1c7154bfe684c92497fb08dea6ce98af94ed1a8)), closes [#11964](https://github.com/angular/material/issues/11964)\n* **panel:** demos need to access locals in controller's $onInit ([6e91c62](https://github.com/angular/material/commit/6e91c621393cd2f5260689cec2c799eef3056a2c))\n* **panel:** don't throw exceptions when the groupName is a string ([4178459](https://github.com/angular/material/commit/4178459c4251f92fac44e4eb9f182704085a2ab9))\n* **select:** md-select-header closes on mouse click when not using multiple ([f2fca2e](https://github.com/angular/material/commit/f2fca2eea9d01be9f72e1dc2a275f1fdbc40764e)), closes [#11969](https://github.com/angular/material/issues/11969)\n* **tabs:** update min-width to follow the spec ([693ecca](https://github.com/angular/material/commit/693eccad4e0c1605513e9b9f747cff53fef6d62a)), closes [#10406](https://github.com/angular/material/issues/10406) [#11432](https://github.com/angular/material/issues/11432)\n* **theming:** dark contrast used incorrectly when only contrastStrongLightColors defined ([4e3f7a7](https://github.com/angular/material/commit/4e3f7a7e0839d9adce8327e67bdb9237e1e91f78))\n* **theming:** update palette contrast types to current spec ([d716fde](https://github.com/angular/material/commit/d716fde69983273940cf67c641c003ba3ffc32c7)), closes [#8992](https://github.com/angular/material/issues/8992) [#10164](https://github.com/angular/material/issues/10164)\n* **theming, toolbar, subheader, input:** align color palettes and contrasts with AA standards ([3a291ac](https://github.com/angular/material/commit/3a291ac6f6ae52093375f4c3dab5f15c4cf476b8)), closes [#8992](https://github.com/angular/material/issues/8992) [#10164](https://github.com/angular/material/issues/10164) [#8993](https://github.com/angular/material/issues/8993)\n* **toast:** improve position handling to better align with docs ([96ec741](https://github.com/angular/material/commit/96ec741e69bfb3d2637a00366e05c11d9538371f)), closes [#11843](https://github.com/angular/material/issues/11843)\n* **toolbar:** input placeholders and ink need more contrast ([a82fc93](https://github.com/angular/material/commit/a82fc93d54793472878da18a64ac8780295fac1f)), closes [#7987](https://github.com/angular/material/issues/7987) [#11376](https://github.com/angular/material/issues/11376)\n\n\n### Code Refactoring\n\n* **$mdCompilerProvider:** remove deprecated $mdCompilerProvider.respectPreAssignBindingsEnabled() ([579a327](https://github.com/angular/material/commit/579a3271698381c49803210c2efaa3b1f9e802bb))\n* **chips:** remove deprecated MdChipsCtrl.selectAndFocusChip ([01d2cde](https://github.com/angular/material/commit/01d2cde76fdc127bef4d52027c143b33dc0666c0))\n* **select:** rename ngMultiple to mdMultiple ([4c75858](https://github.com/angular/material/commit/4c758589f5ff8ad1b6fc1c990ffbbfd5dba913f7))\n* **toast:** remove deprecated content() method and option and updateContent() method ([cf3d56c](https://github.com/angular/material/commit/cf3d56c74fe28b7500bd1d8bc312c132ba06d2b9))\n\n\n### Features\n\n* **theming:** add contrast opacity values for all color types and hues ([68c1d02](https://github.com/angular/material/commit/68c1d02fb40951ea95bf3a136e12e0ff66b2a780))\n\n\n### Documentation\n\n* **theming, colors:** md-colors demo was broken. improve JSDoc and fix lint issues ([01917b3](https://github.com/angular/material/commit/01917b37ec6a8b6a913f9594130b841912e37244))\n\n\n### BREAKING CHANGES\n\n* **list:** `md-list` with the `md-dense` class has been updated to align with the Material Design specification. This means that `md-list-item`s heights have changed when using `md-dense`. The `md-dense-disabled` class is now supported on `md-list`. After updating to this version, you may need to adjust the layout of your app if you use `md-dense` with `md-list` or customize the layout of `md-checkbox`s within `md-list-item`s.\n* **button:** `md-button`'s internal horizontal padding has changed from `6px` to `8px` to match the Material Design spec. This may affect the layout of portions of your application where `md-button`, `md-datepicker`, or `md-toast` with actions are used.\n\nIf you are using our SCSS files, you can override this back to the default, or another value, in your app's SCSS files:\n```scss\n$button-left-right-padding: rem(0.600); // For 6px horizontal padding\n```\n\n* **$mdCompilerProvider:** The deprecated `$mdCompilerProvider.respectPreAssignBindingsEnabled()` API has been removed.\nWe no longer respect AngularJS's `$compileProvider.preAssignBindingsEnabled()` value as this API was removed\nin AngularJS `1.7.0`.\n\nIf you had the recommended configuration for AngularJS 1.6.x:\n```js\n  $compileProvider.preAssignBindingsEnabled(false);\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(true);\n```\nThen you should remove both of these calls as they are now the defaults in AngularJS `1.7.0`\nand AngularJS Material `1.2.0`.\n\nIf you had the recommended configuration for AngularJS 1.7+:\n```js\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(true);\n```\nThen you should remove this call as it is now the default in AngularJS Material `1.2.0`.\n\nIf you were using a backwards-compatible configuration for AngularJS 1.6+:\n```js\n  $mdCompilerProvider.respectPreAssignBindingsEnabled(false);\n```\nThen you will need to remove this call and may need to refactor your Controllers for\nAngularJS Material components like `$mdDialog`, `$mdPanel`, `$mdToast`, or `$mdBottomSheet`.\n\nFor example:\n```js\n $mdDialog.show({\n   locals: {\n     myVar: true\n   },\n   controller: MyController,\n   bindToController: true\n }\n  function MyController() {\n   // No locals from Angular Material are available. e.g myVar is undefined.\n   // You would need to move anything accessing locals in here to $onInit().\n }\n  MyController.prototype.$onInit = function() {\n   // Bindings are now available in the $onInit lifecycle hook.\n }\n```\n* **toast:** The deprecated `content()` and `updateContent()` methods have been removed.\n\nIf you had:\n```js\n  $mdToast.show($mdToast.simple().content('This no longer works.'));\n```\nYou will need to change to:\n```js\n  $mdToast.show($mdToast.simple().textContent('This works.'));\n```\n\nIf you had:\n```js\n  $mdToast.updateContent('This no longer works.');\n```\nYou will need to change to:\n```js\n  $mdToast.updateTextContent('This works.');\n```\n\nIf you had:\n```js\n  $mdToast.show($mdToast.simple({parent: parent, content: 'This no longer works.', theme: 'some-theme', capsule: true}));\n```\nYou will need to change to:\n```js\n  $mdToast.show($mdToast.simple({parent: parent, textContent: 'This works.', theme: 'some-theme', capsule: true}));\n```\n* **select:** `ngMultiple` has been renamed to `mdMultiple` to make it clear that this\nAPI is provided by AngularJS Material and not by AngularJS.\n\nIf you had:\n```html\n  <md-select ng-multiple=\"expression\">...</md-select>\n```\nYou need to change to:\n```html\n  <md-select md-multiple=\"expression\">...</md-select>\n```\n* **chips:** The deprecated `MdChipsCtrl.selectAndFocusChip()` function has been removed.\n`MdChipsCtrl.selectAndFocusChipSafe()` should be used instead.\n* **theming, toolbar, subheader, input:** The contrast colors (the text or icon color, for example on a raised button) of many of our default palettes have been updated to meet the [AA level of the contrast guidelines](https://www.w3.org/TR/WCAG21/#contrast-minimum) for web accessibility. If you are using our default palettes directly, the accessibility of your application should be improved. However, we recommend that you evaluate this after updating to `1.2.0`. There may be edge cases in your app or custom styles that need to be updated to meet accessibility guidelines.\n\nIf you find significant accessibility issues after updating, please report them to us. In `1.2.x`, we have a lot more control over our component theming in regards to hues and opacities.\n\nIf your app is using a custom palette, whether based on a copy of default palette or not, we encourage you to evaluate that your contrast configuration meets the WebAIM guidelines. Please review our guide on [Defining Custom Palettes](https://material.angularjs.org/latest/Theming/03_configuring_a_theme#defining-custom-palettes) for details.\n* **tabs:** Tab items now have a `min-width` and `padding` which matches the Material Design specification. For width, this is `72px` on `xs` screens and `160px` on all other screens. For left and right `padding`, this is now `12px` instead of `24px`. If your app needs to have tabs which are smaller than the spec, you will need to override `md-tab-item`'s `min-width` and `md-tab`'s `padding` styles.\n* **checkbox:** If you've created a custom solution to style links within `md-checkbox` labels, then you may need to remove or change that code now. This is because we automatically detect `<a>` tags in these labels and re-render them in an accessible way.\n* **input-container:** `md-input` and `md-select` inside of `md-input-container`s have been updated to use indentation that is consistent with the spec (aligned to the left in LTR and the right in RTL). This may cause some minor layout issues in apps that depended upon the previous `2px` padding inside of `md-input-container`.\n* The default size and spacing for `md-checkbox` has been updated to align with the Material Design specification. Additionally, many new Sass variables have been added for customizing the size and spacing of `md-checkbox`. The `md-dense` class is now supported. After updating to this version, you may need to adjust the layout of your app due to the larger touch-friendly size of checkbox. You may also want to make use of `md-dense` in cases where space is limited.\n* **toast:** `$mdToast.show()`'s position behavior has been updated to be consistent with the documentation. If you relied on the previously undocumented behavior where it defaulted to `top left` instead of `bottom left`, you will need to update your app.\n\nChange your code from this:\n\n```js\n    $mdToast.show(\n      $mdToast.simple()\n      .textContent('Simple Toast!'))\n    .then(...\n```\n\nTo this:\n\n```js\n    $mdToast.show(\n      $mdToast.simple()\n      .textContent('Simple Toast!')\n      .position('top left'))\n    .then(...\n```\n\n### Contributors\n\nThank you to the contributors who helped with the v1.2.0-rc.1 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"jelbourn\" src=\"https://avatars3.githubusercontent.com/u/838736?v=4&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"clshortfuse\" src=\"https://avatars3.githubusercontent.com/u/9271155?v=4&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"batsauto\" src=\"https://avatars3.githubusercontent.com/u/17678174?v=4&s=117\" width=\"117\">](https://github.com/batsauto) |[<img alt=\"tomaszgrabowski\" src=\"https://avatars0.githubusercontent.com/u/6688790?v=4&s=117\" width=\"117\">](https://github.com/tomaszgrabowski) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[jelbourn](https://github.com/jelbourn) |[clshortfuse](https://github.com/clshortfuse) |[oliversalzburg](https://github.com/oliversalzburg) |[batsauto](https://github.com/batsauto) |[tomaszgrabowski](https://github.com/tomaszgrabowski) |\n\n\n<a name=\"1.1.24\"></a>\n## [1.1.24](https://github.com/angular/material/compare/v1.1.23...v1.1.24) (2020-06-29)\n\n\n### Bug Fixes\n\n* **datepicker:** support `ng-model-options` timezone w/ MomentJS and datepicker now passes `ng-model-options` on to calendar ([12562b0](https://github.com/angular/material/commit/12562b0e0c47472477729ed54b9aa30bfc4110e3)), closes [#11945](https://github.com/angular/material/issues/11945) [#10598](https://github.com/angular/material/issues/10598)\n* **panel:** animated panels never appear on the screen ([e81e2e3](https://github.com/angular/material/commit/e81e2e33cccd414310f47ef9cec22aa54dd604a7)), closes [#11946](https://github.com/angular/material/issues/11946)\n* **panel:** inline transforms accumulate after each time the close animation runs ([6322e98](https://github.com/angular/material/commit/6322e982db2ebe5bc99bddcf1e6ffde4c5041305)), closes [#11946](https://github.com/angular/material/issues/11946)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.24 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[mmalerba](https://github.com/mmalerba) |\n\n\n<a name=\"1.1.23\"></a>\n## [1.1.23](https://github.com/angular/material/compare/v1.1.22...v1.1.23) (2020-06-18)\n\n\n### Bug Fixes\n\n* **calendar, datepicker:** in year view, `md-date-filter` only evaluates first day of month ([3d5ff5d](https://github.com/angular/material/commit/3d5ff5db56d3b84b2c7d813886d13ef831b7a295)), closes [#11703](https://github.com/angular/material/issues/11703)\n* **compiler:** `$onDestroy` hook not called ([8bb1d98](https://github.com/angular/material/commit/8bb1d9811e39ae26e79f629902c3be619eba8b30)), closes [#11847](https://github.com/angular/material/issues/11847)\n* **datepicker:** update error state only after `$validate` has run ([11f65e3](https://github.com/angular/material/commit/11f65e3371eb5fcffba0c1194ef3f9b022d0cf87)), closes [#10360](https://github.com/angular/material/issues/10360)\n* **layout:** Syntax Error: Token `'&&'` not a primary expression ([#11940](https://github.com/angular/material/pull/11940)) ([1bd1a97](https://github.com/angular/material/commit/1bd1a97d7d22921e2cfb1fcb940f485a095130f8)), closes [#10935](https://github.com/angular/material/issues/10935)\n* **list:** allow overriding `md-list-item` padding for clickable items ([f7d9027](https://github.com/angular/material/commit/f7d9027e9b0a91050213372cc0dfa52230d528d1)), closes [#10384](https://github.com/angular/material/issues/10384)\n* **menuBar:** close top nested menu when escape key is pressed ([98e259b](https://github.com/angular/material/commit/98e259bec4dc026fa38fb1a5c16a6c4f37722e7a)), closes [#11678](https://github.com/angular/material/issues/11678)\n* **navBar:** update inkbar on screen resize ([c1e2b12](https://github.com/angular/material/commit/c1e2b1277e59fd802e0e1e2da7eee492d39b84b0)), closes [#10121](https://github.com/angular/material/issues/10121)\n* **panel:** allow transform to be animated on an offset panel ([269b68e](https://github.com/angular/material/commit/269b68e8540062e2a0e195edb54a75903b17fdd0)), closes [#9641](https://github.com/angular/material/issues/9641) [#9905](https://github.com/angular/material/issues/9905)\n* **panel:** consolidate redundant validations ([#9631](https://github.com/angular/material/issues/9631)) ([a334134](https://github.com/angular/material/commit/a3341349631e5a2df4d4a6e0b9a527206f1b7686))\n* **panel:** invisible after hide/show cycle ([a3c533f](https://github.com/angular/material/commit/a3c533f1c657588d4625c2b26c7b59ba7eeefb25)), closes [#11291](https://github.com/angular/material/issues/11291)\n* **progress-circular:** correct rendering for diameter bigger than 60 ([#11896](https://github.com/angular/material/issues/11896)) ([0cca317](https://github.com/angular/material/commit/0cca317c3dfb6455609c840d2b03bb575a4cc35b)), closes [#10376](https://github.com/angular/material/issues/10376)\n* **progress-linear, progress-circular:** mirror indicator when rtl is on ([#11895](https://github.com/angular/material/pull/11895)) ([9fc2f3f](https://github.com/angular/material/commit/9fc2f3fbb9d61fcdcbd32bdbdedca0d2cc9d4664)), closes [#10814](https://github.com/angular/material/issues/10814)\n* **select:** height changes when disabled ([e2af2a3](https://github.com/angular/material/commit/e2af2a3f7fa05de81729d976512304c0f90f2891)), closes [#11812](https://github.com/angular/material/issues/11812)\n* **select:** `md-focused` not removed from options on panel close ([5a7e967](https://github.com/angular/material/commit/5a7e967d9f2a7d568d6b9ede7a8e6a47d9270265)), closes [#11927](https://github.com/angular/material/issues/11927)\n* **select:** optgroups are not visible to screen readers ([5fbabe7](https://github.com/angular/material/commit/5fbabe7e107a623303bcbcfed5c6d9e194f417e2)), closes [#11240](https://github.com/angular/material/issues/11240)\n* **select:** perform correct position calculation in rtl for long labels ([#11894](https://github.com/angular/material/pull/11894)) ([9f49e10](https://github.com/angular/material/commit/9f49e1043b98977ab4e7e1053d0f4ea5ee978df5)), closes [#10395](https://github.com/angular/material/issues/10395)\n* **select:** revert removal of support for `ng-selected` on `md-options` ([546bd84](https://github.com/angular/material/commit/546bd84b6c8e784aa43e88b926a117f077e1200c)), closes [#11914](https://github.com/angular/material/issues/11914)\n* **slider:** vertical slider in a scrolled container sets value to zero on all clicks ([#11801](https://github.com/angular/material/issues/11801)) ([79bf96b](https://github.com/angular/material/commit/79bf96b64e992a99a10145ee6b5a2479afaa5d21)), closes [#11800](https://github.com/angular/material/issues/11800)\n* **toast:** `onRemove` doesn't return a `Promise` in some cases ([e625a9c](https://github.com/angular/material/commit/e625a9ce108722a061bf087ee3b1a600ceee3fb9)), closes [#10379](https://github.com/angular/material/issues/10379)\n* **toolbar:** `md-scroll-shrink` conflicts with `md-select` in toolbar ([1ed54bb](https://github.com/angular/material/commit/1ed54bb90bc9c71cce4575e325250606d97fa867)), closes [#10413](https://github.com/angular/material/issues/10413) [#9871](https://github.com/angular/material/issues/9871)\n* **tooltip:** change from `inline` to `inline-block` to account for `md-panel` change ([20194ba](https://github.com/angular/material/commit/20194ba2f11227f0e3965089af598e9c89ce71a6))\n* **util:** sanitize function used by select and autocomplete throws \"Invalid regular expression\" when typing `(` ([bc71d0b](https://github.com/angular/material/commit/bc71d0b0b6dd58a3025d8d65a309841783ebb0a9)), closes [#11908](https://github.com/angular/material/issues/11908)\n\n\n### Features\n\n* **calendar:** support specifying timezone in `ng-model-options` ([2a01746](https://github.com/angular/material/commit/2a01746c4fbea1bbd2ca82808a6e9f0f979a2968)), closes [#10431](https://github.com/angular/material/issues/10431)\n* **input:** add animation to color change ([#10079](https://github.com/angular/material/issues/10079)) ([b486a41](https://github.com/angular/material/commit/b486a4104e2fdfdac8563b0c301fb3bfaf060142))\n* **select:** add the ability to pre-select the only option in the list ([#9940](https://github.com/angular/material/issues/9940)) ([6372027](https://github.com/angular/material/commit/6372027e8c042845c302dfd52d8cd490faf1f43e)), closes [#9626](https://github.com/angular/material/issues/9626)\n\n### Documentation\n\n* **codepen:** update for AngularJS `1.8.0`\n* **security:** added [Security Policy](https://github.com/angular/material/blob/master/SECURITY.md)\n* **tabs:** improve correctness of API docs and types [a17ef4f](https://github.com/angular/material/commit/a17ef4fa9f7fe0ca812364fb9256f75c17d99442), closes [#10407](https://github.com/angular/material/issues/10407)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.23 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"crisbeto\" src=\"https://avatars0.githubusercontent.com/u/4450522?v=4&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"nnmrts\" src=\"https://avatars0.githubusercontent.com/u/20396367?v=4&s=117\" width=\"117\">](https://github.com/nnmrts) |[<img alt=\"Thaina\" src=\"https://avatars1.githubusercontent.com/u/1042507?v=4&s=117\" width=\"117\">](https://github.com/Thaina) |[<img alt=\"chmelevskij\" src=\"https://avatars1.githubusercontent.com/u/7774918?v=4&s=117\" width=\"117\">](https://github.com/chmelevskij) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[crisbeto](https://github.com/crisbeto) |[marosoft](https://github.com/marosoft) |[nnmrts](https://github.com/nnmrts) |[Thaina](https://github.com/Thaina) |[chmelevskij](https://github.com/chmelevskij) |\n\n\n<a name=\"1.1.22\"></a>\n## [1.1.22](https://github.com/angular/material/compare/v1.1.21...v1.1.22) (2020-04-30)\n\n\n### Bug Fixes\n\n* **autocomplete:** loop options list when moving past first/last option with arrow keys ([5228f23](https://github.com/angular/material/commit/5228f23b963b8d3811c916c2403469b92b2cca7e)), closes [#11766](https://github.com/angular/material/issues/11766)\n* **autocomplete:** md-not-found template is not styled properly ([ce6e2ff](https://github.com/angular/material/commit/ce6e2ff13702cd462a1b45c06753d16278270ba1)), closes [#11852](https://github.com/angular/material/issues/11852)\n* **autocomplete:** Move mouse enter and leave events to container ([5b0c9ba](https://github.com/angular/material/commit/5b0c9ba9e0e5313925f6a27390559f32028fd95b)), closes [#11776](https://github.com/angular/material/issues/11776)\n* **autocomplete:** scroll to top of the list each time dropdown open ([498c9ed](https://github.com/angular/material/commit/498c9edd26e878d53e8f1b02a86380fe1b9895b1)), closes [#10479](https://github.com/angular/material/issues/10479)\n* **contact-chips:** don't rely on debug info to get access to controller scope ([2f77095](https://github.com/angular/material/commit/2f770957f7d38d9c1386767b82bd662c07af9787)), closes [#11699](https://github.com/angular/material/issues/11699)\n* **datepicker:** md-open-on-focus fails when switching tabs with open datepicker ([7a16778](https://github.com/angular/material/commit/7a16778ecc08593463c361b33b4fe17154b8cb75))\n* **gesture:** 'drag' gestures don't clean up touch action styles on parent ([deb3dfc](https://github.com/angular/material/commit/deb3dfc11e76ea38c2ec65a2a9b4d68560d0c181)), closes [#11147](https://github.com/angular/material/issues/11147)\n* **list:** dense lists cut off descenders of letters like gjqpy ([0ab73bd](https://github.com/angular/material/commit/0ab73bd86ab3f5e564ef73663e3f70e2404b2538)), closes [#8890](https://github.com/angular/material/issues/8890)\n* **list:** isEventFromControl() works on all browsers now ([d537d25](https://github.com/angular/material/commit/d537d251d7281ed446ce5b5502a123884e1af9f4)), closes [#7937](https://github.com/angular/material/issues/7937)\n* **list:** primary action is fired twice on space/enter keydown ([920018e](https://github.com/angular/material/commit/920018efbd51ed4f164db3fa02da721d3148da43)), closes [#11756](https://github.com/angular/material/issues/11756)\n* **list:** secondary actions give aria warning if text is in a span ([90c8b8d](https://github.com/angular/material/commit/90c8b8d6f6265b3c5b71f38fa847dc5c6bb9ce04)), closes [#6152](https://github.com/angular/material/issues/6152)\n* **menu-bar:** z-index not restored on menu close ([4a4dde4](https://github.com/angular/material/commit/4a4dde489835dd1c2ef221563bb5f2fd9fc9bddf)), closes [#11235](https://github.com/angular/material/issues/11235)\n* **nav-bar:** clicked nav item not focused or selected in some cases ([4d4e0ac](https://github.com/angular/material/commit/4d4e0ac9487c9a632447fa5ecf38941934c3cf2c)), closes [#11747](https://github.com/angular/material/issues/11747)\n* **select:** overhaul screen reader support ([928c71d](https://github.com/angular/material/commit/928c71d6ee87bc03ce383bfa555f67e1d373fe13)), closes [#10748](https://github.com/angular/material/issues/10748) [#10967](https://github.com/angular/material/issues/10967)\n* **select:** sanitize user input before searching options ([#11855](https://github.com/angular/material/issues/11855)) ([0ec0cc5](https://github.com/angular/material/commit/0ec0cc5ee8aac0db6103ae4c1ee1fc30620247b2)), closes [#11854](https://github.com/angular/material/issues/11854)\n* **select:** when using trackBy, trigger ng-change only when tracked property is different ([ecd55d0](https://github.com/angular/material/commit/ecd55d0dd2d52c746e4aa907bfd3712f6c03a68a)), closes [#11108](https://github.com/angular/material/issues/11108)\n* **select:** menuController not defined edge case in focusOptionNode ([b9d8322](https://github.com/angular/material/commit/b9d832209f8b9e25b4bc5dc2654bf18421144816)), closes [#11885](https://github.com/angular/material/issues/11885)\n\n### Documentation\n\n* **vscode:** add VSCode configuration and guide ([#11879](https://github.com/angular/material/pull/11879)) ([a8954df](https://github.com/angular/material/commit/a8954dfaded6b5ae36aa35eaba3f33602f1e9da3))\n* **dialog:** clarify promise rejection behavior in descriptions ([#11889](https://github.com/angular/material/pull/11889)) ([939f6c9](https://github.com/angular/material/commit/939f6c9f8ef16326b6cd15b0164afb69ae0c72fc)), closes ([#10130](https://github.com/angular/material/issues/10130))\n* **docs, README:** remove Bower references, update GitHub and NPM icons. fix 'View Demo' button appearing for directives w/o demos ([#11888](https://github.com/angular/material/pull/11888)) ([5c75b12](https://github.com/angular/material/commit/5c75b121920243410c164df7ec33558087cccf1f))\n* **getting-started, home:** updates to landing page and getting started. add Blank StackBlitz Demo starter ([#11890](https://github.com/angular/material/pull/11890)) ([d1a9976](https://github.com/angular/material/commit/d1a9976cad047288262d904460e7be6089de8128))\n* **COMMIT_LEVELS:** update guide to better describe the process and responsibilities ([#11862](https://github.com/angular/material/pull/11862)) ([38fe956](https://github.com/angular/material/commit/38fe9560e23467cabe18a8653849238946f2afa5))\n* **BUILD:** rewrote most of the guide ([#11880](https://github.com/angular/material/pull/11880)) ([4093953](https://github.com/angular/material/commit/40939534460f175543a0261c3b232d71e2a2884b))\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.22 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"andrewseguin\" src=\"https://avatars3.githubusercontent.com/u/22898577?v=4&s=117\" width=\"117\">](https://github.com/andrewseguin) |[<img alt=\"free-easy\" src=\"https://avatars2.githubusercontent.com/u/20483759?v=4&s=117\" width=\"117\">](https://github.com/free-easy) |[<img alt=\"nathanael-bice\" src=\"https://avatars2.githubusercontent.com/u/6155868?v=4&s=117\" width=\"117\">](https://github.com/nathanael-bice) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[marosoft](https://github.com/marosoft) |[oliversalzburg](https://github.com/oliversalzburg) |[andrewseguin](https://github.com/andrewseguin) |[free-easy](https://github.com/free-easy) |[nathanael-bice](https://github.com/nathanael-bice) |\n\n[<img alt=\"psamim\" src=\"https://avatars3.githubusercontent.com/u/1868679?v=4&s=117\" width=\"117\">](https://github.com/psamim) |[<img alt=\"qubiack\" src=\"https://avatars1.githubusercontent.com/u/19862364?v=4&s=117\" width=\"117\">](https://github.com/qubiack) |\n:---: |:---: |\n[psamim](https://github.com/psamim) |[qubiack](https://github.com/qubiack) |\n\n\n<a name=\"1.1.22-rc.0\"></a>\n## [1.1.22-rc.0](https://github.com/angular/material/compare/v1.1.21...v1.1.22-rc.0) (2020-03-13)\n\n\n### Bug Fixes\n\n* **autocomplete:** loop options list when moving past first/last option with arrow keys ([5228f23](https://github.com/angular/material/commit/5228f23b963b8d3811c916c2403469b92b2cca7e)), closes [#11766](https://github.com/angular/material/issues/11766)\n* **autocomplete:** md-not-found template is not styled properly ([ce6e2ff](https://github.com/angular/material/commit/ce6e2ff13702cd462a1b45c06753d16278270ba1)), closes [#11852](https://github.com/angular/material/issues/11852)\n* **autocomplete:** Move mouse enter and leave events to container ([5b0c9ba](https://github.com/angular/material/commit/5b0c9ba9e0e5313925f6a27390559f32028fd95b)), closes [#11776](https://github.com/angular/material/issues/11776)\n* **autocomplete:** scroll to top of the list each time dropdown open ([498c9ed](https://github.com/angular/material/commit/498c9edd26e878d53e8f1b02a86380fe1b9895b1)), closes [#10479](https://github.com/angular/material/issues/10479)\n* **contact-chips:** don't rely on debug info to get access to controller scope ([2f77095](https://github.com/angular/material/commit/2f770957f7d38d9c1386767b82bd662c07af9787)), closes [#11699](https://github.com/angular/material/issues/11699)\n* **datepicker:** md-open-on-focus fails when switching tabs with open datepicker ([7a16778](https://github.com/angular/material/commit/7a16778ecc08593463c361b33b4fe17154b8cb75))\n* **gesture:** 'drag' gestures don't clean up touch action styles on parent ([deb3dfc](https://github.com/angular/material/commit/deb3dfc11e76ea38c2ec65a2a9b4d68560d0c181)), closes [#11147](https://github.com/angular/material/issues/11147)\n* **list:** dense lists cut off descenders of letters like gjqpy ([0ab73bd](https://github.com/angular/material/commit/0ab73bd86ab3f5e564ef73663e3f70e2404b2538)), closes [#8890](https://github.com/angular/material/issues/8890)\n* **list:** isEventFromControl() works on all browsers now ([d537d25](https://github.com/angular/material/commit/d537d251d7281ed446ce5b5502a123884e1af9f4)), closes [#7937](https://github.com/angular/material/issues/7937)\n* **list:** primary action is fired twice on space/enter keydown ([920018e](https://github.com/angular/material/commit/920018efbd51ed4f164db3fa02da721d3148da43)), closes [#11756](https://github.com/angular/material/issues/11756)\n* **list:** secondary actions give aria warning if text is in a span ([90c8b8d](https://github.com/angular/material/commit/90c8b8d6f6265b3c5b71f38fa847dc5c6bb9ce04)), closes [#6152](https://github.com/angular/material/issues/6152)\n* **menu-bar:** z-index not restored on menu close ([4a4dde4](https://github.com/angular/material/commit/4a4dde489835dd1c2ef221563bb5f2fd9fc9bddf)), closes [#11235](https://github.com/angular/material/issues/11235)\n* **nav-bar:** clicked nav item not focused or selected in some cases ([4d4e0ac](https://github.com/angular/material/commit/4d4e0ac9487c9a632447fa5ecf38941934c3cf2c)), closes [#11747](https://github.com/angular/material/issues/11747)\n* **select:** overhaul screen reader support ([928c71d](https://github.com/angular/material/commit/928c71d6ee87bc03ce383bfa555f67e1d373fe13)), closes [#10748](https://github.com/angular/material/issues/10748) [#10967](https://github.com/angular/material/issues/10967)\n* **select:** sanitize user input before searching options ([#11855](https://github.com/angular/material/issues/11855)) ([0ec0cc5](https://github.com/angular/material/commit/0ec0cc5ee8aac0db6103ae4c1ee1fc30620247b2)), closes [#11854](https://github.com/angular/material/issues/11854)\n* **select:** when using trackBy, trigger ng-change only when tracked property is different ([ecd55d0](https://github.com/angular/material/commit/ecd55d0dd2d52c746e4aa907bfd3712f6c03a68a)), closes [#11108](https://github.com/angular/material/issues/11108)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.22-rc.0 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"andrewseguin\" src=\"https://avatars3.githubusercontent.com/u/22898577?v=4&s=117\" width=\"117\">](https://github.com/andrewseguin) |[<img alt=\"free-easy\" src=\"https://avatars2.githubusercontent.com/u/20483759?v=4&s=117\" width=\"117\">](https://github.com/free-easy) |[<img alt=\"nathanael-bice\" src=\"https://avatars2.githubusercontent.com/u/6155868?v=4&s=117\" width=\"117\">](https://github.com/nathanael-bice) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[marosoft](https://github.com/marosoft) |[oliversalzburg](https://github.com/oliversalzburg) |[andrewseguin](https://github.com/andrewseguin) |[free-easy](https://github.com/free-easy) |[nathanael-bice](https://github.com/nathanael-bice) |\n\n[<img alt=\"psamim\" src=\"https://avatars3.githubusercontent.com/u/1868679?v=4&s=117\" width=\"117\">](https://github.com/psamim) |[<img alt=\"qubiack\" src=\"https://avatars1.githubusercontent.com/u/19862364?v=4&s=117\" width=\"117\">](https://github.com/qubiack) |\n:---: |:---: |\n[psamim](https://github.com/psamim) |[qubiack](https://github.com/qubiack) |\n\n\n<a name=\"1.1.21\"></a>\n## [1.1.21](https://github.com/angular/material/compare/v1.1.20...v1.1.21) (2019-10-22)\n\n\n### Bug Fixes\n\n* **autocomplete:** improve handling of touch pads and touchscreens ([#11782](https://github.com/angular/material/issues/11782)) ([20c4d3f](https://github.com/angular/material/commit/20c4d3f)), closes [#11778](https://github.com/angular/material/issues/11778)\n* **autocomplete:** improve implementation of aria-activedescendant ([#11743](https://github.com/angular/material/issues/11743)) ([8c159aa](https://github.com/angular/material/commit/8c159aa)), closes [#11742](https://github.com/angular/material/issues/11742)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.21 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"neilsh\" src=\"https://avatars3.githubusercontent.com/u/49814?v=4&s=117\" width=\"117\">](https://github.com/neilsh) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[neilsh](https://github.com/neilsh) |\n\n\n<a name=\"1.1.20\"></a>\n## [1.1.20](https://github.com/angular/material/compare/v1.1.19...v1.1.20) (2019-08-15)\n\n\n### Bug Fixes\n\n* **autocomplete:** options panel flickers on hover after clicking input ([#11757](https://github.com/angular/material/issues/11757)) ([8f14afd](https://github.com/angular/material/commit/8f14afd)), closes [#11625](https://github.com/angular/material/issues/11625)\n* **autocomplete:** support ng-click on md-autocomplete ([#11758](https://github.com/angular/material/issues/11758)) ([313e5e6](https://github.com/angular/material/commit/313e5e6)), closes [#11625](https://github.com/angular/material/issues/11625)\n* **autocomplete:** tap outside options panel on iOS does not close panel ([#11625](https://github.com/angular/material/issues/11625)) ([f81349a](https://github.com/angular/material/commit/f81349a)), closes [#9581](https://github.com/angular/material/issues/9581)\n* **datepicker:** remove invalid aria-expanded ([#11740](https://github.com/angular/material/issues/11740)) ([197d197](https://github.com/angular/material/commit/197d197)), closes [#11475](https://github.com/angular/material/issues/11475)\n* **gesture:** check if navigator is defined before accessing userAgent ([#11755](https://github.com/angular/material/issues/11755)) ([0077d3e](https://github.com/angular/material/commit/0077d3e)), closes [#11751](https://github.com/angular/material/issues/11751)\n* **gesture:** maximum call stack size exceeded on click w/ Tal… ([#11774](https://github.com/angular/material/issues/11774)) ([4acef53](https://github.com/angular/material/commit/4acef53)), closes [#11768](https://github.com/angular/material/issues/11768)\n* **input:** floating label text fails a11y contrast audit ([#11497](https://github.com/angular/material/issues/11497)) ([b5de054](https://github.com/angular/material/commit/b5de054)), closes [#11475](https://github.com/angular/material/issues/11475)\n* **panel:** append panel animation transforms after existing transforms ([#11681](https://github.com/angular/material/issues/11681)) ([ffe9349](https://github.com/angular/material/commit/ffe9349))\n* **rtl:** support applying dir=\"rtl\" on DOM elements other than the body ([#11579](https://github.com/angular/material/issues/11579)) ([bc7833b](https://github.com/angular/material/commit/bc7833b)), closes [#11016](https://github.com/angular/material/issues/11016) [#9754](https://github.com/angular/material/issues/9754)\n* **select:** improve focus/blur handling on iOS ([#11739](https://github.com/angular/material/issues/11739)) ([0284b13](https://github.com/angular/material/commit/0284b13)), closes [#11345](https://github.com/angular/material/issues/11345)\n* **tooltip:** move document.contains polyfill for IE11 into $mdUtil ([#11749](https://github.com/angular/material/issues/11749)) ([f5535f8](https://github.com/angular/material/commit/f5535f8)), closes [#11745](https://github.com/angular/material/issues/11745)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.20 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"Noglen\" src=\"https://avatars0.githubusercontent.com/u/38341522?v=4&s=117\" width=\"117\">](https://github.com/Noglen) |\n:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[marosoft](https://github.com/marosoft) |[Noglen](https://github.com/Noglen) |\n\n\n<a name=\"1.1.19\"></a>\n## [1.1.19](https://github.com/angular/material/compare/v1.1.18...v1.1.19) (2019-05-31)\n\n\n### Bug Fixes\n\n* **datepicker:** auto closes in Chrome when md-open-on-focus is used ([#11719](https://github.com/angular/material/issues/11719)) ([73c424d](https://github.com/angular/material/commit/73c424d)), closes [#11701](https://github.com/angular/material/issues/11701)\n* **gesture:** tapping a submit button fires two submit events on mobile ([#11729](https://github.com/angular/material/issues/11729)) ([244619a](https://github.com/angular/material/commit/244619a)), closes [#10189](https://github.com/angular/material/issues/10189) [#11725](https://github.com/angular/material/issues/11725)\n* **icon:** symbol icons not working on browsers other than IE11 ([#11706](https://github.com/angular/material/issues/11706)) ([a62d160](https://github.com/angular/material/commit/a62d160)), closes [#11705](https://github.com/angular/material/issues/11705)\n* **select:** edge case where the model value is unset w/ AngularJS 1.7.8 ([#11724](https://github.com/angular/material/issues/11724)) ([952a035](https://github.com/angular/material/commit/952a035)), closes [#11679](https://github.com/angular/material/issues/11679)\n* **tabs:** new tab animation broken by code to support IE11 ([#11711](https://github.com/angular/material/issues/11711)) ([1063a92](https://github.com/angular/material/commit/1063a92)), closes [#11689](https://github.com/angular/material/issues/11689)\n\n\n### Features\n\n* **menu-bar:** support md-prevent-menu-close on checkbox/radio items ([#11710](https://github.com/angular/material/issues/11710)) ([d577afd](https://github.com/angular/material/commit/d577afd)), closes [#11707](https://github.com/angular/material/issues/11707)\n\n### Documentation\n\n* **migration:** Add a guide for migration to Angular Material and the CDK ([#11706](https://github.com/angular/material/pull/11706)) ([16cea88](https://github.com/angular/material/commit/16cea88))\n* **docs:** Added support for Sass and TypeScript in code samples ([#11706](https://github.com/angular/material/pull/11706)) ([16cea88](https://github.com/angular/material/commit/16cea88))\n* **docs:** Allow up/down/page up/page down to scroll content ([#11712](https://github.com/angular/material/pull/11712)) ([67826f5](https://github.com/angular/material/commit/67826f5)), closes [#2961](https://github.com/angular/material/issues/2961)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.19 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[codymikol](https://github.com/codymikol) |\n\n\n\n<a name=\"1.1.18\"></a>\n## [1.1.18](https://github.com/angular/material/compare/v1.1.17...v1.1.18) (2019-04-05)\n\n\n### Bug Fixes\n\n* **icon:** stop breaking SVGs that have id references ([#11465](https://github.com/angular/material/issues/11465)) ([1b37e82](https://github.com/angular/material/commit/1b37e82)), closes [#11395](https://github.com/angular/material/issues/11395)\n\n### Documentation\n\n* **docs:** fix demos not loading in CodePen ([#11697](https://github.com/angular/material/pull/11697)) ([43035fd](https://github.com/angular/material/commit/43035fd)), closes [#11696](https://github.com/angular/material/issues/11696)\n\n### Infrastructure\n\n* **release:** workaround NPM bug that publishes `.git/` directory ([#11695](https://github.com/angular/material/pull/11695)) ([f44b271](https://github.com/angular/material/commit/f44b271)), closes [#11684](https://github.com/angular/material/issues/11684)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.18 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"EmielH\" src=\"https://avatars1.githubusercontent.com/u/5822678?v=4&s=117\" width=\"117\">](https://github.com/EmielH) |\n:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[EmielH](https://github.com/EmielH) |\n\n\n\n<a name=\"1.1.17\"></a>\n## [1.1.17](https://github.com/angular/material/compare/v1.1.14...v1.1.17) (2019-03-29)\n\n\n### Bug Fixes\n\n* **autocomplete:** default dropdown to position bottom ([#11670](https://github.com/angular/material/issues/11670)) ([7674959](https://github.com/angular/material/commit/7674959)), closes [#11656](https://github.com/angular/material/issues/11656)\n* **slider:** aria attrs are not announced when tabbing in screen readers ([#11688](https://github.com/angular/material/issues/11688)) ([459c03c](https://github.com/angular/material/commit/459c03c)), closes [#11685](https://github.com/angular/material/issues/11685)\n* **tabs:** use standard `wheel` event instead of `mousewheel` event to fix Firefox ([#11686](https://github.com/angular/material/issues/11686)) ([7f249f9](https://github.com/angular/material/commit/7f249f9)), closes [#11654](https://github.com/angular/material/issues/11654)\n* **npm:** deploy new release early to fix issue of `1.1.14` including a `.git/` dir for NPM installs, relates to [#11684](https://github.com/angular/material/issues/11684)\n\n### Documentation\n\n* **docs:** scroll position improvements for navigation ([#11671](https://github.com/angular/material/issues/11671)) ([b88368f](https://github.com/angular/material/commit/b88368f)), closes [#11669](https://github.com/angular/material/issues/11669)\n\n### Contributors\n\nThank you to the contributors who helped with the v1.1.17 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"gaurav5430\" src=\"https://avatars2.githubusercontent.com/u/12510548?v=4&s=117\" width=\"117\">](https://github.com/gaurav5430) |\n:---: | :---: |\n[Splaktar](https://github.com/Splaktar) | [gaurav5430](https://github.com/gaurav5430) |\n\n\n\n<a name=\"1.1.14\"></a>\n## [1.1.14](https://github.com/angular/material/compare/v1.1.13...v1.1.14) (2019-03-18)\n\n\n### Bug Fixes\n\n* **$mdInteraction:** clean up events on $rootScope destroy ([#11641](https://github.com/angular/material/issues/11641)) ([e9e9ece](https://github.com/angular/material/commit/e9e9ece)), closes [#11493](https://github.com/angular/material/issues/11493) [#11493](https://github.com/angular/material/issues/11493)\n* **icon:** large SVG files can cause icon caching to hang ([#11653](https://github.com/angular/material/issues/11653)) ([6a68c96](https://github.com/angular/material/commit/6a68c96))\n* **input:** placeholder hidden when there is also a label on IE11 ([#11674](https://github.com/angular/material/issues/11674)) ([ddcbb2e](https://github.com/angular/material/commit/ddcbb2e)), closes [#11668](https://github.com/angular/material/issues/11668)\n* **interimElement**: don't track elements that fail compilation ([#11471](https://github.com/angular/material/pull/11471)) [08d90e9](https://github.com/angular/material/commit/08d90e96afd70129db3c57d345b53c59915205fe), closes [#11460](https://github.com/angular/material/issues/11460)\n* **nav-bar:** non-selected tabs with anchors have invalid tabindex value ([#11675](https://github.com/angular/material/issues/11675)) ([ec9aa25](https://github.com/angular/material/commit/ec9aa25)), closes [#11637](https://github.com/angular/material/issues/11637)\n* **panel:** caching of panels by id is not working ([#11638](https://github.com/angular/material/issues/11638)) ([649116b](https://github.com/angular/material/commit/649116b))\n* **progress-circular:** show correct circle arc when changing from indeterminate to determinate mode ([#11580](https://github.com/angular/material/issues/11580)) ([686b365](https://github.com/angular/material/commit/686b365))\n* **virtual-repeat-container:** support horizontal scrollbar in vertical orientation ([#11462](https://github.com/angular/material/issues/11462)) ([3cf4d74](https://github.com/angular/material/commit/3cf4d74))\n\n### Documentation\n\n* **docs:** properly format anchor names and hrefs ([#11648](https://github.com/angular/material/pull/11648))\n* **radio-button:** correct two misspellings on demo ([#11667](https://github.com/angular/material/pull/11667))\n* **colors:** clean up Closure / JSDoc comments and types ([#11676](https://github.com/angular/material/pull/11676))\n\n### Infrastructure\n\n* **build:** make the build output deterministic and reproducible ([#11570](https://github.com/angular/material/pull/11570))\n* **ci:** we moved over to CircleCI from TravisCI in the previous 1.1.13 release ([#11592](https://github.com/angular/material/issues/11592))\n\n#### Contributors\n\nThank you to the contributors who helped with the v1.1.14 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"JSitjaNCR\" src=\"https://avatars0.githubusercontent.com/u/43601493?v=4&s=117\" width=\"117\">](https://github.com/JSitjaNCR) |[<img alt=\"RQF7\" src=\"https://avatars0.githubusercontent.com/u/11713881?v=4&s=117\" width=\"117\">](https://github.com/RQF7) |\n:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[codymikol](https://github.com/codymikol) |[marosoft](https://github.com/marosoft) |[JSitjaNCR](https://github.com/JSitjaNCR) |[RQF7](https://github.com/RQF7) |\n\n\n\n<a name=\"1.1.13\"></a>\n## [1.1.13](https://github.com/angular/material/compare/v1.1.12...v1.1.13) (2019-02-20)\n\n\n### Bug Fixes\n\n* **autocomplete:** show dropdown on top only when there is room ([#11629](https://github.com/angular/material/issues/11629)) ([38fb991](https://github.com/angular/material/commit/38fb991)), closes [#10859](https://github.com/angular/material/issues/10859)\n* **autocomplete:** suggestions can be highlighted incorrectly ([#11529](https://github.com/angular/material/issues/11529)) ([320511c](https://github.com/angular/material/commit/320511c)), closes [#10573](https://github.com/angular/material/issues/10573)\n* **autocomplete:** two chips added on enter w/ IE11 ([#11528](https://github.com/angular/material/issues/11528)) ([705c54e](https://github.com/angular/material/commit/705c54e)), closes [#10640](https://github.com/angular/material/issues/10640) [#10667](https://github.com/angular/material/issues/10667)\n* **checkbox:** submit on enter rather than toggle ([#11584](https://github.com/angular/material/issues/11584)) ([a191a8e](https://github.com/angular/material/commit/a191a8e)) ([#11640](https://github.com/angular/material/pull/11640)) ([251cfed8](https://github.com/angular/material/commit/251cfed8)), closes [#11583](https://github.com/angular/material/issues/11583) [#11639](https://github.com/angular/material/issues/11639)\n* **datepicker:** does not open on focus in Firefox ([#11521](https://github.com/angular/material/issues/11521)) ([45e92ea](https://github.com/angular/material/commit/251cfed82837270c29e1099b34f5e85874a7bcad)), closes [#10619](https://github.com/angular/material/issues/10619)\n* **datepicker:** validation error when adding text after date ([#11110](https://github.com/angular/material/issues/11110)) ([57c81c8](https://github.com/angular/material/commit/57c81c8)), closes [#9994](https://github.com/angular/material/issues/9994) [#10520](https://github.com/angular/material/issues/10520) [#10015](https://github.com/angular/material/issues/10015)\n* **icon:** SVG elements are not loaded from the cache properly on IE11 ([#11635](https://github.com/angular/material/issues/11635)) ([7cde443](https://github.com/angular/material/commit/7cde443)), closes [#11603](https://github.com/angular/material/issues/11603) [#11545](https://github.com/angular/material/issues/11545) [#11604](https://github.com/angular/material/issues/11604)\n* **layout:** remove some duplicate layout > flex styles ([#11613](https://github.com/angular/material/issues/11613)) ([6515e6c](https://github.com/angular/material/commit/6515e6c)), closes [#11609](https://github.com/angular/material/issues/11609)\n* **list:** case where user is unable to interact w/ secondary actions ([#11539](https://github.com/angular/material/issues/11539)) ([708fff9](https://github.com/angular/material/commit/708fff9)), closes [#9676](https://github.com/angular/material/issues/9676)\n* **menu:** fix min-height when scrollable ([#11602](https://github.com/angular/material/pull/11602))\n* **nav-bar:** improve focus behavior for click events ([#11600](https://github.com/angular/material/issues/11600)) ([e64875d](https://github.com/angular/material/commit/e64875d)), closes [#11591](https://github.com/angular/material/issues/11591) [#11494](https://github.com/angular/material/issues/11494) [#11598](https://github.com/angular/material/issues/11598)\n* **radio-group:** style focused but unchecked radio buttons ([#11564](https://github.com/angular/material/issues/11564)) ([8a4105c](https://github.com/angular/material/commit/8a4105c)), closes [#11563](https://github.com/angular/material/issues/11563) [#8339](https://github.com/angular/material/issues/8339) [#3643](https://github.com/angular/material/issues/3643)\n* **select:** carrot not aligned to end in IE11 ([#11544](https://github.com/angular/material/issues/11544)) ([bf5bbfc](https://github.com/angular/material/commit/bf5bbfc)), closes [#10714](https://github.com/angular/material/issues/10714) [#3840](https://github.com/angular/material/issues/3840) [#3840](https://github.com/angular/material/issues/3840)\n* **tabs:** exception when no selection and header clicked ([#11520](https://github.com/angular/material/issues/11520)) ([9c079aa](https://github.com/angular/material/commit/9c079aa)), closes [#10042](https://github.com/angular/material/issues/10042)\n\n\n### Features\n\n* **autocomplete:** support variable-height autocomplete list items ([#11516](https://github.com/angular/material/pull/11516)) ([562e0c7](https://github.com/angular/material/commit/562e0c7))\n* **datepicker, calendar:** `md-date-filter` disables months in month mode ([#11526](https://github.com/angular/material/issues/11526)) ([8aa5d58](https://github.com/angular/material/commit/8aa5d58)), closes [#11525](https://github.com/angular/material/issues/11525)\n\n### Documentation\n\n* **checkbox:** clarify description of `md-no-ink` ([#11605](https://github.com/angular/material/pull/11605))\n* **docs:** copying links to example/demo anchor headers gives a bad URL ([#11634](https://github.com/angular/material/pull/11634)), closes [#11285](https://github.com/angular/material/issues/11285)\n* **menu:** add demo and docs for dense menus. ([#11602](https://github.com/angular/material/pull/11602))\n* **ripple:** break out docs for `$mdInkRippleProvider` from `$mdInkRipple` ([#11606](https://github.com/angular/material/pull/11606))\n\n#### Contributors\n\nThank you to the contributors who helped with the v1.1.13 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"mgol\" src=\"https://avatars0.githubusercontent.com/u/1758366?v=4&s=117\" width=\"117\">](https://github.com/mgol) |[<img alt=\"gopherkhan\" src=\"https://avatars0.githubusercontent.com/u/1106145?v=4&s=117\" width=\"117\">](https://github.com/gopherkhan) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[mmalerba](https://github.com/mmalerba) |[codymikol](https://github.com/codymikol) |[marosoft](https://github.com/marosoft) |[mgol](https://github.com/mgol) |[gopherkhan](https://github.com/gopherkhan) |\n\n\n\n<a name=\"1.1.12\"></a>\n## [1.1.12](https://github.com/angular/material/compare/v1.1.11...v1.1.12) (2019-01-03)\n\n\n### Bug Fixes\n\n* **select:** multiple with initial value causes label to overlap with value ([#11572](https://github.com/angular/material/issues/11572)) ([a4507d6](https://github.com/angular/material/commit/a4507d6)), closes [#11571](https://github.com/angular/material/issues/11571) [#11571](https://github.com/angular/material/issues/11571)\n* **tabs:** md-center-tabs causes tabs to not render ([#11567](https://github.com/angular/material/issues/11567)) ([a49043d](https://github.com/angular/material/commit/a49043d)), closes [#11566](https://github.com/angular/material/issues/11566) [#11432](https://github.com/angular/material/issues/11432)\n\n#### Contributors\n\nThank you to the contributors who helped with the v1.1.12 release over the holiday break:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |\n:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[codymikol](https://github.com/codymikol) |[mmalerba](https://github.com/mmalerba) |\n\n<a name=\"1.1.11\"></a>\n## [1.1.11](https://github.com/angular/material/compare/v1.1.10...v1.1.11) (2018-12-20)\n\n\n### Bug Fixes\n\n* **autocomplete:** screen readers now announce when an item is selected from the dropdown ([#11403](https://github.com/angular/material/issues/11403)) ([e56424e](https://github.com/angular/material/commit/e56424e)), closes [#10837](https://github.com/angular/material/issues/10837)\n* **autocomplete:** apply theme to mdProgressLinear and input ([#9698](https://github.com/angular/material/issues/9698)) ([affe84b](https://github.com/angular/material/commit/affe84b))\n* **autocomplete:** Chromevox indicates selected option on focus ([#11441](https://github.com/angular/material/issues/11441)) ([ca10bd0](https://github.com/angular/material/commit/ca10bd0)), closes [#10838](https://github.com/angular/material/issues/10838) [#10970](https://github.com/angular/material/issues/10970)\n* **autocomplete:** updateSize incorrectly sets the size to zero ([#11500](https://github.com/angular/material/issues/11500)) ([d343363](https://github.com/angular/material/commit/d343363)), closes [#10834](https://github.com/angular/material/issues/10834)\n* **bottom-sheet:** theme now supports dark mode ([#11380](https://github.com/angular/material/issues/11380)) ([4cecebb](https://github.com/angular/material/commit/4cecebb))\n* **chips:** editing chips works again ([#11364](https://github.com/angular/material/issues/11364)) ([97455f5](https://github.com/angular/material/commit/97455f5)), closes [#11322](https://github.com/angular/material/issues/11322) [#11323](https://github.com/angular/material/issues/11323)\n* **chips:** improve screen reader support ([#11422](https://github.com/angular/material/issues/11422)) ([2268c24](https://github.com/angular/material/commit/2268c24)), closes [#2618](https://github.com/angular/material/issues/2618)\n* **chips:** set dirty when a chip is removed ([#11363](https://github.com/angular/material/issues/11363)) ([0dd688c](https://github.com/angular/material/commit/0dd688c)), closes [#11356](https://github.com/angular/material/issues/11356)\n* **datepicker:** md-open-on-focus constantly re-opens on close w/ IE11 ([#11440](https://github.com/angular/material/issues/11440)) ([6596cc7](https://github.com/angular/material/commit/6596cc7)), closes [#10999](https://github.com/angular/material/issues/10999)\n* **icon:** stop breaking svg id references when caching icon ids ([#11342](https://github.com/angular/material/issues/11342)) ([841e8b2](https://github.com/angular/material/commit/841e8b2)), closes [#8689](https://github.com/angular/material/issues/8689)\n* **icon:** regression causing exceptions to be thrown on IE11 ([#11545](https://github.com/angular/material/issues/11545)) ([47527f2](https://github.com/angular/material/commit/47527f2)), closes [#11543](https://github.com/angular/material/issues/11543) [#11342](https://github.com/angular/material/issues/11342) [#11162](https://github.com/angular/material/issues/11162)\n* **input:** make md-maxlength validation happen on initialization with interpolated value ([#11338](https://github.com/angular/material/issues/11338)) ([0cb4af1](https://github.com/angular/material/commit/0cb4af1)), closes [#11329](https://github.com/angular/material/issues/11329) [#11329](https://github.com/angular/material/issues/11329)\n* **input:** placeholder and datepicker value displayed overlapping on Firefox ([#11538](https://github.com/angular/material/issues/11538)) ([44a6946](https://github.com/angular/material/commit/44a6946)), closes [#10440](https://github.com/angular/material/issues/10440)\n* **input:** remove placeholder from button accessibility tree ([#11404](https://github.com/angular/material/issues/11404)) ([2203eec](https://github.com/angular/material/commit/2203eec)), closes [#11293](https://github.com/angular/material/issues/11293)\n* **input:** remove unnecessary warnings when ng-messages not provided ([#11352](https://github.com/angular/material/issues/11352)) ([d48c5b8](https://github.com/angular/material/commit/d48c5b8)), closes [#10461](https://github.com/angular/material/issues/10461)\n* **input-container:** handle initialization of md-icon with ng-if ([#11437](https://github.com/angular/material/issues/11437)) ([4493389](https://github.com/angular/material/commit/4493389)), closes [#9529](https://github.com/angular/material/issues/9529)\n* **interim:** validate the interim element while closing it ([#11509](https://github.com/angular/material/issues/11509)) ([6815faf](https://github.com/angular/material/commit/6815faf)), closes [#11507](https://github.com/angular/material/issues/11507) [#10715](https://github.com/angular/material/issues/10715)\n* **list:** account for IE11 bug with flexbox and min-height ([#11393](https://github.com/angular/material/issues/11393)) ([e3c1a5c](https://github.com/angular/material/commit/e3c1a5c))\n* **nav-bar:** improve screen reader support ([#11486](https://github.com/angular/material/issues/11486)) ([6b29548](https://github.com/angular/material/commit/6b29548)), closes [#11485](https://github.com/angular/material/issues/11485) [#11485](https://github.com/angular/material/issues/11485)\n* **nav-bar:** set ng-href on nav-item even if md-nav-href is empty ([#11488](https://github.com/angular/material/issues/11488)) ([e876eec](https://github.com/angular/material/commit/e876eec)), closes [#11487](https://github.com/angular/material/issues/11487)\n* **nav-bar:** update keyboard navigation to WAI-ARIA guidelines ([#11494](https://github.com/angular/material/issues/11494)) ([4d29450](https://github.com/angular/material/commit/4d29450)), closes [#10419](https://github.com/angular/material/issues/10419) [#11489](https://github.com/angular/material/issues/11489)\n* **select:** display asterisk on label only if empty ([#11355](https://github.com/angular/material/issues/11355)) ([f7b7f10](https://github.com/angular/material/commit/f7b7f10)), closes [#11312](https://github.com/angular/material/issues/11312)\n* **select:** give focus to the first option when loaded asynchronously ([#11372](https://github.com/angular/material/issues/11372)) ([998199f](https://github.com/angular/material/commit/998199f)), closes [#11357](https://github.com/angular/material/issues/11357)\n* **select:** perform full cleanup of the select drop-down after the close ([#11448](https://github.com/angular/material/issues/11448)) ([dfba062](https://github.com/angular/material/commit/dfba062)), closes [#11447](https://github.com/angular/material/issues/11447)\n* **select:** theming issues with md-select-value ([#11373](https://github.com/angular/material/issues/11373)) ([9852ff7](https://github.com/angular/material/commit/9852ff7)), closes [#9592](https://github.com/angular/material/issues/9592)\n* **select:** extra scrollbar when select dropdown is open ([#11453](https://github.com/angular/material/issues/11453)) ([20fc2d8](https://github.com/angular/material/commit/20fc2d8))\n* **select(multiple):**  Remove side-effects to forms when adding md-select elements ([#11491](https://github.com/angular/material/issues/11491)) ([97e2d00](https://github.com/angular/material/commit/97e2d00)), closes [#11490](https://github.com/angular/material/issues/11490)\n* **sidenav:** refactor syntax to work around issue in babel-minify ([#11351](https://github.com/angular/material/issues/11351)) ([0ed110b](https://github.com/angular/material/commit/0ed110b))\n* **switch:** theming issues with focus in dark theme ([#11459](https://github.com/angular/material/issues/11459)) ([71e0411](https://github.com/angular/material/commit/71e0411)), closes [#8518](https://github.com/angular/material/issues/8518) [#11417](https://github.com/angular/material/issues/11417)\n* **tabs:** provide guidance on how to navigate between tabs ([#11402](https://github.com/angular/material/issues/11402)) ([4b1b729](https://github.com/angular/material/commit/4b1b729)), closes [#10895](https://github.com/angular/material/issues/10895)\n* **tabs:** show a visual indication of tab focus ([#11392](https://github.com/angular/material/issues/11392)) ([1d73d81](https://github.com/angular/material/commit/1d73d81))\n* **tabs:** tab labels overly truncated on IE11 when pagination active ([#11432](https://github.com/angular/material/issues/11432)) ([2b2f441](https://github.com/angular/material/commit/2b2f441)), closes [#10406](https://github.com/angular/material/issues/10406)\n* **theme:** prepend # to hex codes for enableBrowserColor ([#11492](https://github.com/angular/material/issues/11492)) ([0306ac0](https://github.com/angular/material/commit/0306ac0)), closes [#11259](https://github.com/angular/material/issues/11259)\n* **toast:** improve a11y support for $mdToast.simple(). improve docs ([#11424](https://github.com/angular/material/issues/11424)) ([fedb9a3](https://github.com/angular/material/commit/fedb9a3)), closes [#349](https://github.com/angular/material/issues/349)\n* **toast:** remove the interim element from the list before closing element ([#11427](https://github.com/angular/material/issues/11427)) ([f616b25](https://github.com/angular/material/commit/f616b25))\n\n\n### Features\n\n* **autocomplete:** add input-aria-label and input-aria-labelledby ([#11412](https://github.com/angular/material/issues/11412)) ([534beea](https://github.com/angular/material/commit/534beea)), closes [#10815](https://github.com/angular/material/issues/10815)\n* **autocomplete:** add support for input-aria-describedby ([#11405](https://github.com/angular/material/issues/11405)) ([a25a7df](https://github.com/angular/material/commit/a25a7df)), closes [#11004](https://github.com/angular/material/issues/11004)\n* **contactChips:** add basic support for md-separator-keys ([#8142](https://github.com/angular/material/issues/8142)) ([eb10b56](https://github.com/angular/material/commit/eb10b56))\n* **slider:** enable page up/down and home/end keyboard actions ([#11517](https://github.com/angular/material/issues/11517)) ([70654c3](https://github.com/angular/material/commit/70654c3)), closes [#11515](https://github.com/angular/material/issues/11515)\n* **tabs:** allow specifying custom class names for tabs ([#11332](https://github.com/angular/material/issues/11332)) ([aa30ada](https://github.com/angular/material/commit/aa30ada))\n* **theming:** add ability to specify hues as options to defineTheme ([#11428](https://github.com/angular/material/issues/11428)) ([f776bf7](https://github.com/angular/material/commit/f776bf7))\n\n\n### Performance Improvements\n\n* **tabs:** md-center-tabs causes in high CPU usage ([#11375](https://github.com/angular/material/issues/11375)) ([7fdf9da](https://github.com/angular/material/commit/7fdf9da)), closes [#9690](https://github.com/angular/material/issues/9690) [#6375](https://github.com/angular/material/issues/6375)\n* **tabs:** remove unreferenced elements variable from TabsController ([#11379](https://github.com/angular/material/issues/11379)) ([33652b4](https://github.com/angular/material/commit/33652b4)), closes [#11377](https://github.com/angular/material/issues/11377)\n* **css:** remove bloat from autoprefixing of unsupported browsers ([#11340](https://github.com/angular/material/issues/11340)) ([3660a32](https://github.com/angular/material/commit/3660a32))\n  * This reduced the minified CSS bundle size by ~75 KB.\n  * You can find the breakdown of supported browsers [here](https://material.angularjs.org/HEAD/#browser-support).\n\n\n#### Contributors\n\nThank you to the contributors, especially the first timers, who helped with the v1.1.11 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"rudzikdawid\" src=\"https://avatars3.githubusercontent.com/u/7476577?v=4&s=117\" width=\"117\">](https://github.com/rudzikdawid) |[<img alt=\"feloy\" src=\"https://avatars0.githubusercontent.com/u/9973512?v=4&s=117\" width=\"117\">](https://github.com/feloy) |[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"marosoft\" src=\"https://avatars0.githubusercontent.com/u/3945455?v=4&s=117\" width=\"117\">](https://github.com/marosoft) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[rudzikdawid](https://github.com/rudzikdawid) |[feloy](https://github.com/feloy) |[codymikol](https://github.com/codymikol) |[marosoft](https://github.com/marosoft) |[mmalerba](https://github.com/mmalerba) |\n\n[<img alt=\"jagmeetb\" src=\"https://avatars1.githubusercontent.com/u/16247626?v=4&s=117\" width=\"117\">](https://github.com/jagmeetb) |[<img alt=\"mckenzielong\" src=\"https://avatars0.githubusercontent.com/u/7656679?v=4&s=117\" width=\"117\">](https://github.com/mckenzielong) |[<img alt=\"Ignigena\" src=\"https://avatars3.githubusercontent.com/u/4356436?v=4&s=117\" width=\"117\">](https://github.com/Ignigena) |[<img alt=\"rossgardt\" src=\"https://avatars0.githubusercontent.com/u/234840?v=4&s=117\" width=\"117\">](https://github.com/rossgardt) |[<img alt=\"cstephe\" src=\"https://avatars1.githubusercontent.com/u/311854?v=4&s=117\" width=\"117\">](https://github.com/cstephe) |[<img alt=\"xyng\" src=\"https://avatars1.githubusercontent.com/u/2403703?v=4&s=117\" width=\"117\">](https://github.com/xyng) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[jagmeetb](https://github.com/jagmeetb) |[mckenzielong](https://github.com/mckenzielong) |[Ignigena](https://github.com/Ignigena) |[rossgardt](https://github.com/rossgardt) |[cstephe](https://github.com/cstephe) |[xyng](https://github.com/xyng) |\n\n[<img alt=\"MarcoZehe\" src=\"https://avatars3.githubusercontent.com/u/1568574?v=4&s=117\" width=\"117\">](https://github.com/MarcoZehe) |[<img alt=\"dokmic\" src=\"https://avatars1.githubusercontent.com/u/15189627?v=4&s=117\" width=\"117\">](https://github.com/dokmic) |[<img alt=\"irkan-hadi\" src=\"https://avatars3.githubusercontent.com/u/2753005?v=4&s=117\" width=\"117\">](https://github.com/irkan-hadi) |\n:---: |:---: |:---: |\n[MarcoZehe](https://github.com/MarcoZehe) |[dokmic](https://github.com/dokmic) |[irkan-hadi](https://github.com/irkan-hadi) |\n\n\n\n<a name=\"1.1.10\"></a>\n## [1.1.10](https://github.com/angular/material/compare/v1.1.9...v1.1.10) (2018-06-28)\n\n\n### Bug Fixes\n\n* **chips:** editable chip gets removed after editing ([#11323](https://github.com/angular/material/issues/11323)) ([9cc165f](https://github.com/angular/material/commit/9cc165f)), closes [#11298](https://github.com/angular/material/issues/11298) [#10392](https://github.com/angular/material/issues/10392) [#10532](https://github.com/angular/material/issues/10532) [#10664](https://github.com/angular/material/issues/10664) [#10879](https://github.com/angular/material/issues/10879)\n* **chips:** improve ability to receive focus on click ([#11098](https://github.com/angular/material/issues/11098)) ([869bc21](https://github.com/angular/material/commit/869bc21)), closes [#10344](https://github.com/angular/material/issues/10344)\n* **chips:** regression where chips model gets out of sync with view ([#11310](https://github.com/angular/material/issues/11310)) ([74d2445](https://github.com/angular/material/commit/74d2445)), closes [#11304](https://github.com/angular/material/issues/11304) [#11301](https://github.com/angular/material/issues/11301)\n* **chips:** unwanted re-focus of last chip after blur ([#11305](https://github.com/angular/material/issues/11305)) ([ae17515](https://github.com/angular/material/commit/ae17515)), closes [#9650](https://github.com/angular/material/issues/9650) [#10758](https://github.com/angular/material/issues/10758)\n* **compiler:** remove dependency on AngularJS private API ([#11320](https://github.com/angular/material/issues/11320)) ([f6534d6](https://github.com/angular/material/commit/f6534d6)), closes [#11319](https://github.com/angular/material/issues/11319)\n* **datepicker:** calendar panel theme supports dark mode in multi theme scenario ([#11267](https://github.com/angular/material/issues/11267)) ([9e6553d](https://github.com/angular/material/commit/9e6553d)), closes [#11265](https://github.com/angular/material/issues/11265)\n* **layout:** allow flex-offset to be a child of layout-margin ([#11330](https://github.com/angular/material/issues/11330)) ([81eb46f](https://github.com/angular/material/commit/81eb46f)), closes [#11328](https://github.com/angular/material/issues/11328)\n* **layout:** reduce layout CSS size by reverting some of [#11247](https://github.com/angular/material/issues/11247) ([#11331](https://github.com/angular/material/issues/11331)) ([5e37b63](https://github.com/angular/material/commit/5e37b63)), closes [#11000](https://github.com/angular/material/issues/11000) [#9546](https://github.com/angular/material/issues/9546)\n* **menu-bar:** md-menu-bar panel theme supports dark mode themes ([#11258](https://github.com/angular/material/issues/11258)) ([3a21b89](https://github.com/angular/material/commit/3a21b89)), closes [#11238](https://github.com/angular/material/issues/11238)\n* **nav-bar:** missing [disabled] scss selector ([#11269](https://github.com/angular/material/issues/11269)) ([d607e17](https://github.com/angular/material/commit/d607e17)), closes [#11268](https://github.com/angular/material/issues/11268)\n* **ripple:** fix iOS Safari stuck ripple issue ([#11302](https://github.com/angular/material/issues/11302)) ([5284145](https://github.com/angular/material/commit/5284145)), closes [#11069](https://github.com/angular/material/issues/11069)\n* **select:** doesn't search correctly when pressing period character ([#11313](https://github.com/angular/material/issues/11313)) ([daf67a8](https://github.com/angular/material/commit/daf67a8)), closes [#11294](https://github.com/angular/material/issues/11294)\n* **theming:** md-theme leaks when child elements are removed ([#11326](https://github.com/angular/material/issues/11326)) ([41c9d00](https://github.com/angular/material/commit/41c9d00)), closes [#11325](https://github.com/angular/material/issues/11325)\n\n\n### Features\n\n* **mdMaxlength:** support use with required and ng-trim ([#11136](https://github.com/angular/material/issues/11136)) ([db1a85d](https://github.com/angular/material/commit/db1a85d)), closes [#10082](https://github.com/angular/material/issues/10082) [#10216](https://github.com/angular/material/issues/10216)\n\n#### Contributors\n\nThank you to the contributors, especially the first timers, who helped with the v1.1.10 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"rudzikdawid\" src=\"https://avatars3.githubusercontent.com/u/7476577?v=4&s=117\" width=\"117\">](https://github.com/rudzikdawid) |[<img alt=\"feloy\" src=\"https://avatars0.githubusercontent.com/u/9973512?v=4&s=117\" width=\"117\">](https://github.com/feloy) |[<img alt=\"jpike88\" src=\"https://avatars1.githubusercontent.com/u/9585787?v=4&s=117\" width=\"117\">](https://github.com/jpike88) |[<img alt=\"bersLucas\" src=\"https://avatars2.githubusercontent.com/u/3892772?v=4&s=117\" width=\"117\">](https://github.com/bersLucas) |\n:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[rudzikdawid](https://github.com/rudzikdawid) |[feloy](https://github.com/feloy) |[jpike88](https://github.com/jpike88) |[bersLucas](https://github.com/bersLucas) |\n\n\n<a name=\"1.1.9\"></a>\n## [1.1.9](https://github.com/angular/material/compare/v1.1.8...v1.1.9) (2018-04-27)\n\n\n### Bug Fixes\n\n* **autocomplete:** align highlight style with spec ([#11244](https://github.com/angular/material/issues/11244)) ([011315f](https://github.com/angular/material/commit/011315f)), closes [#10060](https://github.com/angular/material/issues/10060)\n* **autocomplete:** don't show the menu panel when readonly ([#11245](https://github.com/angular/material/issues/11245)) ([0fe831a](https://github.com/angular/material/commit/0fe831a)), closes [#11231](https://github.com/angular/material/issues/11231)\n* **autocomplete:** md-autocomplete panel theme supports dark mode ([#11203](https://github.com/angular/material/issues/11203)) ([aba7b2b](https://github.com/angular/material/commit/aba7b2b)), closes [#11202](https://github.com/angular/material/issues/11202)\n* **datepicker:** calendar panel theme supports dark mode ([#11201](https://github.com/angular/material/issues/11201)) ([2360764](https://github.com/angular/material/commit/2360764)), closes [#11200](https://github.com/angular/material/issues/11200)\n* **dialog:** thread blocking during large DOM traversals ([#10552](https://github.com/angular/material/issues/10552)) ([#11193](https://github.com/angular/material/issues/11193)) ([9086b54](https://github.com/angular/material/commit/9086b54))\n* **layout:** some flex directives don't work when on a child of `layout=\"column\"` or `layout=\"row\"` ([#11247](https://github.com/angular/material/issues/11247)) ([e0078d7](https://github.com/angular/material/commit/e0078d7)), closes [#9546](https://github.com/angular/material/issues/9546)\n* **menu:** md-menu panel theme supports dark mode ([#11230](https://github.com/angular/material/issues/11230)) ([ef14194](https://github.com/angular/material/commit/ef14194)), closes [#11199](https://github.com/angular/material/issues/11199)\n* **nav-bar:** initial disabled state is now respected ([#11185](https://github.com/angular/material/issues/11185)) ([d412358](https://github.com/angular/material/commit/d412358)), closes [#11172](https://github.com/angular/material/issues/11172) [#10688](https://github.com/angular/material/issues/10688)\n* **panel:** use `$event.target` instead of `$event.srcElement` for Firefox compatibility ([#11234](https://github.com/angular/material/issues/11234)) ([c86767f](https://github.com/angular/material/commit/c86767f)), closes [#11035](https://github.com/angular/material/issues/11035)\n* **select:** options panel theme supports dark mode ([#11198](https://github.com/angular/material/issues/11198)) ([f926c96](https://github.com/angular/material/commit/f926c96)), closes [#3379](https://github.com/angular/material/issues/3379)\n* **slider:** out of sync state between model and view value in same digest cycle ([#10980](https://github.com/angular/material/issues/10980)) ([50a1616](https://github.com/angular/material/commit/50a1616)), closes [#9125](https://github.com/angular/material/issues/9125)\n* **slider-container:** numeric inputs cut off on Firefox and Edge ([#11210](https://github.com/angular/material/issues/11210)) ([bbfede8](https://github.com/angular/material/commit/bbfede8)), closes [#9559](https://github.com/angular/material/issues/9559) [#10909](https://github.com/angular/material/issues/10909) [#10288](https://github.com/angular/material/issues/10288) [#10148](https://github.com/angular/material/issues/10148)\n* **toast:** update style direction to flex-direction ([#11169](https://github.com/angular/material/issues/11169)) ([1ef9ec3](https://github.com/angular/material/commit/1ef9ec3))\n\n\n### Features\n\n* **autocomplete:** add md-input-class binding. ([#11102](https://github.com/angular/material/issues/11102)) ([2a83967](https://github.com/angular/material/commit/2a83967))\n* **autocomplete:** add md-menu-container-class for styling ([#11194](https://github.com/angular/material/issues/11194)) ([5320d22](https://github.com/angular/material/commit/5320d22))\n* **bottom-sheet:** add isLockedOpen option; general cleanup ([#9179](https://github.com/angular/material/issues/9179)) ([e519c1b](https://github.com/angular/material/commit/e519c1b)), closes [#9084](https://github.com/angular/material/issues/9084)\n* **chips:** expose `$event` in md-on-remove ([#11192](https://github.com/angular/material/issues/11192)) ([bd3aa1d](https://github.com/angular/material/commit/bd3aa1d))\n* **chips:** trigger ng-change on chip addition/removal ([#11237](https://github.com/angular/material/issues/11237)) ([0563f24](https://github.com/angular/material/commit/0563f24)), closes [#11161](https://github.com/angular/material/issues/11161) [#3857](https://github.com/angular/material/issues/3857)\n* **gestures:** add ability to disable all gestures for perf ([#11246](https://github.com/angular/material/issues/11246)) ([65d78e0](https://github.com/angular/material/commit/65d78e0)), closes [#10884](https://github.com/angular/material/issues/10884) [#10885](https://github.com/angular/material/issues/10885)\n* **icon:** Add support to svg symbol icon set ([#11162](https://github.com/angular/material/issues/11162)) ([5111f9d](https://github.com/angular/material/commit/5111f9d)), closes [#8689](https://github.com/angular/material/issues/8689) [#1514](https://github.com/angular/material/issues/1514)\n* **sidenav:** add disable click and escape event ([#11165](https://github.com/angular/material/issues/11165)) ([fae4042](https://github.com/angular/material/commit/fae4042))\n\n#### Contributors\n\nThank you to the contributors, especially the first timers, who helped with the v1.1.9 release:\n\n[<img alt=\"crisbeto\" src=\"https://avatars0.githubusercontent.com/u/4450522?v=4&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"feloy\" src=\"https://avatars0.githubusercontent.com/u/9973512?v=4&s=117\" width=\"117\">](https://github.com/feloy) |[<img alt=\"rudzikdawid\" src=\"https://avatars3.githubusercontent.com/u/7476577?v=4&s=117\" width=\"117\">](https://github.com/rudzikdawid) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |[<img alt=\"free-easy\" src=\"https://avatars2.githubusercontent.com/u/20483759?v=4&s=117\" width=\"117\">](https://github.com/free-easy) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[crisbeto](https://github.com/crisbeto) |[Splaktar](https://github.com/Splaktar) |[feloy](https://github.com/feloy) |[rudzikdawid](https://github.com/rudzikdawid) |[mmalerba](https://github.com/mmalerba) |[free-easy](https://github.com/free-easy) |\n\n[<img alt=\"sviams\" src=\"https://avatars2.githubusercontent.com/u/4960234?v=4&s=117\" width=\"117\">](https://github.com/sviams) |[<img alt=\"cobisimo\" src=\"https://avatars0.githubusercontent.com/u/2192460?v=4&s=117\" width=\"117\">](https://github.com/cobisimo) |[<img alt=\"ypislon\" src=\"https://avatars1.githubusercontent.com/u/12954194?v=4&s=117\" width=\"117\">](https://github.com/ypislon) |[<img alt=\"currensy\" src=\"https://avatars3.githubusercontent.com/u/10333370?v=4&s=117\" width=\"117\">](https://github.com/currensy) |[<img alt=\"karansapolia\" src=\"https://avatars1.githubusercontent.com/u/10175625?v=4&s=117\" width=\"117\">](https://github.com/karansapolia) |[<img alt=\"VictorioBerra\" src=\"https://avatars0.githubusercontent.com/u/2934507?v=4&s=117\" width=\"117\">](https://github.com/VictorioBerra) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[sviams](https://github.com/sviams) |[cobisimo](https://github.com/cobisimo) |[ypislon](https://github.com/ypislon) |[currensy](https://github.com/currensy) |[karansapolia](https://github.com/karansapolia) |[VictorioBerra](https://github.com/VictorioBerra) |\n\n[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"FjVillar\" src=\"https://avatars1.githubusercontent.com/u/12049849?v=4&s=117\" width=\"117\">](https://github.com/FjVillar) |\n:---: |:---: |\n[codymikol](https://github.com/codymikol) |[FjVillar](https://github.com/FjVillar) |\n\n<a name=\"1.1.8\"></a>\n## [1.1.8](https://github.com/angular/material/compare/v1.1.7...v1.1.8) (2018-03-16)\n\n\n### Bug Fixes\n\n* **button:** fix rendering issue with borders and webkit browsers ([#9449](https://github.com/angular/material/issues/9449)) ([0f15e39](https://github.com/angular/material/commit/0f15e39)), closes [#9154](https://github.com/angular/material/issues/9154) [#10086](https://github.com/angular/material/issues/10086)\n* **chips:** md-chip-append-delay of 0 does not get converted to 300 ([#11163](https://github.com/angular/material/issues/11163)) ([1f6d1b2](https://github.com/angular/material/commit/1f6d1b2)), closes [#10408](https://github.com/angular/material/issues/10408)\n* **dialog:** fix prompt closing on ENTER key when input is required and empty ([#10990](https://github.com/angular/material/issues/10990)) ([69470a6](https://github.com/angular/material/commit/69470a6))\n* **dialog:** md-colors breaks inside of dialogs ([#11078](https://github.com/angular/material/pull/11078)) ([e3c55f9](https://github.com/angular/material/commit/e3c55f9)), closes [#10276](https://github.com/angular/material/issues/10276)\n* **input:** make md-maxlength validation happen on initialization ([#11150](https://github.com/angular/material/issues/11150)) ([9ced357](https://github.com/angular/material/commit/9ced357)), closes [#10320](https://github.com/angular/material/issues/10320)\n* **input/autocomplete:** prevent md-select-on-focus from refocusing blurred input ([#11129](https://github.com/angular/material/issues/11129)) ([c5ec316](https://github.com/angular/material/commit/c5ec316))\n* **menu:** allow nested md-menu-content ([#11103](https://github.com/angular/material/issues/11103)) ([60e2393](https://github.com/angular/material/commit/60e2393))\n* **menu:** close menu on tab ([#11127](https://github.com/angular/material/issues/11127)) ([7e5b7f4](https://github.com/angular/material/commit/7e5b7f4)), closes [#11123](https://github.com/angular/material/issues/11123)\n* **panel:** allow numbers in offset methods ([#9609](https://github.com/angular/material/issues/9609)) ([0d276f3](https://github.com/angular/material/commit/0d276f3)), closes [#9604](https://github.com/angular/material/issues/9604)\n* **panel/tooltip:** memory leak on destroy ([#11145](https://github.com/angular/material/issues/11145)) ([2ef87f4](https://github.com/angular/material/commit/2ef87f4)), closes [#11133](https://github.com/angular/material/issues/11133)\n\n\n### Features\n\n* **chips:** added validation for ng-required ([#11125](https://github.com/angular/material/issues/11125)) ([ba0e9fe](https://github.com/angular/material/commit/ba0e9fe)), closes [#11124](https://github.com/angular/material/issues/11124)\n* **navBar:** add disabled attribute ([#10992](https://github.com/angular/material/issues/10992)) ([b4d36f3](https://github.com/angular/material/commit/b4d36f3)), closes [#9667](https://github.com/angular/material/issues/9667)\n\n#### Contributors\n\nThank you to the amazing contributors, especially the first timers, who helped with the v1.1.8 release:\n\n[<img alt=\"crisbeto\" src=\"https://avatars0.githubusercontent.com/u/4450522?v=4&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"clshortfuse\" src=\"https://avatars3.githubusercontent.com/u/9271155?v=4&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |[<img alt=\"IMM0rtalis\" src=\"https://avatars3.githubusercontent.com/u/1506919?v=4&s=117\" width=\"117\">](https://github.com/IMM0rtalis) |[<img alt=\"feloy\" src=\"https://avatars0.githubusercontent.com/u/9973512?v=4&s=117\" width=\"117\">](https://github.com/feloy) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[crisbeto](https://github.com/crisbeto) |[Splaktar](https://github.com/Splaktar) |[clshortfuse](https://github.com/clshortfuse) |[mmalerba](https://github.com/mmalerba) |[IMM0rtalis](https://github.com/IMM0rtalis) |[feloy](https://github.com/feloy) |\n\n[<img alt=\"codymikol\" src=\"https://avatars1.githubusercontent.com/u/13606342?v=4&s=117\" width=\"117\">](https://github.com/codymikol) |[<img alt=\"eknowles\" src=\"https://avatars2.githubusercontent.com/u/817611?v=4&s=117\" width=\"117\">](https://github.com/eknowles) |[<img alt=\"currensy\" src=\"https://avatars3.githubusercontent.com/u/10333370?v=4&s=117\" width=\"117\">](https://github.com/currensy) |[<img alt=\"jonbcard\" src=\"https://avatars3.githubusercontent.com/u/497168?v=4&s=117\" width=\"117\">](https://github.com/jonbcard) |[<img alt=\"karansapolia\" src=\"https://avatars1.githubusercontent.com/u/10175625?v=4&s=117\" width=\"117\">](https://github.com/karansapolia) |[<img alt=\"tiberiuzuld\" src=\"https://avatars0.githubusercontent.com/u/15310395?v=4&s=117\" width=\"117\">](https://github.com/tiberiuzuld) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[codymikol](https://github.com/codymikol) |[eknowles](https://github.com/eknowles) |[currensy](https://github.com/currensy) |[jonbcard](https://github.com/jonbcard) |[karansapolia](https://github.com/karansapolia) |[tiberiuzuld](https://github.com/tiberiuzuld) |\n\n[<img alt=\"5earle\" src=\"https://avatars3.githubusercontent.com/u/8709806?v=4&s=117\" width=\"117\">](https://github.com/5earle) |\n:---: |\n[5earle](https://github.com/5earle) |\n\n\n<a name=\"1.1.7\"></a>\n## [1.1.7](https://github.com/angular/material/compare/v1.1.6...v1.1.7) (2018-02-08)\n\n\n### Bug Fixes\n\n* **datepicker:** keep reference of Date object ([#10606](https://github.com/angular/material/issues/10606)) ([b4b9369](https://github.com/angular/material/commit/b4b9369))\n* **panel:** loosen up bounds assessment ([#10651](https://github.com/angular/material/issues/10651)) ([27d0f7c](https://github.com/angular/material/commit/27d0f7c))\n* **tooltip:** changing direction causes invalid position ([#11087](https://github.com/angular/material/issues/11087)) ([89bd69b](https://github.com/angular/material/commit/89bd69b)), closes [#10405](https://github.com/angular/material/issues/10405)\n\n\n### Features\n\n* **swipe:** allow accessing the original currentTarget ([#10997](https://github.com/angular/material/issues/10997)) ([827990e](https://github.com/angular/material/commit/827990e))\n\n#### Contributors\n\nThank you to the contributors who helped with the v1.1.7 release:\n\n[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"mmalerba\" src=\"https://avatars1.githubusercontent.com/u/14793288?v=4&s=117\" width=\"117\">](https://github.com/mmalerba) |[<img alt=\"cgx\" src=\"https://avatars2.githubusercontent.com/u/1088448?v=4&s=117\" width=\"117\">](https://github.com/cgx) |[<img alt=\"gillyb\" src=\"https://avatars3.githubusercontent.com/u/1319502?v=4&s=117\" width=\"117\">](https://github.com/gillyb) |\n:---: |:---: |:---: |:---: |:---: |\n[Splaktar](https://github.com/Splaktar) |[oliversalzburg](https://github.com/oliversalzburg) |[mmalerba](https://github.com/mmalerba) |[cgx](https://github.com/cgx) |[gillyb](https://github.com/gillyb) |\n\n<a name=\"1.1.6\"></a>\n## [1.1.6](https://github.com/angular/material/compare/v1.1.5...v1.1.6) (2018-01-16)\n\n\n### Bug Fixes\n\n* **compiler:** assign bindings to controller instance when using an ES6 ([#10977](https://github.com/angular/material/issues/10977)) ([f4b19fe](https://github.com/angular/material/commit/f4b19fe))\n* **icon:** fix malformed HTML in tests ([#10792](https://github.com/angular/material/issues/10792)) ([0bac462](https://github.com/angular/material/commit/0bac462)), closes [#10785](https://github.com/angular/material/issues/10785)\n* **select:** add closing tag for native select ([#10833](https://github.com/angular/material/issues/10833)) ([3b59b20](https://github.com/angular/material/commit/3b59b20)), closes [#10828](https://github.com/angular/material/issues/10828)\n* **select multiple:** set the element dirty when the selected options change ([#10749](https://github.com/angular/material/issues/10749)) ([7256670](https://github.com/angular/material/commit/7256670)), closes [#10584](https://github.com/angular/material/issues/10584)\n* **slider:** role was applied to inner element instead of the directive itself ([#10731](https://github.com/angular/material/issues/10731)) ([bbb719d](https://github.com/angular/material/commit/bbb719d)), closes [#10565](https://github.com/angular/material/issues/10565)\n* **theming:** don't assume selector corresponds to expression ([#10818](https://github.com/angular/material/issues/10818)) ([f1e4fcb](https://github.com/angular/material/commit/f1e4fcb)), closes [#10793](https://github.com/angular/material/issues/10793)\n* **truncate:** remove controllerAs and bindToController directive attributes ([#10798](https://github.com/angular/material/issues/10798)) ([a91c99a](https://github.com/angular/material/commit/a91c99a)), closes [#10356](https://github.com/angular/material/issues/10356)\n\n\n### Features\n\n* **datepicker:** add the ability to restrict users to a calendar view ([#9736](https://github.com/angular/material/issues/9736)) ([eecc976](https://github.com/angular/material/commit/eecc976)), closes [#9260](https://github.com/angular/material/issues/9260)\n\n#### Contributors\n\nThank you to the excellent contributors who helped with the v1.1.6 release:\n\n[<img alt=\"crisbeto\" src=\"https://avatars0.githubusercontent.com/u/4450522?v=4&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"jelbourn\" src=\"https://avatars3.githubusercontent.com/u/838736?v=4&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"EladBezalel\" src=\"https://avatars3.githubusercontent.com/u/6004537?v=4&s=117\" width=\"117\">](https://github.com/EladBezalel) |[<img alt=\"Splaktar\" src=\"https://avatars1.githubusercontent.com/u/3506071?v=4&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"alopezsanchez\" src=\"https://avatars3.githubusercontent.com/u/15221596?v=4&s=117\" width=\"117\">](https://github.com/alopezsanchez) |[<img alt=\"Phoqe\" src=\"https://avatars3.githubusercontent.com/u/7033377?v=4&s=117\" width=\"117\">](https://github.com/Phoqe) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[crisbeto](https://github.com/crisbeto) |[jelbourn](https://github.com/jelbourn) |[EladBezalel](https://github.com/EladBezalel) |[Splaktar](https://github.com/Splaktar) |[alopezsanchez](https://github.com/alopezsanchez) |[Phoqe](https://github.com/Phoqe) |\n\n[<img alt=\"oliversalzburg\" src=\"https://avatars2.githubusercontent.com/u/1658949?v=4&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"graingert\" src=\"https://avatars3.githubusercontent.com/u/413772?v=4&s=117\" width=\"117\">](https://github.com/graingert) |[<img alt=\"dulynoded\" src=\"https://avatars0.githubusercontent.com/u/11513504?v=4&s=117\" width=\"117\">](https://github.com/dulynoded) |[<img alt=\"Ardeshir81\" src=\"https://avatars3.githubusercontent.com/u/5755214?v=4&s=117\" width=\"117\">](https://github.com/Ardeshir81) |[<img alt=\"beetlerom\" src=\"https://avatars3.githubusercontent.com/u/1420091?v=4&s=117\" width=\"117\">](https://github.com/beetlerom) |[<img alt=\"davestacey\" src=\"https://avatars3.githubusercontent.com/u/754281?v=4&s=117\" width=\"117\">](https://github.com/davestacey) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[oliversalzburg](https://github.com/oliversalzburg) |[graingert](https://github.com/graingert) |[dulynoded](https://github.com/dulynoded) |[Ardeshir81](https://github.com/Ardeshir81) |[beetlerom](https://github.com/beetlerom) |[davestacey](https://github.com/davestacey) |\n\n[<img alt=\"phistuck\" src=\"https://avatars0.githubusercontent.com/u/184400?v=4&s=117\" width=\"117\">](https://github.com/phistuck) |[<img alt=\"wangsha\" src=\"https://avatars0.githubusercontent.com/u/221029?v=4&s=117\" width=\"117\">](https://github.com/wangsha) |[<img alt=\"alphatwit\" src=\"https://avatars1.githubusercontent.com/u/3231066?v=4&s=117\" width=\"117\">](https://github.com/alphatwit) |[<img alt=\"andrewseguin\" src=\"https://avatars3.githubusercontent.com/u/22898577?v=4&s=117\" width=\"117\">](https://github.com/andrewseguin) |\n:---: |:---: |:---: |:---: |\n[phistuck](https://github.com/phistuck) |[wangsha](https://github.com/wangsha) |[alphatwit](https://github.com/alphatwit) |[andrewseguin](https://github.com/andrewseguin) |\n\n<a name=\"1.1.5\"></a>\n## [1.1.5](https://github.com/angular/material/compare/v1.1.4...v1.1.5) (2017-09-06)\n\n\n### Bug Fixes\n\n* **autocomplete:** allow clear button even if directive is disabled ([#10603](https://github.com/angular/material/issues/10603)) ([2602e7b](https://github.com/angular/material/commit/2602e7b))\n* **calendar:** conform to CSP. ([#10519](https://github.com/angular/material/issues/10519)) ([e1345ae](https://github.com/angular/material/commit/e1345ae)), closes [#10389](https://github.com/angular/material/issues/10389)\n* **demo:** fix the disable ink bar checkbox ([#10423](https://github.com/angular/material/issues/10423)) ([f8deb0e](https://github.com/angular/material/commit/f8deb0e))\n* **dialog:** add check that scrollmask is present ([#10708](https://github.com/angular/material/issues/10708)) ([590b684](https://github.com/angular/material/commit/590b684))\n* **dialog:** generate `aria-label` with dialog title (if exists) when `.ariaLabel()` is not specified ([#10735](https://github.com/angular/material/issues/10735)) ([2247248](https://github.com/angular/material/commit/2247248)), closes [#10582](https://github.com/angular/material/issues/10582)\n* **gesture:** unable to move text cursor and tap away on mobile ([#10821](https://github.com/angular/material/issues/10821)) ([baa869a](https://github.com/angular/material/commit/baa869a)), closes [#10301](https://github.com/angular/material/issues/10301) [#5365](https://github.com/angular/material/issues/5365)\n* **gestures:** fix the swipe and scrolling issues on touch devices ([#10455](https://github.com/angular/material/issues/10455)) ([17f09dc](https://github.com/angular/material/commit/17f09dc)), closes [#10187](https://github.com/angular/material/issues/10187) [#10145](https://github.com/angular/material/issues/10145)\n* **input:** correct initial animation state of messages ([#10246](https://github.com/angular/material/issues/10246)) ([0151b4b](https://github.com/angular/material/commit/0151b4b)), closes [#6767](https://github.com/angular/material/issues/6767) [#9543](https://github.com/angular/material/issues/9543) [#9723](https://github.com/angular/material/issues/9723) [#10240](https://github.com/angular/material/issues/10240)\n* **input:** fix placeholder text being read twice by screen readers ([#10524](https://github.com/angular/material/issues/10524)) ([71cd3e9](https://github.com/angular/material/commit/71cd3e9))\n* **list:** add `rel` to copied attributes for `md-list-item` buttons [#10351](https://github.com/angular/material/issues/10351) ([#10352](https://github.com/angular/material/issues/10352)) ([241bbc4](https://github.com/angular/material/commit/241bbc4))\n* **menu:** prevent menu from being larger than the viewport ([#10729](https://github.com/angular/material/issues/10729)) ([f823c83](https://github.com/angular/material/commit/f823c83))\n* **panel:** correctly reverse x-position in RTL ([#10710](https://github.com/angular/material/issues/10710)) ([d3d0c5d](https://github.com/angular/material/commit/d3d0c5d)), closes [#10536](https://github.com/angular/material/issues/10536)\n* **panel:** fix propagateContainerEvents ([#10497](https://github.com/angular/material/issues/10497)) ([281504f](https://github.com/angular/material/commit/281504f)), closes [#10495](https://github.com/angular/material/issues/10495)\n* **progress-linear-theme:** add md-primary support to progress-linear buffer mode ([#10563](https://github.com/angular/material/issues/10563)) ([9430a7c](https://github.com/angular/material/commit/9430a7c))\n* **select:** accessibility fixes allowing screen readers (VoiceOver) to ([#10760](https://github.com/angular/material/issues/10760)) ([28d4bf2](https://github.com/angular/material/commit/28d4bf2))\n* **select:** unable to reopen if element was destroyed while closing ([#10556](https://github.com/angular/material/issues/10556)) ([93c2917](https://github.com/angular/material/commit/93c2917)), closes [#10453](https://github.com/angular/material/issues/10453)\n* **tabs:** accessibility and keyboard interaction fixes ([#10706](https://github.com/angular/material/issues/10706)) ([072f832](https://github.com/angular/material/commit/072f832)), closes [#10075](https://github.com/angular/material/issues/10075)\n* **tabs:** add proper RTL support. ([#9301](https://github.com/angular/material/issues/9301)) ([338ca27](https://github.com/angular/material/commit/338ca27)), closes [#9292](https://github.com/angular/material/issues/9292)\n* **tabs:** allow right and left arrows to cycle through tabs ([#10786](https://github.com/angular/material/issues/10786)) ([bf6e567](https://github.com/angular/material/commit/bf6e567))\n* **tabs:** hide md-tab-content elements entirely when inactive. ([#10776](https://github.com/angular/material/issues/10776)) ([c886286](https://github.com/angular/material/commit/c886286))\n* **util:** scrollTop set on proper scroll target ([#10549](https://github.com/angular/material/issues/10549)) ([c1b715f](https://github.com/angular/material/commit/c1b715f)), closes [#10272](https://github.com/angular/material/issues/10272) [#10432](https://github.com/angular/material/issues/10432)\n* **virtual-repeater:** add role=\"presentation\" to structural divs to fix screen reader interactions ([#10812](https://github.com/angular/material/issues/10812)) ([72f930b](https://github.com/angular/material/commit/72f930b))\n* **virtualRepeat:** fix datepicker scroll to wrong current date ([#10537](https://github.com/angular/material/issues/10537)) ([4e579dd](https://github.com/angular/material/commit/4e579dd))\n\n\n### Features\n\n* **gesture:** allow to change maxClickDistance through setMaxClickDistance ([#10498](https://github.com/angular/material/issues/10498)) ([29ef510](https://github.com/angular/material/commit/29ef510)), closes [#10492](https://github.com/angular/material/issues/10492)\n* **prompt:** implement \"required\" flag for prompt dialogs ([#10626](https://github.com/angular/material/issues/10626)) ([2015ae8](https://github.com/angular/material/commit/2015ae8)), closes [#10135](https://github.com/angular/material/issues/10135)\n* **$mdCompiler:** respect preAssignBindingsEnabled state ([#10726](https://github.com/angular/material/issues/10726)) ([fa997b9](https://github.com/angular/material/commit/fa997b9)), closes [#10016](https://github.com/angular/material/issues/10016)\n\n\n----\n\n###### $mdCompiler\n\n\nThe `$mdCompiler` is able to respect the AngularJS `preAssignBindingsEnabled` state when using AngularJS 1.5.10 or higher.\n\nTo enable/disable whether Material-specific (dialogs/toasts) controllers respect the AngularJS `$compile.preAssignBindingsEnabled` flag, call the AngularJS Material method: `$mdCompilerProvider.respectPreAssignBindingsEnabled(true/false)`. \n\nThis AngularJS Material *flag* doesn't affect directives/components created via regular AngularJS methods which constitute most Material & user-created components. \n\nOnly dynamic construction of elements such as Dialogs, Toast, BottomSheet, etc. may be affected. Invoking `$mdCompilerProvider.respectPreAssignBindingsEnabled(true)` will make **bindings** in Material custom components like `$mdDialog` or `$mdToast` only available in controller constructors.\n\n*  By default `respectPreAssignBindingsEnabled === false`\n*  With AngularJS 1.6 or newer, `respectPreAssignBindingsEnabled === true` as the default.\n*  With AngularJS >=1.5.10 <1.6.0, developers can use `$compilerProvider.preAssignBindingsEnabled(false)` to enforce this.\n\nThe `$mdCompiler` now also understands the the `$onInit` lifecycle hooks in controllers.\n> Note that no other AngularJS 1.5+ lifecycle hooks are supported currently.\n\n\n```js\n// Using the default value `preAssignBindingsEnabled == false`\n\n$mdDialog.show({\n  locals: {\n    myVar: true\n  },\n  controller: MyController,\n  bindToController: true\n}\n\nfunction MyController() {\n  // No locals from Angular Material are set yet. e.g myVar is undefined.\n}\n\nMyController.prototype.$onInit = function() {\n  // Bindings are now set in the $onInit lifecycle hook.\n}\n```\n\n\n<a name=\"1.1.4\"></a>\n## [AngularJS Material 1.1.4](https://github.com/angular/material/compare/v1.1.3...v1.1.4) (2017-04-20)\n\n\n### Bug Fixes\n\n* **autocomplete:** incorrect evaluation of available space in viewport ([#9999](https://github.com/angular/material/issues/9999)) ([9f198c9](https://github.com/angular/material/commit/9f198c9))\n* **checkbox:** click handling when ngCheckbox is set ([#10468](https://github.com/angular/material/issues/10468)) ([#10472](https://github.com/angular/material/issues/10472)) ([69a0d8b](https://github.com/angular/material/commit/69a0d8b))\n* **chips:** failing unit tests against Angular 1.3 ([#10224](https://github.com/angular/material/issues/10224)) ([1095899](https://github.com/angular/material/commit/1095899))\n* **core:** eliminates many (but not all) redundant rules in layout CSS ([#10509](https://github.com/angular/material/issues/10509)) ([90b64fe](https://github.com/angular/material/commit/90b64fe))\n* **gridList:** RTL Layout ([#2996](https://github.com/angular/material/issues/2996)) ([#10178](https://github.com/angular/material/issues/10178)) ([8ab7dd9](https://github.com/angular/material/commit/8ab7dd9))\n* **icon:** fix aria roles and attributes ([#10024](https://github.com/angular/material/issues/10024)) ([f0facb2](https://github.com/angular/material/commit/f0facb2)), closes [#9629](https://github.com/angular/material/issues/9629)\n* **layout:** trim attribute values before use ([#10462](https://github.com/angular/material/issues/10462)) ([fa02e4e](https://github.com/angular/material/commit/fa02e4e)), closes [#10426](https://github.com/angular/material/issues/10426)\n* **mdGesture:** fix form submit via enter/go button on iOS ([#3990](https://github.com/angular/material/issues/3990)) ([#10189](https://github.com/angular/material/issues/10189)) ([eecc541](https://github.com/angular/material/commit/eecc541))\n* **mdSelect:** fix theme change dynamically ([#10152](https://github.com/angular/material/issues/10152)) ([ed10a6e](https://github.com/angular/material/commit/ed10a6e)), closes [#9894](https://github.com/angular/material/issues/9894)\n* **mdTooltip:** Tooltip parent aria label override ([#10464](https://github.com/angular/material/issues/10464)) ([6c209b9](https://github.com/angular/material/commit/6c209b9)), closes [#10242](https://github.com/angular/material/issues/10242)\n* **panel:** use class instead of style attribute ([#10321](https://github.com/angular/material/issues/10321)) ([976f557](https://github.com/angular/material/commit/976f557)), closes [#10085](https://github.com/angular/material/issues/10085)\n* **select:** allow non-english characters for keyboard selection. ([#8893](https://github.com/angular/material/issues/8893)) ([89538d6](https://github.com/angular/material/commit/89538d6)), closes [#7730](https://github.com/angular/material/issues/7730)\n* **tabs:** fix long tab content not scrolling ([#10586](https://github.com/angular/material/issues/10586)) ([562b1c9](https://github.com/angular/material/commit/562b1c9))\n* **tooltip:** resolve expressions against correct scope ([#10596](https://github.com/angular/material/issues/10596)) ([3d87453](https://github.com/angular/material/commit/3d87453))\n* **tooltip:** use different attribute to track setting of aria-label ([#10600](https://github.com/angular/material/issues/10600)) ([471c225](https://github.com/angular/material/commit/471c225))\n* **virtualRepeat:** DOM manipulation may alter scroll ([#10177](https://github.com/angular/material/issues/10177)) ([25aeb0d](https://github.com/angular/material/commit/25aeb0d)), closes [#10144](https://github.com/angular/material/issues/10144)\n\n\n### Features\n\n* **datepicker:** allow date strings as the source for ng-model ([#9554](https://github.com/angular/material/issues/9554)) ([e7de21d](https://github.com/angular/material/commit/e7de21d)), closes [#6253](https://github.com/angular/material/issues/6253) [#9535](https://github.com/angular/material/issues/9535)\n* **navBar:** Add missing styling for md-primary and md-accent ([#10204](https://github.com/angular/material/issues/10204)) ([2cd5018](https://github.com/angular/material/commit/2cd5018)), closes [#8827](https://github.com/angular/material/issues/8827)\n\n\n\n<a name=\"1.1.3\"></a>\n## [Angular Material 1.1.3](https://github.com/angular/material/compare/v1.1.2...v1.1.3) (2017-01-31)\n\n### Bug Fixes\n\n* **gestures:** slider and swipe touch ([#10314](https://github.com/angular/material/issues/10314)) ([b2562cf](https://github.com/angular/material/commit/b2562cf)), closes [#10294](https://github.com/angular/material/issues/10294) [#10187](https://github.com/angular/material/issues/10187) [#10145](https://github.com/angular/material/issues/10145)\n* **select:** don't override initial model value ([#10273](https://github.com/angular/material/issues/10273)) ([2240114](https://github.com/angular/material/commit/2240114))\n\n<a name=\"1.1.2\"></a>\n## [Angular Material 1.1.2](https://github.com/angular/material/compare/g3_v0_x...v1.1.2) (2017-01-30)\n\n### Features\n\n* **autocomplete:** add md-autocomplete-snap=\"width\" ([#7750](https://github.com/angular/material/issues/7750)) ([1e45c44](https://github.com/angular/material/commit/1e45c44))\n* **autocomplete:** add md-dropdown-position option ([#9774](https://github.com/angular/material/issues/9774)) ([1ed298b](https://github.com/angular/material/commit/1ed298b)), closes [#9769](https://github.com/angular/material/issues/9769)\n* **autocomplete:** allow developers to specify amount of dropdown items. ([#9307](https://github.com/angular/material/issues/9307)) ([b114302](https://github.com/angular/material/commit/b114302)), closes [#9306](https://github.com/angular/material/issues/9306) [#8751](https://github.com/angular/material/issues/8751)\n* **autocomplete:** option to toggle the clear button ([#9892](https://github.com/angular/material/issues/9892)) ([70cecda](https://github.com/angular/material/commit/70cecda)), closes [#4841](https://github.com/angular/material/issues/4841) [#2727](https://github.com/angular/material/issues/2727)\n* **autocomplete:** pass md-input-max/min-length to the input with non-floating label ([#9964](https://github.com/angular/material/issues/9964)) ([388a340](https://github.com/angular/material/commit/388a340))\n* **autocomplete:** support ng-trim on the underlaying input ([#9496](https://github.com/angular/material/issues/9496)) ([0032184](https://github.com/angular/material/commit/0032184)), closes [#4492](https://github.com/angular/material/issues/4492)\n* **button:** add md-dense support ([#9313](https://github.com/angular/material/issues/9313)) ([25dd787](https://github.com/angular/material/commit/25dd787))\n* **checkbox/switch:** add support for animating ng-messages ([#9473](https://github.com/angular/material/issues/9473)) ([4006f53](https://github.com/angular/material/commit/4006f53)), closes [#9430](https://github.com/angular/material/issues/9430)\n* **compiler:** pass $element to controller instantiation ([#9516](https://github.com/angular/material/issues/9516)) ([be038d1](https://github.com/angular/material/commit/be038d1)), closes [#9507](https://github.com/angular/material/issues/9507)\n* **compiler:** support for content elements ([#9551](https://github.com/angular/material/issues/9551)) ([dfe1a00](https://github.com/angular/material/commit/dfe1a00))\n* **datepicker:** allow the date locale to be overwritten on a per element basis ([#9749](https://github.com/angular/material/issues/9749)) ([a090079](https://github.com/angular/material/commit/a090079)), closes [#9270](https://github.com/angular/material/issues/9270)\n* **dialog:** extended theme inheritance of dialogs ([#9762](https://github.com/angular/material/issues/9762)) ([b7ae33e](https://github.com/angular/material/commit/b7ae33e))\n* **interaction:** added service to detect last interaction ([#7965](https://github.com/angular/material/issues/7965)) ([24370e7](https://github.com/angular/material/commit/24370e7)), closes [#5563](https://github.com/angular/material/issues/5563) [#5434](https://github.com/angular/material/issues/5434) [#5583](https://github.com/angular/material/issues/5583)\n* **interimElement:** properly handle multiple interims. ([#9053](https://github.com/angular/material/issues/9053)) ([421fed4](https://github.com/angular/material/commit/421fed4)), closes [#8624](https://github.com/angular/material/issues/8624) [#8630](https://github.com/angular/material/issues/8630)\n* **list:** add class to disable proxy elements. ([#9470](https://github.com/angular/material/issues/9470)) ([ad82012](https://github.com/angular/material/commit/ad82012)), closes [#9423](https://github.com/angular/material/issues/9423)\n* **md-nav-item:** support for `ui-sref-opts` on `md-nav-item` ([#9782](https://github.com/angular/material/issues/9782)) ([af041da](https://github.com/angular/material/commit/af041da)), closes [#9481](https://github.com/angular/material/issues/9481)\n* **menu:** expose close method on element scope; deprecate $mdOpenMenu ([#9193](https://github.com/angular/material/issues/9193)) ([1e4ba35](https://github.com/angular/material/commit/1e4ba35)), closes [#8446](https://github.com/angular/material/issues/8446)\n* **navBar:** option to disable ink bar ([#9866](https://github.com/angular/material/issues/9866)) ([97cbe69](https://github.com/angular/material/commit/97cbe69)), closes [#9862](https://github.com/angular/material/issues/9862)\n* **panel:** add contentElement option ([#9829](https://github.com/angular/material/issues/9829)) ([3034237](https://github.com/angular/material/commit/3034237)), closes [#9757](https://github.com/angular/material/issues/9757)\n* **panel:** add hook for close success. ([#9819](https://github.com/angular/material/issues/9819)) ([db90283](https://github.com/angular/material/commit/db90283))\n* **panel:** add interceptors API and onClose hook ([#9574](https://github.com/angular/material/issues/9574)) ([96e5409](https://github.com/angular/material/commit/96e5409)), closes [#9557](https://github.com/angular/material/issues/9557)\n* **panel:** add the ability to update the animation of an existing panel ([#9895](https://github.com/angular/material/issues/9895)) ([a6f0de7](https://github.com/angular/material/commit/a6f0de7))\n* **panel:** allow panels to be part of multiple groups. ([#9830](https://github.com/angular/material/issues/9830)) ([80e87b5](https://github.com/angular/material/commit/80e87b5)), closes [#9565](https://github.com/angular/material/issues/9565)\n* **panel:** allow passing in a function to the offset methods ([#9615](https://github.com/angular/material/issues/9615)) ([0896ba3](https://github.com/angular/material/commit/0896ba3)), closes [#9608](https://github.com/angular/material/issues/9608)\n* **panel:** configurable animation duration ([#9570](https://github.com/angular/material/issues/9570)) ([bee04f3](https://github.com/angular/material/commit/bee04f3)), closes [#9177](https://github.com/angular/material/issues/9177)\n* **panel:** panel grouping ([#9538](https://github.com/angular/material/issues/9538)) ([62df3c8](https://github.com/angular/material/commit/62df3c8)), closes [#8971](https://github.com/angular/material/issues/8971)\n* **panel:** panel provider ([#10215](https://github.com/angular/material/issues/10215)) ([a169f6f](https://github.com/angular/material/commit/a169f6f)), closes [#10006](https://github.com/angular/material/issues/10006) [#10162](https://github.com/angular/material/issues/10162)\n* **switch:** add attribute to invert ([#8205](https://github.com/angular/material/issues/8205)) ([ca06402](https://github.com/angular/material/commit/ca06402)), closes [#7889](https://github.com/angular/material/issues/7889)\n* **themes:** register theme on the fly ([#9475](https://github.com/angular/material/issues/9475)) ([7090a1f](https://github.com/angular/material/commit/7090a1f)), closes [#2965](https://github.com/angular/material/issues/2965)\n* **toolbar:** add CSS rules for checkbox support ([#9799](https://github.com/angular/material/issues/9799)) ([038f3ed](https://github.com/angular/material/commit/038f3ed)), closes [#9500](https://github.com/angular/material/issues/9500)\n* **tooltip:** tooltip uses MdPanel API ([#9742](https://github.com/angular/material/issues/9742)) ([6d06188](https://github.com/angular/material/commit/6d06188)), closes [#9563](https://github.com/angular/material/issues/9563)\n\n### Bug Fixes\n\n* **autocomplete:** fix messages not appearing. ([#9909](https://github.com/angular/material/issues/9909)) ([ce5f7c2](https://github.com/angular/material/commit/ce5f7c2)), closes [#9468](https://github.com/angular/material/issues/9468)\n* **autocomplete:** fix TypeError in autocomplete. ([#10227](https://github.com/angular/material/issues/10227)) ([f8fd076](https://github.com/angular/material/commit/f8fd076))\n* **autocomplete:** two specs leak the scroll mask element ([#9568](https://github.com/angular/material/issues/9568)) ([a95d76d](https://github.com/angular/material/commit/a95d76d))\n* **autocomplete:** use global stylesheet for demo ([#9930](https://github.com/angular/material/issues/9930)) ([e807a3b](https://github.com/angular/material/commit/e807a3b))\n* **build:** fix errors on angular 1.3 ([#9663](https://github.com/angular/material/issues/9663)) ([0ce8a57](https://github.com/angular/material/commit/0ce8a57))\n* **build:** prevent closure from stripping $inject annotations ([#9765](https://github.com/angular/material/issues/9765)) ([dbc52d0](https://github.com/angular/material/commit/dbc52d0)), closes [#9758](https://github.com/angular/material/issues/9758)\n* **button:** only apply focus effect for keyboard interaction. ([#9826](https://github.com/angular/material/issues/9826)) ([34823ac](https://github.com/angular/material/commit/34823ac)), closes [#8749](https://github.com/angular/material/issues/8749)\n* **calendar:** boundKeyHandler preventDefault on other input elements ([#9746](https://github.com/angular/material/issues/9746)) ([b903153](https://github.com/angular/material/commit/b903153))\n* **card:** fix alignment with avatar icons in Safari ([#9801](https://github.com/angular/material/issues/9801)) ([ec318e7](https://github.com/angular/material/commit/ec318e7)), closes [#9147](https://github.com/angular/material/issues/9147)\n* **checkbox:** properly show focus effect ([#9827](https://github.com/angular/material/issues/9827)) ([002207c](https://github.com/angular/material/commit/002207c))\n* **chips:** add basic accessibility support. ([#9650](https://github.com/angular/material/issues/9650)) ([f18cb2b](https://github.com/angular/material/commit/f18cb2b)), closes [#9391](https://github.com/angular/material/issues/9391) [#9556](https://github.com/angular/material/issues/9556) [#8897](https://github.com/angular/material/issues/8897) [#8867](https://github.com/angular/material/issues/8867) [#9649](https://github.com/angular/material/issues/9649)\n* **chips:** add-on-blur with autocomplete ([#9949](https://github.com/angular/material/issues/9949)) ([72264af](https://github.com/angular/material/commit/72264af)), closes [#9582](https://github.com/angular/material/issues/9582)\n* **chips:** no longer throw an error when returning focus to input. ([#9528](https://github.com/angular/material/issues/9528)) ([a3b3e7b](https://github.com/angular/material/commit/a3b3e7b)), closes [#9520](https://github.com/angular/material/issues/9520)\n* **chips:** support md-min-length on md-contact-chips. ([#9215](https://github.com/angular/material/issues/9215)) ([455c679](https://github.com/angular/material/commit/455c679)), closes [#2423](https://github.com/angular/material/issues/2423)\n* **chips:** use empty chip buffer if not a string ([#9885](https://github.com/angular/material/issues/9885)) ([d774b76](https://github.com/angular/material/commit/d774b76)), closes [#9867](https://github.com/angular/material/issues/9867)\n* **colors:** failing unit tests against Edge ([#9876](https://github.com/angular/material/issues/9876)) ([dfbc0f6](https://github.com/angular/material/commit/dfbc0f6))\n* **constant:** remove dependency on $sniffer ([#9875](https://github.com/angular/material/issues/9875)) ([c1eceaf](https://github.com/angular/material/commit/c1eceaf))\n* **datepicker:** add aria-owns and aria-expanded support ([#9733](https://github.com/angular/material/issues/9733)) ([13fba2c](https://github.com/angular/material/commit/13fba2c)), closes [#9727](https://github.com/angular/material/issues/9727)\n* **datepicker:** ensure that all month/year elements have the expected height ([#9893](https://github.com/angular/material/issues/9893)) ([b3b8fab](https://github.com/angular/material/commit/b3b8fab)), closes [#9863](https://github.com/angular/material/issues/9863)\n* **datepicker:** error message alignment in md-input-container ([#9504](https://github.com/angular/material/issues/9504)) ([0592dfa](https://github.com/angular/material/commit/0592dfa)), closes [#9342](https://github.com/angular/material/issues/9342)\n* **datepicker:** pass in the timezone when formatting the date ([#9837](https://github.com/angular/material/issues/9837)) ([22f9faf](https://github.com/angular/material/commit/22f9faf)), closes [#9725](https://github.com/angular/material/issues/9725)\n* **datepicker:** reference error and calendar not being read out by nvda ([#9891](https://github.com/angular/material/issues/9891)) ([694e561](https://github.com/angular/material/commit/694e561))\n* **datepicker:** remove dependency on $mdGesture ([#9803](https://github.com/angular/material/issues/9803)) ([72b4f10](https://github.com/angular/material/commit/72b4f10)), closes [#9793](https://github.com/angular/material/issues/9793)\n* **datepicker:** remove negative margin if triangle icon is disabled ([#9853](https://github.com/angular/material/issues/9853)) ([e1a5146](https://github.com/angular/material/commit/e1a5146)), closes [#9850](https://github.com/angular/material/issues/9850)\n* **datepicker:** updateOn not working with non-bubbling events ([#9632](https://github.com/angular/material/issues/9632)) ([b5c412c](https://github.com/angular/material/commit/b5c412c)), closes [#9577](https://github.com/angular/material/issues/9577)\n* **datepicker, select:** arrow button consistency ([#9807](https://github.com/angular/material/issues/9807)) ([b0df030](https://github.com/angular/material/commit/b0df030))\n* **dialog:** only restore focus with keyboard interaction ([#9923](https://github.com/angular/material/issues/9923)) ([c851204](https://github.com/angular/material/commit/c851204)), closes [#7963](https://github.com/angular/material/issues/7963)\n* **dialog:** re-add md-actions deprecation class. ([#10318](https://github.com/angular/material/issues/10318)) ([e96293a](https://github.com/angular/material/commit/e96293a))\n* **docs:** fix broken links in theming docs  ([fd88814](https://github.com/angular/material/commit/fd88814)), closes [#10203](https://github.com/angular/material/issues/10203)\n* **docs:** prevent tabbing over hidden content; better animation handling ([#9773](https://github.com/angular/material/issues/9773)) ([da6baac](https://github.com/angular/material/commit/da6baac)), closes [#8896](https://github.com/angular/material/issues/8896)\n* **docs:** re-add accidentally removed css ([#9808](https://github.com/angular/material/issues/9808)) ([b14fa93](https://github.com/angular/material/commit/b14fa93))\n* **docs, dialog, interim, panel:** compatibility with latest angular snapshot ([#9787](https://github.com/angular/material/issues/9787)) ([4fb1767](https://github.com/angular/material/commit/4fb1767))\n* **icon:** codepen demo issue ([#9780](https://github.com/angular/material/issues/9780)) ([f03c513](https://github.com/angular/material/commit/f03c513)), closes [#9561](https://github.com/angular/material/issues/9561)\n* **input:** increase placeholder contrast on focus ([#9804](https://github.com/angular/material/issues/9804)) ([974acd3](https://github.com/angular/material/commit/974acd3)), closes [#8903](https://github.com/angular/material/issues/8903)\n* **input:** md-maxlength not properly updates on model changes. ([#8351](https://github.com/angular/material/issues/8351)) ([bf5c036](https://github.com/angular/material/commit/bf5c036)), closes [#1870](https://github.com/angular/material/issues/1870)\n* **interim:** do not immediately splice interim. ([#9670](https://github.com/angular/material/issues/9670)) ([ebc8ace](https://github.com/angular/material/commit/ebc8ace))\n* **interimElement:** added missing scope dispose to fix memory leak ([#9710](https://github.com/angular/material/issues/9710)) ([eac3bfb](https://github.com/angular/material/commit/eac3bfb))\n* **layout:** fix use of flex-basis in layout modes ([#9572](https://github.com/angular/material/issues/9572)) ([c6fb5a5](https://github.com/angular/material/commit/c6fb5a5)), closes [#5345](https://github.com/angular/material/issues/5345)\n* **list:** empty aria-label attributes for list-items with interpolation ([#10218](https://github.com/angular/material/issues/10218)) ([3556d57](https://github.com/angular/material/commit/3556d57))\n* **list:** expect aria-label with respect to aria-hidden ([#9943](https://github.com/angular/material/issues/9943)) ([2c367f7](https://github.com/angular/material/commit/2c367f7)), closes [#9933](https://github.com/angular/material/issues/9933)\n* **menu:** avoid runtime errors when menu-content isn't set. ([#10198](https://github.com/angular/material/issues/10198)) ([0b65e08](https://github.com/angular/material/commit/0b65e08)), closes [#9709](https://github.com/angular/material/issues/9709)\n* **menu:** focus first non disabled item ([#9228](https://github.com/angular/material/issues/9228)) ([1f32ccb](https://github.com/angular/material/commit/1f32ccb)), closes [#9165](https://github.com/angular/material/issues/9165)\n* **menu:** menu content should inherit theme ([#10217](https://github.com/angular/material/issues/10217)) ([dd2c8a9](https://github.com/angular/material/commit/dd2c8a9))\n* **menu-bar:** nested menus not closing when clicking on the toolbar ([#9602](https://github.com/angular/material/issues/9602)) ([e0463c0](https://github.com/angular/material/commit/e0463c0)), closes [#9599](https://github.com/angular/material/issues/9599)\n* **menu-bar:** do not use flex for buttons ([#10027](https://github.com/angular/material/issues/10027)) ([471b850](https://github.com/angular/material/commit/471b850)), closes [#9771](https://github.com/angular/material/issues/9771)\n* **menu-bar:** test leaking scroll mask element ([#9569](https://github.com/angular/material/issues/9569)) ([c5b5386](https://github.com/angular/material/commit/c5b5386))\n* **nav-bar:** null check tabs when updating nav-bar ([#9071](https://github.com/angular/material/issues/9071)) ([b38d928](https://github.com/angular/material/commit/b38d928))\n* **nav-bar:** tabs not being read out by screen readers ([#9925](https://github.com/angular/material/issues/9925)) ([454b974](https://github.com/angular/material/commit/454b974)), closes [#9383](https://github.com/angular/material/issues/9383)\n* **nav-bar:** automatically add aria-label for navBarItem ([#10219](https://github.com/angular/material/issues/10219)) ([b7b1d01](https://github.com/angular/material/commit/b7b1d01)), closes [#10110](https://github.com/angular/material/issues/10110)\n* **panel:** allow clickOutsideToClose to work with propagateContainerEvents ([#9886](https://github.com/angular/material/issues/9886)) ([61bd95e](https://github.com/angular/material/commit/61bd95e)), closes [#9388](https://github.com/angular/material/issues/9388)\n* **panel:** don't bind scroll event if scrolling is disabled ([#9947](https://github.com/angular/material/issues/9947)) ([088d2e6](https://github.com/angular/material/commit/088d2e6))\n* **panel:** element not being removed when scope is destroyed ([#9567](https://github.com/angular/material/issues/9567)) ([d208ac5](https://github.com/angular/material/commit/d208ac5)), closes [#8683](https://github.com/angular/material/issues/8683)\n* **panel:** make the actual position available in the offset methods ([#9732](https://github.com/angular/material/issues/9732)) ([6a0d592](https://github.com/angular/material/commit/6a0d592))\n* **panel:** panel and tooltip theming ([#10031](https://github.com/angular/material/issues/10031)) ([b8357dc](https://github.com/angular/material/commit/b8357dc)), closes [#10030](https://github.com/angular/material/issues/10030)\n* **panel:** panel not being constrained to viewport on repeat openings ([#9944](https://github.com/angular/material/issues/9944)) ([47e4c1b](https://github.com/angular/material/commit/47e4c1b)), closes [#9942](https://github.com/angular/material/issues/9942)\n* **panel:** take offsets into account when checking if element is on screen ([#9662](https://github.com/angular/material/issues/9662)) ([761493d](https://github.com/angular/material/commit/761493d)), closes [#9628](https://github.com/angular/material/issues/9628)\n* **panel:** use prefixed transform property ([#9721](https://github.com/angular/material/issues/9721)) ([7706162](https://github.com/angular/material/commit/7706162))\n* **progress-circular:** path not being re-rendered when diameter changes ([#9846](https://github.com/angular/material/issues/9846)) ([d6d3546](https://github.com/angular/material/commit/d6d3546)), closes [#9841](https://github.com/angular/material/issues/9841)\n* **progress-circular:** fix arc bleeding through container ([#10108](https://github.com/angular/material/issues/10108)) ([491d139](https://github.com/angular/material/commit/491d139)), closes [#10107](https://github.com/angular/material/issues/10107)\n* **progress-circular:** update animation to spec ([#10017](https://github.com/angular/material/issues/10017)) ([cf38b29](https://github.com/angular/material/commit/cf38b29)), closes [#9879](https://github.com/angular/material/issues/9879)\n* **radio-group:** wrong aria-checked value on load when used with ng-value ([#9790](https://github.com/angular/material/issues/9790)) ([2bbf401](https://github.com/angular/material/commit/2bbf401)), closes [#9400](https://github.com/angular/material/issues/9400)\n* **select:** block xss on md-select-label ([#10023](https://github.com/angular/material/issues/10023)) ([f7ecb4f](https://github.com/angular/material/commit/f7ecb4f))\n* **select:** Fix duplicates in label. ([#9695](https://github.com/angular/material/issues/9695)) ([d553919](https://github.com/angular/material/commit/d553919)), closes [#9442](https://github.com/angular/material/issues/9442)\n* **select:** unable to switch between falsy options ([#9945](https://github.com/angular/material/issues/9945)) ([54a1d0d](https://github.com/angular/material/commit/54a1d0d)), closes [#9533](https://github.com/angular/material/issues/9533)\n* **select/datepicker:** fix dropdown icon colors. ([#10226](https://github.com/angular/material/issues/10226)) ([bb90ce9](https://github.com/angular/material/commit/bb90ce9))\n* **sidenav:** allow for data bindings in md-component-id ([#9255](https://github.com/angular/material/issues/9255)) ([5cdceeb](https://github.com/angular/material/commit/5cdceeb)), closes [#9052](https://github.com/angular/material/issues/9052)\n* **sidenav:** allow more time before triggering a resize of the children ([#9809](https://github.com/angular/material/issues/9809)) ([79d272d](https://github.com/angular/material/commit/79d272d)), closes [#9745](https://github.com/angular/material/issues/9745)\n* **sidenav:** correct animation from closed to locked open ([#9833](https://github.com/angular/material/issues/9833)) ([bd605c0](https://github.com/angular/material/commit/bd605c0)), closes [#9425](https://github.com/angular/material/issues/9425)\n* **sidenav:** notify child components when the element is opened ([#9512](https://github.com/angular/material/issues/9512)) ([989f81e](https://github.com/angular/material/commit/989f81e)), closes [#7309](https://github.com/angular/material/issues/7309)\n* **subheader:** add accessibility support ([#9817](https://github.com/angular/material/issues/9817)) ([1d77c92](https://github.com/angular/material/commit/1d77c92)), closes [#9392](https://github.com/angular/material/issues/9392)\n* **switch:** invalid container margin in RTL ([#9586](https://github.com/angular/material/issues/9586)) ([b0d9921](https://github.com/angular/material/commit/b0d9921))\n* **tabs:** allow md-tab-content > div to shrink ([#10290](https://github.com/angular/material/issues/10290)) ([2c9a5cc](https://github.com/angular/material/commit/2c9a5cc))\n* **tabs:** don't set aria-controls when there is no content; better empty tab handling ([#9763](https://github.com/angular/material/issues/9763)) ([c93fdad](https://github.com/angular/material/commit/c93fdad)), closes [#9108](https://github.com/angular/material/issues/9108)\n* **tabs:** dummy tabs should not have acccessibilty roles ([#9452](https://github.com/angular/material/issues/9452)) ([9e0c30e](https://github.com/angular/material/commit/9e0c30e)), closes [#9450](https://github.com/angular/material/issues/9450)\n* **tabs:** icon color isn't correct when the tab item is not active ([#9620](https://github.com/angular/material/issues/9620)) ([e80d0d2](https://github.com/angular/material/commit/e80d0d2)), closes [#9536](https://github.com/angular/material/issues/9536)\n* **tabs:** improve tab button focus styling logic ([#9916](https://github.com/angular/material/issues/9916)) ([166fb79](https://github.com/angular/material/commit/166fb79)), closes [#9039](https://github.com/angular/material/issues/9039)\n* **tabs:** properly blank activedescendant attr when no tabs exist ([#9907](https://github.com/angular/material/issues/9907)) ([348f6c0](https://github.com/angular/material/commit/348f6c0)), closes [#9279](https://github.com/angular/material/issues/9279)\n* **tabs:** remove manually pagination sizing algorithm ([#10136](https://github.com/angular/material/issues/10136)) ([5b799e2](https://github.com/angular/material/commit/5b799e2)), closes [#9429](https://github.com/angular/material/issues/9429)\n* **tabs:** support flexible content layout ([#9451](https://github.com/angular/material/issues/9451)) ([d89a682](https://github.com/angular/material/commit/d89a682)), closes [#9206](https://github.com/angular/material/issues/9206) [#9704](https://github.com/angular/material/issues/9704) [#9779](https://github.com/angular/material/issues/9779)\n* **theming:** match preceding selectors as well ([#9484](https://github.com/angular/material/issues/9484)) ([efb7031](https://github.com/angular/material/commit/efb7031)), closes [#9480](https://github.com/angular/material/issues/9480)\n* **toolbar:** title text should allow ellipsis. ([#9229](https://github.com/angular/material/issues/9229)) ([284d422](https://github.com/angular/material/commit/284d422)), closes [#9026](https://github.com/angular/material/issues/9026)\n* **tooltip:** tooltip role ([#10052](https://github.com/angular/material/issues/10052)) ([7563b47](https://github.com/angular/material/commit/7563b47)), closes [#10045](https://github.com/angular/material/issues/10045)\n* **tooltip:** always resolve expressions against the correct scope ([#10284](https://github.com/angular/material/issues/10284)) ([685b902](https://github.com/angular/material/commit/685b902))\n* **tooltip:** AngularJS 1.3.20 test failures. ([#10115](https://github.com/angular/material/issues/10115)) ([d8263f2](https://github.com/angular/material/commit/d8263f2)), closes [#10114](https://github.com/angular/material/issues/10114)\n* **tooltip:** prevent xss in tooltip content ([#10190](https://github.com/angular/material/issues/10190)) ([8801ef8](https://github.com/angular/material/commit/8801ef8))\n* **tooltip:** properly interpolate tooltip text to prevent possible XSS ([#10159](https://github.com/angular/material/issues/10159)) ([0b72ab9](https://github.com/angular/material/commit/0b72ab9))\n* **util:** body overflow-x breaking disableScrollAround ([#9864](https://github.com/angular/material/issues/9864)) ([4468126](https://github.com/angular/material/commit/4468126)), closes [#9860](https://github.com/angular/material/issues/9860)\n* **util:** check for definition of window.performance.now before using in mdUtil ([#9664](https://github.com/angular/material/issues/9664)) ([1b9245a](https://github.com/angular/material/commit/1b9245a))\n* **util:** disableScrollAround should not remove disabled scroll mask ([#9547](https://github.com/angular/material/issues/9547)) ([bbb9ec5](https://github.com/angular/material/commit/bbb9ec5))\n* **util:** getClosest not working on elements with lowercase nodeName ([#9510](https://github.com/angular/material/issues/9510)) ([9936185](https://github.com/angular/material/commit/9936185)), closes [#9509](https://github.com/angular/material/issues/9509)\n* **util:** properly determine viewport top offset ([#9458](https://github.com/angular/material/issues/9458)) ([fc7e9b3](https://github.com/angular/material/commit/fc7e9b3)), closes [#9370](https://github.com/angular/material/issues/9370)\n* **variables:** rem function should use global $font-size variable ([#9497](https://github.com/angular/material/issues/9497)) ([1f14cc4](https://github.com/angular/material/commit/1f14cc4)), closes [#9486](https://github.com/angular/material/issues/9486)\n\n### Performance Improvements\n\n* **chips,navbar,tooltip:** avoid extra DOM lookups ([#9527](https://github.com/angular/material/issues/9527)) ([a1e68d5](https://github.com/angular/material/commit/a1e68d5))\n* **navbar:** reduces amount of watchers and buttons per item ([#9818](https://github.com/angular/material/issues/9818)) ([a5b8943](https://github.com/angular/material/commit/a5b8943))\n* **tooltip:** reduce amount of event listeners on the window ([#9514](https://github.com/angular/material/issues/9514)) ([dc6b10c](https://github.com/angular/material/commit/dc6b10c))\n\n### update\n\n* **autocomplete:** md-require-match only turn invalid if search text is provided ([#9119](https://github.com/angular/material/issues/9119)) ([399016d](https://github.com/angular/material/commit/399016d)), closes [#9072](https://github.com/angular/material/issues/9072)\n\n\n### BREAKING CHANGES\n\n* **autocomplete:** The autocomplete validator `md-require-match` no longer matches if the search text is empty.\n* **select:** `md-selected-text` now only accepts text. It used to accept and render html but this was an XSS vulnerability.\n  It was fixed in: block xss on md-select-label ([#10023](https://github.com/angular/material/issues/10023)) ([f7ecb4f](https://github.com/angular/material/commit/f7ecb4f)).\n\nWe have added a new `md-selected-html` API for `md-select`. It accepts an expression to be evaluated\nthat will return a string to be displayed as a placeholder in the select input box when it is\nclosed. The value will be treated as html. The value **must** either be explicitly marked as\n**trustedHtml** or the **ngSanitize** module must be loaded.\n\nGiven the following code:\n```html\n<md-select ng-model=\"selectedItem\" md-selected-text=\"getSelectedText()\">\n```\n```js\nangular\n    .module('selectDemoSelectedText', ['ngMaterial'])\n    .controller('SelectedTextController', function($scope) {\n      $scope.items = [1, 2, 3, 4, 5, 6, 7];\n      $scope.selectedItem = undefined;\n      $scope.getSelectedText = function() {\n        if ($scope.selectedItem !== undefined) {\n          return \"You have selected: Item <strong>\" + $scope.selectedItem + \"</strong>\";\n        } else {\n          return \"Please select an item\";\n        }\n      };\n    });\n```\n\nChange it to this:\n```html\n<md-select ng-model=\"selectedItem\" md-selected-html=\"getSelectedText()\">\n```\n```js\nangular\n    .module('selectDemoSelectedText', ['ngMaterial', 'ngSanitize'])\n    .controller('SelectedTextController', function($scope) {\n      $scope.items = [1, 2, 3, 4, 5, 6, 7];\n      $scope.selectedItem = undefined;\n      $scope.getSelectedText = function() {\n        if ($scope.selectedItem !== undefined) {\n          return \"You have selected: Item <strong>\" + $scope.selectedItem + \"</strong>\";\n        } else {\n          return \"Please select an item\";\n        }\n      };\n    });\n```\n\n<a name=\"1.1.1\"></a>\n## [Angular Material 1.1.1](https://github.com/angular/material/compare/v1.1.0...v1.1.1) (2016-09-01)\n\nWe continue to maintain our momentum with Angular Material. Today we published a patch release for Angular Material; a patch that contains more than 60 improvements and fixes.\n\n--\n\n*  Add improvements to Themes registrations\n*  Add improvements to Docs to discuss differences between **TabBar** vs **NavBar**\n*  Add improve **SideNav** to specify disableScroll target when open\n*  Add feature **BrowserColor** to enable browser header coloring with Material Design Colors\n*  Add blur or focus features to **Chips** and **Autocomplete**\n\n--\n\n*  Revert a Layout change for `layout=\"column\"`\n*  Fix animations for **Input** messages, **Autocomplete**, **Dialog**\n*  Fix **Card** images inside `md-card-title-media` to use flexbox CSS\n*  Fix **AutoComplete**, **Input**, **Menubar**, **Select**, and theming\n*  Fix **Datepicker**, **Tooltip** colors, **Navbar** theming, **Virtual repeat** with scrolling\n\n\n--\n\n### Features\n\n* **autocomplete:** forward ngBlur and ngFocus attributes ([#9233](https://github.com/angular/material/issues/9233)) ([a3755d0](https://github.com/angular/material/commit/a3755d0))\n* **browser-color:** enable browser header coloring ([#9192](https://github.com/angular/material/issues/9192)) ([57f2afd](https://github.com/angular/material/commit/57f2afd)), closes [#8062](https://github.com/angular/material/issues/8062)\n* **chips:** md-add-on-blur functionality ([#9095](https://github.com/angular/material/issues/9095)) ([bbc6c07](https://github.com/angular/material/commit/bbc6c07)), closes [#3364](https://github.com/angular/material/issues/3364)\n* **datepicker:** add timezone support ([#9410](https://github.com/angular/material/issues/9410)) ([14fa477](https://github.com/angular/material/commit/14fa477)), closes [#8448](https://github.com/angular/material/issues/8448) [#8936](https://github.com/angular/material/issues/8936)\n* **datepicker:** configurable start/end dates, consistency improvements ([#9309](https://github.com/angular/material/issues/9309)) ([522d428](https://github.com/angular/material/commit/522d428)), closes [#9269](https://github.com/angular/material/issues/9269)\n* **mdPanel:** Wrapper and Panel elements referenced in the MdPanelRef ([#9231](https://github.com/angular/material/issues/9231)) ([87c4b01](https://github.com/angular/material/commit/87c4b01)), closes [#9109](https://github.com/angular/material/issues/9109)\n* **panel:** Configuration ID for tracking ([#9379](https://github.com/angular/material/issues/9379)) ([d230aec](https://github.com/angular/material/commit/d230aec)), closes [#9356](https://github.com/angular/material/issues/9356) [#9357](https://github.com/angular/material/issues/9357)\n* **sidenav:** configurable scroll prevent target ([#9338](https://github.com/angular/material/issues/9338)) ([218c3ec](https://github.com/angular/material/commit/218c3ec)), closes [#8634](https://github.com/angular/material/issues/8634)\n* **themes:** register theme on the fly ([#9413](https://github.com/angular/material/issues/9413)) ([0d2386c](https://github.com/angular/material/commit/0d2386c)), closes [#2965](https://github.com/angular/material/issues/2965)\n\n\n### Bug Fixes\n\n* **autocomplete:** don't use $mdUtils.nextTick in handleHiddenChange ([#9319](https://github.com/angular/material/issues/9319)) ([8f8ad78](https://github.com/angular/material/commit/8f8ad78)), closes [#9318](https://github.com/angular/material/issues/9318)\n* **autocomplete:** properly run animation for dialog in demo. ([#9437](https://github.com/angular/material/issues/9437)) ([69607e0](https://github.com/angular/material/commit/69607e0))\n* **autocomplete:** properly show dropdown on focus when minlength is met. ([#9291](https://github.com/angular/material/issues/9291)) ([e65ffc8](https://github.com/angular/material/commit/e65ffc8)), closes [#9283](https://github.com/angular/material/issues/9283) [#9288](https://github.com/angular/material/issues/9288) [#9289](https://github.com/angular/material/issues/9289)\n* **autocomplete:** remove autofocus ambiguity. ([#9438](https://github.com/angular/material/issues/9438)) ([00a4c05](https://github.com/angular/material/commit/00a4c05))\n* **build:** properly filter core module files with updated gulp-filter ([#9399](https://github.com/angular/material/issues/9399)) ([0cd2a59](https://github.com/angular/material/commit/0cd2a59))\n* **card:** limit img size when using md-card-title-media ([#9446](https://github.com/angular/material/issues/9446)) ([d086e2b](https://github.com/angular/material/commit/d086e2b)), closes [#9355](https://github.com/angular/material/issues/9355)\n* **checkbox:** not being marked as checked with ng-checked on load ([#9424](https://github.com/angular/material/issues/9424)) ([904b455](https://github.com/angular/material/commit/904b455)), closes [#9349](https://github.com/angular/material/issues/9349)\n* **compiler:** remove manual controllerAs logic ([#9462](https://github.com/angular/material/issues/9462)) ([18afebe](https://github.com/angular/material/commit/18afebe))\n* **datepicker:** arrow direction in rtl ([#9384](https://github.com/angular/material/issues/9384)) ([f6da4d3](https://github.com/angular/material/commit/f6da4d3))\n* **datepicker:** forward aria-label to generated input ([#9364](https://github.com/angular/material/issues/9364)) ([165d4e7](https://github.com/angular/material/commit/165d4e7)), closes [#9340](https://github.com/angular/material/issues/9340)\n* **datepicker:** forward tabindex to generated input ([#9325](https://github.com/angular/material/issues/9325)) ([6cfb542](https://github.com/angular/material/commit/6cfb542)), closes [#8147](https://github.com/angular/material/issues/8147)\n* **datepicker:** improved overlay positioning ([#9432](https://github.com/angular/material/issues/9432)) ([d0a7765](https://github.com/angular/material/commit/d0a7765))\n* **datepicker:** jumping forward if min date is in the same month as model ([#9305](https://github.com/angular/material/issues/9305)) ([412bc2c](https://github.com/angular/material/commit/412bc2c)), closes [#9284](https://github.com/angular/material/issues/9284)\n* **datepicker:** keyboard navigation not working if the user scrolls too much ([#9302](https://github.com/angular/material/issues/9302)) ([30f6a74](https://github.com/angular/material/commit/30f6a74)), closes [#9294](https://github.com/angular/material/issues/9294)\n* **datepicker, menu, slider:** remove duplicate properties ([#9335](https://github.com/angular/material/issues/9335)) ([1c098a6](https://github.com/angular/material/commit/1c098a6))\n* **demos:** update core-icons svg in assets cache to latest changes. ([#9418](https://github.com/angular/material/issues/9418)) ([7e21118](https://github.com/angular/material/commit/7e21118))\n* **dialog:** add extra classes to identify buttons ([#9463](https://github.com/angular/material/issues/9463)) ([b11441c](https://github.com/angular/material/commit/b11441c))\n* **dialog:** do not compile an empty element when using a content element ([#9303](https://github.com/angular/material/issues/9303)) ([7c4b434](https://github.com/angular/material/commit/7c4b434))\n* **dialog:** focus dialog element when no actions are set ([#9272](https://github.com/angular/material/issues/9272)) ([bcfe00a](https://github.com/angular/material/commit/bcfe00a)), closes [#9271](https://github.com/angular/material/issues/9271)\n* **dialog:** remove transition classes after hide ([#9299](https://github.com/angular/material/issues/9299)) ([f170133](https://github.com/angular/material/commit/f170133)), closes [#9276](https://github.com/angular/material/issues/9276)\n* **input:** Ensure animated messages disappear. ([#9466](https://github.com/angular/material/issues/9466)) ([4e302c2](https://github.com/angular/material/commit/4e302c2)), closes [#9454](https://github.com/angular/material/issues/9454)\n* **layout:** Revert overzealous IE11 flexbox fix. ([#9412](https://github.com/angular/material/issues/9412)) ([660826b](https://github.com/angular/material/commit/660826b)), closes [#9354](https://github.com/angular/material/issues/9354)\n* **menu-bar:** unable to close menu when clicking on toolbar ([#9428](https://github.com/angular/material/issues/9428)) ([6dcecd5](https://github.com/angular/material/commit/6dcecd5)), closes [#8965](https://github.com/angular/material/issues/8965)\n* **menu-bar:** use checked icon from $$mdSvgRegistry ([#9417](https://github.com/angular/material/issues/9417)) ([04124d8](https://github.com/angular/material/commit/04124d8)), closes [#9407](https://github.com/angular/material/issues/9407)\n* **navbar:** add theming support ([#9210](https://github.com/angular/material/issues/9210)) ([4cfd4a1](https://github.com/angular/material/commit/4cfd4a1)), closes [#9137](https://github.com/angular/material/issues/9137)\n* **panel:** Element reference error ([#9375](https://github.com/angular/material/issues/9375)) ([6383b52](https://github.com/angular/material/commit/6383b52)), closes [#9374](https://github.com/angular/material/issues/9374)\n* **prefixer:** do not throw an exception if element is undefined ([#9345](https://github.com/angular/material/issues/9345)) ([d07240b](https://github.com/angular/material/commit/d07240b))\n* undo change to unknown symbol for prod build ([#9393](https://github.com/angular/material/issues/9393)) ([bd4034d](https://github.com/angular/material/commit/bd4034d))\n* **progressCircular:** better support for older ios versions ([#9254](https://github.com/angular/material/issues/9254)) ([215fae4](https://github.com/angular/material/commit/215fae4)), closes [#9253](https://github.com/angular/material/issues/9253)\n* **select:** Ensure `md-no-asterisk` attribute works. ([#9347](https://github.com/angular/material/issues/9347)) ([f265a0e](https://github.com/angular/material/commit/f265a0e)), closes [#9339](https://github.com/angular/material/issues/9339)\n* **tabs:** ie10 MutationObserver issue ([#9397](https://github.com/angular/material/issues/9397)) ([bd70022](https://github.com/angular/material/commit/bd70022))\n* **tabs:** scroll blocks in pagination (related to [#5439](https://github.com/angular/material/issues/5439)) ([#9457](https://github.com/angular/material/issues/9457)) ([b26c01c](https://github.com/angular/material/commit/b26c01c))\n* **textarea:** resize handle position occasionally wrong ([#9155](https://github.com/angular/material/issues/9155)) ([3fc1004](https://github.com/angular/material/commit/3fc1004)), closes [#9151](https://github.com/angular/material/issues/9151)\n* **theming:** fix read-only .configuration() ([#9389](https://github.com/angular/material/issues/9389)) ([b328882](https://github.com/angular/material/commit/b328882))\n* **virtual-repeat:** not re-rendering when switching to a smaller list ([#9363](https://github.com/angular/material/issues/9363)) ([fce551d](https://github.com/angular/material/commit/fce551d)), closes [#9315](https://github.com/angular/material/issues/9315)\n\n\n#### Contributors\n\nThanks to the great contributors who helped with this v1.1.1 patch release:\n\n[<img alt=\"akaij\" src=\"https://avatars.githubusercontent.com/u/5215129?v=3&s=117\" width=\"117\">](https://github.com/akaij) |[<img alt=\"bradrich\" src=\"https://avatars.githubusercontent.com/u/3429878?v=3&s=117\" width=\"117\">](https://github.com/bradrich) |[<img alt=\"clshortfuse\" src=\"https://avatars.githubusercontent.com/u/9271155?v=3&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"crisbeto\" src=\"https://avatars.githubusercontent.com/u/4450522?v=3&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"DevVersion\" src=\"https://avatars.githubusercontent.com/u/4987015?v=3&s=117\" width=\"117\">](https://github.com/DevVersion) |[<img alt=\"EladBezalel\" src=\"https://avatars.githubusercontent.com/u/6004537?v=3&s=117\" width=\"117\">](https://github.com/EladBezalel) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[akaij](https://github.com/akaij) |[bradrich](https://github.com/bradrich) |[clshortfuse](https://github.com/clshortfuse) |[crisbeto](https://github.com/crisbeto) |[DevVersion](https://github.com/DevVersion) |[EladBezalel](https://github.com/EladBezalel) |\n\n[<img alt=\"enne30\" src=\"https://avatars.githubusercontent.com/u/9323005?v=3&s=117\" width=\"117\">](https://github.com/enne30) |[<img alt=\"hansl\" src=\"https://avatars.githubusercontent.com/u/681969?v=3&s=117\" width=\"117\">](https://github.com/hansl) |[<img alt=\"j3ski\" src=\"https://avatars.githubusercontent.com/u/7190937?v=3&s=117\" width=\"117\">](https://github.com/j3ski) |[<img alt=\"jelbourn\" src=\"https://avatars.githubusercontent.com/u/838736?v=3&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"leibale\" src=\"https://avatars.githubusercontent.com/u/7086055?v=3&s=117\" width=\"117\">](https://github.com/leibale) |[<img alt=\"norkunas\" src=\"https://avatars.githubusercontent.com/u/2722872?v=3&s=117\" width=\"117\">](https://github.com/norkunas) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[enne30](https://github.com/enne30) |[hansl](https://github.com/hansl) |[j3ski](https://github.com/j3ski) |[jelbourn](https://github.com/jelbourn) |[leibale](https://github.com/leibale) |[norkunas](https://github.com/norkunas) |\n\n[<img alt=\"ThomasBurleson\" src=\"https://avatars.githubusercontent.com/u/210413?v=3&s=117\" width=\"117\">](https://github.com/ThomasBurleson) |[<img alt=\"topherfangio\" src=\"https://avatars.githubusercontent.com/u/54370?v=3&s=117\" width=\"117\">](https://github.com/topherfangio) |\n:---: |:---: |\n[ThomasBurleson](https://github.com/ThomasBurleson) |[topherfangio](https://github.com/topherfangio) |\n\n\n\n\n<a name\"1.1.0\"></a>\n## 1.1.0 (2016-08-14)\n\nBREAKING CHANGE\n\nThe `<md-select>`'s, `<md-option>` component now acts more like\nthe default `<option>` attribute of a standard HTML `<select>` by\ntreating empty `value` and `ng-value` attributes as a special\n\"reset\" case that allows the input to return to the default state\n(i.e. the floating label returns to the placeholder position).\n\nIf you use the `value` or `ng-value` attributes with no value\nas follows **and** expect it to be a valid option,\n\n```html\n<md-option value=\"\">All options</md-option>\n```\n\nyou will need to update your option to have a value like one\nof the following:\n\n```html\n<md-option value=\"null\">All options</md-option>\n<md-option value=\"undefined\">All options</md-option>\n<md-option ng-value=\"''\">All options</md-option>\n```\n\nFixes #9718.\n\n#### Features\n\n* **aria:** add provider to disable console warnings. ([d63e4d0a](https://github.com/angular/material/commit/d63e4d0a), closes [#3507](https://github.com/angular/material/issues/3507), [#8709](https://github.com/angular/material/issues/8709))\n* **autocomplete:**\n  * expose position dropdown function to controller ([07c488c5](https://github.com/angular/material/commit/07c488c5), closes [#9085](https://github.com/angular/material/issues/9085), [#9180](https://github.com/angular/material/issues/9180))\n  * add md-require-match validator. ([74b62987](https://github.com/angular/material/commit/74b62987), closes [#2492](https://github.com/angular/material/issues/2492), [#8344](https://github.com/angular/material/issues/8344))\n* **card:** add a class for overriding the image stretching ([6e011b9a](https://github.com/angular/material/commit/6e011b9a), closes [#7447](https://github.com/angular/material/issues/7447), [#8183](https://github.com/angular/material/issues/8183))\n* **chips:** add functionality to disable removing. ([4304e884](https://github.com/angular/material/commit/4304e884), closes [#5796](https://github.com/angular/material/issues/5796), [#3820](https://github.com/angular/material/issues/3820), [#5799](https://github.com/angular/material/issues/5799))\n* **datePicker:**\n  * Add a configuration option for the debounce interval. ([7c6b823a](https://github.com/angular/material/commit/7c6b823a), closes [#8905](https://github.com/angular/material/issues/8905), [#8921](https://github.com/angular/material/issues/8921))\n  * add ngFocus and ngBlur support ([aaf682a1](https://github.com/angular/material/commit/aaf682a1), closes [#8779](https://github.com/angular/material/issues/8779), [#9182](https://github.com/angular/material/issues/9182))\n  * add indicator that month headers are clickable ([f61d53ec](https://github.com/angular/material/commit/f61d53ec), closes [#9128](https://github.com/angular/material/issues/9128), [#9142](https://github.com/angular/material/issues/9142))\n  * allow users to specify the default calendar view ([43e6bf19](https://github.com/angular/material/commit/43e6bf19), closes [#9111](https://github.com/angular/material/issues/9111), [#9113](https://github.com/angular/material/issues/9113))\n  * is-open attribute, ability to hide icons, demo layout ([562b76c5](https://github.com/angular/material/commit/562b76c5), closes [#8481](https://github.com/angular/material/issues/8481), [#8743](https://github.com/angular/material/issues/8743))\n  * add support for md-input-container ([4c65fce5](https://github.com/angular/material/commit/4c65fce5), closes [#4233](https://github.com/angular/material/issues/4233), [#8083](https://github.com/angular/material/issues/8083))\n* **icon:** observing `mdFontIcon` and `mdFontSet` attributes ([5c2a06f3](https://github.com/angular/material/commit/5c2a06f3), closes [#4961](https://github.com/angular/material/issues/4961))\n* **layouts:** add @mixin for responsive support for rows ([b6edf552](https://github.com/angular/material/commit/b6edf552), closes [#9112](https://github.com/angular/material/issues/9112), [#9115](https://github.com/angular/material/issues/9115))\n* **list:**\n  * support md-no-focus class ([d04dfc5d](https://github.com/angular/material/commit/d04dfc5d), closes [#8691](https://github.com/angular/material/issues/8691), [#8734](https://github.com/angular/material/issues/8734))\n  * add support for md-menu as proxied element ([5a0836c5](https://github.com/angular/material/commit/5a0836c5), closes [#3339](https://github.com/angular/material/issues/3339), [#6459](https://github.com/angular/material/issues/6459))\n* **panel:** add RTL support ([d127991c](https://github.com/angular/material/commit/d127991c), closes [#8974](https://github.com/angular/material/issues/8974), [#8990](https://github.com/angular/material/issues/8990))\n* **select:** allow support for any font-size dropdown arrow font-size is now forced to 16px m ([554e5a20](https://github.com/angular/material/commit/554e5a20), closes [#8715](https://github.com/angular/material/issues/8715))\n* **sidenav:** added onClose callback ([1f01d264](https://github.com/angular/material/commit/1f01d264), closes [#3179](https://github.com/angular/material/issues/3179), [#5974](https://github.com/angular/material/issues/5974))\n* **textarea:** add the ability to trigger a resize manually ([b9a57aac](https://github.com/angular/material/commit/b9a57aac), closes [#8376](https://github.com/angular/material/issues/8376), [#8657](https://github.com/angular/material/issues/8657))\n* **theme:**\n  * add `md-themes-disabled` directive to disable themes ([d500aad0](https://github.com/angular/material/commit/d500aad0))\n  * register custom theme styles ([a0ca1393](https://github.com/angular/material/commit/a0ca1393), closes [#7708](https://github.com/angular/material/issues/7708), [#7864](https://github.com/angular/material/issues/7864), [#8641](https://github.com/angular/material/issues/8641))\n  * support disabling of themes and layouts globally ([ea43da3](https://github.com/angular/material/commit/ea43da3))\n* **toast:** added toastClass property ([f72c7816](https://github.com/angular/material/commit/f72c7816), closes [#2878](https://github.com/angular/material/issues/2878), [#8951](https://github.com/angular/material/issues/8951))\n* **util:** add the ability to pass in a predicate function ([c03db65c](https://github.com/angular/material/commit/c03db65c), closes [#8644](https://github.com/angular/material/issues/8644))\n\n\n#### Breaking Changes\n\n* `md-no-focus-style` attribute on `md-button` is now a\nclass (`.md-no-focus`)\n\nCloses #8691. Closes #8734 ([d04dfc5d](https://github.com/angular/material/commit/d04dfc5d))\n\n\n#### Bug Fixes\n\n* **build:**\n  * switch to cssnano for CSS optimizations ([9d525e56](https://github.com/angular/material/commit/9d525e56), closes [#9225](https://github.com/angular/material/issues/9225), [#9236](https://github.com/angular/material/issues/9236))\n  * -webkit- prefix for layouts ([9c4165be](https://github.com/angular/material/commit/9c4165be), closes [#8999](https://github.com/angular/material/issues/8999), [#9136](https://github.com/angular/material/issues/9136))\n* **docs:**\n  * prevent docs from polluting the window ([d9bd2660](https://github.com/angular/material/commit/d9bd2660), closes [#9190](https://github.com/angular/material/issues/9190))\n  * toast documentation  punctuation error ([2c14d92b](https://github.com/angular/material/commit/2c14d92b), closes [#8870](https://github.com/angular/material/issues/8870))\n  * codepen should link to correct license link ([9ba1660d](https://github.com/angular/material/commit/9ba1660d), closes [#8846](https://github.com/angular/material/issues/8846))\n  * should use unicode characters to avoid codepen's unescaping ([6a7a1880](https://github.com/angular/material/commit/6a7a1880), closes [#8761](https://github.com/angular/material/issues/8761), [#9314](https://github.com/angular/material/issues/9314))\n\n* refactor rtl-prop mixin to add less CSS ([9a2c47de](https://github.com/angular/material/commit/9a2c47de), closes [#9217](https://github.com/angular/material/issues/9217), [#9218](https://github.com/angular/material/issues/9218))\n* **autocomplete:**\n  * remove unnecessary execution ([776a75ea](https://github.com/angular/material/commit/776a75ea), closes [#9221](https://github.com/angular/material/issues/9221))\n  * fix a couple of js errors and log a warning if the display value isn't a string ([e85a115d](https://github.com/angular/material/commit/e85a115d), closes [#9242](https://github.com/angular/material/issues/9242), [#9251](https://github.com/angular/material/issues/9251))\n  * properly clean autocomplete specs ([3a0f3235](https://github.com/angular/material/commit/3a0f3235), closes [#9195](https://github.com/angular/material/issues/9195))\n  * clear search text if select item cleared. ([dadbcf21](https://github.com/angular/material/commit/dadbcf21), closes [#8788](https://github.com/angular/material/issues/8788), [#9087](https://github.com/angular/material/issues/9087))\n  * clear search text if select item cleared. ([08eecbed](https://github.com/angular/material/commit/08eecbed), closes [#8788](https://github.com/angular/material/issues/8788), [#9068](https://github.com/angular/material/issues/9068))\n  * improve clear and blur behavior on escape ([36f63a21](https://github.com/angular/material/commit/36f63a21), closes [#8917](https://github.com/angular/material/issues/8917), [#8920](https://github.com/angular/material/issues/8920))\n  * check select-on-match with cached results. ([ae5eec48](https://github.com/angular/material/commit/ae5eec48), closes [#8836](https://github.com/angular/material/issues/8836), [#8853](https://github.com/angular/material/issues/8853))\n  * autocompletes input should not clear the view value. ([5d0d4980](https://github.com/angular/material/commit/5d0d4980), closes [#8947](https://github.com/angular/material/issues/8947), [#8977](https://github.com/angular/material/issues/8977))\n  * list reappearing after tabbing away ([4caf2201](https://github.com/angular/material/commit/4caf2201), closes [#8748](https://github.com/angular/material/issues/8748), [#8800](https://github.com/angular/material/issues/8800))\n  * initialize scope variable with empty string ([3f0d686d](https://github.com/angular/material/commit/3f0d686d), closes [#8767](https://github.com/angular/material/issues/8767), [#8802](https://github.com/angular/material/issues/8802))\n* **backdrop:**\n  * re-introduce resize handler, general cleanup ([c4c7c338](https://github.com/angular/material/commit/c4c7c338), closes [#9249](https://github.com/angular/material/issues/9249))\n  * define var in valid scope for all reference sites ([fc536e92](https://github.com/angular/material/commit/fc536e92), closes [#9226](https://github.com/angular/material/issues/9226))\n* **bottomsheet:** gridlist has spacing issue within a list item. ([87aa4cf0](https://github.com/angular/material/commit/87aa4cf0), closes [#8914](https://github.com/angular/material/issues/8914))\n* **build:**\n  * switch to cssnano for CSS optimizations ([9d525e56](https://github.com/angular/material/commit/9d525e56), closes [#9225](https://github.com/angular/material/issues/9225), [#9236](https://github.com/angular/material/issues/9236))\n  * -webkit- prefix for layouts ([9c4165be](https://github.com/angular/material/commit/9c4165be), closes [#8999](https://github.com/angular/material/issues/8999), [#9136](https://github.com/angular/material/issues/9136))\n* **button:** alignment between anchor buttons and normal buttons ([af923e2f](https://github.com/angular/material/commit/af923e2f), closes [#2440](https://github.com/angular/material/issues/2440), [#9183](https://github.com/angular/material/issues/9183))\n* **card:**\n  * Image selector should only select immediate children or images within `md-card-h ([75a86df8](https://github.com/angular/material/commit/75a86df8), closes [#8785](https://github.com/angular/material/issues/8785), [#8786](https://github.com/angular/material/issues/8786))\n  * image stretching on IE ([d3816196](https://github.com/angular/material/commit/d3816196), closes [#8629](https://github.com/angular/material/issues/8629), [#8653](https://github.com/angular/material/issues/8653))\n* **checkbox:**\n  * Undefined ng-checked value now shows as unchecked. ([ebe2a878](https://github.com/angular/material/commit/ebe2a878), closes [#9280](https://github.com/angular/material/issues/9280), [#9281](https://github.com/angular/material/issues/9281))\n  * avoid potential memory leaks, general cleanup ([1a2b1a85](https://github.com/angular/material/commit/1a2b1a85), closes [#7993](https://github.com/angular/material/issues/7993), [#9130](https://github.com/angular/material/issues/9130))\n  * remove border bounce when transitioning checked state ([b7415314](https://github.com/angular/material/commit/b7415314), closes [#8866](https://github.com/angular/material/issues/8866), [#8877](https://github.com/angular/material/issues/8877))\n* **chips:**\n  * fallback to detect cursor position ([0851736b](https://github.com/angular/material/commit/0851736b), closes [#9097](https://github.com/angular/material/issues/9097), [#9116](https://github.com/angular/material/issues/9116))\n  * Fix static chips remove padding. ([5c54632f](https://github.com/angular/material/commit/5c54632f), closes [#8887](https://github.com/angular/material/issues/8887), [#8888](https://github.com/angular/material/issues/8888))\n  * detect cursor position for selecting previous chip. ([1814c12d](https://github.com/angular/material/commit/1814c12d), closes [#8750](https://github.com/angular/material/issues/8750), [#8791](https://github.com/angular/material/issues/8791))\n* **colors:**\n  * used destroy instead of $destroy ([42833aa6](https://github.com/angular/material/commit/42833aa6), closes [#8769](https://github.com/angular/material/issues/8769), [#8769](https://github.com/angular/material/issues/8769))\n  * validate theme is a string ([d6996b70](https://github.com/angular/material/commit/d6996b70), closes [#8720](https://github.com/angular/material/issues/8720), [#8745](https://github.com/angular/material/issues/8745))\n  * added support for empty values ([b09b3175](https://github.com/angular/material/commit/b09b3175), closes [#8122](https://github.com/angular/material/issues/8122), [#8737](https://github.com/angular/material/issues/8737))\n* **content:** Reduce iOS flicker when scrolling. ([4e2722cd](https://github.com/angular/material/commit/4e2722cd), closes [#7078](https://github.com/angular/material/issues/7078), [#8680](https://github.com/angular/material/issues/8680))\n* **css:** ie-only fixes updated ([cb59b088](https://github.com/angular/material/commit/cb59b088), closes [#6304](https://github.com/angular/material/issues/6304))\n* **datepicker:**\n  * add icon-button-margin to style ([361d5413](https://github.com/angular/material/commit/361d5413), closes [#8736](https://github.com/angular/material/issues/8736))\n  * prevent calendar from closing immediately on mobile with md-open-on-focus ([2d8eb6de](https://github.com/angular/material/commit/2d8eb6de), closes [#9170](https://github.com/angular/material/issues/9170), [#9202](https://github.com/angular/material/issues/9202))\n  * calendar opening on window focus with mdOpenOnFocus ([215dce96](https://github.com/angular/material/commit/215dce96), closes [#9186](https://github.com/angular/material/issues/9186))\n  * add asterisk when required, more unit tests ([73a40822](https://github.com/angular/material/commit/73a40822), closes [#8950](https://github.com/angular/material/issues/8950), [#9043](https://github.com/angular/material/issues/9043))\n  * solve refocusing problems ([0356bed2](https://github.com/angular/material/commit/0356bed2), closes [#8960](https://github.com/angular/material/issues/8960), [#9080](https://github.com/angular/material/issues/9080))\n  * align errors relative to the input inside a md-input-container ([45b7db7b](https://github.com/angular/material/commit/45b7db7b), closes [#9057](https://github.com/angular/material/issues/9057), [#9077](https://github.com/angular/material/issues/9077))\n  * respond to external error state changes ([66065dbd](https://github.com/angular/material/commit/66065dbd), closes [#8878](https://github.com/angular/material/issues/8878), [#9048](https://github.com/angular/material/issues/9048))\n  * mark the input as invalid on submit, add missing import ([2a051766](https://github.com/angular/material/commit/2a051766), closes [#8411](https://github.com/angular/material/issues/8411), [#9050](https://github.com/angular/material/issues/9050))\n  * use accent and warn theme colors ([bc44010c](https://github.com/angular/material/commit/bc44010c), closes [#9006](https://github.com/angular/material/issues/9006), [#9056](https://github.com/angular/material/issues/9056))\n  * wrong disabled dates, rendering issues ([1b5f81c5](https://github.com/angular/material/commit/1b5f81c5), closes [#8982](https://github.com/angular/material/issues/8982), [#8886](https://github.com/angular/material/issues/8886), [#8987](https://github.com/angular/material/issues/8987))\n  * use the short days from the locale ([68b71219](https://github.com/angular/material/commit/68b71219), closes [#8816](https://github.com/angular/material/issues/8816), [#8838](https://github.com/angular/material/issues/8838))\n  * simplify the handleBodyClick handler ([bb04bfaa](https://github.com/angular/material/commit/bb04bfaa), closes [#8452](https://github.com/angular/material/issues/8452), [#8804](https://github.com/angular/material/issues/8804))\n  * hidden calendar pane overflowing in IE ([13734c0b](https://github.com/angular/material/commit/13734c0b), closes [#8774](https://github.com/angular/material/issues/8774))\n  * don't override global label size ([e7d8d1d5](https://github.com/angular/material/commit/e7d8d1d5), closes [#8760](https://github.com/angular/material/issues/8760), [#8762](https://github.com/angular/material/issues/8762))\n  * apply theming to the calendar pane ([0fad106c](https://github.com/angular/material/commit/0fad106c), closes [#8690](https://github.com/angular/material/issues/8690), [#8718](https://github.com/angular/material/issues/8718))\n  * fix the docs and reorganize the directory ([31bc95d9](https://github.com/angular/material/commit/31bc95d9), closes [#8722](https://github.com/angular/material/issues/8722), [#8725](https://github.com/angular/material/issues/8725))\n  * icon alignment ([c66c00f9](https://github.com/angular/material/commit/c66c00f9), closes [#8645](https://github.com/angular/material/issues/8645))\n* **dialog:**\n  * register close listeners before animation ([b875dc57](https://github.com/angular/material/commit/b875dc57), closes [#9096](https://github.com/angular/material/issues/9096), [#9120](https://github.com/angular/material/issues/9120))\n  * apply foreground color and automatically detect theme ([e898d228](https://github.com/angular/material/commit/e898d228), closes [#8719](https://github.com/angular/material/issues/8719), [#8723](https://github.com/angular/material/issues/8723))\n* **gestures:** detect touch action and provide polyfill. ([d3cb371d](https://github.com/angular/material/commit/d3cb371d), closes [#7311](https://github.com/angular/material/issues/7311), [#7857](https://github.com/angular/material/issues/7857))\n* **icon:**\n  * remove trustAs calls in favor of implicit trust conditions (#9250) ([2ddeb915](https://github.com/angular/material/commit/2ddeb915))\n  * implicity trust icon urls given during angular config phase ([64bc5b90](https://github.com/angular/material/commit/64bc5b90), closes [#9203](https://github.com/angular/material/issues/9203))\n* **input:**\n  * Add missing Polyfill for ng1.3 and fix tests. ([1eb1037a](https://github.com/angular/material/commit/1eb1037a), closes [#9169](https://github.com/angular/material/issues/9169))\n  * Fix message animation not running. ([fa6213d3](https://github.com/angular/material/commit/fa6213d3), closes [#8635](https://github.com/angular/material/issues/8635), [#8864](https://github.com/angular/material/issues/8864), [#8973](https://github.com/angular/material/issues/8973), [#9044](https://github.com/angular/material/issues/9044))\n  * don't throw for nested controls in input container ([349c49d6](https://github.com/angular/material/commit/349c49d6), closes [#9091](https://github.com/angular/material/issues/9091), [#9101](https://github.com/angular/material/issues/9101))\n  * icons not inheriting theme colors ([1775c722](https://github.com/angular/material/commit/1775c722), closes [#9058](https://github.com/angular/material/issues/9058))\n  * add support for ng-value ([16021b59](https://github.com/angular/material/commit/16021b59), closes [#8670](https://github.com/angular/material/issues/8670), [#8742](https://github.com/angular/material/issues/8742))\n  * duplicate placeholders and data bindings aria-label ([435088c0](https://github.com/angular/material/commit/435088c0), closes [#8251](https://github.com/angular/material/issues/8251), [#8377](https://github.com/angular/material/issues/8377), [#8291](https://github.com/angular/material/issues/8291))\n* **layout:** improve responsive switches from layout column to row ([93e2488a](https://github.com/angular/material/commit/93e2488a), closes [#6528](https://github.com/angular/material/issues/6528), [#7327](https://github.com/angular/material/issues/7327))\n* **list:**\n  * secondary container should not shrink in safari ([f5bb5b07](https://github.com/angular/material/commit/f5bb5b07), closes [#9235](https://github.com/angular/material/issues/9235), [#9238](https://github.com/angular/material/issues/9238))\n  * only fill minimum required height. ([8000c8e0](https://github.com/angular/material/commit/8000c8e0), closes [#8956](https://github.com/angular/material/issues/8956), [#9045](https://github.com/angular/material/issues/9045))\n  * proxy elements should be not triggered by other controls ([97e30d83](https://github.com/angular/material/commit/97e30d83), closes [#7937](https://github.com/angular/material/issues/7937), [#8180](https://github.com/angular/material/issues/8180))\n  * copy ng-show, ng-hide and ng-if to secondary item parent. ([0d238dd3](https://github.com/angular/material/commit/0d238dd3), closes [#8794](https://github.com/angular/material/issues/8794), [#8796](https://github.com/angular/material/issues/8796))\n* **mdAria:** apply aria-label to buttons correctly ([563b232d](https://github.com/angular/material/commit/563b232d), closes [#8789](https://github.com/angular/material/issues/8789), [#8793](https://github.com/angular/material/issues/8793))\n* **navbar:** clear the selected nav-item if it is null ([83b7e663](https://github.com/angular/material/commit/83b7e663), closes [#8703](https://github.com/angular/material/issues/8703))\n* **menu:**\n  * remove padding from menu ([28fe0fa1](https://github.com/angular/material/commit/28fe0fa1), closes [#8196](https://github.com/angular/material/issues/8196), [#9059](https://github.com/angular/material/issues/9059))\n  * clean up the backdrop if the menu got destroyed mid-animation ([145ce63f](https://github.com/angular/material/commit/145ce63f), closes [#8727](https://github.com/angular/material/issues/8727), [#8766](https://github.com/angular/material/issues/8766))\n  * Fix icon/text alignment in Firefox. ([ccae023c](https://github.com/angular/material/commit/ccae023c), closes [#8464](https://github.com/angular/material/issues/8464), [#8675](https://github.com/angular/material/issues/8675))\n* **menu-item:** properly compile when used with ng-repeat ([bfad5e4d](https://github.com/angular/material/commit/bfad5e4d), closes [#8697](https://github.com/angular/material/issues/8697), [#8852](https://github.com/angular/material/issues/8852), [#8850](https://github.com/angular/material/issues/8850))\n* **menuBar:** menuBar should query for uncompiled md-button directives. ([3654d724](https://github.com/angular/material/commit/3654d724), closes [#6802](https://github.com/angular/material/issues/6802), [#8242](https://github.com/angular/material/issues/8242), [#8709](https://github.com/angular/material/issues/8709))\n* **mixins:** removed multilined comment ([431994db](https://github.com/angular/material/commit/431994db), closes [#9002](https://github.com/angular/material/issues/9002))\n* **panel:**\n  * destroy the scope when the panelRef is destroyed ([9ce2862e](https://github.com/angular/material/commit/9ce2862e), closes [#8845](https://github.com/angular/material/issues/8845), [#8848](https://github.com/angular/material/issues/8848))\n  * Propagation, CSS targeting, and dynamic position updating ([4efafcfb](https://github.com/angular/material/commit/4efafcfb), closes [#8968](https://github.com/angular/material/issues/8968), [#8980](https://github.com/angular/material/issues/8980), [#8983](https://github.com/angular/material/issues/8983))\n  * fix error when opening a previously closed panel ([f85ac4bf](https://github.com/angular/material/commit/f85ac4bf), closes [#8894](https://github.com/angular/material/issues/8894), [#8895](https://github.com/angular/material/issues/8895))\n* **progress-circular:** wrapper not expanding layout ([ff100188](https://github.com/angular/material/commit/ff100188), closes [#9031](https://github.com/angular/material/issues/9031), [#9033](https://github.com/angular/material/issues/9033))\n* **progress-linear:** stop the CSS animations when the element is disabled ([f3369ebb](https://github.com/angular/material/commit/f3369ebb), closes [#8764](https://github.com/angular/material/issues/8764), [#8776](https://github.com/angular/material/issues/8776))\n* **radio:** ng-disabled on radio-group should notify child radio buttons. ([9d6e3386](https://github.com/angular/material/commit/9d6e3386), closes [#8939](https://github.com/angular/material/issues/8939), [#8942](https://github.com/angular/material/issues/8942))\n* **release:** version parser is fixed for `rc.#` syntax ([8568ceea](https://github.com/angular/material/commit/8568ceea))\n* **ripple:** fix ripple artifacts in Chrome v51 ([15da974d](https://github.com/angular/material/commit/15da974d), closes [#8824](https://github.com/angular/material/issues/8824))\n* **select:**\n  * Alter dropdown icon to conform to spec. ([9fa6a97a](https://github.com/angular/material/commit/9fa6a97a), closes [#9290](https://github.com/angular/material/issues/9290))\n  * Allow 0 as default value. ([e435e092](https://github.com/angular/material/commit/e435e092), closes [#9232](https://github.com/angular/material/issues/9232), [#9237](https://github.com/angular/material/issues/9237))\n  * handle input from number pad ([11cbe3a2](https://github.com/angular/material/commit/11cbe3a2), closes [#9104](https://github.com/angular/material/issues/9104), [#9106](https://github.com/angular/material/issues/9106))\n  * Failing tests on Angular 1.6 (snapshot). ([d897b830](https://github.com/angular/material/commit/d897b830), closes [#9012](https://github.com/angular/material/issues/9012))\n  * Fix empty option stlying issue. ([fcd42df8](https://github.com/angular/material/commit/fcd42df8), closes [#6851](https://github.com/angular/material/issues/6851), [#8907](https://github.com/angular/material/issues/8907))\n  * ngModel validator should use option hashkeys. ([87584881](https://github.com/angular/material/commit/87584881), closes [#8666](https://github.com/angular/material/issues/8666), [#8763](https://github.com/angular/material/issues/8763))\n  * Fix pristine/dirty error, scope conflict, and many styles. ([024e9798](https://github.com/angular/material/commit/024e9798), closes [#8529](https://github.com/angular/material/issues/8529), [#7988](https://github.com/angular/material/issues/7988), [#8527](https://github.com/angular/material/issues/8527), [#8672](https://github.com/angular/material/issues/8672))\n  * remove checkbox container for label element ([53175ad1](https://github.com/angular/material/commit/53175ad1), closes [#8726](https://github.com/angular/material/issues/8726), [#8729](https://github.com/angular/material/issues/8729))\n  * remove some unnecessary logic ([85785e4e](https://github.com/angular/material/commit/85785e4e), closes [#8735](https://github.com/angular/material/issues/8735))\n  * Disallow keyboard selection of disabled options. ([d5ac3bb8](https://github.com/angular/material/commit/d5ac3bb8), closes [#8626](https://github.com/angular/material/issues/8626), [#8681](https://github.com/angular/material/issues/8681))\n  * don't mutate the form data ([3c7f24d5](https://github.com/angular/material/commit/3c7f24d5), closes [#8581](https://github.com/angular/material/issues/8581), [#8651](https://github.com/angular/material/issues/8651))\n* **showHide:** don't call getComputedStyle on comment node ([f969ae52](https://github.com/angular/material/commit/f969ae52), closes [#9243](https://github.com/angular/material/issues/9243), [#9244](https://github.com/angular/material/issues/9244))\n* **site:** Fix navigation toggle to properly open on page refresh. ([ec2726e0](https://github.com/angular/material/commit/ec2726e0), closes [#8841](https://github.com/angular/material/issues/8841), [#8842](https://github.com/angular/material/issues/8842))\n* **slider-rtl:** added rtl support for slider ([302f9dc3](https://github.com/angular/material/commit/302f9dc3), closes [#7434](https://github.com/angular/material/issues/7434))\n* **subheader:**\n  * do not compile ng-repeat twice. ([09e2eb61](https://github.com/angular/material/commit/09e2eb61), closes [#8647](https://github.com/angular/material/issues/8647), [#9187](https://github.com/angular/material/issues/9187))\n  * fix ng-show/hide directive on subheader ([0315713e](https://github.com/angular/material/commit/0315713e), closes [#8604](https://github.com/angular/material/issues/8604), [#8648](https://github.com/angular/material/issues/8648))\n* **switch:** fix switch drag functionality. ([911ec721](https://github.com/angular/material/commit/911ec721), closes [#4719](https://github.com/angular/material/issues/4719), [#2338](https://github.com/angular/material/issues/2338), [#6715](https://github.com/angular/material/issues/6715))\n* **tabs:** properly detect text changes ([121a39d5](https://github.com/angular/material/commit/121a39d5), closes [#8667](https://github.com/angular/material/issues/8667), [#8803](https://github.com/angular/material/issues/8803))\n* **textarea:**\n  * properly preserve the padding after measuring the line height ([1fe38576](https://github.com/angular/material/commit/1fe38576), closes [#8782](https://github.com/angular/material/issues/8782), [#8790](https://github.com/angular/material/issues/8790))\n  * take scroll distance into account when setting the height ([fbd7d9d3](https://github.com/angular/material/commit/fbd7d9d3), closes [#8632](https://github.com/angular/material/issues/8632), [#8643](https://github.com/angular/material/issues/8643))\n* **theming:** potentially generating invalid CSS ([aea54376](https://github.com/angular/material/commit/aea54376), closes [#8953](https://github.com/angular/material/issues/8953))\n* **toast:** apply theming correctly to custom toasts ([995dc496](https://github.com/angular/material/commit/995dc496), closes [#8777](https://github.com/angular/material/issues/8777), [#8799](https://github.com/angular/material/issues/8799))\n* **toolbar:**\n  * use variables for height. ([9ccf611d](https://github.com/angular/material/commit/9ccf611d), closes [#8941](https://github.com/angular/material/issues/8941), [#8943](https://github.com/angular/material/issues/8943))\n  * transitions applied too soon before css loaded ([1b33a1a8](https://github.com/angular/material/commit/1b33a1a8), closes [#7986](https://github.com/angular/material/issues/7986), [#8738](https://github.com/angular/material/issues/8738))\n* **tooltip:**\n  * prevent element occasionally animating in from the top ([46662d36](https://github.com/angular/material/commit/46662d36), closes [#8818](https://github.com/angular/material/issues/8818), [#9117](https://github.com/angular/material/issues/9117))\n  * properly handle tapping away ([ddc9e8d6](https://github.com/angular/material/commit/ddc9e8d6), closes [#8744](https://github.com/angular/material/issues/8744))\n  * fix regression on touch devices with a mouse ([c8821eb0](https://github.com/angular/material/commit/c8821eb0), closes [#8710](https://github.com/angular/material/issues/8710), [#8730](https://github.com/angular/material/issues/8730))\n  * improve the behavior on touch devices ([15402f85](https://github.com/angular/material/commit/15402f85), closes [#8642](https://github.com/angular/material/issues/8642), [#8700](https://github.com/angular/material/issues/8700))\n* **virtual-repeat:**\n  * add -webkit-overflow-scrolling ([b25eaf0a](https://github.com/angular/material/commit/b25eaf0a), closes [#5322](https://github.com/angular/material/issues/5322), [#9163](https://github.com/angular/material/issues/9163))\n  * preserve scroll offset when the watched array reduces in length ([f9a84d2a](https://github.com/angular/material/commit/f9a84d2a), closes [#8129](https://github.com/angular/material/issues/8129))\n\n\n#### Contributors\n\nThanks to the great contributors who helped with this release (after the rc.5 release):\n\n[<img alt=\"Aaron-Hartwig\" src=\"https://avatars.githubusercontent.com/u/5115774?v=3&s=117\" width=\"117\">](https://github.com/Aaron-Hartwig) |[<img alt=\"AdriVanHoudt\" src=\"https://avatars.githubusercontent.com/u/2361826?v=3&s=117\" width=\"117\">](https://github.com/AdriVanHoudt) |[<img alt=\"areologist\" src=\"https://avatars.githubusercontent.com/u/4918688?v=3&s=117\" width=\"117\">](https://github.com/areologist) |[<img alt=\"barryvdh\" src=\"https://avatars.githubusercontent.com/u/973269?v=3&s=117\" width=\"117\">](https://github.com/barryvdh) |[<img alt=\"bradrich\" src=\"https://avatars.githubusercontent.com/u/3429878?v=3&s=117\" width=\"117\">](https://github.com/bradrich) |[<img alt=\"chrisguerrero\" src=\"https://avatars.githubusercontent.com/u/3720304?v=3&s=117\" width=\"117\">](https://github.com/chrisguerrero) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[Aaron-Hartwig](https://github.com/Aaron-Hartwig) |[AdriVanHoudt](https://github.com/AdriVanHoudt) |[areologist](https://github.com/areologist) |[barryvdh](https://github.com/barryvdh) |[bradrich](https://github.com/bradrich) |[chrisguerrero](https://github.com/chrisguerrero) |\n\n[<img alt=\"clshortfuse\" src=\"https://avatars.githubusercontent.com/u/9271155?v=3&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"crisbeto\" src=\"https://avatars.githubusercontent.com/u/4450522?v=3&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"cyx8808\" src=\"https://avatars.githubusercontent.com/u/9927197?v=3&s=117\" width=\"117\">](https://github.com/cyx8808) |[<img alt=\"danjarvis\" src=\"https://avatars.githubusercontent.com/u/116640?v=3&s=117\" width=\"117\">](https://github.com/danjarvis) |[<img alt=\"david-gang\" src=\"https://avatars.githubusercontent.com/u/1292882?v=3&s=117\" width=\"117\">](https://github.com/david-gang) |[<img alt=\"davidenke\" src=\"https://avatars.githubusercontent.com/u/275960?v=3&s=117\" width=\"117\">](https://github.com/davidenke) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[clshortfuse](https://github.com/clshortfuse) |[crisbeto](https://github.com/crisbeto) |[cyx8808](https://github.com/cyx8808) |[danjarvis](https://github.com/danjarvis) |[david-gang](https://github.com/david-gang) |[davidenke](https://github.com/davidenke) |\n\n[<img alt=\"DavidFrahm\" src=\"https://avatars.githubusercontent.com/u/889791?v=3&s=117\" width=\"117\">](https://github.com/DavidFrahm) |[<img alt=\"DevVersion\" src=\"https://avatars.githubusercontent.com/u/4987015?v=3&s=117\" width=\"117\">](https://github.com/DevVersion) |[<img alt=\"dirkharbinson\" src=\"https://avatars.githubusercontent.com/u/6855986?v=3&s=117\" width=\"117\">](https://github.com/dirkharbinson) |[<img alt=\"EladBezalel\" src=\"https://avatars.githubusercontent.com/u/6004537?v=3&s=117\" width=\"117\">](https://github.com/EladBezalel) |[<img alt=\"epelc\" src=\"https://avatars.githubusercontent.com/u/5204642?v=3&s=117\" width=\"117\">](https://github.com/epelc) |[<img alt=\"fhernandezn\" src=\"https://avatars.githubusercontent.com/u/12898908?v=3&s=117\" width=\"117\">](https://github.com/fhernandezn) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[DavidFrahm](https://github.com/DavidFrahm) |[DevVersion](https://github.com/DevVersion) |[dirkharbinson](https://github.com/dirkharbinson) |[EladBezalel](https://github.com/EladBezalel) |[epelc](https://github.com/epelc) |[fhernandezn](https://github.com/fhernandezn) |\n\n[<img alt=\"IPRIT\" src=\"https://avatars.githubusercontent.com/u/1553519?v=3&s=117\" width=\"117\">](https://github.com/IPRIT) |[<img alt=\"isaaclyman\" src=\"https://avatars.githubusercontent.com/u/9139369?v=3&s=117\" width=\"117\">](https://github.com/isaaclyman) |[<img alt=\"ivoviz\" src=\"https://avatars.githubusercontent.com/u/1143746?v=3&s=117\" width=\"117\">](https://github.com/ivoviz) |[<img alt=\"jelbourn\" src=\"https://avatars.githubusercontent.com/u/838736?v=3&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"jsr6720\" src=\"https://avatars.githubusercontent.com/u/502432?v=3&s=117\" width=\"117\">](https://github.com/jsr6720) |[<img alt=\"keenondrums\" src=\"https://avatars.githubusercontent.com/u/12794628?v=3&s=117\" width=\"117\">](https://github.com/keenondrums) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[IPRIT](https://github.com/IPRIT) |[isaaclyman](https://github.com/isaaclyman) |[ivoviz](https://github.com/ivoviz) |[jelbourn](https://github.com/jelbourn) |[jsr6720](https://github.com/jsr6720) |[keenondrums](https://github.com/keenondrums) |\n\n[<img alt=\"marcysutton\" src=\"https://avatars.githubusercontent.com/u/1045233?v=3&s=117\" width=\"117\">](https://github.com/marcysutton) |[<img alt=\"martineckardt\" src=\"https://avatars.githubusercontent.com/u/10773395?v=3&s=117\" width=\"117\">](https://github.com/martineckardt) |[<img alt=\"MattCatz\" src=\"https://avatars.githubusercontent.com/u/14895427?v=3&s=117\" width=\"117\">](https://github.com/MattCatz) |[<img alt=\"mkowalchuk\" src=\"https://avatars.githubusercontent.com/u/1266924?v=3&s=117\" width=\"117\">](https://github.com/mkowalchuk) |[<img alt=\"Nickproger\" src=\"https://avatars.githubusercontent.com/u/1409078?v=3&s=117\" width=\"117\">](https://github.com/Nickproger) |[<img alt=\"ofirmgr\" src=\"https://avatars.githubusercontent.com/u/9841636?v=3&s=117\" width=\"117\">](https://github.com/ofirmgr) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[marcysutton](https://github.com/marcysutton) |[martineckardt](https://github.com/martineckardt) |[MattCatz](https://github.com/MattCatz) |[mkowalchuk](https://github.com/mkowalchuk) |[Nickproger](https://github.com/Nickproger) |[ofirmgr](https://github.com/ofirmgr) |\n\n[<img alt=\"oliversalzburg\" src=\"https://avatars.githubusercontent.com/u/1658949?v=3&s=117\" width=\"117\">](https://github.com/oliversalzburg) |[<img alt=\"robertmesserle\" src=\"https://avatars.githubusercontent.com/u/571363?v=3&s=117\" width=\"117\">](https://github.com/robertmesserle) |[<img alt=\"soul-wish\" src=\"https://avatars.githubusercontent.com/u/1968098?v=3&s=117\" width=\"117\">](https://github.com/soul-wish) |[<img alt=\"SpikesCafe-google\" src=\"https://avatars.githubusercontent.com/u/16656302?v=3&s=117\" width=\"117\">](https://github.com/SpikesCafe-google) |[<img alt=\"ThomasBurleson\" src=\"https://avatars.githubusercontent.com/u/210413?v=3&s=117\" width=\"117\">](https://github.com/ThomasBurleson) |[<img alt=\"timlevett\" src=\"https://avatars.githubusercontent.com/u/3534544?v=3&s=117\" width=\"117\">](https://github.com/timlevett) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[oliversalzburg](https://github.com/oliversalzburg) |[robertmesserle](https://github.com/robertmesserle) |[soul-wish](https://github.com/soul-wish) |[SpikesCafe-google](https://github.com/SpikesCafe-google) |[ThomasBurleson](https://github.com/ThomasBurleson) |[timlevett](https://github.com/timlevett) |\n\n[<img alt=\"topherfangio\" src=\"https://avatars.githubusercontent.com/u/54370?v=3&s=117\" width=\"117\">](https://github.com/topherfangio) |[<img alt=\"x87\" src=\"https://avatars.githubusercontent.com/u/5698288?v=3&s=117\" width=\"117\">](https://github.com/x87) |\n:---: |:---: |\n[topherfangio](https://github.com/topherfangio) |[x87](https://github.com/x87) |\n\n\n\n\n\n\n<a name\"1.1.0-rc.5\"></a>\n### 1.1.0-rc.5 (2016-06-03)\n\nWith this release we have merged many of the pending Pull requests and added some notable changes:\n\n*  added new `md-nav-bar` and `md-panel` components\n*  enhanced the performance of the `md-tabs` component\n*  added many improvements to dialog, datepicker\n*  added shrinking and resizing features to the md-input textarea component\n*  improved security safeguards using $templateRequest instead of $http\n\n![panel-animations](https://cloud.githubusercontent.com/assets/210413/15787710/5d7d8fb4-2989-11e6-8392-04f3f6626668.png)\n\n\n#### Contributors\n\nThanks to the great contributors who helped with this release:\n\n[<img alt=\"247GradLabs\" src=\"https://avatars.githubusercontent.com/u/19302650?v=3&s=117\" width=\"117\">](https://github.com/247GradLabs) |[<img alt=\"AaronBuxbaum\" src=\"https://avatars.githubusercontent.com/u/5578581?v=3&s=117\" width=\"117\">](https://github.com/AaronBuxbaum) |[<img alt=\"andresgottlieb\" src=\"https://avatars.githubusercontent.com/u/1126905?v=3&s=117\" width=\"117\">](https://github.com/andresgottlieb) |[<img alt=\"aortyl\" src=\"https://avatars.githubusercontent.com/u/10928389?v=3&s=117\" width=\"117\">](https://github.com/aortyl) |[<img alt=\"areologist\" src=\"https://avatars.githubusercontent.com/u/4918688?v=3&s=117\" width=\"117\">](https://github.com/areologist) |[<img alt=\"BevanR\" src=\"https://avatars.githubusercontent.com/u/325176?v=3&s=117\" width=\"117\">](https://github.com/BevanR) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[247GradLabs](https://github.com/247GradLabs) |[AaronBuxbaum](https://github.com/AaronBuxbaum) |[andresgottlieb](https://github.com/andresgottlieb) |[aortyl](https://github.com/aortyl) |[areologist](https://github.com/areologist) |[BevanR](https://github.com/BevanR) |\n\n[<img alt=\"bvahdat\" src=\"https://avatars.githubusercontent.com/u/3122177?v=3&s=117\" width=\"117\">](https://github.com/bvahdat) |[<img alt=\"chrisconover\" src=\"https://avatars.githubusercontent.com/u/694311?v=3&s=117\" width=\"117\">](https://github.com/chrisconover) |[<img alt=\"code-tree\" src=\"https://avatars.githubusercontent.com/u/11289719?v=3&s=117\" width=\"117\">](https://github.com/code-tree) |[<img alt=\"crisbeto\" src=\"https://avatars.githubusercontent.com/u/4450522?v=3&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"daniel-nagy\" src=\"https://avatars.githubusercontent.com/u/1622446?v=3&s=117\" width=\"117\">](https://github.com/daniel-nagy) |[<img alt=\"david-gang\" src=\"https://avatars.githubusercontent.com/u/1292882?v=3&s=117\" width=\"117\">](https://github.com/david-gang) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[bvahdat](https://github.com/bvahdat) |[chrisconover](https://github.com/chrisconover) |[code-tree](https://github.com/code-tree) |[crisbeto](https://github.com/crisbeto) |[daniel-nagy](https://github.com/daniel-nagy) |[david-gang](https://github.com/david-gang) |\n\n[<img alt=\"davidenke\" src=\"https://avatars.githubusercontent.com/u/275960?v=3&s=117\" width=\"117\">](https://github.com/davidenke) |[<img alt=\"DerekLouie\" src=\"https://avatars.githubusercontent.com/u/709204?v=3&s=117\" width=\"117\">](https://github.com/DerekLouie) |[<img alt=\"DevVersion\" src=\"https://avatars.githubusercontent.com/u/4987015?v=3&s=117\" width=\"117\">](https://github.com/DevVersion) |[<img alt=\"EladBezalel\" src=\"https://avatars.githubusercontent.com/u/6004537?v=3&s=117\" width=\"117\">](https://github.com/EladBezalel) |[<img alt=\"Emeegeemee\" src=\"https://avatars.githubusercontent.com/u/4241156?v=3&s=117\" width=\"117\">](https://github.com/Emeegeemee) |[<img alt=\"epelc\" src=\"https://avatars.githubusercontent.com/u/5204642?v=3&s=117\" width=\"117\">](https://github.com/epelc) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[davidenke](https://github.com/davidenke) |[DerekLouie](https://github.com/DerekLouie) |[DevVersion](https://github.com/DevVersion) |[EladBezalel](https://github.com/EladBezalel) |[Emeegeemee](https://github.com/Emeegeemee) |[epelc](https://github.com/epelc) |\n\n[<img alt=\"ErinCoughlan\" src=\"https://avatars.githubusercontent.com/u/2660421?v=3&s=117\" width=\"117\">](https://github.com/ErinCoughlan) |[<img alt=\"gkalpak\" src=\"https://avatars.githubusercontent.com/u/8604205?v=3&s=117\" width=\"117\">](https://github.com/gkalpak) |[<img alt=\"gmoothart\" src=\"https://avatars.githubusercontent.com/u/3227?v=3&s=117\" width=\"117\">](https://github.com/gmoothart) |[<img alt=\"ivoviz\" src=\"https://avatars.githubusercontent.com/u/1143746?v=3&s=117\" width=\"117\">](https://github.com/ivoviz) |[<img alt=\"jelbourn\" src=\"https://avatars.githubusercontent.com/u/838736?v=3&s=117\" width=\"117\">](https://github.com/jelbourn) |[<img alt=\"julienmartin\" src=\"https://avatars.githubusercontent.com/u/1759785?v=3&s=117\" width=\"117\">](https://github.com/julienmartin) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[ErinCoughlan](https://github.com/ErinCoughlan) |[gkalpak](https://github.com/gkalpak) |[gmoothart](https://github.com/gmoothart) |[ivoviz](https://github.com/ivoviz) |[jelbourn](https://github.com/jelbourn) |[julienmartin](https://github.com/julienmartin) |\n\n[<img alt=\"KarenParker\" src=\"https://avatars.githubusercontent.com/u/16341592?v=3&s=117\" width=\"117\">](https://github.com/KarenParker) |[<img alt=\"mgilson\" src=\"https://avatars.githubusercontent.com/u/5216702?v=3&s=117\" width=\"117\">](https://github.com/mgilson) |[<img alt=\"neko1235\" src=\"https://avatars.githubusercontent.com/u/13606126?v=3&s=117\" width=\"117\">](https://github.com/neko1235) |[<img alt=\"Nickproger\" src=\"https://avatars.githubusercontent.com/u/1409078?v=3&s=117\" width=\"117\">](https://github.com/Nickproger) |[<img alt=\"petebacondarwin\" src=\"https://avatars.githubusercontent.com/u/15655?v=3&s=117\" width=\"117\">](https://github.com/petebacondarwin) |[<img alt=\"programmist\" src=\"https://avatars.githubusercontent.com/u/527082?v=3&s=117\" width=\"117\">](https://github.com/programmist) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[KarenParker](https://github.com/KarenParker) |[mgilson](https://github.com/mgilson) |[neko1235](https://github.com/neko1235) |[Nickproger](https://github.com/Nickproger) |[petebacondarwin](https://github.com/petebacondarwin) |[programmist](https://github.com/programmist) |\n\n[<img alt=\"robertmesserle\" src=\"https://avatars.githubusercontent.com/u/571363?v=3&s=117\" width=\"117\">](https://github.com/robertmesserle) |[<img alt=\"solojavier\" src=\"https://avatars.githubusercontent.com/u/1088010?v=3&s=117\" width=\"117\">](https://github.com/solojavier) |[<img alt=\"soooooot\" src=\"https://avatars.githubusercontent.com/u/1481589?v=3&s=117\" width=\"117\">](https://github.com/soooooot) |[<img alt=\"Splaktar\" src=\"https://avatars.githubusercontent.com/u/3506071?v=3&s=117\" width=\"117\">](https://github.com/Splaktar) |[<img alt=\"StefanFeederle\" src=\"https://avatars.githubusercontent.com/u/11903965?v=3&s=117\" width=\"117\">](https://github.com/StefanFeederle) |[<img alt=\"ThomasBurleson\" src=\"https://avatars.githubusercontent.com/u/210413?v=3&s=117\" width=\"117\">](https://github.com/ThomasBurleson) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[robertmesserle](https://github.com/robertmesserle) |[solojavier](https://github.com/solojavier) |[soooooot](https://github.com/soooooot) |[Splaktar](https://github.com/Splaktar) |[StefanFeederle](https://github.com/StefanFeederle) |[ThomasBurleson](https://github.com/ThomasBurleson) |\n\n[<img alt=\"tirana\" src=\"https://avatars.githubusercontent.com/u/5245919?v=3&s=117\" width=\"117\">](https://github.com/tirana) |[<img alt=\"topherfangio\" src=\"https://avatars.githubusercontent.com/u/54370?v=3&s=117\" width=\"117\">](https://github.com/topherfangio) |[<img alt=\"voyti\" src=\"https://avatars.githubusercontent.com/u/6819634?v=3&s=117\" width=\"117\">](https://github.com/voyti) |\n:---: |:---: |:---: |\n[tirana](https://github.com/tirana) |[topherfangio](https://github.com/topherfangio) |[voyti](https://github.com/voyti) |\n\n#### Features\n\n* **colors:**\n  * mdTheme integration ([077769b2](https://github.com/angular/material/commit/077769b2), closes [#8407](https://github.com/angular/material/issues/8407), [#8507](https://github.com/angular/material/issues/8507))\n  * support hue-x on primary/accent/warn/background palettes ([d62bb5e1](https://github.com/angular/material/commit/d62bb5e1), closes [#8175](https://github.com/angular/material/issues/8175), [#8257](https://github.com/angular/material/issues/8257))\n* **datepicker:**\n  * year view, open on focus, bug fixes ([5615d06f](https://github.com/angular/material/commit/5615d06f), closes [#4251](https://github.com/angular/material/issues/4251), [#4650](https://github.com/angular/material/issues/4650), [#8547](https://github.com/angular/material/issues/8547), [#8030](https://github.com/angular/material/issues/8030), [#8557](https://github.com/angular/material/issues/8557), [#8472](https://github.com/angular/material/issues/8472))\n  * add a year view ([cfc33a60](https://github.com/angular/material/commit/cfc33a60), closes [#4251](https://github.com/angular/material/issues/4251), [#8472](https://github.com/angular/material/issues/8472))\n* **demos:** add global classes support ([b639ce21](https://github.com/angular/material/commit/b639ce21), closes [#8400](https://github.com/angular/material/issues/8400), [#8406](https://github.com/angular/material/issues/8406))\n* **dialog:**\n  * add initial value option to prompt preset. ([b49ebcf5](https://github.com/angular/material/commit/b49ebcf5), closes [#7046](https://github.com/angular/material/issues/7046), [#7090](https://github.com/angular/material/issues/7090))\n  * allow to specify a content element ([135cb3a2](https://github.com/angular/material/commit/135cb3a2), closes [#7566](https://github.com/angular/material/issues/7566), [#8491](https://github.com/angular/material/issues/8491))\n* **list:** add support for ng-dblclick. ([a9bca2bb](https://github.com/angular/material/commit/a9bca2bb), closes [#8303](https://github.com/angular/material/issues/8303), [#8306](https://github.com/angular/material/issues/8306))\n* **menu:** add support for md-autofocus attribute ([10e47120](https://github.com/angular/material/commit/10e47120), closes [#7868](https://github.com/angular/material/issues/7868), [#8469](https://github.com/angular/material/issues/8469))\n* **navbar:** add new md-nav-bar component. ([0e2e60fd](https://github.com/angular/material/commit/0e2e60fd), closes [#7781](https://github.com/angular/material/issues/7781))\n* **panel:**\n  * Update the panel position on scroll. ([18aa360e](https://github.com/angular/material/commit/18aa360e))\n  * animation hook and origin focus config ([0d2e4890](https://github.com/angular/material/commit/0d2e4890))\n  * Clean up promises ([16f4aeed](https://github.com/angular/material/commit/16f4aeed))\n  * Allows centering to be used with animation transforms. ([67ccfc54](https://github.com/angular/material/commit/67ccfc54))\n  * Add hasBackdrop config to the panel. ([0c4ad174](https://github.com/angular/material/commit/0c4ad174))\n  * Inject mdPanelRef when instantiating the panel controller. ([49c96c14](https://github.com/angular/material/commit/49c96c14))\n  * Add default animations and withAnimation API method. ([4ec5cebd](https://github.com/angular/material/commit/4ec5cebd))\n  * initial implementation. ([c481d5b1](https://github.com/angular/material/commit/c481d5b1))\n* **prefixer:** add service to prefix attributes ([b3e401a7](https://github.com/angular/material/commit/b3e401a7), closes [#3258](https://github.com/angular/material/issues/3258), [#8080](https://github.com/angular/material/issues/8080), [#8121](https://github.com/angular/material/issues/8121), [#8163](https://github.com/angular/material/issues/8163))\n* **ripple:** add the ability to disable ripples globally ([86bb3f75](https://github.com/angular/material/commit/86bb3f75), closes [#5669](https://github.com/angular/material/issues/5669), [#8191](https://github.com/angular/material/issues/8191))\n* **select:** support asterisk on floating labels. ([d9784584](https://github.com/angular/material/commit/d9784584), closes [#7928](https://github.com/angular/material/issues/7928), [#8348](https://github.com/angular/material/issues/8348))\n* **slider:** md-invert ([e85e1b95](https://github.com/angular/material/commit/e85e1b95), closes [#7666](https://github.com/angular/material/issues/7666), [#7667](https://github.com/angular/material/issues/7667))\n* **textarea:** support shrinking and resizing ([ce076517](https://github.com/angular/material/commit/ce076517), closes [#7649](https://github.com/angular/material/issues/7649), [#5919](https://github.com/angular/material/issues/5919), [#8135](https://github.com/angular/material/issues/8135), [#7991](https://github.com/angular/material/issues/7991))\n* **toast:** add dynamic `start` and `end` positions. ([7f776a14](https://github.com/angular/material/commit/7f776a14), closes [#7263](https://github.com/angular/material/issues/7263), [#7318](https://github.com/angular/material/issues/7318))\n\n\n#### Bug Fixes\n\n* **$mdIcon:** prevent \"Possibly unhandled rejection\" errors ([1fc80ce1](https://github.com/angular/material/commit/1fc80ce1), closes [#8468](https://github.com/angular/material/issues/8468))\n* **all:** Use $templateRequest instead of $http for security. ([0397e298](https://github.com/angular/material/commit/0397e298), closes [#8413](https://github.com/angular/material/issues/8413), [#8423](https://github.com/angular/material/issues/8423))\n* **autocomplete:**\n  * always hide the progressbar when clearing the input ([3b3fc39b](https://github.com/angular/material/commit/3b3fc39b), closes [#8301](https://github.com/angular/material/issues/8301), [#8195](https://github.com/angular/material/issues/8195), [#8341](https://github.com/angular/material/issues/8341))\n  * Fix autocomplete items with spaces. ([2fa2e4d5](https://github.com/angular/material/commit/2fa2e4d5), closes [#7655](https://github.com/angular/material/issues/7655), [#8178](https://github.com/angular/material/issues/8178), [#8580](https://github.com/angular/material/issues/8580))\n  * disable scroll events for autocomplete wrap layer ([8c79f32a](https://github.com/angular/material/commit/8c79f32a), closes [#6585](https://github.com/angular/material/issues/6585), [#5230](https://github.com/angular/material/issues/5230), [#5890](https://github.com/angular/material/issues/5890), [#6589](https://github.com/angular/material/issues/6589))\n* **backdrop:** adjust the backdrop height when the viewport resizes ([918e335e](https://github.com/angular/material/commit/918e335e), closes [#8155](https://github.com/angular/material/issues/8155), [#8285](https://github.com/angular/material/issues/8285))\n* **build:**\n  * fix a warning when running local server ([b09dcbb0](https://github.com/angular/material/commit/b09dcbb0), closes [#8463](https://github.com/angular/material/issues/8463))\n  * Fix failing tests with Angular 1.6. ([2b0e0fd9](https://github.com/angular/material/commit/2b0e0fd9), closes [#8404](https://github.com/angular/material/issues/8404))\n  * remove use of template strings in build-contributors ([93921f8e](https://github.com/angular/material/commit/93921f8e))\n* **checkbox:**\n  * md-checkbox documentation update & indeterminate color fix. ([65151504](https://github.com/angular/material/commit/65151504), closes [#8513](https://github.com/angular/material/issues/8513))\n  * initial value not being marked properly ([63e1c8e6](https://github.com/angular/material/commit/63e1c8e6), closes [#8343](https://github.com/angular/material/issues/8343), [#8511](https://github.com/angular/material/issues/8511))\n* **chips:**\n  * safety check before getting length ([4c47b27e](https://github.com/angular/material/commit/4c47b27e), closes [#6175](https://github.com/angular/material/issues/6175))\n  * chipsCtrl.resetChip() should be called synchronously ([7c6ff365](https://github.com/angular/material/commit/7c6ff365))\n* **colors:** parsed watched expression ([e9a1d4f4](https://github.com/angular/material/commit/e9a1d4f4), closes [#8212](https://github.com/angular/material/issues/8212), [#8235](https://github.com/angular/material/issues/8235))\n* **constants:** prefixes for properties should be correct. ([6aa9e08e](https://github.com/angular/material/commit/6aa9e08e), closes [#8186](https://github.com/angular/material/issues/8186), [#8187](https://github.com/angular/material/issues/8187))\n* **datepicker:**\n  * prevent scrolling within a dialog ([6e38d7c4](https://github.com/angular/material/commit/6e38d7c4), closes [#8177](https://github.com/angular/material/issues/8177), [#8292](https://github.com/angular/material/issues/8292))\n  * align input border colors with inputs. ([e5dcbab9](https://github.com/angular/material/commit/e5dcbab9), closes [#8148](https://github.com/angular/material/issues/8148), [#8375](https://github.com/angular/material/issues/8375))\n  * don't use the locale in the default formatting function ([00f09f4e](https://github.com/angular/material/commit/00f09f4e), closes [#7456](https://github.com/angular/material/issues/7456), [#7404](https://github.com/angular/material/issues/7404), [#8275](https://github.com/angular/material/issues/8275), [#8162](https://github.com/angular/material/issues/8162))\n  * disabled dates blending in with background on a dark theme ([ab1d7253](https://github.com/angular/material/commit/ab1d7253), closes [#8550](https://github.com/angular/material/issues/8550), [#8627](https://github.com/angular/material/issues/8627))\n  * occasionally failing test ([92e932c3](https://github.com/angular/material/commit/92e932c3), closes [#8596](https://github.com/angular/material/issues/8596))\n  * unit tests in safari ([e588df9a](https://github.com/angular/material/commit/e588df9a), closes [#8551](https://github.com/angular/material/issues/8551))\n* **dialog:**\n  * backdrop being clipped ([f9738f5b](https://github.com/angular/material/commit/f9738f5b), closes [#8602](https://github.com/angular/material/issues/8602), [#8611](https://github.com/angular/material/issues/8611))\n  * remove whitespace from \"custom\" dialog demo ([55041ce4](https://github.com/angular/material/commit/55041ce4), closes [#8271](https://github.com/angular/material/issues/8271))\n  * don't clobber md-dialog id ([f0e6de99](https://github.com/angular/material/commit/f0e6de99))\n* **fabToolbar:** change of pointerEvents from initial to inherit ([562d7c17](https://github.com/angular/material/commit/562d7c17), closes [#7012](https://github.com/angular/material/issues/7012), [#8082](https://github.com/angular/material/issues/8082))\n* **highlight-flags:** make ^/$ work properly ([45278ec0](https://github.com/angular/material/commit/45278ec0), closes [#8096](https://github.com/angular/material/issues/8096), [#8120](https://github.com/angular/material/issues/8120))\n* **icon:**\n  * fix icon vertical alignment within md-button. ([bc2fac05](https://github.com/angular/material/commit/bc2fac05), closes [#8066](https://github.com/angular/material/issues/8066), [#8194](https://github.com/angular/material/issues/8194))\n  * Use data URLS instead of $templateCache ([9ce4f9ec](https://github.com/angular/material/commit/9ce4f9ec), closes [#6531](https://github.com/angular/material/issues/6531), [#7741](https://github.com/angular/material/issues/7741))\n  * static svg urls are trustable (#8484) ([05a3a0f9](https://github.com/angular/material/commit/05a3a0f9))\n* **input:**\n  * number input width in webkit ([c6c5d48c](https://github.com/angular/material/commit/c6c5d48c), closes [#7349](https://github.com/angular/material/issues/7349), [#7761](https://github.com/angular/material/issues/7761))\n  * prevent the floating label from overflowing ([437f764a](https://github.com/angular/material/commit/437f764a), closes [#7403](https://github.com/angular/material/issues/7403), [#8116](https://github.com/angular/material/issues/8116))\n  * add support for dynamically loaded ngMessage directives. ([06e7e992](https://github.com/angular/material/commit/06e7e992), closes [#7477](https://github.com/angular/material/issues/7477), [#7596](https://github.com/angular/material/issues/7596), [#6810](https://github.com/angular/material/issues/6810), [#7823](https://github.com/angular/material/issues/7823), [#8387](https://github.com/angular/material/issues/8387))\n* **interimElement:**\n  * prevent unhandled rejection error in $exceptionHandler. ([112a3e40](https://github.com/angular/material/commit/112a3e40), closes [#8622](https://github.com/angular/material/issues/8622))\n  * show method should cancel existing interim element ([8bf174b5](https://github.com/angular/material/commit/8bf174b5), closes [#8600](https://github.com/angular/material/issues/8600))\n* **layout:** IE10-IE11 column-flex bug fix ([ce0ebbfc](https://github.com/angular/material/commit/ce0ebbfc), closes [#8161](https://github.com/angular/material/issues/8161))\n* **list:** remove secondary container flex filler. ([621cc952](https://github.com/angular/material/commit/621cc952), closes [#8094](https://github.com/angular/material/issues/8094), [#7976](https://github.com/angular/material/issues/7976), [#8075](https://github.com/angular/material/issues/8075))\n* **menu:** type checkbox should not affect a normal menu item. ([560474f7](https://github.com/angular/material/commit/560474f7), closes [#8110](https://github.com/angular/material/issues/8110), [#8117](https://github.com/angular/material/issues/8117))\n* **navbar:** fixes navbar logic in angular 1.3 ([2b8d18fb](https://github.com/angular/material/commit/2b8d18fb), closes [#8419](https://github.com/angular/material/issues/8419))\n* **panel:**\n  * attached panels to body ([b9b6203a](https://github.com/angular/material/commit/b9b6203a), closes [#8420](https://github.com/angular/material/issues/8420))\n  * Fix panel tests in Angular 1.3. ([296f1c71](https://github.com/angular/material/commit/296f1c71), closes [#8418](https://github.com/angular/material/issues/8418))\n  * positions panel offscreen when calculating height/width ([46492407](https://github.com/angular/material/commit/46492407), closes [#8405](https://github.com/angular/material/issues/8405))\n  * css and docs fixes ([c13feb76](https://github.com/angular/material/commit/c13feb76))\n  * updates to positioning ([0168e867](https://github.com/angular/material/commit/0168e867))\n  * Fixes custom animations in the demo to account for opacity. ([060a54bb](https://github.com/angular/material/commit/060a54bb))\n  * Make all tests wait for promises to resolve. ([685c6fc8](https://github.com/angular/material/commit/685c6fc8))\n* **radioButton:** demos are not support RTL properly. ([02d3de20](https://github.com/angular/material/commit/02d3de20), closes [#8233](https://github.com/angular/material/issues/8233), [#8243](https://github.com/angular/material/issues/8243))\n* **select:**\n  * Fail validation if selection is not a valid option. ([da02ea2e](https://github.com/angular/material/commit/da02ea2e), closes [#7954](https://github.com/angular/material/issues/7954), [#7989](https://github.com/angular/material/issues/7989))\n  * properly hide the progressbar ([9e1e2023](https://github.com/angular/material/commit/9e1e2023), closes [#8379](https://github.com/angular/material/issues/8379), [#8381](https://github.com/angular/material/issues/8381))\n* **sidenav:**\n  * update position of sidenav and backdrop if scrolled. ([9f6eecb0](https://github.com/angular/material/commit/9f6eecb0), closes [#5850](https://github.com/angular/material/issues/5850), [#8184](https://github.com/angular/material/issues/8184))\n  * don't log an error when waiting for an instance. ([ca07b769](https://github.com/angular/material/commit/ca07b769), closes [#8308](https://github.com/angular/material/issues/8308), [#8326](https://github.com/angular/material/issues/8326))\n  * rightNav button and input text is blurry on IE11 ([fc42e2cd](https://github.com/angular/material/commit/fc42e2cd), closes [#6007](https://github.com/angular/material/issues/6007), [#8297](https://github.com/angular/material/issues/8297))\n* **slider:** fix a js error if the slider container doesn't have a md-input-container ([4aa7160c](https://github.com/angular/material/commit/4aa7160c), closes [#8174](https://github.com/angular/material/issues/8174), [#7728](https://github.com/angular/material/issues/7728), [#8225](https://github.com/angular/material/issues/8225))\n* **subheader:** fix hidden directives inside of sticky clone. ([44140ce6](https://github.com/angular/material/commit/44140ce6), closes [#8500](https://github.com/angular/material/issues/8500), [#8504](https://github.com/angular/material/issues/8504), [#8505](https://github.com/angular/material/issues/8505))\n* **swipe:** safe apply the callback ([715dd34f](https://github.com/angular/material/commit/715dd34f), closes [#8318](https://github.com/angular/material/issues/8318), [#8497](https://github.com/angular/material/issues/8497))\n* **tabs:**\n  * avoid width calculation deviations. ([efbbd372](https://github.com/angular/material/commit/efbbd372), closes [#8289](https://github.com/angular/material/issues/8289), [#8293](https://github.com/angular/material/issues/8293))\n  * fix object reference-related errors in IE ([a3cd6191](https://github.com/angular/material/commit/a3cd6191), closes [#8276](https://github.com/angular/material/issues/8276), [#8354](https://github.com/angular/material/issues/8354))\n  * fixes keyboard navigation issue ([8aa9b169](https://github.com/angular/material/commit/8aa9b169), closes [#2344](https://github.com/angular/material/issues/2344), [#7098](https://github.com/angular/material/issues/7098))\n* **tests:**\n  * Cleans up the DOM after select, menu, and tooltip tests. ([62c2da1b](https://github.com/angular/material/commit/62c2da1b), closes [#8181](https://github.com/angular/material/issues/8181))\n  * re-enable the mdGridList test ([b496b0d7](https://github.com/angular/material/commit/b496b0d7), closes [#8086](https://github.com/angular/material/issues/8086))\n* **theming:**\n  * remove console warn for same primary and accent palettes ([3654fbf0](https://github.com/angular/material/commit/3654fbf0), closes [#8260](https://github.com/angular/material/issues/8260), [#8564](https://github.com/angular/material/issues/8564))\n  * only insert default theme if its usable. ([4c4c170c](https://github.com/angular/material/commit/4c4c170c), closes [#7425](https://github.com/angular/material/issues/7425), [#8578](https://github.com/angular/material/issues/8578))\n* **toast:** toast template transform was not appending nodes. ([a8f43b85](https://github.com/angular/material/commit/a8f43b85), closes [#8131](https://github.com/angular/material/issues/8131), [#8132](https://github.com/angular/material/issues/8132))\n* **toolbar:**\n  * fix the toolbar not shrinking on load ([72ed02fe](https://github.com/angular/material/commit/72ed02fe), closes [#8258](https://github.com/angular/material/issues/8258), [#8221](https://github.com/angular/material/issues/8221), [#8543](https://github.com/angular/material/issues/8543))\n  * remove transition duration for $ngAnimate ([9ef50a7a](https://github.com/angular/material/commit/9ef50a7a), closes [#7929](https://github.com/angular/material/issues/7929), [#8190](https://github.com/angular/material/issues/8190))\n* **tooltip:**\n  * interpolate the tooltip text when adding it to the aria-label ([60910efa](https://github.com/angular/material/commit/60910efa), closes [#6855](https://github.com/angular/material/issues/6855), [#8170](https://github.com/angular/material/issues/8170))\n  * properly default to \"bottom\", if no position is specified ([491e692d](https://github.com/angular/material/commit/491e692d), closes [#8389](https://github.com/angular/material/issues/8389), [#8525](https://github.com/angular/material/issues/8525))\n  * empty tooltips should not show up. ([c513e493](https://github.com/angular/material/commit/c513e493), closes [#8021](https://github.com/angular/material/issues/8021))\n  * cancel show timeouts when leaving before delay. ([5ba4c0e7](https://github.com/angular/material/commit/5ba4c0e7), closes [#8363](https://github.com/angular/material/issues/8363), [#8394](https://github.com/angular/material/issues/8394))\n  * set initial position of tooltip ([1cc80d3a](https://github.com/angular/material/commit/1cc80d3a), closes [#4345](https://github.com/angular/material/issues/4345), [#5654](https://github.com/angular/material/issues/5654))\n* **util:** restore scrolling after test executed. ([1ccf7277](https://github.com/angular/material/commit/1ccf7277), closes [#8206](https://github.com/angular/material/issues/8206))\n* **virtual-repeat:** auto shrink restored wrong original size. ([7e5be01a](https://github.com/angular/material/commit/7e5be01a), closes [#7955](https://github.com/angular/material/issues/7955), [#8095](https://github.com/angular/material/issues/8095))\n* **virtualRepeat:** Memory leak ([b99e74d9](https://github.com/angular/material/commit/b99e74d9), closes [#8055](https://github.com/angular/material/issues/8055), [#8056](https://github.com/angular/material/issues/8056))\n* **whiteframe:** prevent contents from being printed black ([0f0c4b65](https://github.com/angular/material/commit/0f0c4b65), closes [#8512](https://github.com/angular/material/issues/8512), [#8520](https://github.com/angular/material/issues/8520))\n\n\n\n<a name\"1.1.0-rc4\"></a>\n### 1.1.0-rc4 (2016-04-15)\n\nThis release we added a new feature `md-select-header` which supports custom content in the header of the `md-select` component:\n\n![selectwithinputheader](https://cloud.githubusercontent.com/assets/210413/14587401/f46c7c8c-0477-11e6-9cfc-79cecebec121.png)\n\n\n#### Features\n\n* **select:** Adding md-select-header directive to md-select. ([62754242](https://github.com/angular/material/commit/62754242), closes [#7782](https://github.com/angular/material/issues/7782))\n\n\n#### Bug Fixes\n\n* **colors:**\n  * using default palette and defined palettes from $mdTheming ([61b742ef](https://github.com/angular/material/commit/61b742ef), closes [#8036](https://github.com/angular/material/issues/8036), [#8061](https://github.com/angular/material/issues/8061))\n  * coverts COLOR_PALETTES to colorPalettes ([246ae54b](https://github.com/angular/material/commit/246ae54b), closes [#8051](https://github.com/angular/material/issues/8051))\n* **list:** Correct avatar/icon size/spacing. ([05b8c1e9](https://github.com/angular/material/commit/05b8c1e9), closes [#8053](https://github.com/angular/material/issues/8053))\n* **menu:** Typo in hover deregistration. ([9f663524](https://github.com/angular/material/commit/9f663524), closes [#7947](https://github.com/angular/material/issues/7947), [#8045](https://github.com/angular/material/issues/8045))\n* **sidenav:** add support for  legacy API ([fbf17dbf](https://github.com/angular/material/commit/fbf17dbf))\n* **subheader:** transform span to div to allow custom styling. ([01952ec5](https://github.com/angular/material/commit/01952ec5), closes [#8063](https://github.com/angular/material/issues/8063), [#8069](https://github.com/angular/material/issues/8069))\n\n#### Contributors\n\nThanks to the great contributors who helped with this release:\n\n[<img alt=\"ThomasBurleson\" src=\"https://avatars.githubusercontent.com/u/210413?v=3&s=117\" width=\"117\">](https://github.com/ThomasBurleson) |[<img alt=\"robertmesserle\" src=\"https://avatars.githubusercontent.com/u/571363?v=3&s=117\" width=\"117\">](https://github.com/robertmesserle) |[<img alt=\"DevVersion\" src=\"https://avatars.githubusercontent.com/u/4987015?v=3&s=117\" width=\"117\">](https://github.com/DevVersion) |[<img alt=\"topherfangio\" src=\"https://avatars.githubusercontent.com/u/54370?v=3&s=117\" width=\"117\">](https://github.com/topherfangio) |[<img alt=\"EladBezalel\" src=\"https://avatars.githubusercontent.com/u/6004537?v=3&s=117\" width=\"117\">](https://github.com/EladBezalel) |[<img alt=\"clshortfuse\" src=\"https://avatars.githubusercontent.com/u/9271155?v=3&s=117\" width=\"117\">](https://github.com/clshortfuse) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[ThomasBurleson](https://github.com/ThomasBurleson) |[robertmesserle](https://github.com/robertmesserle) |[DevVersion](https://github.com/DevVersion) |[topherfangio](https://github.com/topherfangio) |[EladBezalel](https://github.com/EladBezalel) |[clshortfuse](https://github.com/clshortfuse) |\n\n[<img alt=\"DerekLouie\" src=\"https://avatars.githubusercontent.com/u/709204?v=3&s=117\" width=\"117\">](https://github.com/DerekLouie) |[<img alt=\"VictorCoding\" src=\"https://avatars.githubusercontent.com/u/6878222?v=3&s=117\" width=\"117\">](https://github.com/VictorCoding) |\n:---: |:---: |\n[DerekLouie](https://github.com/DerekLouie) |[VictorCoding](https://github.com/VictorCoding) |\n\n\n<br/>\n---\n\n\n<a name\"1.1.0-rc3\"></a>\n### 1.1.0-rc3 (2016-04-13)\n\nThis RC3 provides several fixes to Theme foreground and background colors. Also included is a **Colors** demo *Theme ColorPicker* that will be useful for developers interested using Theme colors and the new `md-colors` directive within their own custom components.\n\n![theme_colorpicker](https://cloud.githubusercontent.com/assets/210413/14511803/b8905722-019f-11e6-90ff-8e724d6ce3b5.png)\n\n\n#### Features\n\n* **colors:** directive and service to use any color from any palette on any element ([ced4e0c2](https://github.com/angular/material/commit/ced4e0c2), closes [#1269](https://github.com/angular/material/issues/1269), [#7791](https://github.com/angular/material/issues/7791))\n* **progress:** add the ability to disable the progressbars ([18bfae10](https://github.com/angular/material/commit/18bfae10), closes [#7862](https://github.com/angular/material/issues/7862))\n* **theme:** allow global disable of theming generation ([cb694048](https://github.com/angular/material/commit/cb694048), closes [#7959](https://github.com/angular/material/issues/7959))\n\n\n\n#### Breaking Changes\n\n* `<a>`: anchor tags in md components inherit theme colors\n* Content: `background-color: '{{background-default}}'`\n* Subheader: `background-color: '{{background-default}}'`\n* Button: use accent palette A700 for hover and focused\n* Checkbox: ripple use accent palette A700\n* Input: use `primary-color` instead of `primary-500`\n* LinearProgress: `background-color: '{{accent-A100}}'`\n* RadioButton: container uses `color: '{{accent-A700}}';`\n* Select: accent uses color: `'{{accent-color}}';`\n* Slider: focus reing uses  `background-color: '{{accent-A200-0.2}}';`\n* Toast: uses `color: '{{accent-color}}';` instead of `color: '{{accent-A200}}';`\n\n\n#### Bug Fixes\n\n* **a:** default accent color removed ([59dfce63](https://github.com/angular/material/commit/59dfce63), closes [#7891](https://github.com/angular/material/issues/7891))\n* **aria:** $mdAria should not use texts from aria-hidden nodes ([b3cb84d3](https://github.com/angular/material/commit/b3cb84d3), closes [#7376](https://github.com/angular/material/issues/7376), [#7957](https://github.com/angular/material/issues/7957))\n* **autocomplete:**\n  * don't show the loading bar when hitting escape on an empty input ([e821ae32](https://github.com/angular/material/commit/e821ae32), closes [#7927](https://github.com/angular/material/issues/7927), [#7934](https://github.com/angular/material/issues/7934))\n  * don't apply a background if the autocomplete has a floating label ([44cf4a93](https://github.com/angular/material/commit/44cf4a93), closes [#7841](https://github.com/angular/material/issues/7841), [#7848](https://github.com/angular/material/issues/7848))\n* **build:** prevent npm publishing ([fb4670fd](https://github.com/angular/material/commit/fb4670fd), closes [#7393](https://github.com/angular/material/issues/7393))\n* **components:** wrong use of accent and primary colors ([da48b6c9](https://github.com/angular/material/commit/da48b6c9), closes [#7890](https://github.com/angular/material/issues/7890))\n* **css:** use classname to identify md components for styling ([9aac20fa](https://github.com/angular/material/commit/9aac20fa), closes [#7942](https://github.com/angular/material/issues/7942))\n* **demo:** bottomSheet grid icon buttons are clipped ([15424bac](https://github.com/angular/material/commit/15424bac), closes [#8018](https://github.com/angular/material/issues/8018))\n* **icon:** icons should have a minimum height. ([1dc0c17f](https://github.com/angular/material/commit/1dc0c17f), closes [#7599](https://github.com/angular/material/issues/7599), [#7860](https://github.com/angular/material/issues/7860))\n* **input:** prevent the input from jumping when it becomes disabled ([4bff2bbe](https://github.com/angular/material/commit/4bff2bbe), closes [#7640](https://github.com/angular/material/issues/7640), [#7919](https://github.com/angular/material/issues/7919))\n* **list:**\n  * add target to copiedAttrs ([1227b0a6](https://github.com/angular/material/commit/1227b0a6), closes [#7831](https://github.com/angular/material/issues/7831))\n  * clickable list-items should show a focus effect. ([1fc29394](https://github.com/angular/material/commit/1fc29394), closes [#7960](https://github.com/angular/material/issues/7960), [#7964](https://github.com/angular/material/issues/7964))\n* **menu:** resolve an error when going from a nested menu item to a regular one ([e3fc728f](https://github.com/angular/material/commit/e3fc728f), closes [#7819](https://github.com/angular/material/issues/7819), [#7826](https://github.com/angular/material/issues/7826))\n* **progress-circular:** use a non-flushable requestAnimationFrame ([f687d106](https://github.com/angular/material/commit/f687d106), closes [#7936](https://github.com/angular/material/issues/7936))\n* **release:**\n  * specifies upstream URL when pushing to material repo ([bbaa5b80](https://github.com/angular/material/commit/bbaa5b80), closes [#7852](https://github.com/angular/material/issues/7852))\n  * adds `newVersion` value to node string to update package.json ([0fc0f3e4](https://github.com/angular/material/commit/0fc0f3e4), closes [#7810](https://github.com/angular/material/issues/7810))\n* **rtl-mixin:** changed ltr override to initial ([8968c999](https://github.com/angular/material/commit/8968c999), closes [#7423](https://github.com/angular/material/issues/7423))\n* **select:**\n  * prevent selectedLabels from being passed $scope by $watch ([d0bacdfe](https://github.com/angular/material/commit/d0bacdfe), closes [#7830](https://github.com/angular/material/issues/7830))\n  * md-checkbox inside md-list-item using incorrect text color. ([a3f63cbd](https://github.com/angular/material/commit/a3f63cbd), closes [#7893](https://github.com/angular/material/issues/7893))\n* **sidenav:**\n  * animation when width is explicitly defined ([57ab6d9c](https://github.com/angular/material/commit/57ab6d9c), closes [#7483](https://github.com/angular/material/issues/7483), [#7605](https://github.com/angular/material/issues/7605))\n  * mdSideNav should support deferred or instant component lookups ([877551c5](https://github.com/angular/material/commit/877551c5), closes [#7900](https://github.com/angular/material/issues/7900))\n* **tabs:** not selected tab text color as spec ([ccfef921](https://github.com/angular/material/commit/ccfef921), closes [#7920](https://github.com/angular/material/issues/7920))\n* **tests:** disable gridlist test ([317c1c8d](https://github.com/angular/material/commit/317c1c8d))\n* **themes:**\n  * anchor should inherit theme to support colors ([81b44a47](https://github.com/angular/material/commit/81b44a47))\n  * anchor theme colors are scoped to _md components ([901c3fc6](https://github.com/angular/material/commit/901c3fc6))\n* **theming:** theming should probably parse background hue names. ([79eba382](https://github.com/angular/material/commit/79eba382), closes [#7510](https://github.com/angular/material/issues/7510), [#8022](https://github.com/angular/material/issues/8022))\n\n#### Contributors\n\nThanks to the great contributors who helped with this release:\n\n[<img alt=\"ThomasBurleson\" src=\"https://avatars.githubusercontent.com/u/210413?v=3&s=117\" width=\"117\">](https://github.com/ThomasBurleson) |[<img alt=\"robertmesserle\" src=\"https://avatars.githubusercontent.com/u/571363?v=3&s=117\" width=\"117\">](https://github.com/robertmesserle) |[<img alt=\"DevVersion\" src=\"https://avatars.githubusercontent.com/u/4987015?v=3&s=117\" width=\"117\">](https://github.com/DevVersion) |[<img alt=\"EladBezalel\" src=\"https://avatars.githubusercontent.com/u/6004537?v=3&s=117\" width=\"117\">](https://github.com/EladBezalel) |[<img alt=\"crisbeto\" src=\"https://avatars.githubusercontent.com/u/4450522?v=3&s=117\" width=\"117\">](https://github.com/crisbeto) |[<img alt=\"Splaktar\" src=\"https://avatars.githubusercontent.com/u/3506071?v=3&s=117\" width=\"117\">](https://github.com/Splaktar) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[ThomasBurleson](https://github.com/ThomasBurleson) |[robertmesserle](https://github.com/robertmesserle) |[DevVersion](https://github.com/DevVersion) |[EladBezalel](https://github.com/EladBezalel) |[crisbeto](https://github.com/crisbeto) |[Splaktar](https://github.com/Splaktar) |\n\n[<img alt=\"clshortfuse\" src=\"https://avatars.githubusercontent.com/u/9271155?v=3&s=117\" width=\"117\">](https://github.com/clshortfuse) |[<img alt=\"DerekLouie\" src=\"https://avatars.githubusercontent.com/u/709204?v=3&s=117\" width=\"117\">](https://github.com/DerekLouie) |[<img alt=\"jadjoubran\" src=\"https://avatars.githubusercontent.com/u/2265232?v=3&s=117\" width=\"117\">](https://github.com/jadjoubran) |[<img alt=\"code-tree\" src=\"https://avatars.githubusercontent.com/u/11289719?v=3&s=117\" width=\"117\">](https://github.com/code-tree) |[<img alt=\"trainerbill\" src=\"https://avatars.githubusercontent.com/u/3578259?v=3&s=117\" width=\"117\">](https://github.com/trainerbill) |[<img alt=\"dentych\" src=\"https://avatars.githubusercontent.com/u/2256372?v=3&s=117\" width=\"117\">](https://github.com/dentych) |\n:---: |:---: |:---: |:---: |:---: |:---: |\n[clshortfuse](https://github.com/clshortfuse) |[DerekLouie](https://github.com/DerekLouie) |[jadjoubran](https://github.com/jadjoubran) |[code-tree](https://github.com/code-tree) |[trainerbill](https://github.com/trainerbill) |[dentych](https://github.com/dentych) |\n\n[<img alt=\"ilovett\" src=\"https://avatars.githubusercontent.com/u/1776100?v=3&s=117\" width=\"117\">](https://github.com/ilovett) |[<img alt=\"Djulia\" src=\"https://avatars.githubusercontent.com/u/3987507?v=3&s=117\" width=\"117\">](https://github.com/Djulia) |[<img alt=\"kwypchlo\" src=\"https://avatars.githubusercontent.com/u/3755029?v=3&s=117\" width=\"117\">](https://github.com/kwypchlo) |\n:---: |:---: |:---: |\n[ilovett](https://github.com/ilovett) |[Djulia](https://github.com/Djulia) |[kwypchlo](https://github.com/kwypchlo) |\n\n\n<br/>\n---\n\n\n<a name\"1.1.0-rc2\"></a>\n### 1.1.0-rc2 (2016-03-30)\n\n\n#### Features\n\n* **autocomplete:**\n  * allow disabling asterisk on floating label ([5e043a1e](https://github.com/angular/material/commit/5e043a1e), closes [#7119](https://github.com/angular/material/issues/7119))\n  * support readonly attribute ([2a884c61](https://github.com/angular/material/commit/2a884c61), closes [#5507](https://github.com/angular/material/issues/5507), [#7107](https://github.com/angular/material/issues/7107))\n* **checkbox:** add indeterminate checkbox support ([2776ad29](https://github.com/angular/material/commit/2776ad29), closes [#7643](https://github.com/angular/material/issues/7643))\n* **chips:** Make chips editable ([c3085ee7](https://github.com/angular/material/commit/c3085ee7), closes [#7579](https://github.com/angular/material/issues/7579))\n* **input:** allow skip hidden inputs ([a2ac9a3a](https://github.com/angular/material/commit/a2ac9a3a), closes [#2153](https://github.com/angular/material/issues/2153), [#6425](https://github.com/angular/material/issues/6425))\n* **list:** add ui-sref-opts attribute to button executor. ([6763bfa7](https://github.com/angular/material/commit/6763bfa7), closes [#7658](https://github.com/angular/material/issues/7658), [#7672](https://github.com/angular/material/issues/7672))\n* **select:**\n  * add support for checkbox options in the dropdown ([3524aa95](https://github.com/angular/material/commit/3524aa9573fe29e53341c60ce6127fc7ad323446))\n  * add hover styles and fix disabled ([7bc3cc1e](https://github.com/angular/material/commit/7bc3cc1e), closes [#7518](https://github.com/angular/material/issues/7518), [#7765](https://github.com/angular/material/issues/7765))\n  * Adding md-selected-text attribute to md-select. ([bbbe9e30](https://github.com/angular/material/commit/bbbe9e30), closes [#7721](https://github.com/angular/material/issues/7721))\n* **tabs:** allow disabling select click event by adding `md-no-select-click` attribute ([6bc38e59](https://github.com/angular/material/commit/6bc38e59), closes [#5351](https://github.com/angular/material/issues/5351))\n\n\n#### Breaking Changes\n\n* Button: modified theme CSS  `background-color: '{{accent-600}}'`\n* Content: restored `background-color: '{{background-hue-1}}'` in md-content\n* DatePicker: modified theme CSS `background: '{{background-hue-1}}'`\n* Calendar: modified theme CSS ` background: '{{background-A100}}';`\n* Input: inputs with type `hidden` will be skipped by the `input-container`\n* Select: added hover styles and fixes disabled styles to `md-select`\n* privatized CSS for\n  * Autocomplete: `_md-mode-indeterminate`\n  * Chips: Added read-only styles for `.md-readonly ._md-chip-input-container`\n  * Chips: Support for editable chips with `._md-chip-editing`\n  * Select: updated layout CSS for `._md-text`\n* updated global CSS style for html and body: `color: '{{foreground-1}}'; background-color: '{{background-color}}'`\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * only handle results if it's an array or a promise ([05a08c8c](https://github.com/angular/material/commit/05a08c8c), closes [#7074](https://github.com/angular/material/issues/7074), [#7089](https://github.com/angular/material/issues/7089))\n  * probably clear the autocomplete. ([6d705b9f](https://github.com/angular/material/commit/6d705b9f), closes [#7180](https://github.com/angular/material/issues/7180), [#7354](https://github.com/angular/material/issues/7354))\n  * stop loading if last promise got resolved ([e372cf9c](https://github.com/angular/material/commit/e372cf9c), closes [#6907](https://github.com/angular/material/issues/6907), [#6927](https://github.com/angular/material/issues/6927))\n  * fix incorrect height for progress-bar ([b6ecc31d](https://github.com/angular/material/commit/b6ecc31d), closes [#7497](https://github.com/angular/material/issues/7497), [#7504](https://github.com/angular/material/issues/7504))\n* **button:**\n  * reduce selector length ([e9c3b69b](https://github.com/angular/material/commit/e9c3b69b), closes [#7705](https://github.com/angular/material/issues/7705))\n  * Fix icon opacity in themed toolbar disabled buttons. ([74a53a8c](https://github.com/angular/material/commit/74a53a8c), closes [#5815](https://github.com/angular/material/issues/5815), [#7492](https://github.com/angular/material/issues/7492))\n  * FAB & Raised buttons hover and focus colors match material design ([7a650bc5](https://github.com/angular/material/commit/7a650bc54de70aa8c01e484d27a90d88d5f0e154))\n* **card:** remove duplicate demo module names. ([30b90192](https://github.com/angular/material/commit/30b90192), closes [#7693](https://github.com/angular/material/issues/7693))\n* **checkbox:** pointer events disable ripple events too ([c2628d7f](https://github.com/angular/material/commit/c2628d7f), closes [#7538](https://github.com/angular/material/issues/7538), [#7541](https://github.com/angular/material/issues/7541))\n* **chips:**\n  * do not trim the input model. ([2d020e12](https://github.com/angular/material/commit/2d020e12), closes [#7243](https://github.com/angular/material/issues/7243), [#7748](https://github.com/angular/material/issues/7748))\n  * Disable editing for custom templates ([31787c05](https://github.com/angular/material/commit/31787c05), closes [#7586](https://github.com/angular/material/issues/7586))\n  * fix md-max-chips for autocomplete watcher ([051474eb](https://github.com/angular/material/commit/051474eb), closes [#7549](https://github.com/angular/material/issues/7549), [#7550](https://github.com/angular/material/issues/7550))\n  * fix chips focus functionality ([cfb5acb8](https://github.com/angular/material/commit/cfb5acb8), closes [#5897](https://github.com/angular/material/issues/5897), [#5662](https://github.com/angular/material/issues/5662), [#5941](https://github.com/angular/material/issues/5941))\n  * Fix readonly hiding and other issues. ([92be8d2b](https://github.com/angular/material/commit/92be8d2b), closes [#7136](https://github.com/angular/material/issues/7136), [#7489](https://github.com/angular/material/issues/7489))\n* **datepicker:**\n  * style demo ngMessage as same as input messages. ([9a8a079b](https://github.com/angular/material/commit/9a8a079b), closes [#7071](https://github.com/angular/material/issues/7071), [#7219](https://github.com/angular/material/issues/7219))\n  * ensure the element always blends in with it's parent ([81c15e32](https://github.com/angular/material/commit/81c15e32), closes [#7502](https://github.com/angular/material/issues/7502), [#7603](https://github.com/angular/material/issues/7603))\n  * enable scrolling when scope destroyed. ([b8c2d513](https://github.com/angular/material/commit/b8c2d513), closes [#7542](https://github.com/angular/material/issues/7542), [#7544](https://github.com/angular/material/issues/7544))\n* **icon:**\n  * rename nodes id's from cache to prevent duplicates. ([67bd35de](https://github.com/angular/material/commit/67bd35de), closes [#7468](https://github.com/angular/material/issues/7468))\n  * Allow using data URLs ([bebd07c5](https://github.com/angular/material/commit/bebd07c5), closes [#4126](https://github.com/angular/material/issues/4126), [#7547](https://github.com/angular/material/issues/7547))\n* **input:** prevent the label from overflowing the parent ([dbb75a64](https://github.com/angular/material/commit/dbb75a64), closes [#7403](https://github.com/angular/material/issues/7403), [#7641](https://github.com/angular/material/issues/7641))\n* **layout:** small screen layout attribute selectors ([8bda8418](https://github.com/angular/material/commit/8bda8418), closes [#5166](https://github.com/angular/material/issues/5166), [#7638](https://github.com/angular/material/issues/7638))\n* **list:**\n  * apply md-no-style to `a` tags ([9a8eab0c](https://github.com/angular/material/commit/9a8eab0c), closes [#5653](https://github.com/angular/material/issues/5653))\n  * dense list font size ([9c85915e](https://github.com/angular/material/commit/9c85915e), closes [#7552](https://github.com/angular/material/issues/7552), [#7650](https://github.com/angular/material/issues/7650))\n  * make secondary items static ([9bb78e06](https://github.com/angular/material/commit/9bb78e06), closes [#7500](https://github.com/angular/material/issues/7500), [#2759](https://github.com/angular/material/issues/2759), [#7651](https://github.com/angular/material/issues/7651))\n  * fix compatibility with IE11 ([2bc88e22](https://github.com/angular/material/commit/2bc88e22), closes [#7557](https://github.com/angular/material/issues/7557), [#7573](https://github.com/angular/material/issues/7573))\n  * item-inner should be not wider than the container ([91585893](https://github.com/angular/material/commit/91585893), closes [#7551](https://github.com/angular/material/issues/7551), [#7525](https://github.com/angular/material/issues/7525), [#7531](https://github.com/angular/material/issues/7531))\n  * fix overflow for ng-click and fix firefox click issues ([497190b7](https://github.com/angular/material/commit/497190b7), closes [#7490](https://github.com/angular/material/issues/7490), [#7499](https://github.com/angular/material/issues/7499), [#7503](https://github.com/angular/material/issues/7503))\n* **menubar:** remove debugger; statement ([3f34900d](https://github.com/angular/material/commit/3f34900d))\n* **progress-circular:**\n  * add the dark theme background in the demo ([ae14f254](https://github.com/angular/material/commit/ae14f254), closes [#7775](https://github.com/angular/material/issues/7775))\n  * add theming, simplify demo ([34035f04](https://github.com/angular/material/commit/34035f04), closes [#7570](https://github.com/angular/material/issues/7570), [#7576](https://github.com/angular/material/issues/7576))\n  * animation timing ([df7310f3](https://github.com/angular/material/commit/df7310f3), closes [#7471](https://github.com/angular/material/issues/7471))\n* **radioButton:** replaced inherit margin values with 0 Inherit is not the proper value, 0 should  ([d996176a](https://github.com/angular/material/commit/d996176a), closes [#7740](https://github.com/angular/material/issues/7740), [#7770](https://github.com/angular/material/issues/7770))\n* **select:**\n  * fix flickering of ngMessages on mdSelect opening ([c68869ea](https://github.com/angular/material/commit/c68869ea), closes [#7636](https://github.com/angular/material/issues/7636), [#7646](https://github.com/angular/material/issues/7646))\n  * disabled state, invalid html in unit tests ([cc4f6263](https://github.com/angular/material/commit/cc4f6263), closes [#7773](https://github.com/angular/material/issues/7773), [#7778](https://github.com/angular/material/issues/7778))\n  * Fix NPE by checking for controller existence. ([c3b498f7](https://github.com/angular/material/commit/c3b498f7), closes [#7079](https://github.com/angular/material/issues/7079), [#7560](https://github.com/angular/material/issues/7560))\n  * fix layout issue ([dfa0a0c0](https://github.com/angular/material/commit/dfa0a0c0), closes [#6200](https://github.com/angular/material/issues/6200), [#7509](https://github.com/angular/material/issues/7509))\n  * spinner size ([00619c71](https://github.com/angular/material/commit/00619c71), closes [#7505](https://github.com/angular/material/issues/7505), [#7506](https://github.com/angular/material/issues/7506))\n* **sidenav:**\n  * enable native scrolling on touch devices ([2c403671](https://github.com/angular/material/commit/2c403671), closes [#7786](https://github.com/angular/material/issues/7786), [#7751](https://github.com/angular/material/issues/7751))\n  * fix is-locked-open backdrop and incorrect backdrop tests ([586aa7a6](https://github.com/angular/material/commit/586aa7a6), closes [#7537](https://github.com/angular/material/issues/7537), [#7790](https://github.com/angular/material/issues/7790))\n* **textarea:** scrolling, text selection, reduced DOM manipulation. ([7789d6a4](https://github.com/angular/material/commit/7789d6a4), closes [#7487](https://github.com/angular/material/issues/7487), [#7553](https://github.com/angular/material/issues/7553))\n* **theme:**\n  * remove default background theme (grey) `1000` value ([4b49f23c](https://github.com/angular/material/commit/4b49f23c), closes [#7600](https://github.com/angular/material/issues/7600), [#7686](https://github.com/angular/material/issues/7686))\n  * restore use of unqoute in mixins ([d2b02c8f](https://github.com/angular/material/commit/d2b02c8f))\n  * fix text color defined in theme html, body ([4112f514](https://github.com/angular/material/commit/4112f514))\n  * theming should also watch for controller changes. ([a653122c](https://github.com/angular/material/commit/a653122c), closes [#5899](https://github.com/angular/material/issues/5899), [#7154](https://github.com/angular/material/issues/7154))\n  * updates text opacities to the newest specs ([48a3b9c3](https://github.com/angular/material/commit/48a3b9c3), closes [#7433](https://github.com/angular/material/issues/7433))\n* **toast:** better toast templating allowing comments and sibling elements ([43d53878](https://github.com/angular/material/commit/43d53878), closes [#6259](https://github.com/angular/material/issues/6259), [#6494](https://github.com/angular/material/issues/6494))\n\n<br/>\n---\n\n\n<a name\"1.1.0-rc1\"></a>\n### 1.1.0-rc1 (2016-03-09)\n\n\n#### Features\n\n* **$mdDialog:** add prompt ([4d535e2d](https://github.com/angular/material/commit/4d535e2d), closes [#4995](https://github.com/angular/material/issues/4995), [#6769](https://github.com/angular/material/issues/6769))\n* **a:** support theme colors ([3177e666](https://github.com/angular/material/commit/3177e666), closes [#7472](https://github.com/angular/material/issues/7472))\n* **autocomplete:**\n  * forward `md-select-on-focus` attribute to input aswell ([4b9f93d6](https://github.com/angular/material/commit/4b9f93d6), closes [#7125](https://github.com/angular/material/issues/7125), [#7127](https://github.com/angular/material/issues/7127))\n  * allow select on match to be case insensitive. ([3fffde79](https://github.com/angular/material/commit/3fffde79), closes [#5782](https://github.com/angular/material/issues/5782), [#6935](https://github.com/angular/material/issues/6935))\n* **chips:** md-max-chips to specify a maximum of chips that can be added through user input ([03caf58e](https://github.com/angular/material/commit/03caf58e), closes [#6864](https://github.com/angular/material/issues/6864), [#6897](https://github.com/angular/material/issues/6897))\n* **input:**\n  * add directive to auto select text on input focus ([1a852bcd](https://github.com/angular/material/commit/1a852bcd), closes [#6679](https://github.com/angular/material/issues/6679), [#6701](https://github.com/angular/material/issues/6701))\n  * add asterisk to input directive ([1f997951](https://github.com/angular/material/commit/1f997951), closes [#6511](https://github.com/angular/material/issues/6511), [#6518](https://github.com/angular/material/issues/6518))\n* **layout:**\n  * add `-print` breakpoint alias ([417f3c49](https://github.com/angular/material/commit/417f3c49))\n  * add `-print` breakpoint alias ([eb1249da](https://github.com/angular/material/commit/eb1249da))\n* **progressCircular:** implement progressCircular to use SVG ([640b55db](https://github.com/angular/material/commit/640b55db), closes [#7322](https://github.com/angular/material/issues/7322))\n* **slider:** vertical slider, UI fixes and bug fixes ([e0abeb4d](https://github.com/angular/material/commit/e0abeb4d), closes [#4371](https://github.com/angular/material/issues/4371), [#3259](https://github.com/angular/material/issues/3259), [#2421](https://github.com/angular/material/issues/2421), [#1221](https://github.com/angular/material/issues/1221), [#4576](https://github.com/angular/material/issues/4576), [#6996](https://github.com/angular/material/issues/6996), [#7093](https://github.com/angular/material/issues/7093), [#7093](https://github.com/angular/material/issues/7093), [#5874](https://github.com/angular/material/issues/5874), [#5872](https://github.com/angular/material/issues/5872), [#6051](https://github.com/angular/material/issues/6051))\n* **toast:** add highlight class method + improved docs design + align demo with specs ([1efe8162](https://github.com/angular/material/commit/1efe8162), closes [#6607](https://github.com/angular/material/issues/6607), [#7246](https://github.com/angular/material/issues/7246))\n\n\n#### Breaking Changes\n\n* Many components now have *private CSS classes*. These are classes that should not be overridden\nbecause they are either vital to the component's function or may change even between minor releases.\n* Toasts now use accent color by default for a highlighted action button.\n\n- Add `highlightClass` method to toast (very useful! - and won't break anything)\n- Improved the docs design for the possible methods for the #simple method.\n- Changed demo to align with specs, No Dismiss buttons.\n- Highlight Color should use by default the accent color.\n\nFixes #6607\n\nCloses #7246\n\n ([1efe8162](https://github.com/angular/material/commit/1efe8162))\n\n\n#### Bug Fixes\n\n* **FAB:** Re-add line-height to fix ui-sref issues. ([f9f893ab](https://github.com/angular/material/commit/f9f893ab), closes [#7087](https://github.com/angular/material/issues/7087), [#7145](https://github.com/angular/material/issues/7145))\n* **autocomplete:**\n  * fix progressbar and messages alignment and bottom padding. ([e0423cee](https://github.com/angular/material/commit/e0423cee), closes [#6218](https://github.com/angular/material/issues/6218), [#6231](https://github.com/angular/material/issues/6231), [#6255](https://github.com/angular/material/issues/6255), [#6258](https://github.com/angular/material/issues/6258))\n  * fix not found template detection when element is hidden ([96cfa742](https://github.com/angular/material/commit/96cfa742), closes [#7035](https://github.com/angular/material/issues/7035), [#7142](https://github.com/angular/material/issues/7142), [#7042](https://github.com/angular/material/issues/7042))\n  * clean up md-scroll-mask element on destroy ([042086f3](https://github.com/angular/material/commit/042086f3), closes [#7049](https://github.com/angular/material/issues/7049), [#7128](https://github.com/angular/material/issues/7128), [#7291](https://github.com/angular/material/issues/7291))\n  * improve promise logic ([4d59a611](https://github.com/angular/material/commit/4d59a611), closes [#6521](https://github.com/angular/material/issues/6521))\n  * fix autocomplete tabindex support ([1f54bf6c](https://github.com/angular/material/commit/1f54bf6c), closes [#6999](https://github.com/angular/material/issues/6999), [#7005](https://github.com/angular/material/issues/7005))\n  * fixes the sizing math ([bc55ac90](https://github.com/angular/material/commit/bc55ac90), closes [#6212](https://github.com/angular/material/issues/6212), [#7015](https://github.com/angular/material/issues/7015))\n  * store hasNotFoundTemplate in shared element ([655eb0f0](https://github.com/angular/material/commit/655eb0f0), closes [#5865](https://github.com/angular/material/issues/5865), [#5867](https://github.com/angular/material/issues/5867))\n  * allow clicking on not-found template. ([52a519ea](https://github.com/angular/material/commit/52a519ea), closes [#6191](https://github.com/angular/material/issues/6191), [#5526](https://github.com/angular/material/issues/5526), [#6103](https://github.com/angular/material/issues/6103))\n* **bidi-demos:** fixed broken demos ([8d7f54fb](https://github.com/angular/material/commit/8d7f54fb), closes [#7399](https://github.com/angular/material/issues/7399), [#7409](https://github.com/angular/material/issues/7409))\n* **build:**\n  * partition IE-only CSS fixes during build ([eaf0fe51](https://github.com/angular/material/commit/eaf0fe51), closes [#6304](https://github.com/angular/material/issues/6304))\n  * add phantomjs polyfill for ng1.5 testing ([86855767](https://github.com/angular/material/commit/86855767))\n* **button:** fixed wrong md-icon selector and changed raised icon color to hue-900 ([f6c93b8f](https://github.com/angular/material/commit/f6c93b8f), closes [#6944](https://github.com/angular/material/issues/6944), [#6945](https://github.com/angular/material/issues/6945))\n* **card:**\n  * flex-size 0px didn't worked well on IE ([4a2e558c](https://github.com/angular/material/commit/4a2e558c), closes [#7061](https://github.com/angular/material/issues/7061), [#7117](https://github.com/angular/material/issues/7117))\n  * image height should maintain aspect ratio ([df902381](https://github.com/angular/material/commit/df902381))\n* **checkbox:**\n  * replaced inherit margin values with 0 ([eb33c371](https://github.com/angular/material/commit/eb33c371), closes [#6472](https://github.com/angular/material/issues/6472))\n  * fix IE11 focus for checkbox ([a5a0eaf0](https://github.com/angular/material/commit/a5a0eaf0), closes [#7086](https://github.com/angular/material/issues/7086), [#7088](https://github.com/angular/material/issues/7088))\n* **chips:**\n  * apply right theme styles ([e4f4533a](https://github.com/angular/material/commit/e4f4533a), closes [#7104](https://github.com/angular/material/issues/7104), [#7428](https://github.com/angular/material/issues/7428))\n  * removed redundant class the enable custom colors on chips ([8177ee95](https://github.com/angular/material/commit/8177ee95), closes [#6965](https://github.com/angular/material/issues/6965), [#7051](https://github.com/angular/material/issues/7051))\n* **constants:** add semicolon keycode ([1aa98f93](https://github.com/angular/material/commit/1aa98f93), closes [#7228](https://github.com/angular/material/issues/7228))\n* **content:** removed foreground and background colors ([4a2c362c](https://github.com/angular/material/commit/4a2c362c), closes [#7422](https://github.com/angular/material/issues/7422))\n* **datePicker:** ensure one is able to override default sass variables values ([2712003b](https://github.com/angular/material/commit/2712003b), closes [#7329](https://github.com/angular/material/issues/7329))\n* **datepicker:** Set vertical align on datepicker tables ([abde470b](https://github.com/angular/material/commit/abde470b), closes [#7278](https://github.com/angular/material/issues/7278))\n* **demo:** observe interpolated docs-demo attributes + fix layout alignment interactive dem ([82625cf4](https://github.com/angular/material/commit/82625cf4), closes [#6564](https://github.com/angular/material/issues/6564), [#6361](https://github.com/angular/material/issues/6361), [#6319](https://github.com/angular/material/issues/6319), [#6567](https://github.com/angular/material/issues/6567))\n* **dialog:**\n  * prefix dialog content probably ([32951a7d](https://github.com/angular/material/commit/32951a7d), closes [#7469](https://github.com/angular/material/issues/7469), [#7480](https://github.com/angular/material/issues/7480))\n  * moved bottom focus trap to be a sibling ([a2eca807](https://github.com/angular/material/commit/a2eca807), closes [#7407](https://github.com/angular/material/issues/7407), [#7408](https://github.com/angular/material/issues/7408))\n  * Unprivatize .md-dialog-container class. ([357e4d58](https://github.com/angular/material/commit/357e4d58), closes [#7449](https://github.com/angular/material/issues/7449))\n  * correctly disable keydown listener for escapeToClose ([72f8dfd6](https://github.com/angular/material/commit/72f8dfd6), closes [#7214](https://github.com/angular/material/issues/7214), [#5153](https://github.com/angular/material/issues/5153), [#7222](https://github.com/angular/material/issues/7222))\n  * prevent duplicate ids for md-dialog and md-dialog-content ([9ace8ecc](https://github.com/angular/material/commit/9ace8ecc), closes [#6339](https://github.com/angular/material/issues/6339), [#6717](https://github.com/angular/material/issues/6717))\n* **docs:**\n  * stretched icon button will interfere with ripple ([7803395b](https://github.com/angular/material/commit/7803395b), closes [#7227](https://github.com/angular/material/issues/7227))\n  * docs stylesheet should not prevent scrolling in code pens ([ced1e83e](https://github.com/angular/material/commit/ced1e83e), closes [#7269](https://github.com/angular/material/issues/7269), [#7216](https://github.com/angular/material/issues/7216), [#7270](https://github.com/angular/material/issues/7270))\n  * DocsDemoCtrl fixed to interpolate and observe. ([da53c008](https://github.com/angular/material/commit/da53c008))\n  * fix animation for menu-toggle ([9a331e7f](https://github.com/angular/material/commit/9a331e7f), closes [#6262](https://github.com/angular/material/issues/6262), [#6936](https://github.com/angular/material/issues/6936), [#6937](https://github.com/angular/material/issues/6937))\n* **fabController:** Properly namespace FabController. ([3a51edf2](https://github.com/angular/material/commit/3a51edf2), closes [#6881](https://github.com/angular/material/issues/6881), [#6919](https://github.com/angular/material/issues/6919))\n* **grid-list:** validate that row height is defined ([f171fd29](https://github.com/angular/material/commit/f171fd29), closes [#6870](https://github.com/angular/material/issues/6870), [#7348](https://github.com/angular/material/issues/7348))\n* **handleMenuItemHover:** allow any mdButton to be a focusableTarget ([0627d9e9](https://github.com/angular/material/commit/0627d9e9), closes [#7221](https://github.com/angular/material/issues/7221))\n* **icon:**\n  * accessibility issue with unique IDs ([810c4f33](https://github.com/angular/material/commit/810c4f33), closes [#6796](https://github.com/angular/material/issues/6796), [#7440](https://github.com/angular/material/issues/7440))\n  * change line-height to icon size ([5a528b8f](https://github.com/angular/material/commit/5a528b8f), closes [#6043](https://github.com/angular/material/issues/6043))\n  * disable e11 focus for SVG icons ([ada5850f](https://github.com/angular/material/commit/ada5850f), closes [#7250](https://github.com/angular/material/issues/7250), [#7321](https://github.com/angular/material/issues/7321))\n* **input:**\n  * IE perf with attribute selectors for ngMessages ([7a15750c](https://github.com/angular/material/commit/7a15750c), closes [#7360](https://github.com/angular/material/issues/7360))\n  * Fix transition when switching tabs in Safari. ([6e685c37](https://github.com/angular/material/commit/6e685c37), closes [#4203](https://github.com/angular/material/issues/4203), [#7207](https://github.com/angular/material/issues/7207))\n  * ngMessages height changing. ([e6176fb5](https://github.com/angular/material/commit/e6176fb5), closes [#7072](https://github.com/angular/material/issues/7072), [#7146](https://github.com/angular/material/issues/7146))\n  * match up all label transitions ([176a2f92](https://github.com/angular/material/commit/176a2f92), closes [#6328](https://github.com/angular/material/issues/6328), [#6400](https://github.com/angular/material/issues/6400))\n  * calculate icon vertical offset ([47f37004](https://github.com/angular/material/commit/47f37004), closes [#5731](https://github.com/angular/material/issues/5731), [#5732](https://github.com/angular/material/issues/5732))\n  * smart icon support for input, textarea, select ([7778a9ca](https://github.com/angular/material/commit/7778a9ca), closes [#6977](https://github.com/angular/material/issues/6977), [#6979](https://github.com/angular/material/issues/6979))\n  * truncate long label ([fd46483c](https://github.com/angular/material/commit/fd46483c), closes [#5331](https://github.com/angular/material/issues/5331), [#6740](https://github.com/angular/material/issues/6740))\n* **interim-element:** cancel was emitted as list and not as stack ([6d39c218](https://github.com/angular/material/commit/6d39c218), closes [#6912](https://github.com/angular/material/issues/6912), [#7053](https://github.com/angular/material/issues/7053))\n* **layout:**\n  * Firefox and flex layout with min-height ([faf58455](https://github.com/angular/material/commit/faf58455), closes [#7382](https://github.com/angular/material/issues/7382))\n  * revert temp fix for Chrome flexbox bug ([557eea8f](https://github.com/angular/material/commit/557eea8f))\n* **list:**\n  * make dense and normal showcase responsive. ([7efb351a](https://github.com/angular/material/commit/7efb351a), closes [#7395](https://github.com/angular/material/issues/7395))\n  * removed `keypress` event listener from first child on destroy ([b2afa360](https://github.com/angular/material/commit/b2afa360), closes [#5842](https://github.com/angular/material/issues/5842), [#7057](https://github.com/angular/material/issues/7057))\n  * apply ripple only once and fix list-inner alignment for multi-line lists. ([db763bc3](https://github.com/angular/material/commit/db763bc3), closes [#7059](https://github.com/angular/material/issues/7059), [#7060](https://github.com/angular/material/issues/7060))\n  * fix converted space when target is content editable. ([70489c25](https://github.com/angular/material/commit/70489c25), closes [#5406](https://github.com/angular/material/issues/5406), [#7161](https://github.com/angular/material/issues/7161))\n  * multi-line inner-text-container should not overflow ([8499d029](https://github.com/angular/material/commit/8499d029), closes [#7065](https://github.com/angular/material/issues/7065), [#7272](https://github.com/angular/material/issues/7272))\n  * fix list margin if anchor is present. ([528a4393](https://github.com/angular/material/commit/528a4393), closes [#5608](https://github.com/angular/material/issues/5608), [#6317](https://github.com/angular/material/issues/6317), [#6496](https://github.com/angular/material/issues/6496))\n  * show item content separated to the button ([bb5c1057](https://github.com/angular/material/commit/bb5c1057), closes [#6984](https://github.com/angular/material/issues/6984), [#6488](https://github.com/angular/material/issues/6488), [#6493](https://github.com/angular/material/issues/6493))\n  * Don't require avatar to be direct child ([2dfd1cd7](https://github.com/angular/material/commit/2dfd1cd7), closes [#5554](https://github.com/angular/material/issues/5554), [#6181](https://github.com/angular/material/issues/6181))\n* **listItem:** allow for multiple md-secondary items ([3ffa0a2b](https://github.com/angular/material/commit/3ffa0a2b), closes [#2595](https://github.com/angular/material/issues/2595), [#5958](https://github.com/angular/material/issues/5958))\n* **md-chips placeholder:** correct placeholder/secondary logic ([dfd4ba2e](https://github.com/angular/material/commit/dfd4ba2e), closes [#6535](https://github.com/angular/material/issues/6535))\n* **menu:** text alignment in md-button with icon and href ([34f2704c](https://github.com/angular/material/commit/34f2704c), closes [#7367](https://github.com/angular/material/issues/7367), [#7401](https://github.com/angular/material/issues/7401))\n* **menuBar:** Fix hovering consecutive nested menus. ([b58343c2](https://github.com/angular/material/commit/b58343c2), closes [#6685](https://github.com/angular/material/issues/6685), [#7361](https://github.com/angular/material/issues/7361))\n* **progress-circular:** removed dependency on `ng-hide` class ([a56591d1](https://github.com/angular/material/commit/a56591d1), closes [#7454](https://github.com/angular/material/issues/7454), [#7460](https://github.com/angular/material/issues/7460))\n* **progress-linear:** changed default behavior of invalid mode ([91ec2bf5](https://github.com/angular/material/commit/91ec2bf5), closes [#7470](https://github.com/angular/material/issues/7470))\n* **progressCircular:**\n  * add ARIA in indeterminate mode, IE10 visibility, test cleanup ([8539eac5](https://github.com/angular/material/commit/8539eac5), closes [#7420](https://github.com/angular/material/issues/7420))\n  * switch to using SVG transform for the indeterminate circle rotation and apply so ([d67389c8](https://github.com/angular/material/commit/d67389c8), closes [#7414](https://github.com/angular/material/issues/7414))\n* **release:** cleans up git commands used for release script ([c60d16be](https://github.com/angular/material/commit/c60d16be), closes [#7369](https://github.com/angular/material/issues/7369))\n* **select:**\n  * use parsed attribute for md-container-class attribute ([9179c619](https://github.com/angular/material/commit/9179c619), closes [#6973](https://github.com/angular/material/issues/6973), [#6976](https://github.com/angular/material/issues/6976))\n  * fix set form to pristine if ng-model for multiple select is predefined. ([19966a31](https://github.com/angular/material/commit/19966a31), closes [#6556](https://github.com/angular/material/issues/6556), [#6782](https://github.com/angular/material/issues/6782))\n* **sidenav:** apply theming on sidenav correctly ([cb864d55](https://github.com/angular/material/commit/cb864d55), closes [#7084](https://github.com/angular/material/issues/7084), [#7374](https://github.com/angular/material/issues/7374))\n* **slider:** allow tabindex overwrite ([9b9e4a5b](https://github.com/angular/material/commit/9b9e4a5b), closes [#5829](https://github.com/angular/material/issues/5829), [#5830](https://github.com/angular/material/issues/5830))\n* **sticky:**\n  * NPE in ([5cf32d0b](https://github.com/angular/material/commit/5cf32d0b), closes [#7316](https://github.com/angular/material/issues/7316))\n  * tests relaid on private classes ([20a4c2f4](https://github.com/angular/material/commit/20a4c2f4), closes [#7307](https://github.com/angular/material/issues/7307))\n  * compile cloned element in the same scope ([76d89c73](https://github.com/angular/material/commit/76d89c73), closes [#4979](https://github.com/angular/material/issues/4979), [#7151](https://github.com/angular/material/issues/7151))\n* **tabs:**\n  * remove inline css width if tabs should stretch ([a838761d](https://github.com/angular/material/commit/a838761d), closes [#7157](https://github.com/angular/material/issues/7157))\n  * fixes background flicker in iOS Safari ([1d8fc166](https://github.com/angular/material/commit/1d8fc166), closes [#6290](https://github.com/angular/material/issues/6290), [#7076](https://github.com/angular/material/issues/7076))\n  * fixes tab math to address issues when used within dialog ([55b71a47](https://github.com/angular/material/commit/55b71a47), closes [#7048](https://github.com/angular/material/issues/7048), [#7118](https://github.com/angular/material/issues/7118))\n* **test:** remove fdescribe in compiler.spec ([e50dd9b8](https://github.com/angular/material/commit/e50dd9b8))\n* **tests:**\n  * update mdCompiler to support unwrapped simple text nodes ([5488d946](https://github.com/angular/material/commit/5488d946))\n  * improve karma config  for failing CI server. ([df268e81](https://github.com/angular/material/commit/df268e81), closes [#7094](https://github.com/angular/material/issues/7094))\n  * configure Travis CI to use PhantomJS2 ([4e977bb0](https://github.com/angular/material/commit/4e977bb0))\n* **toast:** Updated toast styles, added rtl features, added custom demo ([af40e255](https://github.com/angular/material/commit/af40e255), closes [#6649](https://github.com/angular/material/issues/6649), [#7099](https://github.com/angular/material/issues/7099))\n* **toolbar:** apply accent color to ripple and icons in toolbar. ([83829a77](https://github.com/angular/material/commit/83829a77), closes [#5341](https://github.com/angular/material/issues/5341), [#5811](https://github.com/angular/material/issues/5811))\n* **travis:**\n  * update secure access token for Github pushes ([30b370d3](https://github.com/angular/material/commit/30b370d3))\n  * update use of 'secure' token for git pushes ([3badcc08](https://github.com/angular/material/commit/3badcc08), closes [#7247](https://github.com/angular/material/issues/7247))\n  * download PhantomJS2 from bitBucket ([55399162](https://github.com/angular/material/commit/55399162))\n  * removed allow_failures ([0b5fa378](https://github.com/angular/material/commit/0b5fa378))\n* **virtualRepeat:** Do not scroll past bottom Might also fix #4169 ([2bf00ad2](https://github.com/angular/material/commit/2bf00ad2), closes [#6279](https://github.com/angular/material/issues/6279), [#6990](https://github.com/angular/material/issues/6990))\n* **whiteframe:** update breakpoints in whiteframe class demo ([d2913a97](https://github.com/angular/material/commit/d2913a97), closes [#6911](https://github.com/angular/material/issues/6911))\n\n<a name\"1.0.9\"></a>\n### 1.0.9 (2016-05-19, Patch release)\n\n\n#### Features\n\n* **demos:** add global classes support ([6726ca6c](https://github.com/angular/material/commit/6726ca6c), closes [#8400](https://github.com/angular/material/issues/8400), [#8406](https://github.com/angular/material/issues/8406))\n* **panel:**\n  * New `$mdPanel` service!\n\n\n#### Bug Fixes\n\n* **build:** Fix failing tests with Angular 1.6. ([af1e2269](https://github.com/angular/material/commit/af1e2269), closes [#8404](https://github.com/angular/material/issues/8404))\n\n\n<a name\"1.0.8\"></a>\n### 1.0.8 (2016-04-28, Patch release)\n\n\n#### Features\n\n* **autocomplete:**\n  * allow disabling asterisk on floating label ([7361e715](https://github.com/angular/material/commit/7361e715), closes [#7119](https://github.com/angular/material/issues/7119))\n  * allow select on match to be case insensitive. ([5e222561](https://github.com/angular/material/commit/5e222561), closes [#5782](https://github.com/angular/material/issues/5782), [#6935](https://github.com/angular/material/issues/6935))\n  * forward `md-select-on-focus` attribute to input aswell ([2023a33d](https://github.com/angular/material/commit/2023a33d), closes [#7125](https://github.com/angular/material/issues/7125), [#7127](https://github.com/angular/material/issues/7127))\n  * support readonly attribute ([e0a7843f](https://github.com/angular/material/commit/e0a7843f), closes [#5507](https://github.com/angular/material/issues/5507), [#7107](https://github.com/angular/material/issues/7107))\n* **checkbox:** add indeterminate checkbox support ([cd987f0b](https://github.com/angular/material/commit/cd987f0b), closes [#7643](https://github.com/angular/material/issues/7643))\n* **chips:** md-max-chips to specify a maximum of chips that can be added through user input ([64cefc81](https://github.com/angular/material/commit/64cefc81), closes [#6864](https://github.com/angular/material/issues/6864), [#6897](https://github.com/angular/material/issues/6897))\n* **input:**\n  * allow skip hidden inputs ([e7c51e3e](https://github.com/angular/material/commit/e7c51e3e), closes [#2153](https://github.com/angular/material/issues/2153), [#6425](https://github.com/angular/material/issues/6425))\n  * add directive to auto select text on input focus ([cb8ef183](https://github.com/angular/material/commit/cb8ef183), closes [#6679](https://github.com/angular/material/issues/6679), [#6701](https://github.com/angular/material/issues/6701))\n* **select:**\n  * Adding md-select-header directive to md-select. ([c6d08bbf](https://github.com/angular/material/commit/c6d08bbf), closes [#7782](https://github.com/angular/material/issues/7782))\n  * Adding md-selected-text attribute to md-select. ([e7af2c87](https://github.com/angular/material/commit/e7af2c87), closes [#7721](https://github.com/angular/material/issues/7721))\n* **tabs:** allow disabling select click event by adding `md-no-select-click` attribute ([9624dac1](https://github.com/angular/material/commit/9624dac1), closes [#5351](https://github.com/angular/material/issues/5351))\n\n\n#### Breaking Changes\n\n* inputs with type `hidden` will be skipped by the `input-container`\n\nFixes #2153\n\nCloses #6425\n\n ([e7c51e3e](https://github.com/angular/material/commit/e7c51e3e))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * fix autocomplete tabindex support ([321feb00](https://github.com/angular/material/commit/321feb00), closes [#6999](https://github.com/angular/material/issues/6999), [#7005](https://github.com/angular/material/issues/7005))\n  * only handle results if it's an array or a promise ([5eab71b8](https://github.com/angular/material/commit/5eab71b8), closes [#7074](https://github.com/angular/material/issues/7074), [#7089](https://github.com/angular/material/issues/7089))\n  * probably clear the autocomplete. ([b05b1f7c](https://github.com/angular/material/commit/b05b1f7c), closes [#7180](https://github.com/angular/material/issues/7180), [#7354](https://github.com/angular/material/issues/7354))\n  * stop loading if last promise got resolved ([6307516c](https://github.com/angular/material/commit/6307516c), closes [#6907](https://github.com/angular/material/issues/6907), [#6927](https://github.com/angular/material/issues/6927))\n  * fix not found template detection when element is hidden ([3b766479](https://github.com/angular/material/commit/3b766479), closes [#7035](https://github.com/angular/material/issues/7035), [#7142](https://github.com/angular/material/issues/7142), [#7042](https://github.com/angular/material/issues/7042))\n  * clean up md-scroll-mask element on destroy ([acbd5c6a](https://github.com/angular/material/commit/acbd5c6a), closes [#7049](https://github.com/angular/material/issues/7049), [#7128](https://github.com/angular/material/issues/7128), [#7291](https://github.com/angular/material/issues/7291))\n  * fixes the sizing math ([2390d88b](https://github.com/angular/material/commit/2390d88b), closes [#6212](https://github.com/angular/material/issues/6212), [#7015](https://github.com/angular/material/issues/7015))\n  * store hasNotFoundTemplate in shared element ([0f9dae36](https://github.com/angular/material/commit/0f9dae36), closes [#5865](https://github.com/angular/material/issues/5865), [#5867](https://github.com/angular/material/issues/5867))\n  * allow clicking on not-found template. ([4ef9674c](https://github.com/angular/material/commit/4ef9674c), closes [#6191](https://github.com/angular/material/issues/6191), [#5526](https://github.com/angular/material/issues/5526), [#6103](https://github.com/angular/material/issues/6103))\n* **build:**\n  * bower-material-release should force remove the stale layout files. ([a543def6](https://github.com/angular/material/commit/a543def6), closes [#7807](https://github.com/angular/material/issues/7807))\n  * remove stale bower-material/layout css files ([ab1a7d2f](https://github.com/angular/material/commit/ab1a7d2f))\n  * closure build needs @ngInject to $mdUtil ([d3c29fe2](https://github.com/angular/material/commit/d3c29fe2), closes [#7611](https://github.com/angular/material/issues/7611), [#7609](https://github.com/angular/material/issues/7609), [#7608](https://github.com/angular/material/issues/7608))\n  * closure build needs @ngInject annotation ([79a00dbd](https://github.com/angular/material/commit/79a00dbd), closes [#7613](https://github.com/angular/material/issues/7613))\n* **button:** fixed wrong md-icon selector and changed raised icon color to hue-900 ([32435759](https://github.com/angular/material/commit/32435759), closes [#6944](https://github.com/angular/material/issues/6944), [#6945](https://github.com/angular/material/issues/6945))\n* **card:** remove duplicate demo module names. ([cc47355a](https://github.com/angular/material/commit/cc47355a), closes [#7693](https://github.com/angular/material/issues/7693))\n* **checkbox:**\n  * pointer events disable ripple events too ([f790e93e](https://github.com/angular/material/commit/f790e93e), closes [#7538](https://github.com/angular/material/issues/7538), [#7541](https://github.com/angular/material/issues/7541))\n  * fix IE11 focus for checkbox ([1f6cd8f9](https://github.com/angular/material/commit/1f6cd8f9), closes [#7086](https://github.com/angular/material/issues/7086), [#7088](https://github.com/angular/material/issues/7088))\n* **chips:**\n  * fix md-max-chips for autocomplete watcher ([ed4b20f1](https://github.com/angular/material/commit/ed4b20f1), closes [#7549](https://github.com/angular/material/issues/7549), [#7550](https://github.com/angular/material/issues/7550))\n  * do not trim the input model. ([d7c389d7](https://github.com/angular/material/commit/d7c389d7), closes [#7243](https://github.com/angular/material/issues/7243), [#7748](https://github.com/angular/material/issues/7748))\n  * fix chips focus functionality ([cfb285cb](https://github.com/angular/material/commit/cfb285cb), closes [#5897](https://github.com/angular/material/issues/5897), [#5662](https://github.com/angular/material/issues/5662), [#5941](https://github.com/angular/material/issues/5941))\n* **constants:** add semicolon keycode ([5e8cf9eb](https://github.com/angular/material/commit/5e8cf9eb), closes [#7228](https://github.com/angular/material/issues/7228))\n* **datePicker:** ensure one is able to override default sass variables values ([dee1c1c7](https://github.com/angular/material/commit/dee1c1c7), closes [#7329](https://github.com/angular/material/issues/7329))\n* **datepicker:**\n  * style demo ngMessage as same as input messages. ([0e5c253a](https://github.com/angular/material/commit/0e5c253a), closes [#7071](https://github.com/angular/material/issues/7071), [#7219](https://github.com/angular/material/issues/7219))\n  * enable scrolling when scope destroyed. ([4d639b0d](https://github.com/angular/material/commit/4d639b0d), closes [#7542](https://github.com/angular/material/issues/7542), [#7544](https://github.com/angular/material/issues/7544))\n* **demo:**\n  * use md-dialog-actions ([e12859a7](https://github.com/angular/material/commit/e12859a7))\n  * observe interpolated docs-demo attributes + fix layout alignment interactive dem ([d0deb379](https://github.com/angular/material/commit/d0deb379), closes [#6564](https://github.com/angular/material/issues/6564), [#6361](https://github.com/angular/material/issues/6361), [#6319](https://github.com/angular/material/issues/6319), [#6567](https://github.com/angular/material/issues/6567))\n* **dialog:**\n  * don't clobber md-dialog id ([8390c22d](https://github.com/angular/material/commit/8390c22d))\n  * prefix dialog content probably ([3a41828a](https://github.com/angular/material/commit/3a41828a), closes [#7469](https://github.com/angular/material/issues/7469), [#7480](https://github.com/angular/material/issues/7480))\n  * moved bottom focus trap to be a sibling ([1e2d3806](https://github.com/angular/material/commit/1e2d3806), closes [#7407](https://github.com/angular/material/issues/7407), [#7408](https://github.com/angular/material/issues/7408))\n  * correctly disable keydown listener for escapeToClose ([35de3d1a](https://github.com/angular/material/commit/35de3d1a), closes [#7214](https://github.com/angular/material/issues/7214), [#5153](https://github.com/angular/material/issues/5153), [#7222](https://github.com/angular/material/issues/7222))\n* **docs:**\n  * retrieve source descriptor dynamically. ([4e3846dd](https://github.com/angular/material/commit/4e3846dd), closes [#7131](https://github.com/angular/material/issues/7131), [#7319](https://github.com/angular/material/issues/7319))\n  * stretched icon button will interfere with ripple ([c59f33e4](https://github.com/angular/material/commit/c59f33e4), closes [#7227](https://github.com/angular/material/issues/7227))\n  * docs stylesheet should not prevent scrolling in code pens ([f2858c61](https://github.com/angular/material/commit/f2858c61), closes [#7269](https://github.com/angular/material/issues/7269), [#7216](https://github.com/angular/material/issues/7216), [#7270](https://github.com/angular/material/issues/7270))\n  * DocsDemoCtrl fixed to interpolate and observe. ([893b67ec](https://github.com/angular/material/commit/893b67ec))\n  * fix animation for menu-toggle ([c739d110](https://github.com/angular/material/commit/c739d110), closes [#6262](https://github.com/angular/material/issues/6262), [#6936](https://github.com/angular/material/issues/6936), [#6937](https://github.com/angular/material/issues/6937))\n* **grid-list:** validate that row height is defined ([a8b886ab](https://github.com/angular/material/commit/a8b886ab), closes [#6870](https://github.com/angular/material/issues/6870), [#7348](https://github.com/angular/material/issues/7348))\n* **handleMenuItemHover:** allow any mdButton to be a focusableTarget ([0fa96d54](https://github.com/angular/material/commit/0fa96d54), closes [#7221](https://github.com/angular/material/issues/7221))\n* **icon:**\n  * rename nodes id's from cache to prevent duplicates. ([0afbbd04](https://github.com/angular/material/commit/0afbbd04), closes [#7468](https://github.com/angular/material/issues/7468))\n  * Allow using data URLs ([e494c159](https://github.com/angular/material/commit/e494c159), closes [#4126](https://github.com/angular/material/issues/4126), [#7547](https://github.com/angular/material/issues/7547))\n  * accessibility issue with unique IDs ([5a2ad02e](https://github.com/angular/material/commit/5a2ad02e), closes [#6796](https://github.com/angular/material/issues/6796), [#7440](https://github.com/angular/material/issues/7440))\n  * disable e11 focus for SVG icons ([ccc1fdb5](https://github.com/angular/material/commit/ccc1fdb5), closes [#7250](https://github.com/angular/material/issues/7250), [#7321](https://github.com/angular/material/issues/7321))\n* **input:**\n  * IE perf with attribute selectors for ngMessages ([e8cbc957](https://github.com/angular/material/commit/e8cbc957), closes [#7360](https://github.com/angular/material/issues/7360))\n  * Fix transition when switching tabs in Safari. ([b944ea1e](https://github.com/angular/material/commit/b944ea1e), closes [#4203](https://github.com/angular/material/issues/4203), [#7207](https://github.com/angular/material/issues/7207))\n* **interim-element:** cancel was emitted as list and not as stack ([f4ac5299](https://github.com/angular/material/commit/f4ac5299), closes [#6912](https://github.com/angular/material/issues/6912), [#7053](https://github.com/angular/material/issues/7053))\n* **layout:** Firefox and flex layout with min-height ([ee3cab59](https://github.com/angular/material/commit/ee3cab59), closes [#7382](https://github.com/angular/material/issues/7382))\n* **list:**\n  * removed `keypress` event listener from first child on destroy ([2df6cffa](https://github.com/angular/material/commit/2df6cffa), closes [#5842](https://github.com/angular/material/issues/5842), [#7057](https://github.com/angular/material/issues/7057))\n  * fix converted space when target is content editable. ([5d596a4f](https://github.com/angular/material/commit/5d596a4f), closes [#5406](https://github.com/angular/material/issues/5406), [#7161](https://github.com/angular/material/issues/7161))\n* **md-chips placeholder:** correct placeholder/secondary logic ([367d0ccc](https://github.com/angular/material/commit/367d0ccc), closes [#6535](https://github.com/angular/material/issues/6535))\n* **mdSelect:** fix flickering of ngMessages on mdSelect opening ([b54f7ede](https://github.com/angular/material/commit/b54f7ede), closes [#7636](https://github.com/angular/material/issues/7636), [#7646](https://github.com/angular/material/issues/7646))\n* **menuBar:** Fix hovering consecutive nested menus. ([4bdda21c](https://github.com/angular/material/commit/4bdda21c), closes [#6685](https://github.com/angular/material/issues/6685), [#7361](https://github.com/angular/material/issues/7361))\n* **menubar:** remove debugger; statement ([822267b0](https://github.com/angular/material/commit/822267b0))\n* **radioButton:** replaced inherit margin values with 0 Inherit is not the proper value, 0 should  ([39619ae4](https://github.com/angular/material/commit/39619ae4), closes [#7740](https://github.com/angular/material/issues/7740), [#7770](https://github.com/angular/material/issues/7770))\n* **release:**\n  * specifies upstream URL when pushing to material repo ([7abfddf5](https://github.com/angular/material/commit/7abfddf5), closes [#7852](https://github.com/angular/material/issues/7852))\n  * replace https urls with ssh versions to prevent typing password during release ([cdecdd2a](https://github.com/angular/material/commit/cdecdd2a), closes [#8070](https://github.com/angular/material/issues/8070))\n  * adds `newVersion` value to node string to update package.json ([0e13786b](https://github.com/angular/material/commit/0e13786b), closes [#7810](https://github.com/angular/material/issues/7810))\n  * cleans up git commands used for release script ([4b0d1bfe](https://github.com/angular/material/commit/4b0d1bfe), closes [#7369](https://github.com/angular/material/issues/7369))\n* **select:**\n  * md-checkbox inside md-list-item using incorrect text color. ([d9682e24](https://github.com/angular/material/commit/d9682e24), closes [#7893](https://github.com/angular/material/issues/7893))\n  * prevent labels from overflowing ([d0c781f9](https://github.com/angular/material/commit/d0c781f9), closes [#7865](https://github.com/angular/material/issues/7865))\n  * disabled state, invalid html in unit tests ([d2c29b59](https://github.com/angular/material/commit/d2c29b59), closes [#7773](https://github.com/angular/material/issues/7773), [#7778](https://github.com/angular/material/issues/7778))\n  * spinner size ([2dcc90eb](https://github.com/angular/material/commit/2dcc90eb), closes [#7505](https://github.com/angular/material/issues/7505), [#7506](https://github.com/angular/material/issues/7506))\n  * use parsed attribute for md-container-class attribute ([ecd68378](https://github.com/angular/material/commit/ecd68378), closes [#6973](https://github.com/angular/material/issues/6973), [#6976](https://github.com/angular/material/issues/6976))\n  * fix set form to pristine if ng-model for multiple select is predefined. ([e164e69d](https://github.com/angular/material/commit/e164e69d), closes [#6556](https://github.com/angular/material/issues/6556), [#6782](https://github.com/angular/material/issues/6782))\n* **sidenav:**\n  * enable native scrolling on touch devices ([e440edbf](https://github.com/angular/material/commit/e440edbf), closes [#7786](https://github.com/angular/material/issues/7786), [#7751](https://github.com/angular/material/issues/7751))\n  * apply theming on sidenav correctly ([035626be](https://github.com/angular/material/commit/035626be), closes [#7084](https://github.com/angular/material/issues/7084), [#7374](https://github.com/angular/material/issues/7374))\n* **slider:** allow tabindex overwrite ([47cfe446](https://github.com/angular/material/commit/47cfe446), closes [#5829](https://github.com/angular/material/issues/5829), [#5830](https://github.com/angular/material/issues/5830))\n* **sticky:**\n  * logic NPE ([63098b08](https://github.com/angular/material/commit/63098b08), closes [#7316](https://github.com/angular/material/issues/7316))\n  * compile cloned element in the same scope ([026c87be](https://github.com/angular/material/commit/026c87be), closes [#4979](https://github.com/angular/material/issues/4979), [#7151](https://github.com/angular/material/issues/7151))\n* **tabs:**\n  * fix always ignoring click events ([c998c49c](https://github.com/angular/material/commit/c998c49c), closes [#6482](https://github.com/angular/material/issues/6482))\n  * fixes background flicker in iOS Safari ([8961dcb2](https://github.com/angular/material/commit/8961dcb2), closes [#6290](https://github.com/angular/material/issues/6290), [#7076](https://github.com/angular/material/issues/7076))\n  * fixes tab math to address issues when used within dialog ([463d5e3f](https://github.com/angular/material/commit/463d5e3f), closes [#7048](https://github.com/angular/material/issues/7048), [#7118](https://github.com/angular/material/issues/7118))\n* **tests:**\n  * update mdCompiler to support unwrapped simple text nodes ([36df9b9b](https://github.com/angular/material/commit/36df9b9b))\n  * remove invalid use of css private names ([d35c3bbd](https://github.com/angular/material/commit/d35c3bbd))\n* **theming:** theming should also watch for controller changes. ([3e35ef0a](https://github.com/angular/material/commit/3e35ef0a), closes [#5899](https://github.com/angular/material/issues/5899), [#7154](https://github.com/angular/material/issues/7154))\n* **toast:** better toast templating allowing comments and sibling elements ([57a929a2](https://github.com/angular/material/commit/57a929a2), closes [#6259](https://github.com/angular/material/issues/6259), [#6494](https://github.com/angular/material/issues/6494))\n* **util:** restore scrolling after test executed. ([59144784](https://github.com/angular/material/commit/59144784), closes [#8206](https://github.com/angular/material/issues/8206))\n* **virtualRepeat:**\n  * Memory leak ([ac010d39](https://github.com/angular/material/commit/ac010d39), closes [#8055](https://github.com/angular/material/issues/8055), [#8056](https://github.com/angular/material/issues/8056))\n  * Do not scroll past bottom Might also fix #4169 ([9a36112c](https://github.com/angular/material/commit/9a36112c), closes [#6279](https://github.com/angular/material/issues/6279), [#6990](https://github.com/angular/material/issues/6990))\n* **whiteframe:** update breakpoints in whiteframe class demo ([c43b1a34](https://github.com/angular/material/commit/c43b1a34))\n\n<a name\"1.0.7\"></a>\n### 1.0.7 (2016-04-01, Patch Release)\n\n\n#### Features\n\n* **autocomplete:**\n  * allow disabling asterisk on floating label ([7361e715](https://github.com/angular/material/commit/7361e715), closes [#7119](https://github.com/angular/material/issues/7119))\n  * allow select on match to be case insensitive. ([5e222561](https://github.com/angular/material/commit/5e222561), closes [#5782](https://github.com/angular/material/issues/5782), [#6935](https://github.com/angular/material/issues/6935))\n  * forward `md-select-on-focus` attribute to input aswell ([2023a33d](https://github.com/angular/material/commit/2023a33d), closes [#7125](https://github.com/angular/material/issues/7125), [#7127](https://github.com/angular/material/issues/7127))\n  * support readonly attribute ([e0a7843f](https://github.com/angular/material/commit/e0a7843f), closes [#5507](https://github.com/angular/material/issues/5507), [#7107](https://github.com/angular/material/issues/7107))\n* **chips:** md-max-chips to specify a maximum of chips that can be added through user input ([64cefc81](https://github.com/angular/material/commit/64cefc81), closes [#6864](https://github.com/angular/material/issues/6864), [#6897](https://github.com/angular/material/issues/6897))\n* **input:**\n  * allow skip hidden inputs ([e7c51e3e](https://github.com/angular/material/commit/e7c51e3e), closes [#2153](https://github.com/angular/material/issues/2153), [#6425](https://github.com/angular/material/issues/6425))\n  * add directive to auto select text on input focus ([cb8ef183](https://github.com/angular/material/commit/cb8ef183), closes [#6679](https://github.com/angular/material/issues/6679), [#6701](https://github.com/angular/material/issues/6701))\n* **tabs:** allow disabling select click event by adding `md-no-select-click` attribute ([9624dac1](https://github.com/angular/material/commit/9624dac1), closes [#5351](https://github.com/angular/material/issues/5351))\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * fix autocomplete tabindex support ([321feb00](https://github.com/angular/material/commit/321feb00), closes [#6999](https://github.com/angular/material/issues/6999), [#7005](https://github.com/angular/material/issues/7005))\n  * only handle results if it's an array or a promise ([5eab71b8](https://github.com/angular/material/commit/5eab71b8), closes [#7074](https://github.com/angular/material/issues/7074), [#7089](https://github.com/angular/material/issues/7089))\n  * probably clear the autocomplete. ([b05b1f7c](https://github.com/angular/material/commit/b05b1f7c), closes [#7180](https://github.com/angular/material/issues/7180), [#7354](https://github.com/angular/material/issues/7354))\n  * stop loading if last promise got resolved ([6307516c](https://github.com/angular/material/commit/6307516c), closes [#6907](https://github.com/angular/material/issues/6907), [#6927](https://github.com/angular/material/issues/6927))\n  * fix not found template detection when element is hidden ([3b766479](https://github.com/angular/material/commit/3b766479), closes [#7035](https://github.com/angular/material/issues/7035), [#7142](https://github.com/angular/material/issues/7142), [#7042](https://github.com/angular/material/issues/7042))\n  * clean up md-scroll-mask element on destroy ([acbd5c6a](https://github.com/angular/material/commit/acbd5c6a), closes [#7049](https://github.com/angular/material/issues/7049), [#7128](https://github.com/angular/material/issues/7128), [#7291](https://github.com/angular/material/issues/7291))\n  * fixes the sizing math ([2390d88b](https://github.com/angular/material/commit/2390d88b), closes [#6212](https://github.com/angular/material/issues/6212), [#7015](https://github.com/angular/material/issues/7015))\n  * store hasNotFoundTemplate in shared element ([0f9dae36](https://github.com/angular/material/commit/0f9dae36), closes [#5865](https://github.com/angular/material/issues/5865), [#5867](https://github.com/angular/material/issues/5867))\n  * allow clicking on not-found template. ([4ef9674c](https://github.com/angular/material/commit/4ef9674c), closes [#6191](https://github.com/angular/material/issues/6191), [#5526](https://github.com/angular/material/issues/5526), [#6103](https://github.com/angular/material/issues/6103))\n* **build:**\n  * bower-material-release should force remove the stale layout files. ([a543def6](https://github.com/angular/material/commit/a543def6), closes [#7807](https://github.com/angular/material/issues/7807))\n  * remove stale bower-material/layout css files ([ab1a7d2f](https://github.com/angular/material/commit/ab1a7d2f))\n  * closure build needs @ngInject to $mdUtil ([d3c29fe2](https://github.com/angular/material/commit/d3c29fe2), closes [#7611](https://github.com/angular/material/issues/7611), [#7609](https://github.com/angular/material/issues/7609), [#7608](https://github.com/angular/material/issues/7608))\n  * closure build needs @ngInject annotation ([79a00dbd](https://github.com/angular/material/commit/79a00dbd), closes [#7613](https://github.com/angular/material/issues/7613))\n* **button:** fixed wrong md-icon selector and changed raised icon color to hue-900 ([32435759](https://github.com/angular/material/commit/32435759), closes [#6944](https://github.com/angular/material/issues/6944), [#6945](https://github.com/angular/material/issues/6945))\n* **card:** remove duplicate demo module names. ([cc47355a](https://github.com/angular/material/commit/cc47355a), closes [#7693](https://github.com/angular/material/issues/7693))\n* **checkbox:**\n  * pointer events disable ripple events too ([f790e93e](https://github.com/angular/material/commit/f790e93e), closes [#7538](https://github.com/angular/material/issues/7538), [#7541](https://github.com/angular/material/issues/7541))\n  * fix IE11 focus for checkbox ([1f6cd8f9](https://github.com/angular/material/commit/1f6cd8f9), closes [#7086](https://github.com/angular/material/issues/7086), [#7088](https://github.com/angular/material/issues/7088))\n* **chips:**\n  * fix md-max-chips for autocomplete watcher ([ed4b20f1](https://github.com/angular/material/commit/ed4b20f1), closes [#7549](https://github.com/angular/material/issues/7549), [#7550](https://github.com/angular/material/issues/7550))\n  * do not trim the input model. ([d7c389d7](https://github.com/angular/material/commit/d7c389d7), closes [#7243](https://github.com/angular/material/issues/7243), [#7748](https://github.com/angular/material/issues/7748))\n  * fix chips focus functionality ([cfb285cb](https://github.com/angular/material/commit/cfb285cb), closes [#5897](https://github.com/angular/material/issues/5897), [#5662](https://github.com/angular/material/issues/5662), [#5941](https://github.com/angular/material/issues/5941))\n* **constants:** add semicolon keycode ([5e8cf9eb](https://github.com/angular/material/commit/5e8cf9eb), closes [#7228](https://github.com/angular/material/issues/7228))\n* **datePicker:** ensure one is able to override default sass variables values ([dee1c1c7](https://github.com/angular/material/commit/dee1c1c7), closes [#7329](https://github.com/angular/material/issues/7329))\n* **datepicker:**\n  * style demo ngMessage as same as input messages. ([0e5c253a](https://github.com/angular/material/commit/0e5c253a), closes [#7071](https://github.com/angular/material/issues/7071), [#7219](https://github.com/angular/material/issues/7219))\n  * enable scrolling when scope destroyed. ([4d639b0d](https://github.com/angular/material/commit/4d639b0d), closes [#7542](https://github.com/angular/material/issues/7542), [#7544](https://github.com/angular/material/issues/7544))\n* **demo:**\n  * use md-dialog-actions ([e12859a7](https://github.com/angular/material/commit/e12859a7))\n  * observe interpolated docs-demo attributes + fix layout alignment interactive dem ([d0deb379](https://github.com/angular/material/commit/d0deb379), closes [#6564](https://github.com/angular/material/issues/6564), [#6361](https://github.com/angular/material/issues/6361), [#6319](https://github.com/angular/material/issues/6319), [#6567](https://github.com/angular/material/issues/6567))\n* **dialog:**\n  * prefix dialog content probably ([3a41828a](https://github.com/angular/material/commit/3a41828a), closes [#7469](https://github.com/angular/material/issues/7469), [#7480](https://github.com/angular/material/issues/7480))\n  * moved bottom focus trap to be a sibling ([1e2d3806](https://github.com/angular/material/commit/1e2d3806), closes [#7407](https://github.com/angular/material/issues/7407), [#7408](https://github.com/angular/material/issues/7408))\n  * correctly disable keydown listener for escapeToClose ([35de3d1a](https://github.com/angular/material/commit/35de3d1a), closes [#7214](https://github.com/angular/material/issues/7214), [#5153](https://github.com/angular/material/issues/5153), [#7222](https://github.com/angular/material/issues/7222))\n* **docs:**\n  * retrieve source descriptor dynamically. ([4e3846dd](https://github.com/angular/material/commit/4e3846dd), closes [#7131](https://github.com/angular/material/issues/7131), [#7319](https://github.com/angular/material/issues/7319))\n  * stretched icon button will interfere with ripple ([c59f33e4](https://github.com/angular/material/commit/c59f33e4), closes [#7227](https://github.com/angular/material/issues/7227))\n  * docs stylesheet should not prevent scrolling in code pens ([f2858c61](https://github.com/angular/material/commit/f2858c61), closes [#7269](https://github.com/angular/material/issues/7269), [#7216](https://github.com/angular/material/issues/7216), [#7270](https://github.com/angular/material/issues/7270))\n  * DocsDemoCtrl fixed to interpolate and observe. ([893b67ec](https://github.com/angular/material/commit/893b67ec))\n  * fix animation for menu-toggle ([c739d110](https://github.com/angular/material/commit/c739d110), closes [#6262](https://github.com/angular/material/issues/6262), [#6936](https://github.com/angular/material/issues/6936), [#6937](https://github.com/angular/material/issues/6937))\n* **grid-list:** validate that row height is defined ([a8b886ab](https://github.com/angular/material/commit/a8b886ab), closes [#6870](https://github.com/angular/material/issues/6870), [#7348](https://github.com/angular/material/issues/7348))\n* **handleMenuItemHover:** allow any mdButton to be a focusableTarget ([0fa96d54](https://github.com/angular/material/commit/0fa96d54), closes [#7221](https://github.com/angular/material/issues/7221))\n* **icon:**\n  * rename nodes id's from cache to prevent duplicates. ([0afbbd04](https://github.com/angular/material/commit/0afbbd04), closes [#7468](https://github.com/angular/material/issues/7468))\n  * Allow using data URLs ([e494c159](https://github.com/angular/material/commit/e494c159), closes [#4126](https://github.com/angular/material/issues/4126), [#7547](https://github.com/angular/material/issues/7547))\n  * accessibility issue with unique IDs ([5a2ad02e](https://github.com/angular/material/commit/5a2ad02e), closes [#6796](https://github.com/angular/material/issues/6796), [#7440](https://github.com/angular/material/issues/7440))\n  * disable e11 focus for SVG icons ([ccc1fdb5](https://github.com/angular/material/commit/ccc1fdb5), closes [#7250](https://github.com/angular/material/issues/7250), [#7321](https://github.com/angular/material/issues/7321))\n* **input:**\n  * IE perf with attribute selectors for ngMessages ([e8cbc957](https://github.com/angular/material/commit/e8cbc957), closes [#7360](https://github.com/angular/material/issues/7360))\n  * Fix transition when switching tabs in Safari. ([b944ea1e](https://github.com/angular/material/commit/b944ea1e), closes [#4203](https://github.com/angular/material/issues/4203), [#7207](https://github.com/angular/material/issues/7207))\n* **interim-element:** cancel was emitted as list and not as stack ([f4ac5299](https://github.com/angular/material/commit/f4ac5299), closes [#6912](https://github.com/angular/material/issues/6912), [#7053](https://github.com/angular/material/issues/7053))\n* **layout:** Firefox and flex layout with min-height ([ee3cab59](https://github.com/angular/material/commit/ee3cab59), closes [#7382](https://github.com/angular/material/issues/7382))\n* **list:**\n  * removed `keypress` event listener from first child on destroy ([2df6cffa](https://github.com/angular/material/commit/2df6cffa), closes [#5842](https://github.com/angular/material/issues/5842), [#7057](https://github.com/angular/material/issues/7057))\n  * fix converted space when target is content editable. ([5d596a4f](https://github.com/angular/material/commit/5d596a4f), closes [#5406](https://github.com/angular/material/issues/5406), [#7161](https://github.com/angular/material/issues/7161))\n* **md-chips placeholder:** correct placeholder/secondary logic ([367d0ccc](https://github.com/angular/material/commit/367d0ccc), closes [#6535](https://github.com/angular/material/issues/6535))\n* **mdSelect:** fix flickering of ngMessages on mdSelect opening ([b54f7ede](https://github.com/angular/material/commit/b54f7ede), closes [#7636](https://github.com/angular/material/issues/7636), [#7646](https://github.com/angular/material/issues/7646))\n* **menuBar:** Fix hovering consecutive nested menus. ([4bdda21c](https://github.com/angular/material/commit/4bdda21c), closes [#6685](https://github.com/angular/material/issues/6685), [#7361](https://github.com/angular/material/issues/7361))\n* **menubar:** remove debugger; statement ([822267b0](https://github.com/angular/material/commit/822267b0))\n* **radioButton:** replaced inherit margin values with 0 Inherit is not the proper value, 0 should  ([39619ae4](https://github.com/angular/material/commit/39619ae4), closes [#7740](https://github.com/angular/material/issues/7740), [#7770](https://github.com/angular/material/issues/7770))\n* **release:**\n  * adds `newVersion` value to node string to update package.json ([0e13786b](https://github.com/angular/material/commit/0e13786b), closes [#7810](https://github.com/angular/material/issues/7810))\n  * cleans up git commands used for release script ([4b0d1bfe](https://github.com/angular/material/commit/4b0d1bfe), closes [#7369](https://github.com/angular/material/issues/7369))\n* **select:**\n  * disabled state, invalid html in unit tests ([d2c29b59](https://github.com/angular/material/commit/d2c29b59), closes [#7773](https://github.com/angular/material/issues/7773), [#7778](https://github.com/angular/material/issues/7778))\n  * spinner size ([2dcc90eb](https://github.com/angular/material/commit/2dcc90eb), closes [#7505](https://github.com/angular/material/issues/7505), [#7506](https://github.com/angular/material/issues/7506))\n  * use parsed attribute for md-container-class attribute ([ecd68378](https://github.com/angular/material/commit/ecd68378), closes [#6973](https://github.com/angular/material/issues/6973), [#6976](https://github.com/angular/material/issues/6976))\n  * fix set form to pristine if ng-model for multiple select is predefined. ([e164e69d](https://github.com/angular/material/commit/e164e69d), closes [#6556](https://github.com/angular/material/issues/6556), [#6782](https://github.com/angular/material/issues/6782))\n* **sidenav:**\n  * enable native scrolling on touch devices ([e440edbf](https://github.com/angular/material/commit/e440edbf), closes [#7786](https://github.com/angular/material/issues/7786), [#7751](https://github.com/angular/material/issues/7751))\n  * apply theming on sidenav correctly ([035626be](https://github.com/angular/material/commit/035626be), closes [#7084](https://github.com/angular/material/issues/7084), [#7374](https://github.com/angular/material/issues/7374))\n* **slider:** allow tabindex overwrite ([47cfe446](https://github.com/angular/material/commit/47cfe446), closes [#5829](https://github.com/angular/material/issues/5829), [#5830](https://github.com/angular/material/issues/5830))\n* **sticky:**\n  * logic NPE ([63098b08](https://github.com/angular/material/commit/63098b08), closes [#7316](https://github.com/angular/material/issues/7316))\n  * compile cloned element in the same scope ([026c87be](https://github.com/angular/material/commit/026c87be), closes [#4979](https://github.com/angular/material/issues/4979), [#7151](https://github.com/angular/material/issues/7151))\n* **tabs:**\n  * fix always ignoring click events ([c998c49c](https://github.com/angular/material/commit/c998c49c), closes [#6482](https://github.com/angular/material/issues/6482))\n  * fixes background flicker in iOS Safari ([8961dcb2](https://github.com/angular/material/commit/8961dcb2), closes [#6290](https://github.com/angular/material/issues/6290), [#7076](https://github.com/angular/material/issues/7076))\n  * fixes tab math to address issues when used within dialog ([463d5e3f](https://github.com/angular/material/commit/463d5e3f), closes [#7048](https://github.com/angular/material/issues/7048), [#7118](https://github.com/angular/material/issues/7118))\n* **tests:**\n  * update mdCompiler to support unwrapped simple text nodes ([36df9b9b](https://github.com/angular/material/commit/36df9b9b))\n  * remove invalid use of css private names ([d35c3bbd](https://github.com/angular/material/commit/d35c3bbd))\n* **theming:** theming should also watch for controller changes. ([3e35ef0a](https://github.com/angular/material/commit/3e35ef0a), closes [#5899](https://github.com/angular/material/issues/5899), [#7154](https://github.com/angular/material/issues/7154))\n* **toast:** better toast templating allowing comments and sibling elements ([57a929a2](https://github.com/angular/material/commit/57a929a2), closes [#6259](https://github.com/angular/material/issues/6259), [#6494](https://github.com/angular/material/issues/6494))\n* **virtualRepeat:** Do not scroll past bottom Might also fix #4169 ([9a36112c](https://github.com/angular/material/commit/9a36112c), closes [#6279](https://github.com/angular/material/issues/6279), [#6990](https://github.com/angular/material/issues/6990))\n* **whiteframe:** update breakpoints in whiteframe class demo ([c43b1a34](https://github.com/angular/material/commit/c43b1a34))\n\n\n\n<a name\"1.0.6\"></a>\n### 1.0.6 (2016-02-29)\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * fix not found template detection when element is hidden ([3b766479](https://github.com/angular/material/commit/3b766479), closes [#7035](https://github.com/angular/material/issues/7035), [#7142](https://github.com/angular/material/issues/7142), [#7042](https://github.com/angular/material/issues/7042))\n  * clean up md-scroll-mask element on destroy ([acbd5c6a](https://github.com/angular/material/commit/acbd5c6a), closes [#7049](https://github.com/angular/material/issues/7049), [#7128](https://github.com/angular/material/issues/7128), [#7291](https://github.com/angular/material/issues/7291))\n* **constants:** add semicolon keycode ([5e8cf9eb](https://github.com/angular/material/commit/5e8cf9eb), closes [#7228](https://github.com/angular/material/issues/7228))\n* **dialog:** correctly disable keydown listener for escapeToClose ([35de3d1a](https://github.com/angular/material/commit/35de3d1a), closes [#7214](https://github.com/angular/material/issues/7214), [#5153](https://github.com/angular/material/issues/5153), [#7222](https://github.com/angular/material/issues/7222))\n* **docs:**\n  * stretched icon button will interfere with ripple ([c59f33e4](https://github.com/angular/material/commit/c59f33e4), closes [#7227](https://github.com/angular/material/issues/7227))\n  * docs stylesheet should not prevent scrolling in code pens ([f2858c61](https://github.com/angular/material/commit/f2858c61), closes [#7269](https://github.com/angular/material/issues/7269), [#7216](https://github.com/angular/material/issues/7216), [#7270](https://github.com/angular/material/issues/7270))\n* **handleMenuItemHover:** allow any mdButton to be a focusableTarget ([0fa96d54](https://github.com/angular/material/commit/0fa96d54), closes [#7221](https://github.com/angular/material/issues/7221))\n* **input:** Fix transition when switching tabs in Safari. ([b944ea1e](https://github.com/angular/material/commit/b944ea1e), closes [#4203](https://github.com/angular/material/issues/4203), [#7207](https://github.com/angular/material/issues/7207))\n* **list:** fix converted space when target is content editable. ([5d596a4f](https://github.com/angular/material/commit/5d596a4f), closes [#5406](https://github.com/angular/material/issues/5406), [#7161](https://github.com/angular/material/issues/7161))\n* **sticky:**\n  * logic NPE ([63098b08](https://github.com/angular/material/commit/63098b08), closes [#7316](https://github.com/angular/material/issues/7316))\n  * compile cloned element in the same scope ([026c87be](https://github.com/angular/material/commit/026c87be), closes [#4979](https://github.com/angular/material/issues/4979), [#7151](https://github.com/angular/material/issues/7151))\n* **tabs:**\n  * fixes background flicker in iOS Safari ([8961dcb2](https://github.com/angular/material/commit/8961dcb2), closes [#6290](https://github.com/angular/material/issues/6290), [#7076](https://github.com/angular/material/issues/7076))\n  * fixes tab math to address issues when used within dialog ([463d5e3f](https://github.com/angular/material/commit/463d5e3f), closes [#7048](https://github.com/angular/material/issues/7048), [#7118](https://github.com/angular/material/issues/7118))\n\n\n<a name\"1.0.5\"></a>\n### 1.0.5 (2016-02-04)\n\n\n#### Features\n\n* **input:** add directive to auto select text on input focus ([cb8ef183](https://github.com/angular/material/commit/cb8ef183), closes [#6679](https://github.com/angular/material/issues/6679), [#6701](https://github.com/angular/material/issues/6701))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * store hasNotFoundTemplate in shared element ([0f9dae36](https://github.com/angular/material/commit/0f9dae36), closes [#5865](https://github.com/angular/material/issues/5865), [#5867](https://github.com/angular/material/issues/5867))\n  * allow clicking on not-found template. ([4ef9674c](https://github.com/angular/material/commit/4ef9674c), closes [#6191](https://github.com/angular/material/issues/6191), [#5526](https://github.com/angular/material/issues/5526), [#6103](https://github.com/angular/material/issues/6103))\n* **tabs:**\n  * fixes the sizing math ([2390d88b](https://github.com/angular/material/commit/2390d88b), closes [#6212](https://github.com/angular/material/issues/6212), [#7015](https://github.com/angular/material/issues/7015))\n* **button:** fixed wrong md-icon selector and changed raised icon color to hue-900 ([32435759](https://github.com/angular/material/commit/32435759), closes [#6944](https://github.com/angular/material/issues/6944), [#6945](https://github.com/angular/material/issues/6945))\n* **demo:**\n  * use md-dialog-actions ([e12859a7](https://github.com/angular/material/commit/e12859a7))\n  * observe interpolated docs-demo attributes + fix layout alignment interactive dem ([d0deb379](https://github.com/angular/material/commit/d0deb379), closes [#6564](https://github.com/angular/material/issues/6564), [#6361](https://github.com/angular/material/issues/6361), [#6319](https://github.com/angular/material/issues/6319), [#6567](https://github.com/angular/material/issues/6567))\n* **docs:**\n  * DocsDemoCtrl fixed to interpolate and observe. ([893b67ec](https://github.com/angular/material/commit/893b67ec))\n  * fix animation for menu-toggle ([c739d110](https://github.com/angular/material/commit/c739d110), closes [#6262](https://github.com/angular/material/issues/6262), [#6936](https://github.com/angular/material/issues/6936), [#6937](https://github.com/angular/material/issues/6937))\n* **md-chips placeholder:** correct placeholder/secondary logic ([367d0ccc](https://github.com/angular/material/commit/367d0ccc), closes [#6535](https://github.com/angular/material/issues/6535))\n* **select:**\n  * use parsed attribute for md-container-class attribute ([ecd68378](https://github.com/angular/material/commit/ecd68378), closes [#6973](https://github.com/angular/material/issues/6973), [#6976](https://github.com/angular/material/issues/6976))\n  * fix set form to pristine if ng-model for multiple select is predefined. ([e164e69d](https://github.com/angular/material/commit/e164e69d), closes [#6556](https://github.com/angular/material/issues/6556), [#6782](https://github.com/angular/material/issues/6782))\n* **slider:** allow tabindex overwrite ([47cfe446](https://github.com/angular/material/commit/47cfe446), closes [#5829](https://github.com/angular/material/issues/5829), [#5830](https://github.com/angular/material/issues/5830))\n* **virtualRepeat:** Do not scroll past bottom Might also fix #4169 ([9a36112c](https://github.com/angular/material/commit/9a36112c), closes [#6279](https://github.com/angular/material/issues/6279), [#6990](https://github.com/angular/material/issues/6990))\n* **whiteframe:** update breakpoints in whiteframe class demo ([c43b1a34](https://github.com/angular/material/commit/c43b1a34))\n\n\n<a name\"1.0.4\"></a>\n### 1.0.4 (2016-01-28)\n\n\n#### Features\n\n* **whiteframe:** support attribute directive to apply md-whiteframe classes ([4d5e0ed0](https://github.com/angular/material/commit/4d5e0ed0), closes [#6772](https://github.com/angular/material/issues/6772), [#6831](https://github.com/angular/material/issues/6831))\n\n\n#### Bug Fixes\n\n* **datepicker:**\n  * change mdDateUtil.isDateWithinRange to ignore the time component of the date ([e1c07ec9](https://github.com/angular/material/commit/e1c07ec9), closes [#6887](https://github.com/angular/material/issues/6887), [#6888](https://github.com/angular/material/issues/6888))\n  * set datepicker touched if bluring input or closing the pane ([f4839afa](https://github.com/angular/material/commit/f4839afa), closes [#6598](https://github.com/angular/material/issues/6598), [#6722](https://github.com/angular/material/issues/6722))\n  * fix input always being required. ([83f4d5e6](https://github.com/angular/material/commit/83f4d5e6))\n* **dialog:** fix dialog resizing on window resize ([ae7d661e](https://github.com/angular/material/commit/ae7d661e), closes [#6876](https://github.com/angular/material/issues/6876), [#6878](https://github.com/angular/material/issues/6878))\n* **input:**\n  * fix invalid animation for input. ([7a98d7ba](https://github.com/angular/material/commit/7a98d7ba), closes [#6822](https://github.com/angular/material/issues/6822), [#6880](https://github.com/angular/material/issues/6880))\n  * smart support of icons ([0c87f089](https://github.com/angular/material/commit/0c87f089), closes [#6348](https://github.com/angular/material/issues/6348), [#6720](https://github.com/angular/material/issues/6720))\n  * check if parent form is undefined before checking if it's submitted ([34e02781](https://github.com/angular/material/commit/34e02781), closes [#6807](https://github.com/angular/material/issues/6807), [#6809](https://github.com/angular/material/issues/6809))\n* **layout:**\n  * restore flex percentages ([474c37a3](https://github.com/angular/material/commit/474c37a3), closes [#6898](https://github.com/angular/material/issues/6898))\n  * flex sizes for 33% and 66% corrected ([3d6077b4](https://github.com/angular/material/commit/3d6077b4))\n  * Chrome 48 bug with flexbox ([a7056cc1](https://github.com/angular/material/commit/a7056cc1), closes [#6841](https://github.com/angular/material/issues/6841))\n  * change attribute selector justify-content to `flex-start` ([0dc677cb](https://github.com/angular/material/commit/0dc677cb), closes [#6818](https://github.com/angular/material/issues/6818), [#6827](https://github.com/angular/material/issues/6827))\n* **md-slider:** clamp md-slider's initialisation ([b3ffa6f7](https://github.com/angular/material/commit/b3ffa6f7), closes [#6858](https://github.com/angular/material/issues/6858))\n* **mdSelect:** Selected label shouldn't copy the ripple container in the md-option ([b7073759](https://github.com/angular/material/commit/b7073759))\n* **menu:** cleanup interim element on element destroy ([95fbb16f](https://github.com/angular/material/commit/95fbb16f), closes [#6545](https://github.com/angular/material/issues/6545), [#6558](https://github.com/angular/material/issues/6558))\n* **select:** made select line height aligned with input ([c19eec4b](https://github.com/angular/material/commit/c19eec4b), closes [#5524](https://github.com/angular/material/issues/5524), [#6741](https://github.com/angular/material/issues/6741))\n* **tabs:** fix dynamic height demo for tabs ([09185964](https://github.com/angular/material/commit/09185964), closes [#6785](https://github.com/angular/material/issues/6785))\n* **toolbar:** apply the warn color, accent color ([64911ab7](https://github.com/angular/material/commit/64911ab7), closes [#6447](https://github.com/angular/material/issues/6447))\n\n\n<a name\"1.0.3\"></a>\n### 1.0.3 (2016-01-21)\n\n\n#### Features\n\n* **$mdThemeProvider:** allow the user to define a nonce attribute for generated theme style tags ([3f1208b4](https://github.com/angular/material/commit/3f1208b4), closes [#6691](https://github.com/angular/material/issues/6691))\n\n\n#### Bug Fixes\n\n* **button:**\n  * fix aria-label async injection and tests ([57163406](https://github.com/angular/material/commit/57163406))\n  * aria-label injection ([61136481](https://github.com/angular/material/commit/61136481))\n* **card:** fix card demo for webkit engine ([8871eb3d](https://github.com/angular/material/commit/8871eb3d), closes [#6573](https://github.com/angular/material/issues/6573), [#6678](https://github.com/angular/material/issues/6678), [#6765](https://github.com/angular/material/issues/6765))\n* **datepicker:** use time-insensitive comparison for min/max. ([0e334cd3](https://github.com/angular/material/commit/0e334cd3))\n* **demos:** codepen demos load svg assets ([d8602747](https://github.com/angular/material/commit/d8602747), closes [#6695](https://github.com/angular/material/issues/6695), [#6727](https://github.com/angular/material/issues/6727))\n* **dialog:** changed translate3d to translate ([689a34da](https://github.com/angular/material/commit/689a34da), closes [#4544](https://github.com/angular/material/issues/4544), [#6729](https://github.com/angular/material/issues/6729))\n* **input:** show messages with nested forms ([74fe691c](https://github.com/angular/material/commit/74fe691c), closes [#6276](https://github.com/angular/material/issues/6276), [#6699](https://github.com/angular/material/issues/6699))\n* **speedDial:** Ensure scale animation actions are invisible when closed. ([7e7ac8f5](https://github.com/angular/material/commit/7e7ac8f5), closes [#6344](https://github.com/angular/material/issues/6344), [#6670](https://github.com/angular/material/issues/6670), [#6786](https://github.com/angular/material/issues/6786))\n\n\n<a name\"1.0.2\"></a>\n### 1.0.2 (2016-01-14)\n\n\n#### Bug Fixes\n\n* **datepicker:** temporarily disable test that only passes on FF. ([656694f4](https://github.com/angular/material/commit/656694f4))\n* **dialog:** fix focus trap sometimes not working. ([0a7ded9e](https://github.com/angular/material/commit/0a7ded9e), closes [#6590](https://github.com/angular/material/issues/6590))\n* **doc:** update CodePen community url ([985ec605](https://github.com/angular/material/commit/985ec605), closes [#6652](https://github.com/angular/material/issues/6652))\n* **layout:** use flex-start instead of start ([c0f5aea7](https://github.com/angular/material/commit/c0f5aea7), closes [#6402](https://github.com/angular/material/issues/6402), [#6403](https://github.com/angular/material/issues/6403))\n* **virtualRepeat:** Recover from scroll events that occur when hidden. ([bbca34f4](https://github.com/angular/material/commit/bbca34f4), closes [#5448](https://github.com/angular/material/issues/5448), [#5448](https://github.com/angular/material/issues/5448), [#6389](https://github.com/angular/material/issues/6389))\n\n\n<a name\"1.0.1\"></a>\n### 1.0.1 (2015-12-17)\n\n\n#### Bug Fixes\n\n* **select:** Position incorrect if selection scrolled. ([de5237f1](https://github.com/angular/material/commit/de5237f1), closes [#6190](https://github.com/angular/material/issues/6190), [#6354](https://github.com/angular/material/issues/6354))\n* **tabs:** workaround for ngAnimate issue with ngClass ([19c11fdd](https://github.com/angular/material/commit/19c11fdd))\n\n\n<a name\"1.0.0\"></a>\n## 1.0.0 (2015-12-14)\n\nThis is a landmark release - announcing public availability of version 1.0.0!\n\n\n#### Bug Fixes\n\n* **demos:** CodePen launches fixed ([86ec22ad](https://github.com/angular/material/commit/86ec22ad), closes [#6297](https://github.com/angular/material/issues/6297))\n* **dialog:** guard against missing focus traps upon removal. ([8d7ec062](https://github.com/angular/material/commit/8d7ec062))\n* **input:**\n  * Fix input errors CSS to properly display. ([0eb7d8a6](https://github.com/angular/material/commit/0eb7d8a6), closes [#5837](https://github.com/angular/material/issues/5837), [#6298](https://github.com/angular/material/issues/6298))\n  * guard against null access on parentForm (Angular 1.3). ([1d71928e](https://github.com/angular/material/commit/1d71928e))\n  * Remove unneccessary CSS error margin. ([5ca31706](https://github.com/angular/material/commit/5ca31706), closes [#6235](https://github.com/angular/material/issues/6235))\n* **layout:** 'flex' change per recommended workarounds and added `flex=nogrow` ([f3761781](https://github.com/angular/material/commit/f3761781), closes [#6205](https://github.com/angular/material/issues/6205))\n* **layouts:** do not replace invalid attribute values ([16486dbf](https://github.com/angular/material/commit/16486dbf))\n* **menu-bar:** fix embeded menus closing immediately ([62af9387](https://github.com/angular/material/commit/62af9387), closes [#6184](https://github.com/angular/material/issues/6184), [#5866](https://github.com/angular/material/issues/5866))\n* **select:**\n  * focus should behave as same as normal inputs ([dc8f388a](https://github.com/angular/material/commit/dc8f388a), closes [#6122](https://github.com/angular/material/issues/6122), [#6185](https://github.com/angular/material/issues/6185), [#6132](https://github.com/angular/material/issues/6132), [#6274](https://github.com/angular/material/issues/6274))\n  * removes usage of `element.scope()` ([3040fd2e](https://github.com/angular/material/commit/3040fd2e), closes [#6033](https://github.com/angular/material/issues/6033), [#6228](https://github.com/angular/material/issues/6228))\n  * don't wrap multiple choices in new lines ([2ab30758](https://github.com/angular/material/commit/2ab30758), closes [#6176](https://github.com/angular/material/issues/6176), [#6177](https://github.com/angular/material/issues/6177))\n* **showHide:** Don't set up $md-resize $broadcasting $watcher until recieving $md-resize-enable ([2f18bb4e](https://github.com/angular/material/commit/2f18bb4e), closes [#5760](https://github.com/angular/material/issues/5760), [#6170](https://github.com/angular/material/issues/6170))\n* **speedDial:** Fix intially open bug. ([cfdd7cf1](https://github.com/angular/material/commit/cfdd7cf1), closes [#6111](https://github.com/angular/material/issues/6111))\n* **tabs:** tabs will not try to animate height if the new height matches the current height ([a4ea9dea](https://github.com/angular/material/commit/a4ea9dea))\n* **test:** improve test of $interpolate for ng v1.5.x ([43e01a7f](https://github.com/angular/material/commit/43e01a7f))\n* **toast:** wrap toast content with .md-toast-content ([ea60dd3b](https://github.com/angular/material/commit/ea60dd3b))\n* **tooltip:** Firefox scroll event was triggered cause the usage of translate3d ([c33819e8](https://github.com/angular/material/commit/c33819e8), closes [#6206](https://github.com/angular/material/issues/6206))\n* **virtualRepeat:** Resolve bizarre missing $scope.$root issue (#6129) ([190d304f](https://github.com/angular/material/commit/190d304f), closes [#6171](https://github.com/angular/material/issues/6171))\n\n\n<a name\"1.0.0-rc7\"></a>\n### 1.0.0-rc7 (2015-12-08)\n\nThe Getting Started and the Layout documentation have been improved with more CodePen\nsamples.  RTL support has been improved for the Input components.\n\n\n#### Features\n\n* **layout:** add flex noshrink attribute to prevent shrinking ([3d32c2e6](https://github.com/angular/material/commit/3d32c2e6), closes [#6067](https://github.com/angular/material/issues/6067), [#6100](https://github.com/angular/material/issues/6100))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * gets rid of uncompiled content flicker. Works around issues cased by the scope d ([88ba1fdd](https://github.com/angular/material/commit/88ba1fdd), closes [#5637](https://github.com/angular/material/issues/5637))\n  * always set tabindex to allow receiving focus. ([d3c0acb2](https://github.com/angular/material/commit/d3c0acb2), closes [#6101](https://github.com/angular/material/issues/6101), [#5665](https://github.com/angular/material/issues/5665), [#6135](https://github.com/angular/material/issues/6135))\n* **cards:** applying zero margin only on first and last p elements ([aa6a0588](https://github.com/angular/material/commit/aa6a0588), closes [#6060](https://github.com/angular/material/issues/6060))\n* **dialog:** update code example from `content` to `textContent`. Fixes ([19389455](https://github.com/angular/material/commit/19389455))\n* **input:**\n  * ngMessages jump with ngShow, ngIf, etc ([cf7f21aa](https://github.com/angular/material/commit/cf7f21aa), closes [#5298](https://github.com/angular/material/issues/5298), [#6164](https://github.com/angular/material/issues/6164))\n  * input error messages visible on form submit ([871512d0](https://github.com/angular/material/commit/871512d0), closes [#5752](https://github.com/angular/material/issues/5752), [#6091](https://github.com/angular/material/issues/6091))\n* **layout:** hide and show directives with breakpoint suffixes now work properly ([a2ec6607](https://github.com/angular/material/commit/a2ec6607))\n* **list:** don't turn list-items with ngIf into a button. ([ef05ea36](https://github.com/angular/material/commit/ef05ea36))\n* **menu:** fix menus inside toolbars and dialogs ([378248a5](https://github.com/angular/material/commit/378248a5), closes [#6131](https://github.com/angular/material/issues/6131), [#6109](https://github.com/angular/material/issues/6109), [#6049](https://github.com/angular/material/issues/6049), [#6073](https://github.com/angular/material/issues/6073), [#6089](https://github.com/angular/material/issues/6089), [#6116](https://github.com/angular/material/issues/6116))\n* **menubar:**\n  * fix broken menubar accessability with checkbox and radio menuitems ([eb1695a0](https://github.com/angular/material/commit/eb1695a0), closes [#6151](https://github.com/angular/material/issues/6151))\n  * fix keyboard controls ([0fa917d5](https://github.com/angular/material/commit/0fa917d5))\n  * fix menus overflow hiding behind menubar ([b339baa9](https://github.com/angular/material/commit/b339baa9))\n* **ripple:** calculate relative coordinates from ripple target. ([36b03f2f](https://github.com/angular/material/commit/36b03f2f), closes [#5917](https://github.com/angular/material/issues/5917), [#6092](https://github.com/angular/material/issues/6092))\n* **select:** fix bugs introduced by keeping md-select-menu in DOM. Fix tests ([7edda118](https://github.com/angular/material/commit/7edda118), closes [#6071](https://github.com/angular/material/issues/6071))\n* **toast:** Hide scrollbars during animation. ([cae51a65](https://github.com/angular/material/commit/cae51a65), closes [#2936](https://github.com/angular/material/issues/2936), [#6029](https://github.com/angular/material/issues/6029))\n* **toolbar:** solves NgUpgrade interop issue. ([c668ba40](https://github.com/angular/material/commit/c668ba40), closes [#6069](https://github.com/angular/material/issues/6069), [#6081](https://github.com/angular/material/issues/6081))\n* **tooltip:**\n  * always append to body and disappear on scroll ([9d726593](https://github.com/angular/material/commit/9d726593), closes [#6140](https://github.com/angular/material/issues/6140))\n  * guard against missing offsetParent. ([d0b7bacf](https://github.com/angular/material/commit/d0b7bacf))\n* **virtualRepeat:**\n  * sets initial size for virtual repeat when the first results require shrinking ([6acd1c3a](https://github.com/angular/material/commit/6acd1c3a), closes [#5826](https://github.com/angular/material/issues/5826), [#6139](https://github.com/angular/material/issues/6139))\n  * Broken demos relating to size computation ([10134231](https://github.com/angular/material/commit/10134231), closes [#6167](https://github.com/angular/material/issues/6167))\n  * fix sizer not shrinking when items reduce in number. ([1771b29f](https://github.com/angular/material/commit/1771b29f), closes [#4435](https://github.com/angular/material/issues/4435))\n  * update deps to include showHide.. ([b4ef3024](https://github.com/angular/material/commit/b4ef3024), closes [#4435](https://github.com/angular/material/issues/4435))\n\n\n<a name\"1.0.0-rc6\"></a>\n### 1.0.0-rc6 (2015-12-02)\n\nAdded accessibility support to `select`, `menu`, and `toast`.\nAdded a `tips` documents section for layout issues and added some layout warnings for IE.\nDetect `ng-touch` usages and provide integration warnings regarding interference of `ng-touch` with `$mdGestures`\n\n\n#### Breaking Changes\n\n* Added breakpoints: `xs`, `gt-xs`, `xl` per Material Design spec.  Breakpoints `sm` and `gt-sm` have changed.\n\n\n#### Bug Fixes\n\n* **core:** detect incompatible ngTouch usages\n* **chips:** Fix readonly padding issue. ([5d34eff3](https://github.com/angular/material/commit/5d34eff3), closes [#2829](https://github.com/angular/material/issues/2829))\n* **datepicker:**\n  * fix not closing on body-click on iOS Safari. Fixes ([5a56a881](https://github.com/angular/material/commit/5a56a881))\n  * improve error state updating. ([d5b72dfe](https://github.com/angular/material/commit/d5b72dfe), closes [#5315](https://github.com/angular/material/issues/5315))\n* **dialog:** trap focus within dialog.. ([fbb1192a](https://github.com/angular/material/commit/fbb1192a), closes [#4105](https://github.com/angular/material/issues/4105))\n* **input:**\n  * fixes alignment between datepicker and other input elements ([08b5af5b](https://github.com/angular/material/commit/08b5af5b), closes [#5936](https://github.com/angular/material/issues/5936))\n  * has-icon overwriting should have higher css priority as normal label without an  ([6cac7daa](https://github.com/angular/material/commit/6cac7daa), closes [#6005](https://github.com/angular/material/issues/6005), [#6013](https://github.com/angular/material/issues/6013))\n* **layout:** allow layout-align without cross-axis or main-axis value ([6b1d7586](https://github.com/angular/material/commit/6b1d7586), closes [#5996](https://github.com/angular/material/issues/5996), [#6003](https://github.com/angular/material/issues/6003))\n* **layouts:** register Layout directives for xs, gt-xs, xl ([2a1de83b](https://github.com/angular/material/commit/2a1de83b), closes [#5995](https://github.com/angular/material/issues/5995), [#5983](https://github.com/angular/material/issues/5983), [#6037](https://github.com/angular/material/issues/6037))\n* **list:**\n  * wrapping secondary if it has ng-click ([358fd98e](https://github.com/angular/material/commit/358fd98e), closes [#3928](https://github.com/angular/material/issues/3928), [#5993](https://github.com/angular/material/issues/5993))\n  * secondary button wasn't coping ngIf attribute ([19a32d0b](https://github.com/angular/material/commit/19a32d0b), closes [#5297](https://github.com/angular/material/issues/5297), [#5991](https://github.com/angular/material/issues/5991))\n  * no longer proxy clicks to multiple elements ([db458cbb](https://github.com/angular/material/commit/db458cbb), closes [#2594](https://github.com/angular/material/issues/2594))\n* **menu:** improve aria compliance ([097b799d](https://github.com/angular/material/commit/097b799d), closes [#4415](https://github.com/angular/material/issues/4415))\n* **radioButton:** fixes focus color for md-primary and md-warn ([16934336](https://github.com/angular/material/commit/16934336), closes [#4487](https://github.com/angular/material/issues/4487))\n* **select:**\n  * fixes positioning of select menu and sets it to append to the body again ([b3177f2f](https://github.com/angular/material/commit/b3177f2f), closes [#6044](https://github.com/angular/material/issues/6044))\n  * make aria compliant, read value in screen readers ([f73e5033](https://github.com/angular/material/commit/f73e5033), closes [#3891](https://github.com/angular/material/issues/3891), [#4914](https://github.com/angular/material/issues/4914), [#4977](https://github.com/angular/material/issues/4977), [#6000](https://github.com/angular/material/issues/6000), [#3859](https://github.com/angular/material/issues/3859))\n  * fix touched status flicker ([c633ad85](https://github.com/angular/material/commit/c633ad85), closes [#5879](https://github.com/angular/material/issues/5879))\n* **tabs:** shift+tab will now work properly when focus is on tabs ([86edea49](https://github.com/angular/material/commit/86edea49), closes [#4696](https://github.com/angular/material/issues/4696))\n* **toast:**\n  * Hide scrollbars during animation. ([d641433f](https://github.com/angular/material/commit/d641433f), closes [#2936](https://github.com/angular/material/issues/2936), [#6017](https://github.com/angular/material/issues/6017))\n  * add missing a11y context. See #349 ([037e3768](https://github.com/angular/material/commit/037e3768))\n\n\n<a name\"1.0.0-rc5\"></a>\n### 1.0.0-rc5 (2015-11-25)\n\n\n#### Features\n\n* **card:** improved to behave as spec ([b8ffdfe0](https://github.com/angular/material/commit/b8ffdfe0), closes [#1900](https://github.com/angular/material/issues/1900), [#5607](https://github.com/angular/material/issues/5607))\n* **dialog:** added fullscreen option to dialog ([19c2df83](https://github.com/angular/material/commit/19c2df83), closes [#2148](https://github.com/angular/material/issues/2148), [#5793](https://github.com/angular/material/issues/5793))\n* **select:** add support for raw HTML in options ([e07c52da](https://github.com/angular/material/commit/e07c52da), closes [#2242](https://github.com/angular/material/issues/2242), [#5847](https://github.com/angular/material/issues/5847))\n\n#### Breaking Changes\n\n* default for `layout-align` is `start stretch` (for main and cross-axis respectively)\n* no longer removes Layout attributes from DOM elements\n* `md-toast` now uses `textContent` instead of `content` - `content` is deprecated\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * fixes autocomplete height when near the bottom of the page ([c667b549](https://github.com/angular/material/commit/c667b549), closes [#5209](https://github.com/angular/material/issues/5209))\n  * fixes height issue on `md-not-found` message ([f1dcaf96](https://github.com/angular/material/commit/f1dcaf96), closes [#5305](https://github.com/angular/material/issues/5305))\n  * should now properly support `ng-disabled` ([2ab1d2d9](https://github.com/angular/material/commit/2ab1d2d9), closes [#4999](https://github.com/angular/material/issues/4999))\n* **datepicker:**\n  * prevent calendar pane being in wrong position after body scrolling is disabled. ([a899c5b4](https://github.com/angular/material/commit/a899c5b4), closes [#5201](https://github.com/angular/material/issues/5201), [#5918](https://github.com/angular/material/issues/5918))\n  * correctly position datepicker inside dialogs. Fixes ([d423a656](https://github.com/angular/material/commit/d423a656))\n* **dialog:** removed no dialog actions warning ([75a565e8](https://github.com/angular/material/commit/75a565e8), closes [#5767](https://github.com/angular/material/issues/5767), [#5774](https://github.com/angular/material/issues/5774))\n* **input:**\n  * fixes label alignment in Firefox ([035a4ef3](https://github.com/angular/material/commit/035a4ef3))\n  * fixes alignment issues between textareas and inputs ([b2b4c933](https://github.com/angular/material/commit/b2b4c933), closes [#5462](https://github.com/angular/material/issues/5462), [#5682](https://github.com/angular/material/issues/5682))\n* **layouts:**\n  * support layout-align start and stretch ([d24cf25b](https://github.com/angular/material/commit/d24cf25b), closes [#5509](https://github.com/angular/material/issues/5509), [#5249](https://github.com/angular/material/issues/5249))\n  * do NOT remove layout attributes after className generation ([7cb035d9](https://github.com/angular/material/commit/7cb035d9))\n* **list:**\n  * Copy md-icon.md-secondary attributes to button. ([7d8bc2d2](https://github.com/angular/material/commit/7d8bc2d2), closes [#3356](https://github.com/angular/material/issues/3356), [#5716](https://github.com/angular/material/issues/5716))\n  * Don't wrap secondary buttons in a button. ([5cc492c6](https://github.com/angular/material/commit/5cc492c6), closes [#3176](https://github.com/angular/material/issues/3176), [#5721](https://github.com/angular/material/issues/5721))\n* **mdUtil:** disableBodyScroll no longer scrolls page to top in IE ([badc1ef1](https://github.com/angular/material/commit/badc1ef1), closes [#4640](https://github.com/angular/material/issues/4640), [#5334](https://github.com/angular/material/issues/5334), [#3627](https://github.com/angular/material/issues/3627))\n* **progressCircular:**\n  * fixes scaling issues ([ff2e92b4](https://github.com/angular/material/commit/ff2e92b4), closes [#4839](https://github.com/angular/material/issues/4839), [#5891](https://github.com/angular/material/issues/5891))\n  * fixes animation bug when used inside `md-dialog` ([f780beb0](https://github.com/angular/material/commit/f780beb0), closes [#5039](https://github.com/angular/material/issues/5039))\n* **radio:** no longer prevents events from nested elements ([7a87ddad](https://github.com/angular/material/commit/7a87ddad), closes [#2960](https://github.com/angular/material/issues/2960))\n* **select:**\n  * reduce overly agressive truncation ([8051e980](https://github.com/angular/material/commit/8051e980))\n  * fix select label not updating on option model changes ([4f3c5d91](https://github.com/angular/material/commit/4f3c5d91), closes [#3052](https://github.com/angular/material/issues/3052), [#3909](https://github.com/angular/material/issues/3909))\n  * select no longer overflows window, resizes from small to big correctly ([ee4ab189](https://github.com/angular/material/commit/ee4ab189), closes [#5291](https://github.com/angular/material/issues/5291))\n  * fix IE 11 select not growing ([4306331c](https://github.com/angular/material/commit/4306331c))\n* **tabs:**\n  * resolves issue with nested tabs ([20ba8a59](https://github.com/angular/material/commit/20ba8a59), closes [#4989](https://github.com/angular/material/issues/4989), [#5719](https://github.com/angular/material/issues/5719))\n  * rename `disabled` to the right `ng-disabled` ([b8d3519f](https://github.com/angular/material/commit/b8d3519f), closes [#5691](https://github.com/angular/material/issues/5691), [#5699](https://github.com/angular/material/issues/5699))\n  * labels with fraction CSS width disabling pagination ([a120a358](https://github.com/angular/material/commit/a120a358), closes [#5794](https://github.com/angular/material/issues/5794), [#5770](https://github.com/angular/material/issues/5770), [#5692](https://github.com/angular/material/issues/5692), [#5801](https://github.com/angular/material/issues/5801))\n* **toast:** switch `content` to `textContent`  to unify w/ dialog. Deprecate `content` ([1eeafee4](https://github.com/angular/material/commit/1eeafee4))\n* **toolbar:** add support in scrollshrink to ngshow/hide ([eb94d640](https://github.com/angular/material/commit/eb94d640), closes [#5706](https://github.com/angular/material/issues/5706), [#5863](https://github.com/angular/material/issues/5863))\n* **tooltip:** tooltip sometimes not hidden after element is disabled. ([7920dba1](https://github.com/angular/material/commit/7920dba1), closes [#5912](https://github.com/angular/material/issues/5912))\n* **util:** added toUpperCase to nodeName ([6260a769](https://github.com/angular/material/commit/6260a769), closes [#5609](https://github.com/angular/material/issues/5609), [#5771](https://github.com/angular/material/issues/5771))\n\n\n<a name\"1.0.0-rc4\"></a>\n### 1.0.0-rc4 (2015-11-13)\n\n\n#### Features\n\n* **card:** improved to behave closer to spec ([323d5f6e](https://github.com/angular/material/commit/323d5f6e), closes [#1900](https://github.com/angular/material/issues/1900))\n* **chips:** add support for custom separator keys ([5f5ae455](https://github.com/angular/material/commit/5f5ae455), closes [#5279](https://github.com/angular/material/issues/5279), [#5281](https://github.com/angular/material/issues/5281))\n* **mdMenu:** add md-prevent-menu-close ([e9bcec1b](https://github.com/angular/material/commit/e9bcec1b), closes [#5457](https://github.com/angular/material/issues/5457), [#4334](https://github.com/angular/material/issues/4334))\n\n\n#### Breaking Changes\n\n* Dialog presets for `alert` and `confirm` no longer have a `content` option.  There is now `textContent` and `htmlContent`.  In order to use `htmlContent` you must load the `ngSanitize` module.  HTML will not be compiled as an Angular template to prevent XSS attack vectors.\n\n\n#### Bug Fixes\n\n* **autocomplete:** adjusts dropdown position for standard input style ([44d1636b](https://github.com/angular/material/commit/44d1636b), closes [#5558](https://github.com/angular/material/issues/5558), [#5680](https://github.com/angular/material/issues/5680))\n* **datepicker:** icon jumping upon open/close. ([e73c560b](https://github.com/angular/material/commit/e73c560b), closes [#4570](https://github.com/angular/material/issues/4570), [#5703](https://github.com/angular/material/issues/5703))\n* **dialog:** break `content` into `textContent` and `htmlContent` to help keep users from acc ([6a564508](https://github.com/angular/material/commit/6a564508))\n* **input:**\n  * textarea auto grow fixed ([7fe6f87b](https://github.com/angular/material/commit/7fe6f87b), closes [#5627](https://github.com/angular/material/issues/5627), [#5636](https://github.com/angular/material/issues/5636))\n  * fixes alignment issues between textareas and inputs ([fb6f81a5](https://github.com/angular/material/commit/fb6f81a5), closes [#5462](https://github.com/angular/material/issues/5462), [#5682](https://github.com/angular/material/issues/5682))\n* **mdMenu:** fix attempting to close non-existant nested menus ([6bf98aa6](https://github.com/angular/material/commit/6bf98aa6))\n* **menu:**\n  * all menus no longer self destruct when one is destroyed ([667a05ff](https://github.com/angular/material/commit/667a05ff), closes [#5395](https://github.com/angular/material/issues/5395))\n  * fix divider disappearing on scrolling menu ([3ab6aa35](https://github.com/angular/material/commit/3ab6aa35), closes [#5081](https://github.com/angular/material/issues/5081))\n  * menu items are not aligned in Microsoft Edge ([818652d4](https://github.com/angular/material/commit/818652d4), closes [#3987](https://github.com/angular/material/issues/3987), [#5487](https://github.com/angular/material/issues/5487))\n* **ripple:** Fix failing spec. ([fe84405d](https://github.com/angular/material/commit/fe84405d))\n* **select:**\n  * disabled option no longer reacting to hover and closing on click ([ab0ffc4d](https://github.com/angular/material/commit/ab0ffc4d), closes [#4967](https://github.com/angular/material/issues/4967), [#5619](https://github.com/angular/material/issues/5619))\n  * fix floating label not rendering until focus ([a3a0f48c](https://github.com/angular/material/commit/a3a0f48c), closes [#5566](https://github.com/angular/material/issues/5566))\n  * fix auto-complete element not being removed from form ([2760f67e](https://github.com/angular/material/commit/2760f67e), closes [#5575](https://github.com/angular/material/issues/5575))\n* **toast:** added position relative to toast parent ([617ab2c8](https://github.com/angular/material/commit/617ab2c8), closes [#4542](https://github.com/angular/material/issues/4542), [#5660](https://github.com/angular/material/issues/5660))\n\n\n<a name\"1.0.0-rc3\"></a>\n### 1.0.0-rc3 (2015-11-06)\n\n\n#### Features\n\n* **datepicker:** predicate function to allow fine-grained control over pickable dates ([9522148b](https://github.com/angular/material/commit/9522148b), closes [#4538](https://github.com/angular/material/issues/4538), [#5475](https://github.com/angular/material/issues/5475))\n* **ripple:** ink-ripple is now getting an interpolated value ([fbcc3acc](https://github.com/angular/material/commit/fbcc3acc), closes [#5438](https://github.com/angular/material/issues/5438), [#5580](https://github.com/angular/material/issues/5580))\n\n\n#### Breaking Changes\n\n* Buttons with undefined `type` will have type=\"button\" assigned, so forms may not submit as previously expected.\n\nBefore:\n```html\n<button class=\"md-button\" ng-transclude>\n```\n\nwill become\n```html\n<button type=\"button\" class=\"md-button\" ng-transclude>\n```\n\nFixes #3127. Closes #5468.\n\n ([747ef826](https://github.com/angular/material/commit/747ef826))\n* `md-on-append` has been renamed/deprecated in favor of\n`md-transform-chip` or the simple notifier `md-on-add`.\n\nWe expect to remove this completely in 1.0, so please update\nyour code to use one of the new methods.\n\nFixes #4666. Fixes #4193. Fixes #4412. Fixes #4863. Closes #5497. Closes #3816.\n\n ([d69d6d0b](https://github.com/angular/material/commit/d69d6d0b))\n* adding actions to `md-card` is now done through `<md-card-actions>` rather than `<div class=”md-actions”>`\n* adding actions to `md-dialog` is now done through `<md-dialog-actions>` rather than `<div class=”md-actions”>`\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * Allow clicks inside md-not-found. ([5ae3d4cd](https://github.com/angular/material/commit/5ae3d4cd), closes [#5424](https://github.com/angular/material/issues/5424))\n  * fix md-not-found bug with multiple autocompletes ([96932048](https://github.com/angular/material/commit/96932048), closes [#5400](https://github.com/angular/material/issues/5400), [#5442](https://github.com/angular/material/issues/5442))\n  * handle undefined searchText ([fbf45fdf](https://github.com/angular/material/commit/fbf45fdf), closes [#5162](https://github.com/angular/material/issues/5162), [#5393](https://github.com/angular/material/issues/5393), [#5445](https://github.com/angular/material/issues/5445))\n* **button:** set color of disabled button to highest css priority. ([ce2f28d0](https://github.com/angular/material/commit/ce2f28d0), closes [#5569](https://github.com/angular/material/issues/5569), [#5574](https://github.com/angular/material/issues/5574))\n* **card:** now md-card-actions ([f8c003c3](https://github.com/angular/material/commit/f8c003c3))\n* **components:** fix issue with removeClass removing previous classes ([bd65bf74](https://github.com/angular/material/commit/bd65bf74), closes [#5538](https://github.com/angular/material/issues/5538))\n* **datepicker:**\n  * apply ngMessages errors when using text input. Fixes ([3c9ba380](https://github.com/angular/material/commit/3c9ba380))\n  * throw error if model is not a Date. For #5266 ([71976be8](https://github.com/angular/material/commit/71976be8))\n  * throw error if inside md-input-container. For #5055 ([5004a2a6](https://github.com/angular/material/commit/5004a2a6))\n  * properly set ngModel validity. ([b4d77330](https://github.com/angular/material/commit/b4d77330), closes [#4926](https://github.com/angular/material/issues/4926))\n* **dialog:** now md-dialog-actions ([bf08e179](https://github.com/angular/material/commit/bf08e179))\n* **fab:** Remove transition for fabs on ng-hide. ([e778cdd4](https://github.com/angular/material/commit/e778cdd4), closes [#5235](https://github.com/angular/material/issues/5235))\n* **input:**\n  * ngMessages will no longer cause layout to change on animation ([faa8b5b7](https://github.com/angular/material/commit/faa8b5b7))\n  * fixes input height in IE11 ([ee98b70f](https://github.com/angular/material/commit/ee98b70f))\n* **layouts:** removeAttr RTE on comment nodes ([6879c6f4](https://github.com/angular/material/commit/6879c6f4))\n* **lists:** Fix alignment of secondary icons/controls. ([3b835ca6](https://github.com/angular/material/commit/3b835ca6), closes [#3699](https://github.com/angular/material/issues/3699), [#5533](https://github.com/angular/material/issues/5533))\n* **mdUtil:** fix disable scroll adding extra scroll-bars on IE ([d59bd5e7](https://github.com/angular/material/commit/d59bd5e7), closes [#5300](https://github.com/angular/material/issues/5300))\n* **menu-bar:** fix sibling nested opening and closing incorrectly ([ead4d022](https://github.com/angular/material/commit/ead4d022), closes [#5119](https://github.com/angular/material/issues/5119))\n* **menubar:** fix RTE with close dialogs invoked from menubar ([5c129be4](https://github.com/angular/material/commit/5c129be4), closes [#5476](https://github.com/angular/material/issues/5476))\n* **progressLinear:** Remove extra semi-colon from SCSS. ([06c60af4](https://github.com/angular/material/commit/06c60af4), closes [#5260](https://github.com/angular/material/issues/5260))\n* **ripple:**\n  * moved mouseleave listener to a separated declaration ([2e2aaa8a](https://github.com/angular/material/commit/2e2aaa8a))\n  * removing ripples on touchmove ([65b2454c](https://github.com/angular/material/commit/65b2454c), closes [#5261](https://github.com/angular/material/issues/5261), [#5532](https://github.com/angular/material/issues/5532))\n  * changed ripple center from layerX/Y to offsetX/Y ([f30dd8cf](https://github.com/angular/material/commit/f30dd8cf), closes [#4807](https://github.com/angular/material/issues/4807), [#5508](https://github.com/angular/material/issues/5508), [#5527](https://github.com/angular/material/issues/5527))\n* **select:**\n  * fix escape closing dialogs when used inside select ([f31d2552](https://github.com/angular/material/commit/f31d2552))\n  * fix ng-change over firing when using trackBy ([41671e2d](https://github.com/angular/material/commit/41671e2d), closes [#4118](https://github.com/angular/material/issues/4118))\n  * ngModel.$touched trigger after menu close ([0917523d](https://github.com/angular/material/commit/0917523d), closes [#5256](https://github.com/angular/material/issues/5256))\n  * allow circular references ([cba5fa72](https://github.com/angular/material/commit/cba5fa72), closes [#5330](https://github.com/angular/material/issues/5330))\n* **sidenav:** Notify other close events like datepicker-close too ([2a76887c](https://github.com/angular/material/commit/2a76887c), closes [#5522](https://github.com/angular/material/issues/5522), [#5528](https://github.com/angular/material/issues/5528))\n* **subheader:** Remove 16px right margin. ([bb839317](https://github.com/angular/material/commit/bb839317), closes [#4389](https://github.com/angular/material/issues/4389), [#708](https://github.com/angular/material/issues/708), [#4419](https://github.com/angular/material/issues/4419))\n* **tabs:**\n  * fix positioning absolute/fixed elements inside md-tab-content ([65e15bf4](https://github.com/angular/material/commit/65e15bf4), closes [#4613](https://github.com/angular/material/issues/4613))\n  * icons in tab labels should match the text color ([fcd199ea](https://github.com/angular/material/commit/fcd199ea), closes [#5465](https://github.com/angular/material/issues/5465))\n* **toolbar button:** Fix color of raised buttons. ([0690e1b6](https://github.com/angular/material/commit/0690e1b6), closes [#4845](https://github.com/angular/material/issues/4845), [#5562](https://github.com/angular/material/issues/5562))\n* **virtual-repeat:** Prevent nested calls to virtualRepeatUpdate_ ([821d1a34](https://github.com/angular/material/commit/821d1a34), closes [#4950](https://github.com/angular/material/issues/4950), [#5009](https://github.com/angular/material/issues/5009))\n* **virtualRepeat:** Add ability for container to resize after creation ([d6d7b084](https://github.com/angular/material/commit/d6d7b084), closes [#5561](https://github.com/angular/material/issues/5561))\n\n\n<a name\"1.0.0-rc2\"></a>\n### 1.0.0-rc2 (2015-10-29)\n\n\n#### Breaking Changes\n\n* **layout:**\n  * `flex=34` and `flex=67` are no longer supported; use `flex=33` and `flex=66` for 1/3 and 2/3 sizing respectively\n  * `layout-margin` and `layout-padding` styles will apply to all children of `layout=row` and `layout=column`\n* **backdrop:** when backdrop parent is the body, backdrop will use `position: fixed`\n* **input:** form elements will now have an external `display` value of `inline-block`\n\n\n#### Bug Fixes\n\n* **autocomplete:** clicking on the scrollbar will no longer close dropdown ([309cef5d](https://github.com/angular/material/commit/309cef5d), closes [#4785](https://github.com/angular/material/issues/4785), [#4625](https://github.com/angular/material/issues/4625))\n* **backdrop:** use fixed position for global backdrops. ([a8537e63](https://github.com/angular/material/commit/a8537e63), closes [#2831](https://github.com/angular/material/issues/2831))\n* **dialog:** make sure dialog only destroys itself. ([e8cfce2e](https://github.com/angular/material/commit/e8cfce2e), closes [#5157](https://github.com/angular/material/issues/5157))\n* **layout:**\n  * layout-margin and layout-padding fixes for child containers ([4649b93b](https://github.com/angular/material/commit/4649b93b), closes [#5425](https://github.com/angular/material/issues/5425))\n  * fix wrapping and filling layouts to 100% using flex-33 or flex-66 ([a4a4a45b](https://github.com/angular/material/commit/a4a4a45b), closes [#5346](https://github.com/angular/material/issues/5346), [#5348](https://github.com/angular/material/issues/5348))\n* **md-chips:** appendChip disallows identical objects ([03db13d8](https://github.com/angular/material/commit/03db13d8), closes [#4466](https://github.com/angular/material/issues/4466), [#4479](https://github.com/angular/material/issues/4479))\n* **mdChips:** Autocomplete styling is incorrect. ([3bf6eb38](https://github.com/angular/material/commit/3bf6eb38), closes [#4600](https://github.com/angular/material/issues/4600), [#4621](https://github.com/angular/material/issues/4621))\n* **speedDial:**\n  * non-fab clicks no longer close immediately ([14eebf42](https://github.com/angular/material/commit/14eebf42), closes [#5243](https://github.com/angular/material/issues/5243), [#5440](https://github.com/angular/material/issues/5440))\n  * Don't intercept spaces and fix animations. ([32c0fe18](https://github.com/angular/material/commit/32c0fe18), closes [#5085](https://github.com/angular/material/issues/5085), [#4750](https://github.com/angular/material/issues/4750), [#5065](https://github.com/angular/material/issues/5065), [#5396](https://github.com/angular/material/issues/5396))\n* **tabs:** will no longer jump to top when changing tabs with `md-dynamic-height` ([4205be7d](https://github.com/angular/material/commit/4205be7d), closes [#4281](https://github.com/angular/material/issues/4281))\n\n\n<a name\"1.0.0-rc1\"></a>\n### 1.0.0-rc1 (2015-10-21)\n\n\nThis is the first release candidate for our 1.0 beta.  We believe that the API is complete and are working towards closing out remaining bugs.\n\n\n#### Features\n\n* **core:** add ngMaterial global with version info. ([275e604c](https://github.com/angular/material/commit/275e604c), closes [#5202](https://github.com/angular/material/issues/5202))\n* **mdDialog:** added openFrom and closeTo properties ([71e23e5b](https://github.com/angular/material/commit/71e23e5b), closes [#4228](https://github.com/angular/material/issues/4228), [#5075](https://github.com/angular/material/issues/5075))\n* **mdGestures:** greatly improve emulated click hijacking ([446df804](https://github.com/angular/material/commit/446df804), closes [#4850](https://github.com/angular/material/issues/4850), [#4757](https://github.com/angular/material/issues/4757))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * adjusts vertical offset of dropdown to account for ngMessages in floating label  ([ae00a7fd](https://github.com/angular/material/commit/ae00a7fd))\n  * fixed integration with dialog ([1df38df7](https://github.com/angular/material/commit/1df38df7), closes [#3979](https://github.com/angular/material/issues/3979), [#5154](https://github.com/angular/material/issues/5154))\n* **datepicker:** fix theme not being applied. ([f20a6354](https://github.com/angular/material/commit/f20a6354), closes [#5141](https://github.com/angular/material/issues/5141))\n* **dialog:** Provide option to not autowrap templates. ([87d62300](https://github.com/angular/material/commit/87d62300), closes [#4898](https://github.com/angular/material/issues/4898), [#5237](https://github.com/angular/material/issues/5237))\n* **divider:** Fix stlying for md-divider inside md-list-item. ([5218c18b](https://github.com/angular/material/commit/5218c18b), closes [#3021](https://github.com/angular/material/issues/3021), [#5058](https://github.com/angular/material/issues/5058))\n* **layout:**\n  * Prevent class overriding when lastClass is null ([9025f4de](https://github.com/angular/material/commit/9025f4de), closes [#5257](https://github.com/angular/material/issues/5257))\n  * standalone layout css flex-grow and flex-shrink updated ([7b8acac1](https://github.com/angular/material/commit/7b8acac1))\n  * provide missing SCSS variables for standalone Layout css ([f966d0f9](https://github.com/angular/material/commit/f966d0f9))\n  * fix flew-grow and flex-shrink values for flex-xx='xx' markup ([9f704302](https://github.com/angular/material/commit/9f704302))\n* **list:**\n  * restore ui-sref and href support on md-list-item ([f8a8b3c5](https://github.com/angular/material/commit/f8a8b3c5), closes [#2131](https://github.com/angular/material/issues/2131))\n  * adds support for `data-ng-click` in place of `ng-click` for buttons ([2ecbb8f7](https://github.com/angular/material/commit/2ecbb8f7), closes [#3374](https://github.com/angular/material/issues/3374))\n* **md-slider:** set step property relative to min ([441cbf11](https://github.com/angular/material/commit/441cbf11), closes [#4403](https://github.com/angular/material/issues/4403), [#4385](https://github.com/angular/material/issues/4385))\n* **mdCard:** Content padding not showing in IE 10. ([57bd0c64](https://github.com/angular/material/commit/57bd0c64), closes [#2974](https://github.com/angular/material/issues/2974), [#5120](https://github.com/angular/material/issues/5120))\n* **select:** do not let empty arrays satisfy required on multiple select ([9f561a56](https://github.com/angular/material/commit/9f561a56), closes [#4604](https://github.com/angular/material/issues/4604))\n* **tabs:** fix tab paging and sizing on IE11 when tabs are in a dialog ([5034a044](https://github.com/angular/material/commit/5034a044), closes [#3953](https://github.com/angular/material/issues/3953), [#5096](https://github.com/angular/material/issues/5096))\n* **tooltip:** corrected md-tooltip positioning when scrolled ([f62f6934](https://github.com/angular/material/commit/f62f6934), closes [#2406](https://github.com/angular/material/issues/2406), [#5161](https://github.com/angular/material/issues/5161))\n\n\n<a name\"0.11.4\"></a>\n### 0.11.4 (2015-10-13)\n\n\n#### Bug Fixes\n\n* **input:** fix border-bottom transparency ([5da3c456](https://github.com/angular/material/commit/5da3c456), closes [#5128](https://github.com/angular/material/issues/5128))\n* **list:** ng-click changes item width in IE ([9b918cbc](https://github.com/angular/material/commit/9b918cbc), closes [#3708](https://github.com/angular/material/issues/3708))\n* **mdCard:** Fix card image height in IE. ([f54275ad](https://github.com/angular/material/commit/f54275ad), closes [#761](https://github.com/angular/material/issues/761))\n* **theming:** no longer apply md-default-theme class to unnested themable elements ([5eb94a55](https://github.com/angular/material/commit/5eb94a55), closes [#4846](https://github.com/angular/material/issues/4846))\n\n#### Breaking Changes\n\n* theming no longer apply md-default-theme class to unnested themable elements\n\n\n<a name\"0.11.3\"></a>\n### 0.11.3 (2015-10-12)\n\n\n#### Features\n\n* **input:** Add right-side icon to input container ([d49d8dcd](https://github.com/angular/material/commit/d49d8dcd), closes [#4763](https://github.com/angular/material/issues/4763), [#4808](https://github.com/angular/material/issues/4808))\n* **interimElement:** add onShowing event ([39efc85a](https://github.com/angular/material/commit/39efc85a), closes [#4820](https://github.com/angular/material/issues/4820))\n* **layout:** support for `md-layout-css` directive ([a4a5644d](https://github.com/angular/material/commit/a4a5644d))\n* **slider:** add md-max class when at max value ([b998696b](https://github.com/angular/material/commit/b998696b), closes [#3513](https://github.com/angular/material/issues/3513), [#5077](https://github.com/angular/material/issues/5077))\n\n\n#### Breaking Changes\n\n* Material Layout attribute `offset` should now be `flex-offset`.\n\n    Change your code from this:\n\n    ```html\n    <md-content flex offset-gt-sm=\"33\" > ... </div>\n    ```\n\n    To this:\n\n    ```html\n    <md-content flex flex-offset-gt-sm=\"33\" > ... </div>\n    ```\n\n ([ad1b78bf](https://github.com/angular/material/commit/ad1b78bf))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * adds tabindex support for autocomplete ([b4e6354e](https://github.com/angular/material/commit/b4e6354e), closes [#2113](https://github.com/angular/material/issues/2113))\n  * Fix many issues with showing/hiding. ([74297007](https://github.com/angular/material/commit/74297007), closes [#4665](https://github.com/angular/material/issues/4665), [#4788](https://github.com/angular/material/issues/4788), [#4906](https://github.com/angular/material/issues/4906), [#4855](https://github.com/angular/material/issues/4855), [#4618](https://github.com/angular/material/issues/4618), [#4469](https://github.com/angular/material/issues/4469), [#4025](https://github.com/angular/material/issues/4025), [#4958](https://github.com/angular/material/issues/4958))\n  * prevents scrollbar from displaying unnecessarily ([9dd2e354](https://github.com/angular/material/commit/9dd2e354), closes [#4308](https://github.com/angular/material/issues/4308))\n  * resolves issue with not-found message displaying unnecessarily ([281bc521](https://github.com/angular/material/commit/281bc521))\n* **button:** Fix button height in Firefox. ([aaa89093](https://github.com/angular/material/commit/aaa89093), closes [#3291](https://github.com/angular/material/issues/3291))\n* **card:** position md-card-footer at bottom of card ([156605b8](https://github.com/angular/material/commit/156605b8), closes [#3144](https://github.com/angular/material/issues/3144), [#4891](https://github.com/angular/material/issues/4891))\n* **chips:** do not display broken image when no image is provided ([315ea48e](https://github.com/angular/material/commit/315ea48e), closes [#4851](https://github.com/angular/material/issues/4851))\n* **dialog:**\n  * Switched the click action to mouse down/up ([35e2f2ac](https://github.com/angular/material/commit/35e2f2ac), closes [#3873](https://github.com/angular/material/issues/3873), [#4972](https://github.com/angular/material/issues/4972))\n  * keydown instead of keyup to close dialog ([23e18e1d](https://github.com/angular/material/commit/23e18e1d), closes [#4041](https://github.com/angular/material/issues/4041), [#4884](https://github.com/angular/material/issues/4884))\n  * fixed alert and confim `md-transition-in` class attachment ([82160e16](https://github.com/angular/material/commit/82160e16), closes [#4862](https://github.com/angular/material/issues/4862), [#5006](https://github.com/angular/material/issues/5006))\n* **fabSpeedDial:** Make hovering an option via CSS. ([bbbc475c](https://github.com/angular/material/commit/bbbc475c), closes [#4259](https://github.com/angular/material/issues/4259), [#4847](https://github.com/angular/material/issues/4847))\n* **gridList:**\n  * Animation reflow fix. ([9ae95010](https://github.com/angular/material/commit/9ae95010), closes [#1559](https://github.com/angular/material/issues/1559), [#5042](https://github.com/angular/material/issues/5042))\n  * Animated tile removal now triggers appropriate layout ([b6836d60](https://github.com/angular/material/commit/b6836d60), closes [#1559](https://github.com/angular/material/issues/1559), [#4811](https://github.com/angular/material/issues/4811))\n  * Changes to md-gutter will now trigger reflows ([ba63159a](https://github.com/angular/material/commit/ba63159a), closes [#3029](https://github.com/angular/material/issues/3029))\n  * Fixes \"fit\" mode ([a703fe54](https://github.com/angular/material/commit/a703fe54), closes [#2012](https://github.com/angular/material/issues/2012))\n* **icon:**\n  * Update demo fonts from 21px to 24px. ([3f9fce09](https://github.com/angular/material/commit/3f9fce09), closes [#4569](https://github.com/angular/material/issues/4569), [#4799](https://github.com/angular/material/issues/4799))\n  * adds check for `el` before checking its `tagName` ([43264909](https://github.com/angular/material/commit/43264909))\n  * Fix bug that prevented custom default fontset from being applied. ([b24f55fa](https://github.com/angular/material/commit/b24f55fa), closes [#4349](https://github.com/angular/material/issues/4349), [#4829](https://github.com/angular/material/issues/4829))\n* **input:**\n  * Fix border styles on Firefox. ([88282d1b](https://github.com/angular/material/commit/88282d1b), closes [#2914](https://github.com/angular/material/issues/2914))\n  * Sizes textareas properly when the container is shown ([16f92ec2](https://github.com/angular/material/commit/16f92ec2), closes [#1202](https://github.com/angular/material/issues/1202), [#4726](https://github.com/angular/material/issues/4726))\n  * fix extra `var` in input tests. ([4fcad371](https://github.com/angular/material/commit/4fcad371))\n  * fix bad char counter when value is a number.. ([74b4bae2](https://github.com/angular/material/commit/74b4bae2), closes [#4635](https://github.com/angular/material/issues/4635))\n* **inputs:** Fix floating label and char counter positions. ([db99d5ac](https://github.com/angular/material/commit/db99d5ac), closes [#4872](https://github.com/angular/material/issues/4872), [#4915](https://github.com/angular/material/issues/4915))\n* **interimElement:** Removed unnecessary resolve fallback values ([eae9eead](https://github.com/angular/material/commit/eae9eead), closes [#4094](https://github.com/angular/material/issues/4094), [#4150](https://github.com/angular/material/issues/4150), [#4982](https://github.com/angular/material/issues/4982))\n* **layout:**\n  * disable `offset` directive ([af45a22d](https://github.com/angular/material/commit/af45a22d))\n  * deprecate `offset` attribute in lieu of `flex-offset` ([ad1b78bf](https://github.com/angular/material/commit/ad1b78bf))\n  * Fix IE align-items: center issue. ([1aa95f98](https://github.com/angular/material/commit/1aa95f98), closes [#5089](https://github.com/angular/material/issues/5089))\n  * interpolated values, validations, test & CSS fixes ([2478f1d2](https://github.com/angular/material/commit/2478f1d2), closes [#5076](https://github.com/angular/material/issues/5076), [#5054](https://github.com/angular/material/issues/5054), [#4994](https://github.com/angular/material/issues/4994), [#4959](https://github.com/angular/material/issues/4959), [#4902](https://github.com/angular/material/issues/4902), [#2954](https://github.com/angular/material/issues/2954), [#5014](https://github.com/angular/material/issues/5014), [#5090](https://github.com/angular/material/issues/5090))\n* **mdListItem:** Fixed integration with checkbox and added icon avatar ([88952d6c](https://github.com/angular/material/commit/88952d6c), closes [#3784](https://github.com/angular/material/issues/3784), [#3186](https://github.com/angular/material/issues/3186), [#5054](https://github.com/angular/material/issues/5054))\n* **tabs:**\n  * overrides icon color when used within tab label ([3bc36688](https://github.com/angular/material/commit/3bc36688), closes [#3879](https://github.com/angular/material/issues/3879))\n  * fixes `md-stretch-tabs` functionality ([3c7f9faa](https://github.com/angular/material/commit/3c7f9faa), closes [#5048](https://github.com/angular/material/issues/5048))\n  * adds proper detection for bodyless tabs ([054c066b](https://github.com/angular/material/commit/054c066b), closes [#4120](https://github.com/angular/material/issues/4120))\n  * fixes tab sizing issues with and without pagination ([ed80df79](https://github.com/angular/material/commit/ed80df79), closes [#4065](https://github.com/angular/material/issues/4065), [#4834](https://github.com/angular/material/issues/4834), [#4873](https://github.com/angular/material/issues/4873))\n  * inkbar is now visible in Firefox when using centered tabs ([bb8fd26d](https://github.com/angular/material/commit/bb8fd26d), closes [#4367](https://github.com/angular/material/issues/4367))\n  * tabs now work properly with `md-dynamic-height` and `md-align-tabs=\"bottom\"` ([01b7af30](https://github.com/angular/material/commit/01b7af30), closes [#4368](https://github.com/angular/material/issues/4368))\n* **toast.scss:** Change height to defined for IE11 ([8cc6b848](https://github.com/angular/material/commit/8cc6b848), closes [#4946](https://github.com/angular/material/issues/4946), [#5057](https://github.com/angular/material/issues/5057))\n\n\n<a name\"0.11.2\"></a>\n### 0.11.2 (2015-10-01)\n\n\n#### Bug Fixes\n\n* **checkbox:** prevent ng-click firing on didabled checkboxes. Fixes ([1cae87c2](https://github.com/angular/material/commit/1cae87c2))\n* **datepicker:** stop calendar going off-screen if body is scrollable.. ([3c876c1b](https://github.com/angular/material/commit/3c876c1b), closes [#4781](https://github.com/angular/material/issues/4781))\n* **layout:**\n  * add border-box style to  to all `.flex` variants ([b1974bb0](https://github.com/angular/material/commit/b1974bb0))\n  * resolve minify bug with flex css ([b1fb32c7](https://github.com/angular/material/commit/b1fb32c7))\n  * conflict with [flex='initial'] ([f636bcc8](https://github.com/angular/material/commit/f636bcc8))\n  * improve logic for `layout > flex` specificities ([77c050ae](https://github.com/angular/material/commit/77c050ae))\n  * improved css specificity for layout ([381a0baf](https://github.com/angular/material/commit/381a0baf))\n* **select:**\n  * rollback number parsing on value attr ([b983c0d4](https://github.com/angular/material/commit/b983c0d4), closes [#4615](https://github.com/angular/material/issues/4615))\n  * fix dynamic placeholder text ([b1b2c061](https://github.com/angular/material/commit/b1b2c061), closes [#4689](https://github.com/angular/material/issues/4689))\n* **sidenav:** resolve jQuery conflict with  handler ([1a61e2ea](https://github.com/angular/material/commit/1a61e2ea), closes [#4876](https://github.com/angular/material/issues/4876))\n\n\n<a name\"0.11.1\"></a>\n### 0.11.1 (2015-09-25)\n\nThis release resolves many issues and include the following notable changes:\n\n* Fixes to support browser navigation (or $location changes)\n  * properly close Menu, Select, Dialog, Bottomsheet, and Toast components in *open* states.\n* Dialog components enhanced\n  * support adding dialog custom CSS\n  * dialog resizing as the browser window resize\n  * auto closes during navigation changes\n* Layout (flexbox) features have been improved with\n  * a smaller CSS footprint,\n  * better support for media triggers,\n  * improved specificity for hide- and show- flags\n  * Fixes media trigger `.layout-<xxx>-row` and `.layout-<xxx>-column` layouts\n  * Add support for to observe and interpolate Layout Attribute values\n  * Allow flex-order to be negative\n  * apply flexbox workarounds per [Flexbox Workarounds](https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items): use flex longhand notations with workarounds\n  *  add support for flex=\"1\", flex=\"auto\", and flex\n  *  add references to online specs/resources\n  *  fix flex-33 and flex-67 max-width and max-heights\n  *  fix layout-align to use max-width\n* A consistent API is now provided for flushing animation states during testing.\n* CI testing now performs sandbox testing for Angular 1.3.x, 1.4.x, and 1.5.x.\n\n\nDevelopers are requested to always test with the latest versions. And any CodePens provided in issue reports should use:\n\n*  Angular Material HEAD (0.11.1 or greater)\n  *  Bower Install - https://github.com/angular/bower-material/blob/master/angular-material.js\n  *  Bower Install - https://github.com/angular/bower-material/blob/master/angular-material.css\n  *  RAWGIT - https://rawgit.com/angular/bower-material/master/angular-material.js\n  *  RAWGIT - https://rawgit.com/angular/bower-material/master/angular-material.css\n* AngularJS Latest Release versions:\n  *  Angular 1.3.19 (or greater)\n  *  Angular 1.4.6 (or greater).\n\n#### Features\n\n* **datepicker:**\n  * support for ngMessages.. ([c2e17ad6](https://github.com/angular/material/commit/c2e17ad6), closes [#4672](https://github.com/angular/material/issues/4672))\n  * prevent calendar from going off-screen.. ([9d1f9daf](https://github.com/angular/material/commit/9d1f9daf), closes [#4333](https://github.com/angular/material/issues/4333))\n  * add shadow and animation cue for scrolling. Fixes ([1330cb09](https://github.com/angular/material/commit/1330cb09), closes [#4547](https://github.com/angular/material/issues/4547))\n  * allow changing first day of the week.. ([46c7b187](https://github.com/angular/material/commit/46c7b187), closes [#4316](https://github.com/angular/material/issues/4316))\n* **dialog:** allow specifying parent by string selector. support to add dialog custom CSS and dialog resizing as the browser window resize. ([5551699c](https://github.com/angular/material/commit/5551699c))\n* **layout:** support to disable attribute translation to class notations. restore max-width for layouts ([bf77109c](https://github.com/angular/material/commit/bf77109c))\n* **input:** Add support for both labels and placeholders. ([b5dd1507](https://github.com/angular/material/commit/b5dd1507), closes [#4462](https://github.com/angular/material/issues/4462), [#4258](https://github.com/angular/material/issues/4258), [#4623](https://github.com/angular/material/issues/4623))\n\n\n#### Bug Fixes\n\n* **autocomplete:** re-adds support for custom item names in autocomplete templates ([8849213c](https://github.com/angular/material/commit/8849213c), closes [#4667](https://github.com/angular/material/issues/4667))\n  * Fix scope watch bug. ([9a275970](https://github.com/angular/material/commit/9a275970), closes [#4713](https://github.com/angular/material/issues/4713), [#4715](https://github.com/angular/material/issues/4715))\n  * Fix small style regression introduced by multiple errors. ([9891723e](https://github.com/angular/material/commit/9891723e), closes [#4692](https://github.com/angular/material/issues/4692), [#4695](https://github.com/angular/material/issues/4695))\n  * Compile autocomplete template against proper scope. ([6681e824](https://github.com/angular/material/commit/6681e824), closes [#4390](https://github.com/angular/material/issues/4390), [#4495](https://github.com/angular/material/issues/4495), [#4391](https://github.com/angular/material/issues/4391))\n* **codepen:** improve use of external css ([cdcf31d6](https://github.com/angular/material/commit/cdcf31d6))\n* **dateLocale:** guard for setting midnight to null. ([65abc82c](https://github.com/angular/material/commit/65abc82c), closes [#4780](https://github.com/angular/material/issues/4780))\n* **datepicker:**\n  * prevent calendar clipping on small screens. For #4558 ([64fb8037](https://github.com/angular/material/commit/64fb8037))\n  * ngModel updates for empty input. ([416dc4c0](https://github.com/angular/material/commit/416dc4c0), closes [#4643](https://github.com/angular/material/issues/4643), [#4648](https://github.com/angular/material/issues/4648))\n  * make dark theme picker not terrible. ([e80c6214](https://github.com/angular/material/commit/e80c6214), closes [#4614](https://github.com/angular/material/issues/4614))\n  * handle DST incocnsistency encountered in some timezones.. ([562e41a6](https://github.com/angular/material/commit/562e41a6), closes [#4215](https://github.com/angular/material/issues/4215))\n* **dialog:**\n  * resolves issue where dialog templates were displaying HTML as text ([ea9890f1](https://github.com/angular/material/commit/ea9890f1))\n  * resize top and height on window resize ([3e34e021](https://github.com/angular/material/commit/3e34e021), closes [#4513](https://github.com/angular/material/issues/4513))\n  * incorrect dialog placement if page is scrolled ([1fc76229](https://github.com/angular/material/commit/1fc76229), closes [#4115](https://github.com/angular/material/issues/4115))\n* **fabSpeedDial:** remove keyboard handlers on scope destroy ([3516a85b](https://github.com/angular/material/commit/3516a85b), closes [#4681](https://github.com/angular/material/issues/4681))\n* **general:** common disabled behavior for switch/slider/select. ([86d876bf](https://github.com/angular/material/commit/86d876bf), closes [#3797](https://github.com/angular/material/issues/3797), [#4654](https://github.com/angular/material/issues/4654))\n* **gridlist:** improve getTileStyle() to use rowCount ([0853f2c8](https://github.com/angular/material/commit/0853f2c8), closes [#2741](https://github.com/angular/material/issues/2741))\n* **input:**\n  * Fix md-maxlength when used with ng-messages. ([968aa23a](https://github.com/angular/material/commit/968aa23a), closes [#4783](https://github.com/angular/material/issues/4783), [#4786](https://github.com/angular/material/issues/4786))\n  * Support multiple ng-messages simultaneously. ([3d0b4181](https://github.com/angular/material/commit/3d0b4181), closes [#2648](https://github.com/angular/material/issues/2648), [#1957](https://github.com/angular/material/issues/1957), [#1793](https://github.com/angular/material/issues/1793), [#4647](https://github.com/angular/material/issues/4647), [#4472](https://github.com/angular/material/issues/4472), [#4008](https://github.com/angular/material/issues/4008))\n* **interimElement:**\n  * use angular.extend ([bfb8daca](https://github.com/angular/material/commit/bfb8daca), closes [#4683](https://github.com/angular/material/issues/4683))\n  * support scope.$destroy events ([77a34bd8](https://github.com/angular/material/commit/77a34bd8), closes [#3741](https://github.com/angular/material/issues/3741), [#4405](https://github.com/angular/material/issues/4405), [#4504](https://github.com/angular/material/issues/4504), [#4151](https://github.com/angular/material/issues/4151), [#4659](https://github.com/angular/material/issues/4659))\n* **layout:**\n  * prevents missing body error in unit tests ([c3a2adaa](https://github.com/angular/material/commit/c3a2adaa))\n  * resolve incorrect and duplicate layout tests ([5d9f9607](https://github.com/angular/material/commit/5d9f9607), closes [#4740](https://github.com/angular/material/issues/4740))\n  * restrict directives to attributes only ([e8b60de9](https://github.com/angular/material/commit/e8b60de9))\n  * device size attributes should not set max-width or max-height ([8b210c38](https://github.com/angular/material/commit/8b210c38))\n* **list:**\n  * fix clipping on list items, simplify code ([9759440d](https://github.com/angular/material/commit/9759440d), closes [#2199](https://github.com/angular/material/issues/2199))\n  * fixes list item height ([30f334ac](https://github.com/angular/material/commit/30f334ac))\n* **listItem:** fix menu triggering proxy elements ([c7ff50ca](https://github.com/angular/material/commit/c7ff50ca), closes [#4303](https://github.com/angular/material/issues/4303))\n* **menu:**\n  * remove exception when async loading ([4f841379](https://github.com/angular/material/commit/4f841379), closes [#4687](https://github.com/angular/material/issues/4687))\n  * safeguard NRE in `activateInteraction()` ([d98f9a7c](https://github.com/angular/material/commit/d98f9a7c), closes [#3741](https://github.com/angular/material/issues/3741))\n  * fixes JS focus error on close ([d75d021f](https://github.com/angular/material/commit/d75d021f))\n* **ripple:** ripple will no longer be triggered on disabled elements ([313342cf](https://github.com/angular/material/commit/313342cf), closes [#5445](https://github.com/angular/material/issues/5445))\n* **select:**\n  * multiple no longer sets form to $dirty ([09bd5a3b](https://github.com/angular/material/commit/09bd5a3b), closes [#3933](https://github.com/angular/material/issues/3933))\n  * fix undefined class on select container ([5ca0b2b6](https://github.com/angular/material/commit/5ca0b2b6), closes [#4184](https://github.com/angular/material/issues/4184))\n  * fix options not closing with explicit md-select-label ([3c0d21ef](https://github.com/angular/material/commit/3c0d21ef), closes [#4387](https://github.com/angular/material/issues/4387))\n* **sidenav:** binds remove function to prevent errors ([5346de47](https://github.com/angular/material/commit/5346de47))\n* **switch:** inverted logic in md-switch dragging ([316b4c82](https://github.com/angular/material/commit/316b4c82), closes [#4549](https://github.com/angular/material/issues/4549), [#4560](https://github.com/angular/material/issues/4560))\n* **tabs:** addresses potential `$digest already in progress` error ([4a16038b](https://github.com/angular/material/commit/4a16038b), closes [#4743](https://github.com/angular/material/issues/4743))\n* **theme:** input placeholder color style fixed for Chrome ([85dceef4](https://github.com/angular/material/commit/85dceef4), closes [#4162](https://github.com/angular/material/issues/4162))\n* **tooltip:**\n  * using tooltip inside subheader causes Firefox hang. ([5bb3505e](https://github.com/angular/material/commit/5bb3505e), closes [#4777](https://github.com/angular/material/issues/4777), [#4800](https://github.com/angular/material/issues/4800))\n  * trigger parent blur on `leaveHandler( )` ([b65d1536](https://github.com/angular/material/commit/b65d1536), closes [#4249](https://github.com/angular/material/issues/4249), [#4597](https://github.com/angular/material/issues/4597), [#4590](https://github.com/angular/material/issues/4590))\n* **util:** improve parse logic in supplant() ([81b633c1](https://github.com/angular/material/commit/81b633c1), closes [#4511](https://github.com/angular/material/issues/4511))\n* **utils:** extractElementByName() and findFocusTarget() logic improved ([a5d84c37](https://github.com/angular/material/commit/a5d84c37), closes [#4532](https://github.com/angular/material/issues/4532), [#4497](https://github.com/angular/material/issues/4497))\n* **virtualRepeat:** prevents digest if digest is already in progress ([acbf293d](https://github.com/angular/material/commit/acbf293d))\n* **whiteframe:** working with dp insted of z-index ([b37ac3ad](https://github.com/angular/material/commit/b37ac3ad), closes [#4706](https://github.com/angular/material/issues/4706))\n\n\n<a name\"0.11.0-rc2\"></a>\n### 0.11.0 (2015-09-08)\n\nThis release includes all changes from RC1 and RC2.\n\n\n<a name\"0.11.0-rc2\"></a>\n### 0.11.0-rc2 (2015-09-03)\n\nThis release is comprised of 1 major effort:\n\n* Performance and API improvements for ProgressLinear and ProgressCircular\n\n#### Features\n\n* **progressCircular:** css reduction with js animations ([b1f7dc41](https://github.com/angular/material/commit/b1f7dc41))\n* **progressLinear, progressCircular** sync logic, fix linear animations, performance upgrades ([d74f93a84](https://github.com/angular/material/commit/d74f93a8463727a01cc5ed89d04d1108ba413359))\n  * synchronize progressLinear with similar logic used in progressCircular.\n  * improve animation performances\n  * watch md-mode for changes\n  * refactor animation SCSS\n  * enable hiding and no-animations with undefined/empty md-mode attributes\n  * for both indicators, use `display:block;`\n  * update demos with enable switch\n  * fix query mode\n  * update Select to use enhanced progressCircular component\n  * fix autocomplete styling of progress-linear.md-mode-indeterminate\n  *  auto-inject md-mode attribute if missing\n    *  use 'determinate' if value attribute is defined\n    *  otherwise use 'indeterminate'\n    *  $log.debug() notify user (via $log.debug) of injection\n    *  add API doc details regarding md-mode auto-injection\n  * fix tests\nFixes [#4421](https://github.com/angular/material/issues/4421). Fixes [#4409](https://github.com/angular/material/issues/4409). Fixes [#2540](https://github.com/angular/material/issues/2540). Fixes [#2364](https://github.com/angular/material/issues/2364). Fixes [#1926](https://github.com/angular/material/issues/1926). Fixes [#3802](https://github.com/angular/material/issues/3802). Closes [#4454](https://github.com/angular/material/issues/4454).\n\n#### Breaking Changes\n\n* progressLinear and progressCircular indicators explicitly set `display` and `position` styles\n\nBefore:\n\n```css\nmd-progress-linear {\n  display: block;\n}\nmd-progress-circular {\n   // display not set\n   // position not set\n}\n```\n\n```css\nmd-progress-linear {\n  display: block;\n  position: relative;\n}\nmd-progress-circular {\n  display: block;\n  position: relative;\n}\n```\n\n\n#### Bug Fixes\n\n* **dialog:**\n  * allow Confirm dialogs to have empty/undefined content ([ffbcff39](https://github.com/angular/material/commit/ffbcff39), closes [#4429](https://github.com/angular/material/issues/4429))\n* **gesture:** fix overzealous preventDefault on label+input clicks. ([912bcefd](https://github.com/angular/material/commit/912bcefd), closes [#4110](https://github.com/angular/material/issues/4110), [#4110](https://github.com/angular/material/issues/4110), [#4223](https://github.com/angular/material/issues/4223))\n* **mdSubheader:** Non top-level md-content causes incorrect position. ([391479b0](https://github.com/angular/material/commit/391479b0), closes [#4420](https://github.com/angular/material/issues/4420), [#4439](https://github.com/angular/material/issues/4439))\n* **mdToolbar:**\n  * Better fix for ng-if that allows ng-controller. ([a09b9abb](https://github.com/angular/material/commit/a09b9abb), closes [#4144](https://github.com/angular/material/issues/4144), [#4423](https://github.com/angular/material/issues/4423))\n* **ripple:**\n  * fixes ripple when jQuery is loaded ([4e048ff8](https://github.com/angular/material/commit/4e048ff8), closes [#4375](https://github.com/angular/material/issues/4375))\n  * fixes js error on button click for date picker ([be4311ac](https://github.com/angular/material/commit/be4311ac))\n\n\n<a name\"0.11.0-rc1\"></a>\n### 0.11.0-rc1 (2015-09-01)\n\nThis release is comprised of three major efforts:\n\n* Release of new components: DatePicker and MenuBar\n* Performance improvements to Layout and use of Flexbox\n* Performance improvements to Ripple\n\n#### Features\n\n* **calendar:**\n  * Add date completion detection ([d6457e27](https://github.com/angular/material/commit/d6457e27))\n  * more fine-tuned a11y ([c3bf8400](https://github.com/angular/material/commit/c3bf8400))\n  * cleanup and i18n ([0e8be31e](https://github.com/angular/material/commit/0e8be31e))\n  * Add metaKey keyboard shortcuts ([733431b4](https://github.com/angular/material/commit/733431b4))\n  * change coors to be in terms of the theme ([78f8eea0](https://github.com/angular/material/commit/78f8eea0))\n  * improve datepicker css ([56df8d51](https://github.com/angular/material/commit/56df8d51))\n  * add clickable arrow button and placeholder ([c9a23242](https://github.com/angular/material/commit/c9a23242))\n  * add calendar icon and associated styles ([24ae0fa3](https://github.com/angular/material/commit/24ae0fa3))\n  * implement virtual scrolling in calendar ([34eb48cf](https://github.com/angular/material/commit/34eb48cf))\n  * fix up $$mdDateLocaleProvider and use in calendar. ([36eae116](https://github.com/angular/material/commit/36eae116))\n  * starting work for date-picker. ([b158d15b](https://github.com/angular/material/commit/b158d15b))\n  * fix up $$mdDateLocaleProvider and use in calendar. ([b789eef8](https://github.com/angular/material/commit/b789eef8))\n  * starting work for date-picker. ([7b70d74e](https://github.com/angular/material/commit/7b70d74e))\n  * fix up $$mdDateLocaleProvider and use in calendar. ([f3457b86](https://github.com/angular/material/commit/f3457b86))\n  * starting work for date-picker. ([9b0b861e](https://github.com/angular/material/commit/9b0b861e))\n* **chips:** Add `md-on-remove` attribute. ([7037b394](https://github.com/angular/material/commit/7037b394), closes [#3190](https://github.com/angular/material/issues/3190))\n* **contactChips:** Add md-highlight-flags support. ([00474c39](https://github.com/angular/material/commit/00474c39), closes [#3182](https://github.com/angular/material/issues/3182), [#4278](https://github.com/angular/material/issues/4278))\n* **datepicker:**\n  * Add min/max dates in datepicker ([cecba236](https://github.com/angular/material/commit/cecba236), closes [#4158](https://github.com/angular/material/issues/4158), [#4306](https://github.com/angular/material/issues/4306))\n  * Add theme color and border width on focused datepicker ([1fcd0179](https://github.com/angular/material/commit/1fcd0179))\n  * Debounce datepicker input element event ([5d088d3a](https://github.com/angular/material/commit/5d088d3a))\n  * Add invalid class for datepicker ([40c7a8f5](https://github.com/angular/material/commit/40c7a8f5))\n  * add docs with usage for $mdDateLocale ([bd4dc668](https://github.com/angular/material/commit/bd4dc668))\n  * add documentation for datepicker ([4211d212](https://github.com/angular/material/commit/4211d212))\n  * a11y experimentation ([1400d25e](https://github.com/angular/material/commit/1400d25e))\n  * fixes for a11y ([6480d710](https://github.com/angular/material/commit/6480d710))\n  * opening animation and better shadow ([a1844f71](https://github.com/angular/material/commit/a1844f71))\n  * change colors to theme ([26dbbf8b](https://github.com/angular/material/commit/26dbbf8b))\n  * floating calendar panel for date picker. ([e6b1d239](https://github.com/angular/material/commit/e6b1d239))\n  * binding for the date-picker ([cc10fa94](https://github.com/angular/material/commit/cc10fa94))\n  * floating calendar panel for date picker. ([a324e66c](https://github.com/angular/material/commit/a324e66c))\n  * floating calendar panel for date picker. ([b1f6e1a0](https://github.com/angular/material/commit/b1f6e1a0))\n  * binding for the date-picker ([8a8824a1](https://github.com/angular/material/commit/8a8824a1))\n* **mdChips:** Add `md-on-select` expression support. ([333984f2](https://github.com/angular/material/commit/333984f2), closes [#4088](https://github.com/angular/material/issues/4088))\n* **mdToolbar:** Vary height depending upon device width/orientation. ([b6e10989](https://github.com/angular/material/commit/b6e10989), closes [#2047](https://github.com/angular/material/issues/2047), [#4161](https://github.com/angular/material/issues/4161))\n* **menuBar:** add menu bar component ([d9ba0e13](https://github.com/angular/material/commit/d9ba0e13), closes [#78](https://github.com/angular/material/issues/78))\n* **theming:** add hue-specific contrast support ([c4f9f504](https://github.com/angular/material/commit/c4f9f504))\n* **virtualRepeat:** Infinite scroll and deferred data loading ([d68b4f6f](https://github.com/angular/material/commit/d68b4f6f), closes [#4002](https://github.com/angular/material/issues/4002))\n\n\n#### Breaking Changes\n\n* Layout (flex, layout, etc) use Class selectors instead of Attribute selectors\n\n* Backdrop animates opacity instead of background-color\n\n* Menu button ripples inherit border-radius.\n\n* ProgressCircular uses class selectors instead of attribute selectors\n\n* Ripples are completely rewritten\n\n* modify scope of `box-sizing: border-box` to be specific to only to elements owned by ngMaterial.\n\nBefore:\n\n```css\n*,*:before,*:after {\n  box-sizing: border-box;\n}\n\n.md-container { }\n```\n\nAfter\n\n```css\n.md-container {\n   box-sizing: border-box;\n}\n```\n\nRefs #3516. Closes #4222\n\n ([fbb6b28c](https://github.com/angular/material/commit/fbb6b28c))\n\n* dialog content text is now injected into **div.md-dialog-content-body**\n\nBefore the template used was:\n\n```html\n<md-dialog-content>\n   <h2></h2>\n   <p></p>\n</md-dialog-content>\n```\n\nNow uses:\n\n```html\n<md-dialog-content>\n   <h2></h2>\n   <div class=\"md-dialog-content-body\">\n     <p></p>\n    </div>\n</md-dialog-content>\n```\n\nFixes #1495.\n\n ([81e94b4f](https://github.com/angular/material/commit/81e94b4f))\n\n\n#### Bug Fixes\n\n* **autocomplete:** not found message no longer gets stuck ([f2e6b162](https://github.com/angular/material/commit/f2e6b162), closes [#4309](https://github.com/angular/material/issues/4309))\n* **build:**\n  * lock CI tests to use Angular 1.4.4 ([8157dece](https://github.com/angular/material/commit/8157dece))\n  * correct detection and generation ngMaterial module definition ([d85e14af](https://github.com/angular/material/commit/d85e14af))\n  * parse module definitions for material only or general ([e4ca61f0](https://github.com/angular/material/commit/e4ca61f0))\n  * buildNgMaterialDefinition RegExp updated ([391cff58](https://github.com/angular/material/commit/391cff58), closes [#4305](https://github.com/angular/material/issues/4305))\n* **calendar:**\n  * ensure all instances are removed from DOM after tests. ([e314072e](https://github.com/angular/material/commit/e314072e))\n  * Update ngModel instead of ctrl.date on input change ([36d355a9](https://github.com/angular/material/commit/36d355a9))\n  * fix broken unit tests ([b60bd35c](https://github.com/angular/material/commit/b60bd35c))\n  * fix incorrect angular.bind use ([70467da3](https://github.com/angular/material/commit/70467da3))\n  * remove non-working VoiceOver fix hack ([a22b002b](https://github.com/angular/material/commit/a22b002b))\n  * clean-up code after a11y experiments ([0777cd98](https://github.com/angular/material/commit/0777cd98))\n  * fix voiceover scrolling already-scrolled calendar. ([db3d06e9](https://github.com/angular/material/commit/db3d06e9))\n  * fix broken unit tests for component rename and focus changes. ([a3786ce7](https://github.com/angular/material/commit/a3786ce7))\n  * fix focus behavior on open ([fa7b3830](https://github.com/angular/material/commit/fa7b3830))\n  * add remaining missing tests for dateUtil ([8443fd5a](https://github.com/angular/material/commit/8443fd5a))\n  * Make calendar directive IDs unique ([406ffe6a](https://github.com/angular/material/commit/406ffe6a))\n  * Make calendar directive IDs unique ([cde67d61](https://github.com/angular/material/commit/cde67d61))\n  * add remaining missing tests for dateUtil ([7fe79319](https://github.com/angular/material/commit/7fe79319))\n* **chips:**\n  * Fix styling issues with padding & remove. ([af3ef522](https://github.com/angular/material/commit/af3ef522), closes [#4264](https://github.com/angular/material/issues/4264), [#3276](https://github.com/angular/material/issues/3276), [#2410](https://github.com/angular/material/issues/2410), [#4275](https://github.com/angular/material/issues/4275))\n  * interaction with Autocomplete ([86db4db9](https://github.com/angular/material/commit/86db4db9), closes [#3475](https://github.com/angular/material/issues/3475), [#4108](https://github.com/angular/material/issues/4108))\n  * item name in autcomplete ([dc5357de](https://github.com/angular/material/commit/dc5357de), closes [#4109](https://github.com/angular/material/issues/4109), [#4111](https://github.com/angular/material/issues/4111))\n  * cursor style on static chips ([6726eca9](https://github.com/angular/material/commit/6726eca9), closes [#3253](https://github.com/angular/material/issues/3253), [#4114](https://github.com/angular/material/issues/4114))\n  * adjust chips css. ([565b7b46](https://github.com/angular/material/commit/565b7b46), closes [#3402](https://github.com/angular/material/issues/3402), [#4117](https://github.com/angular/material/issues/4117))\n  * hide remove button on custom template when readonly ([3fdb3140](https://github.com/angular/material/commit/3fdb3140), closes [#3697](https://github.com/angular/material/issues/3697), [#4090](https://github.com/angular/material/issues/4090))\n* **css:** remove styles that could apply to user-controlled elements. ([fbb6b28c](https://github.com/angular/material/commit/fbb6b28c), closes [#4222](https://github.com/angular/material/issues/4222))\n* **datepicker:**\n  * fix bad valid date check and resize-on-open. ([1fb8ab5a](https://github.com/angular/material/commit/1fb8ab5a), closes [#4270](https://github.com/angular/material/issues/4270))\n  * update input size and invalid class on calendar click ([18458b74](https://github.com/angular/material/commit/18458b74), closes [#4262](https://github.com/angular/material/issues/4262))\n  * fix error w/ null date model value. ([bafbacb3](https://github.com/angular/material/commit/bafbacb3), closes [#4232](https://github.com/angular/material/issues/4232))\n  * add missing type=\"button\" and check for pane being in the DOM before removing. a ([314a05df](https://github.com/angular/material/commit/314a05df), closes [#4214](https://github.com/angular/material/issues/4214))\n  * fix oblong open button. ([db815dba](https://github.com/angular/material/commit/db815dba))\n  * fix ngDisabled not working with jQuery. ([51436568](https://github.com/angular/material/commit/51436568))\n  * prevent scrolling while calendar pane is open. ([e6053736](https://github.com/angular/material/commit/e6053736))\n  * fix pane position when pinch-zoomed ([1e28d521](https://github.com/angular/material/commit/1e28d521))\n* **dialog:**\n  * improve support for template and templateUrl options ([22c34bad](https://github.com/angular/material/commit/22c34bad), closes [#3191](https://github.com/angular/material/issues/3191), [#4206](https://github.com/angular/material/issues/4206))\n  * enable support for html content for alert and confirm dialogs ([81e94b4f](https://github.com/angular/material/commit/81e94b4f), closes [#1495](https://github.com/angular/material/issues/1495))\n* **docs:** Build on Windows results in broken docs site ([35ce9b8f](https://github.com/angular/material/commit/35ce9b8f), closes [#4226](https://github.com/angular/material/issues/4226), [#4227](https://github.com/angular/material/issues/4227))\n* **fabSpeedDial:** support all ng-repeat variants, fix CSS height ([17676e6f](https://github.com/angular/material/commit/17676e6f), closes [#3632](https://github.com/angular/material/issues/3632), [#3370](https://github.com/angular/material/issues/3370), [#3796](https://github.com/angular/material/issues/3796), [#4006](https://github.com/angular/material/issues/4006))\n* **fabToolbar:**\n  * Fix md-direction attribute to be a string instead of expression. ([ec336c7c](https://github.com/angular/material/commit/ec336c7c), closes [#3390](https://github.com/angular/material/issues/3390), [#4185](https://github.com/angular/material/issues/4185))\n  * fix toolbar height to use variables ([2dc200af](https://github.com/angular/material/commit/2dc200af), closes [#3384](https://github.com/angular/material/issues/3384), [#4007](https://github.com/angular/material/issues/4007))\n* **font:** use Roboto font instead of RobotoDraft ([aa7f83aa](https://github.com/angular/material/commit/aa7f83aa), closes [#4063](https://github.com/angular/material/issues/4063), [#4064](https://github.com/angular/material/issues/4064))\n* **gesture:** fix overzealous preventDefault on label+input clicks. ([912bcefd](https://github.com/angular/material/commit/912bcefd), closes [#4110](https://github.com/angular/material/issues/4110), [#4110](https://github.com/angular/material/issues/4110), [#4223](https://github.com/angular/material/issues/4223))\n* **icon:**\n  * Log network errors without throwing exceptions. ([e2a8f292](https://github.com/angular/material/commit/e2a8f292), closes [#2530](https://github.com/angular/material/issues/2530), [#3718](https://github.com/angular/material/issues/3718))\n  * don't guard adding icon class on presence of class attr. ([1daa8bce](https://github.com/angular/material/commit/1daa8bce))\n* **input:** fix bad label initialization when using static value. Fixes ([f98e8514](https://github.com/angular/material/commit/f98e8514))\n* **layout:** corrections to `material.core.layout` module and tests ([46b5500c](https://github.com/angular/material/commit/46b5500c))\n* **md-month:** fix overwriting offset for initial months. ([3598e6d9](https://github.com/angular/material/commit/3598e6d9))\n* **mdBottomSheet:** Enable touch interaction on mobile devices ([1a90a727](https://github.com/angular/material/commit/1a90a727), closes [#4327](https://github.com/angular/material/issues/4327))\n* **mdChips:**\n  * Backspace key and custom input focus/blur. ([703f2c8a](https://github.com/angular/material/commit/703f2c8a), closes [#3562](https://github.com/angular/material/issues/3562), [#3960](https://github.com/angular/material/issues/3960), [#2607](https://github.com/angular/material/issues/2607), [#4359](https://github.com/angular/material/issues/4359))\n  * Fix error with audocomplete inside readonly chips and allow usage inside ng-repe ([3e8c9945](https://github.com/angular/material/commit/3e8c9945), closes [#2841](https://github.com/angular/material/issues/2841), [#3482](https://github.com/angular/material/issues/3482), [#4133](https://github.com/angular/material/issues/4133))\n  * Run duplicate check after mdOnAppend. ([44ab0722](https://github.com/angular/material/commit/44ab0722), closes [#2748](https://github.com/angular/material/issues/2748), [#4113](https://github.com/angular/material/issues/4113))\n  * Allow custom $interpolate start/end symbols. ([6fd31c9a](https://github.com/angular/material/commit/6fd31c9a), closes [#2958](https://github.com/angular/material/issues/2958), [#4136](https://github.com/angular/material/issues/4136))\n* **mdSelect:**\n  * Close menu on hitting Enter key ([303ab0dc](https://github.com/angular/material/commit/303ab0dc), closes [#4377](https://github.com/angular/material/issues/4377), [#4384](https://github.com/angular/material/issues/4384), [#4372](https://github.com/angular/material/issues/4372))\n  * Close menu on hitting Enter key ([925301f2](https://github.com/angular/material/commit/925301f2), closes [#4377](https://github.com/angular/material/issues/4377), [#4384](https://github.com/angular/material/issues/4384))\n* **mdToolbar:** Allow md-scroll-shrink usage with ng-if. ([9b861fdb](https://github.com/angular/material/commit/9b861fdb), closes [#2751](https://github.com/angular/material/issues/2751), [#4394](https://github.com/angular/material/issues/4394))\n* **progressCircular:** css reduction with js animations ([b1f7dc41](https://github.com/angular/material/commit/b1f7dc41))\n* **ripple:**\n  * fixes ripple when jQuery is loaded ([4e048ff8](https://github.com/angular/material/commit/4e048ff8), closes [#4375](https://github.com/angular/material/issues/4375))\n  * fixes js error on button click for date picker ([be4311ac](https://github.com/angular/material/commit/be4311ac))\n* **select:**\n  * Don't close on mouseup on scrollbar ([8fc273a6](https://github.com/angular/material/commit/8fc273a6), closes [#4229](https://github.com/angular/material/issues/4229))\n  * fix incorrect styling of md-select ([d9b72b66](https://github.com/angular/material/commit/d9b72b66), closes [#3937](https://github.com/angular/material/issues/3937))\n  * fix arrow placement on IE 10 ([70c0c6e8](https://github.com/angular/material/commit/70c0c6e8), closes [#2213](https://github.com/angular/material/issues/2213))\n  * multiple select clears on undefined ngModel ([346198a4](https://github.com/angular/material/commit/346198a4), closes [#2921](https://github.com/angular/material/issues/2921))\n* **sidenav:** add valid transition to close animations ([e26a2754](https://github.com/angular/material/commit/e26a2754), closes [#3576](https://github.com/angular/material/issues/3576))\n* **slider:** Update CSS to better conform to spec. ([7fd8b098](https://github.com/angular/material/commit/7fd8b098), closes [#2427](https://github.com/angular/material/issues/2427))\n* **sticky:** improve onScroll logic ([40e5469d](https://github.com/angular/material/commit/40e5469d))\n* **subheader:**\n  * Set styles to allow click/hover when stickied. ([27ea0c93](https://github.com/angular/material/commit/27ea0c93), closes [#3932](https://github.com/angular/material/issues/3932))\n  * Fix thrown error when using md-subheader with ng-if and ng-repeat. ([dbca2a47](https://github.com/angular/material/commit/dbca2a47), closes [#2650](https://github.com/angular/material/issues/2650), [#2980](https://github.com/angular/material/issues/2980), [#4171](https://github.com/angular/material/issues/4171))\n* **tabs:** Fix 0-height animation on iOS devices. ([9ac7496e](https://github.com/angular/material/commit/9ac7496e), closes [#4339](https://github.com/angular/material/issues/4339), [#4341](https://github.com/angular/material/issues/4341))\n* **tooltip:** Fix md-tooltip showing when window receives focus ([954cab5e](https://github.com/angular/material/commit/954cab5e), closes [#3035](https://github.com/angular/material/issues/3035), [#4191](https://github.com/angular/material/issues/4191))\n* **virtualRepeat:** Virtual repeat starting off empty #3807 ([38f2c35d](https://github.com/angular/material/commit/38f2c35d), closes [#4112](https://github.com/angular/material/issues/4112), [#3807](https://github.com/angular/material/issues/3807))\n\n\n<a name\"0.10.1\"></a>\n### 0.10.1 (2015-08-11)\n\n\n#### Features\n\n* **autocomplete:**\n  * adds `md-input-id` to allow the user to provide a custom ID for autocomplete inp ([9931e2a8](https://github.com/angular/material/commit/9931e2a8), closes [#3481](https://github.com/angular/material/issues/3481))\n  * adds a new attribute option `md-select-on-match` ([d16d2b66](https://github.com/angular/material/commit/d16d2b66), closes [#3324](https://github.com/angular/material/issues/3324), [#3825](https://github.com/angular/material/issues/3825))\n  * Add promise support to md-item-text ([7430e687](https://github.com/angular/material/commit/7430e687))\n* **menu:** do not propagate event in mdOpenMenu ([b8045df5](https://github.com/angular/material/commit/b8045df5), closes [#3296](https://github.com/angular/material/issues/3296), [#3332](https://github.com/angular/material/issues/3332))\n* **select:**\n  * add support for disabled ([adcee7d1](https://github.com/angular/material/commit/adcee7d1), closes [#3518](https://github.com/angular/material/issues/3518))\n  * add md-container-class for custom styling ([b8897dba](https://github.com/angular/material/commit/b8897dba), closes [#3116](https://github.com/angular/material/issues/3116))\n  * allow md-input-container label and remove md-select-label ([5d9874fb](https://github.com/angular/material/commit/5d9874fb), closes [#2684](https://github.com/angular/material/issues/2684), [#1586](https://github.com/angular/material/issues/1586), [#3307](https://github.com/angular/material/issues/3307))\n* **tabs:** setting `md-selected` to `-1` will allow `md-tabs` to function without forcing a ([27783df9](https://github.com/angular/material/commit/27783df9), closes [#3172](https://github.com/angular/material/issues/3172))\n* **virtualRepeat:**\n  * Add md-auto-shrink and md-auto-shrink-min ([79dcbf73](https://github.com/angular/material/commit/79dcbf73), closes [#3536](https://github.com/angular/material/issues/3536))\n  * add md-start-index attribute. ([9a045fb7](https://github.com/angular/material/commit/9a045fb7))\n  * allow for scrolling areas larger than the browser's maximum element size. ([98e91ae2](https://github.com/angular/material/commit/98e91ae2))\n\n\n#### Breaking Changes\n\n* **input:** change `min-height` for textarea to one row\n(and remove extra padding space); set `rows=1` since it defaults to 2\n\n ([2132cd29](https://github.com/angular/material/commit/2132cd29))\n* **css:** media queries for `sm`, `lg`, and `md` have\nmodified `max-width` values\n\n ([51dbd402](https://github.com/angular/material/commit/51dbd402))\n* **button:** `md-button` class now uses `display:\ninline-block` instead of `display: flex`; removes associated flexbox\nstyles\n\n ([fd331c87](https://github.com/angular/material/commit/fd331c87))\n* **dialog:** changes classes `transition-in` and\n`transition-out` to `md-transition-in` and `md-transition-out`\n\n ([4210ade7](https://github.com/angular/material/commit/4210ade7))\n* `md-select-label` has been removed.  Users must use\n`md-input-container` and `label` going forward.\n\n ([712bc721](https://github.com/angular/material/commit/712bc721))\n\n\n#### Bug Fixes\n\n* ** sidenav:** corrected use of internal $toggleOpen() ([6f72befb](https://github.com/angular/material/commit/6f72befb))\n* **$mdConstant:** fix overlapping in media-queries ([61a0e539](https://github.com/angular/material/commit/61a0e539), closes [#3423](https://github.com/angular/material/issues/3423), [#3451](https://github.com/angular/material/issues/3451))\n* **autocomplete:**\n  * hitting escape once again clears the search text ([99e8e2c2](https://github.com/angular/material/commit/99e8e2c2), closes [#3847](https://github.com/angular/material/issues/3847))\n  * re-adds `preventDefault` calls to keydown event ([d52e9c29](https://github.com/angular/material/commit/d52e9c29))\n  * keyboard input used by autocomplete will now call `$event.stopPropagation()` to  ([2781eac5](https://github.com/angular/material/commit/2781eac5), closes [#2931](https://github.com/angular/material/issues/2931))\n  * promises that resolve immediately will work properly ([b316bba9](https://github.com/angular/material/commit/b316bba9), closes [#3117](https://github.com/angular/material/issues/3117))\n  * changing windows while typing (with no results) no longer breaks scrolling ([c0659cc8](https://github.com/angular/material/commit/c0659cc8), closes [#3546](https://github.com/angular/material/issues/3546))\n  * addresses bug with AngularJS 1.4.1 ([a52c943a](https://github.com/angular/material/commit/a52c943a), closes [#3637](https://github.com/angular/material/issues/3637))\n  * fixes z-index issues with autocomplete menu ([d75b5924](https://github.com/angular/material/commit/d75b5924))\n  * tests wait for promises to complete now ([9990e618](https://github.com/angular/material/commit/9990e618), closes [#2462](https://github.com/angular/material/issues/2462), [#2710](https://github.com/angular/material/issues/2710))\n  * fixes infinite digest issue in IE11 ([f5959cc2](https://github.com/angular/material/commit/f5959cc2), closes [#3101](https://github.com/angular/material/issues/3101))\n  * selecting an item while loading will now hide the progress bar ([7314e12d](https://github.com/angular/material/commit/7314e12d), closes [#3478](https://github.com/angular/material/issues/3478))\n  * ngMessages should once again work with mdAutocomplete ([2ccbc9da](https://github.com/angular/material/commit/2ccbc9da), closes [#3401](https://github.com/angular/material/issues/3401))\n  * fixes issue in Firefox/Linux where textChange is not a function ([1be46cb9](https://github.com/angular/material/commit/1be46cb9))\n* **backdrop:**\n  * use absolute positioning and anchors ([87bdf36a](https://github.com/angular/material/commit/87bdf36a))\n  * set css `position: fixed` to `md-backdrop` ([4011df9c](https://github.com/angular/material/commit/4011df9c))\n* **build:** reset to using Angular v1.3.15 until animation issues resolve ([17490baf](https://github.com/angular/material/commit/17490baf))\n* **button:**\n  * fixes button styles for components that override their default styles ([b1046bc0](https://github.com/angular/material/commit/b1046bc0))\n  * fixes button styles so that <a> and <button> examples look identical ([b1a144db](https://github.com/angular/material/commit/b1a144db))\n  * fab buttons will no longer distort when used with flexbox ([8de8f7ae](https://github.com/angular/material/commit/8de8f7ae), closes [#2797](https://github.com/angular/material/issues/2797))\n* **chips:**\n  * prevents unnecessary ellipsis in chips ([7fed14eb](https://github.com/angular/material/commit/7fed14eb), closes [#2688](https://github.com/angular/material/issues/2688))\n  * prevents styling issues caused by extremely long text ([e9b4de54](https://github.com/angular/material/commit/e9b4de54), closes [#3523](https://github.com/angular/material/issues/3523))\n  * makes sure that input is cleared when selecting a chip ([ee1fed19](https://github.com/angular/material/commit/ee1fed19), closes [#3575](https://github.com/angular/material/issues/3575))\n* **compiler:**\n  * use reference copy instead of deep copy for resolve and locals ([a9145013](https://github.com/angular/material/commit/a9145013), closes [#3651](https://github.com/angular/material/issues/3651), [#3561](https://github.com/angular/material/issues/3561))\n  * prevent `resolve` and `locals` overwrite ([bee05239](https://github.com/angular/material/commit/bee05239), closes [#2676](https://github.com/angular/material/issues/2676), [#2614](https://github.com/angular/material/issues/2614))\n* **css:**\n  * global page style improvements for min-height and text ([76cfd706](https://github.com/angular/material/commit/76cfd706))\n  * stop using @extend for rules in a different module. ([fb7b9b39](https://github.com/angular/material/commit/fb7b9b39), closes [#3400](https://github.com/angular/material/issues/3400))\n* **demo:** button  needs layout-wrap attribute ([0d6e5acb](https://github.com/angular/material/commit/0d6e5acb), closes [#3687](https://github.com/angular/material/issues/3687))\n* **dialog:**\n  * adds logic to account for image load delays that could impact content height ([3aab9e4e](https://github.com/angular/material/commit/3aab9e4e))\n  * set css `position: fixed` to `.md-dialog-container` ([01859080](https://github.com/angular/material/commit/01859080))\n  * autoclose fixed and close animation shrinks to originating element poisition. ([94341209](https://github.com/angular/material/commit/94341209), closes [#3555](https://github.com/angular/material/issues/3555), [#3541](https://github.com/angular/material/issues/3541), [#2479](https://github.com/angular/material/issues/2479))\n  * switch dialog to use disableScroll, fix focus trap ([862444a8](https://github.com/angular/material/commit/862444a8), closes [#2443](https://github.com/angular/material/issues/2443))\n* **disableScroll:**\n  * fix z-index getting set too large ([44fda3d7](https://github.com/angular/material/commit/44fda3d7), closes [#3501](https://github.com/angular/material/issues/3501))\n  * fix disable scroll breaking layout for fixed page layouts ([ddfe5230](https://github.com/angular/material/commit/ddfe5230))\n  * fix disable scroll creating scrollbar when none existed ([7fe482cf](https://github.com/angular/material/commit/7fe482cf))\n  * fix scroll mask z-index blocking backdrops ([b4eac137](https://github.com/angular/material/commit/b4eac137), closes [#3283](https://github.com/angular/material/issues/3283), [#3269](https://github.com/angular/material/issues/3269), [#3245](https://github.com/angular/material/issues/3245))\n* **docs:** style tables w/ css class instead of element. ([605cd94a](https://github.com/angular/material/commit/605cd94a))\n* **fabActions:** corrected use of postLink ([f91a3845](https://github.com/angular/material/commit/f91a3845))\n* **fabSpeedDial:**\n  * ng-hide, ng-repeat, animation bug ([5e3a651f](https://github.com/angular/material/commit/5e3a651f), closes [#3313](https://github.com/angular/material/issues/3313), [#3224](https://github.com/angular/material/issues/3224), [#3349](https://github.com/angular/material/issues/3349), [#3600](https://github.com/angular/material/issues/3600))\n  * fix many visual issues ([288285c4](https://github.com/angular/material/commit/288285c4), closes [#3213](https://github.com/angular/material/issues/3213), [#3338](https://github.com/angular/material/issues/3338), [#3277](https://github.com/angular/material/issues/3277), [#3236](https://github.com/angular/material/issues/3236), [#3375](https://github.com/angular/material/issues/3375), [#3468](https://github.com/angular/material/issues/3468))\n* **fabToolbar:** fail gracefully if no icon used in trigger ([5d2bcbf9](https://github.com/angular/material/commit/5d2bcbf9), closes [#3223](https://github.com/angular/material/issues/3223), [#3601](https://github.com/angular/material/issues/3601))\n* **highlightText:** changes to the template data will update the generated HTML ([eda47822](https://github.com/angular/material/commit/eda47822), closes [#3550](https://github.com/angular/material/issues/3550))\n* **icon:** when specified, the defaultFontSet class should be used. ([f5a9101a](https://github.com/angular/material/commit/f5a9101a))\n* **icons:** improve use of material-icons style ([dab30b34](https://github.com/angular/material/commit/dab30b34), closes [#3333](https://github.com/angular/material/issues/3333))\n* **input:** textarea with rows provided will no longer throw an error ([e38a2c82](https://github.com/angular/material/commit/e38a2c82))\n* **interimElement:**\n  * added variable declaration in findParent() ([af052358](https://github.com/angular/material/commit/af052358), closes [#3927](https://github.com/angular/material/issues/3927), [#3943](https://github.com/angular/material/issues/3943))\n  * improve hide/cancel promise timings ([7eefcfe6](https://github.com/angular/material/commit/7eefcfe6))\n* **layout:** explicitly adds webkit prefix for safari ([778af934](https://github.com/angular/material/commit/778af934))\n* **mdTooltip:** fix regression that broke tooltips on Firefox ([6fc9212c](https://github.com/angular/material/commit/6fc9212c), closes [#3047](https://github.com/angular/material/issues/3047), [#3250](https://github.com/angular/material/issues/3250), [#3430](https://github.com/angular/material/issues/3430), [#3467](https://github.com/angular/material/issues/3467))\n* **mdUtil:** fix double scrollbar ([7ed0af6b](https://github.com/angular/material/commit/7ed0af6b), closes [#3382](https://github.com/angular/material/issues/3382))\n* **menu:**\n  * ensure menu button is type=button ([d203d722](https://github.com/angular/material/commit/d203d722), closes [#3821](https://github.com/angular/material/issues/3821))\n  * fix memory leak on component destroy ([1a9a5300](https://github.com/angular/material/commit/1a9a5300), closes [#3775](https://github.com/angular/material/issues/3775))\n  * cleanup click listeners on close ([9b57c2ec](https://github.com/angular/material/commit/9b57c2ec))\n  * fix menu positioning when using display:none items ([8609318f](https://github.com/angular/material/commit/8609318f), closes [#3444](https://github.com/angular/material/issues/3444))\n  * fix scrolling menu always showing scrollbar ([86e9bf0d](https://github.com/angular/material/commit/86e9bf0d))\n  * make menu close with ui-sref and ng-href ([dc011491](https://github.com/angular/material/commit/dc011491), closes [#3397](https://github.com/angular/material/issues/3397))\n  * menu not closing with clicks that disable element ([c7c7180a](https://github.com/angular/material/commit/c7c7180a), closes [#3288](https://github.com/angular/material/issues/3288))\n  * fix potential scoping issues on mdMenu ([4a6cd566](https://github.com/angular/material/commit/4a6cd566))\n  * fix error on clicking on menu container element ([f94820e6](https://github.com/angular/material/commit/f94820e6), closes [#3252](https://github.com/angular/material/issues/3252), [#3369](https://github.com/angular/material/issues/3369))\n  * fix options with x-ng-click and data-ng-click not working ([17f38b0b](https://github.com/angular/material/commit/17f38b0b), closes [#3258](https://github.com/angular/material/issues/3258))\n  * prevents scrollbar from unnecessarily showing up on the body ([5c08d5c9](https://github.com/angular/material/commit/5c08d5c9), closes [#3266](https://github.com/angular/material/issues/3266))\n* **ripple:** fixes typo in ripple code ([c93ba5c9](https://github.com/angular/material/commit/c93ba5c9))\n* **select:**\n  * interimElement will resolve its promise even when transition end event is not fi ([d6a938e9](https://github.com/angular/material/commit/d6a938e9), closes [#3704](https://github.com/angular/material/issues/3704), [#3780](https://github.com/angular/material/issues/3780), [#3800](https://github.com/angular/material/issues/3800), [#3794](https://github.com/angular/material/issues/3794))\n  * restore ngModel functionality ([86a4ca99](https://github.com/angular/material/commit/86a4ca99), closes [#3767](https://github.com/angular/material/issues/3767))\n  * fix slight pixel miss-alignment on select open ([2b423587](https://github.com/angular/material/commit/2b423587), closes [#3594](https://github.com/angular/material/issues/3594))\n  * fix positioning when using option groups ([d8d3e4ca](https://github.com/angular/material/commit/d8d3e4ca))\n  * remove correct controller from formCtrl w/ name ([ed6b45c7](https://github.com/angular/material/commit/ed6b45c7), closes [#3062](https://github.com/angular/material/issues/3062), [#3671](https://github.com/angular/material/issues/3671))\n  * fix select value not filling parent ([14786283](https://github.com/angular/material/commit/14786283))\n  * fix duplicate keydown listeners after select shown ([3e3eb9ef](https://github.com/angular/material/commit/3e3eb9ef), closes [#2616](https://github.com/angular/material/issues/2616))\n  * fix cycle option focus after keyboard search ([cc8850b3](https://github.com/angular/material/commit/cc8850b3))\n  * fix select-menu width being incorrectly computed ([18d8ae03](https://github.com/angular/material/commit/18d8ae03))\n  * fix select-value label not filling select width ([ba60122e](https://github.com/angular/material/commit/ba60122e))\n  * fix empty attribute for selected not selecting options ([4f7af228](https://github.com/angular/material/commit/4f7af228), closes [#2114](https://github.com/angular/material/issues/2114))\n  * mdInputContainer not realizing select had value ([1a8acd02](https://github.com/angular/material/commit/1a8acd02))\n  * fix double label issue using placeholder in md-input-container ([cbbb4b98](https://github.com/angular/material/commit/cbbb4b98))\n  * fix menu positioning inside fixed elements ([044dbdc3](https://github.com/angular/material/commit/044dbdc3))\n  * fix md-select with no placeholder outside of md-input-container ([4be344bb](https://github.com/angular/material/commit/4be344bb), closes [#3483](https://github.com/angular/material/issues/3483))\n  * refresh optionNodes reference ([05119a71](https://github.com/angular/material/commit/05119a71), closes [#2109](https://github.com/angular/material/issues/2109))\n  * IE down arrow key error resolved ([c183e9b4](https://github.com/angular/material/commit/c183e9b4), closes [#2109](https://github.com/angular/material/issues/2109))\n  * make select popup inherit theming ([691dd2fa](https://github.com/angular/material/commit/691dd2fa), closes [#2483](https://github.com/angular/material/issues/2483))\n* **slider:**\n  * check for invalid discrete step value ([273fff4c](https://github.com/angular/material/commit/273fff4c), closes [#3590](https://github.com/angular/material/issues/3590))\n  * render issues with ticks that occur when parent elements are resized ([5b0c256a](https://github.com/angular/material/commit/5b0c256a), closes [#1996](https://github.com/angular/material/issues/1996), [#2764](https://github.com/angular/material/issues/2764))\n* **tabs:**\n  * fixes size logic for centered tabs ([5722449b](https://github.com/angular/material/commit/5722449b))\n  * removes scope disconnect logic from tab templates ([2976add7](https://github.com/angular/material/commit/2976add7), closes [#3692](https://github.com/angular/material/issues/3692))\n  * theme palettes will no longer be inherited from parent elements ([0667380d](https://github.com/angular/material/commit/0667380d), closes [#3150](https://github.com/angular/material/issues/3150))\n  * fixes errors thrown when user-defined click events triggered their own digest cy ([1b984ed6](https://github.com/angular/material/commit/1b984ed6))\n  * internal scope will now be the same as external scope ([c5c148df](https://github.com/angular/material/commit/c5c148df), closes [#3300](https://github.com/angular/material/issues/3300))\n  * prevents error when navigating away from tabs section while using Angular 1.4.x ([31bb1210](https://github.com/angular/material/commit/31bb1210))\n  * focused item will once again scroll into view properly on focus ([5616f48f](https://github.com/angular/material/commit/5616f48f))\n  * fixes `md-swipe-content` support ([0982c76a](https://github.com/angular/material/commit/0982c76a), closes [#3225](https://github.com/angular/material/issues/3225))\n  * `md-center-tabs` should work now ([aa1e47d3](https://github.com/angular/material/commit/aa1e47d3))\n  * limits the width of tabs to the width of `md-tab-canvas` ([46ffa9eb](https://github.com/angular/material/commit/46ffa9eb), closes [#3577](https://github.com/angular/material/issues/3577))\n  * reduces the number of watchers by using bind-once syntax for non-changing items ([6f63d708](https://github.com/angular/material/commit/6f63d708))\n  * properly sets initial styles for inkbar when using centered tabs ([8ccf67e5](https://github.com/angular/material/commit/8ccf67e5))\n  * fixes `md-stretch-tabs` with one-way binding ([cd3e8a1c](https://github.com/angular/material/commit/cd3e8a1c), closes [#3547](https://github.com/angular/material/issues/3547))\n  * fixes `md-center-tabs` support with recent changes ([4867e318](https://github.com/angular/material/commit/4867e318), closes [#3549](https://github.com/angular/material/issues/3549))\n  * prevents an error from being thrown if an empty attribute `md-selected` is added ([f5cd5a07](https://github.com/angular/material/commit/f5cd5a07), closes [#3537](https://github.com/angular/material/issues/3537))\n  * improves performance by reducing the number of digests caused by tabs ([556be5fb](https://github.com/angular/material/commit/556be5fb))\n  * prevents error on empty tab list ([3e7ff23c](https://github.com/angular/material/commit/3e7ff23c), closes [#3264](https://github.com/angular/material/issues/3264))\n* **tests:**\n  * phantomjs does not support Function.bind() ([523ff091](https://github.com/angular/material/commit/523ff091))\n  * update the mdToast hide test ([186e0638](https://github.com/angular/material/commit/186e0638), closes [#2728](https://github.com/angular/material/issues/2728), [#2729](https://github.com/angular/material/issues/2729))\n* **textarea:** Start at a height of one line ([52ca5e5a](https://github.com/angular/material/commit/52ca5e5a), closes [#2953](https://github.com/angular/material/issues/2953), [#2154](https://github.com/angular/material/issues/2154))\n* **theming:** make theme inheritance not depend on DOM order ([73b1df4b](https://github.com/angular/material/commit/73b1df4b))\n* **toast:**\n  * differentiate between hide action clicks and hide timeouts ([285ac72d](https://github.com/angular/material/commit/285ac72d), closes [#3745](https://github.com/angular/material/issues/3745))\n  * replace cancel with hide on hideDelay ([2b687133](https://github.com/angular/material/commit/2b687133), closes [#3558](https://github.com/angular/material/issues/3558))\n* **util:** fix timeouts in transitionEndPromise() ([602f4904](https://github.com/angular/material/commit/602f4904))\n* **utils:** update for Angular 1.4.1 compatibility ([7ca139af](https://github.com/angular/material/commit/7ca139af), closes [#3315](https://github.com/angular/material/issues/3315), [#3325](https://github.com/angular/material/issues/3325))\n\n\n<a name\"0.10.0\"></a>\n## 0.10.0 (2015-06-15)\n\n\n#### Features\n\n* **fabSpeedDial:** adds fabSpeedDial component ([e813dcdb](https://github.com/angular/material/commit/e813dcdb))\n* **fabToolbar:** adds fabToolbar component ([30a53c30](https://github.com/angular/material/commit/30a53c30))\n* **menu:** add a basic dropdown menu component ([3f6b4af4](https://github.com/angular/material/commit/3f6b4af4), closes [#3173](https://github.com/angular/material/issues/3173))\n* **select:** add mdOnClose expression eval event ([d7bfc86f](https://github.com/angular/material/commit/d7bfc86f), closes [#3217](https://github.com/angular/material/issues/3217))\n* **tabs:**\n  * replaces unnecessary watches with getter/setter syntax for improved performance ([c806e8be](https://github.com/angular/material/commit/c806e8be))\n  * adds support for `md-autoselect` ([8285e2d0](https://github.com/angular/material/commit/8285e2d0))\n\n\n#### Breaking Changes\n\n* The API has changed for `md-icon` - `iconSize` has been\nchanged to `viewBoxSize`\n\n ([f93e117a](https://github.com/angular/material/commit/f93e117a))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * prevents an error when passing null instead of an array ([afa213df](https://github.com/angular/material/commit/afa213df))\n  * waits for screen to reposition on focus before locking scrolling ([6bfc31ea](https://github.com/angular/material/commit/6bfc31ea), closes [#2973](https://github.com/angular/material/issues/2973))\n  * fixes typo in autocomplete mouseup method ([67817713](https://github.com/angular/material/commit/67817713))\n  * locks scrolling while autocomplete menu is visible ([deae957b](https://github.com/angular/material/commit/deae957b), closes [#2973](https://github.com/angular/material/issues/2973))\n  * fixes issue where setting a min-length of 0 was not working ([d3f65195](https://github.com/angular/material/commit/d3f65195))\n* **button:** fixes style inconsistencies between `md-buttons` using `a` and `button` under th ([cc07e63d](https://github.com/angular/material/commit/cc07e63d), closes [#2440](https://github.com/angular/material/issues/2440))\n* **checkbox:** adds ability to click links within checkbox ([999e0da2](https://github.com/angular/material/commit/999e0da2), closes [#852](https://github.com/angular/material/issues/852))\n* **icon:** Change iconSize param to viewBoxSize. ([f93e117a](https://github.com/angular/material/commit/f93e117a), closes [#1679](https://github.com/angular/material/issues/1679), [#3123](https://github.com/angular/material/issues/3123))\n* **icons:** support for ngDirectives using compile phase ([9521a1e0](https://github.com/angular/material/commit/9521a1e0))\n* **mdMenu:**\n  * improve aria accessability ([113ad446](https://github.com/angular/material/commit/113ad446))\n  * close on scope $destroy ([67be5ce9](https://github.com/angular/material/commit/67be5ce9), closes [#3189](https://github.com/angular/material/issues/3189))\n  * fix positioning breaking after scroll/resize ([94b03b03](https://github.com/angular/material/commit/94b03b03), closes [#3204](https://github.com/angular/material/issues/3204))\n  * re-enable keyboard controls ([25131532](https://github.com/angular/material/commit/25131532), closes [#3205](https://github.com/angular/material/issues/3205))\n  * fix rc2 complete break ([fb245fb8](https://github.com/angular/material/commit/fb245fb8), closes [#3197](https://github.com/angular/material/issues/3197))\n* **radioButton:** fixes potential theming bug due to CSS specificity ([e8ec2b5e](https://github.com/angular/material/commit/e8ec2b5e))\n* **select:**\n  * fixes screen jump in Firefox ([7b8efe21](https://github.com/angular/material/commit/7b8efe21))\n  * fix focus color not picking up theming ([781a4bcf](https://github.com/angular/material/commit/781a4bcf), closes [#3128](https://github.com/angular/material/issues/3128))\n* **tabs:**\n  * programmatically changing tabs will now adjust pagination to show the selected t ([6d45f104](https://github.com/angular/material/commit/6d45f104), closes [#3139](https://github.com/angular/material/issues/3139))\n  * calls on-select for the initially selected item ([cc1d9d2b](https://github.com/angular/material/commit/cc1d9d2b), closes [#3169](https://github.com/angular/material/issues/3169))\n  * fixes CSS to respect non-truthy values for `md-dynamic-height` ([60197180](https://github.com/angular/material/commit/60197180), closes [#3184](https://github.com/angular/material/issues/3184))\n  * fixes centered tabs for Safari ([25526864](https://github.com/angular/material/commit/25526864), closes [#3198](https://github.com/angular/material/issues/3198))\n  * nested tabs should now work properly when using md-tab-label and md-tab-body ([e3e52c2c](https://github.com/angular/material/commit/e3e52c2c), closes [#3206](https://github.com/angular/material/issues/3206))\n  * fixes infinite digests bug in Firefox ([781929d7](https://github.com/angular/material/commit/781929d7))\n  * fixes issue with tab pagination in Angular 1.4 ([4273f52b](https://github.com/angular/material/commit/4273f52b))\n* **theming:** fixes bugs with progress circular and select theming ([3ac50acc](https://github.com/angular/material/commit/3ac50acc))\n\n\n<a name=\"0.9.8\"></a>\n### 0.9.8  (2015-06-08)\n\n\n#### Bug Fixes\n\n* **tabs:**\n  * prevents tabs from shrinking when used with flexbox ([dd041927](https://github.com/angular/material/commit/dd0419277523a44f8d06e45dc3c31b2afb3c8101), closes [#3011](https://github.com/angular/material/issues/3011))\n  * prevents select/deselect events from firing on destroy ([1ba0686e](https://github.com/angular/material/commit/1ba0686e7b42fef6072d011bf2f61fc3576a2017))\n\n\n<a name=\"0.9.8-rc1\"></a>\n### 0.9.8-rc1  (2015-06-05)\n\n\n#### Features\n\n* **autocomplete:** custom template demo ([7d2deb7e](https://github.com/angular/material/commit/7d2deb7ec702dac7999ae6b0fdba966c497e46ca), closes [#2505](https://github.com/angular/material/issues/2505))\n* **docs:**\n  * Use $scope instead of scope ([9683d66b](https://github.com/angular/material/commit/9683d66b9be37db753b5bca56d4531b35c99422f), closes [#2788](https://github.com/angular/material/issues/2788))\n  * css customizations for buttons ([91c86c63](https://github.com/angular/material/commit/91c86c63e2aec579c9043fec1e548980eb8aa005))\n* **icons:** api changes for font-icons ([498048dc](https://github.com/angular/material/commit/498048dc9e340b98a001ea3223a25c42a556e747))\n* **tabs:**\n  * adds an opt-out option for disconnecting tab scopes ([4c1bf4b6](https://github.com/angular/material/commit/4c1bf4b6850d09ba27ffe744e7bdc50e435a6ccf))\n  * makes swipe gestures on the content area opt-in ([03d01e96](https://github.com/angular/material/commit/03d01e96623de397ef171c063b7a8a56656fe0de), closes [#2331](https://github.com/angular/material/issues/2331))\n* **theming:** reduce specificity of default-theme selectors ([8468c600](https://github.com/angular/material/commit/8468c6008c10f8d218af057ab31f519efffad8d5))\n\n\n#### Breaking Changes\n\n* Tabs will now require the `md-swipe-content` attribute in order to enable swipe gestures to change tabs in the content area.\n\n ([03d01e96](https://github.com/angular/material/commit/03d01e96623de397ef171c063b7a8a56656fe0de))\n\n\n#### Bug Fixes\n\n* add missing alt attribute to logo in docs ([19ad66d1](https://github.com/angular/material/commit/19ad66d1a5954296de68d3f85d78a3522ff488e5))\n* **autocomplete:**\n  * selecting an item will hide the menu in IE11 ([0c073d10](https://github.com/angular/material/commit/0c073d10a18409d1d1f900951e42ba35df79d81e), closes [#2188](https://github.com/angular/material/issues/2188), [#3008](https://github.com/angular/material/issues/3008))\n  * removes flicker of 'not found' message with async results ([08532b40](https://github.com/angular/material/commit/08532b40a336cd6fbd5e73356fa5142fbb305ca7))\n  * adds cleanup step when autocomplete is destroyed ([e3a82c92](https://github.com/angular/material/commit/e3a82c92af2679e92e3b7f23deeffedf064e1a3c), closes [#2624](https://github.com/angular/material/issues/2624))\n  * fixes positioning of progress bar ([85a75909](https://github.com/angular/material/commit/85a75909aad3cbac28defd3ec7a2ef45ea81ee0a), closes [#3115](https://github.com/angular/material/issues/3115))\n  * updates docs, removes `clear` button when using a floating label ([86b4afab](https://github.com/angular/material/commit/86b4afabf3fbe210635426af29ac73d2e03b70a1), closes [#2727](https://github.com/angular/material/issues/2727))\n  * selecting a value will now flag the form/input as `$dirty` ([217cae1f](https://github.com/angular/material/commit/217cae1f599c842687c1d2a19056df3820c06d96), closes [#2753](https://github.com/angular/material/issues/2753))\n* **list:** support empty list-item(s) ([e9ad5491](https://github.com/angular/material/commit/e9ad5491a3bfbfe5802b580ba7e570f03585db6e), closes [#2649](https://github.com/angular/material/issues/2649))\n* **slider:**\n  * fix for attributes being ignored ([07295879](https://github.com/angular/material/commit/072958796a64c2175de9e4cb0de10a8025f0dc7c))\n  * increment the value properly when step is a decimal number ([476d068c](https://github.com/angular/material/commit/476d068c6f6e204d2c0797be08346076154a9029), closes [#2015](https://github.com/angular/material/issues/2015))\n* **styles:** fixes theming specificy regarding border colors ([264f043e](https://github.com/angular/material/commit/264f043e4220d13f74fef013081c68dcd878c12d))\n* **tabs:** fixes continuous `$digest` bug in Firefox when using `md-stretch-tabs` ([5372710a](https://github.com/angular/material/commit/5372710a7a4764a908f08deeb06481ae71e539d3), closes [#3101](https://github.com/angular/material/issues/3101))\n* **tooltip:**\n  * moves tooltip to the $rootElement rather than body or md-content ([32b0facc](https://github.com/angular/material/commit/32b0facc0b971f12f777f8f7b7392db1e5c5e091))\n  * tooltip will attach to the body rather than $rootElement ([24ca2966](https://github.com/angular/material/commit/24ca2966cf08a56aad59f4f60b186664fcd7e7f3))\n\n\n<a name=\"0.9.7\"></a>\n### 0.9.7  (2015-06-01)\n\n\n#### Features\n\n* **autocomplete:** adds support for validation/ng-messages ([1f0a8450](https://github.com/angular/material/commit/1f0a845033df53244c54b47b42173fb37241586c), closes [#2808](https://github.com/angular/material/issues/2808), [#2664](https://github.com/angular/material/issues/2664))\n* **icons:** add support for font-icons with ligatures and Material-Icon demos ([a1074907](https://github.com/angular/material/commit/a10749074ee05b5f12685c546c52165bf7420eb9), closes [#3059](https://github.com/angular/material/issues/3059))\n\n\n#### Breaking Changes\n\n* **autocomplete:** `name` attribute has been changed to `input-name` to more clearly show its purpose\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * only 2 messages will be displayed at any given time for autocomplete ([6b4e95ce](https://github.com/angular/material/commit/6b4e95ce23dded8787329cc0f394fe9178d5bc06), closes [#2785](https://github.com/angular/material/issues/2785))\n  * prevents text from going under the `clear` button ([73e03a70](https://github.com/angular/material/commit/73e03a704124475cadb2eec5de09403c9a447186), closes [#2193](https://github.com/angular/material/issues/2193), [#2578](https://github.com/angular/material/issues/2578))\n  * prevents error on keydown when menu is hidden ([a7dcfb6d](https://github.com/angular/material/commit/a7dcfb6d9427d0645ed98f53f9575925177dcbe6), closes [#2774](https://github.com/angular/material/issues/2774))\n  * autocomplete will no longer show the dropdown on value changes when not focused ([c3ec08d8](https://github.com/angular/material/commit/c3ec08d8aa5ccfa95fec4f41a5be09369cd19f73), closes [#2756](https://github.com/angular/material/issues/2756))\n* **input:** update disabled underline styles ([8f2b2c68](https://github.com/angular/material/commit/8f2b2c6835feb151e362d9e135c795055f9a5ccd), closes [#2870](https://github.com/angular/material/issues/2870))\n* **progressLinear:** rewrites animation for progress linear ([1d478ebd](https://github.com/angular/material/commit/1d478ebd6e5c6ddb6453cc1a708064459075a75e), closes [#2762](https://github.com/angular/material/issues/2762))\n* **tabs:**\n  * adds ui-sref/ng-href support to tabs ([6c53d112](https://github.com/angular/material/commit/6c53d1127fc1cb7d2a86802e5831642a40ff1e41), closes [#2344](https://github.com/angular/material/issues/2344))\n  * updating dynamic tab labels will now be reflected ([8ac4fa1b](https://github.com/angular/material/commit/8ac4fa1b3f23f1f73125cc7e2425d349d7ad546e))\n  * select/deselect events will now fire when a tab is removed but the index does no ([5e47b52b](https://github.com/angular/material/commit/5e47b52bd6a8817b2624ca6797b8267a162f84af), closes [#2837](https://github.com/angular/material/issues/2837))\n  * initial state will now scroll to selected tab ([120c271b](https://github.com/angular/material/commit/120c271be0058ec96e676c34dd55baf53357ae6d), closes [#2838](https://github.com/angular/material/issues/2838))\n* **toolbar:** add h1 to toolbar tools headings ([c100ef10](https://github.com/angular/material/commit/c100ef10069f769f90d606792c68ca9042fe67a4))\n* **tooltip:**\n  * pointer-events 'none' used properly with activate events ([667e4c24](https://github.com/angular/material/commit/667e4c244ccd9a1dfef6894a64b6df0c5e2f6305))\n  * hide tooltip after mouseleave if focus is achieved through mousedown ([e73d290c](https://github.com/angular/material/commit/e73d290cc84f07612d0faf08aec014714f18011a))\n\n\n<a name=\"0.9.6\"></a>\n### 0.9.6  (2015-05-28)\n\n\n#### Bug Fixes\n\n* **build:** fixes bug where versions in 0.9.5 comments were wrong. ([7a1ad41f](https://github.com/angular/material/commit/7a1ad41f3c1df6cb1dfa750cb817f166f02097ee))\n* **closure:** fixes issue in core.js where multiple `goog.provide` lines were included\n\n\n<a name=\"0.9.5\"></a>\n### 0.9.5  (2015-05-28)\n\n\n#### Features\n\n* **accessibility:** additional Windows high-contrast styles ([37bc5b6f](https://github.com/angular/material/commit/37bc5b6f54bde618df8cfd9f85c0f860c811e451))\n* **button:** md-icon-button to use round ripple ([ab1e9e05](https://github.com/angular/material/commit/ab1e9e05908114fe5fb587f9b59aab4db749f9b3))\n* **listItem:** allow use of own md-buttons ([0ef4b79f](https://github.com/angular/material/commit/0ef4b79f53da91edc9f5591ceeb1950e73c50d3d))\n\n\n#### Breaking Changes\n\n* Removed attach(button|tab|checkbox|list)Behavior\n    in favor of composing an injectable ripple service specific to\n    your target.  $mdInkRipple was too aware of how to configure\n    components.  You now have access to $mdButtonInkRipple,\n    $mdTabInkRipple, $mdListInkRipple, $mdCheckboxInkRipple.\n\n  Change your code from this:\n    ``` javascript\n        function MyService($mdInkRipple) {\n          //... Included for brevity\n          $mdInkRipple.attachButtonBehavior(scope, element, options);\n        }\n    ```\n\n  To this:\n    ``` javascript\n        function MyService($mdButtonInkRipple) {\n          //... Included for brevity\n          $mdButtonInkRipple.attach(scope, element, options);\n        }\n    ```\n* **icons:** Default size for `md-icon` has been changed from `28px` to `24px`\n* **tabs:** Replaces pagination transition with `transform` rather than `left` for performance\n\n ([3b0f12e3](https://github.com/angular/material/commit/3b0f12e3b8e7c5b7ab78ea0b8672d1b1b54ef4b8))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * uses $attr to support `data-` prefixed attributes ([1dc56a6c](https://github.com/angular/material/commit/1dc56a6cfae0ace6c20848f65c3d6262bb9973bb), closes [#2798](https://github.com/angular/material/issues/2798))\n  * resolves xss bug with autocomplete text highlighter ([1538ebe9](https://github.com/angular/material/commit/1538ebe9c2d8b9aec84d1f556a9b4cfe5a38dc04), closes [#2901](https://github.com/angular/material/issues/2901))\n  * pulls in text content as HTML to prevent it from being un-escaped ([33ac259d](https://github.com/angular/material/commit/33ac259d66c90e96489d0512ac762f969458f5bd))\n* **build:**\n  * build will now update CHANGELOG in master ([859ceb18](https://github.com/angular/material/commit/859ceb1866094a85625de532ff578779712ff7d5))\n  * fixes issue where release tag doesn't match release branch ([5f7b1e91](https://github.com/angular/material/commit/5f7b1e91d1575d89de8c228099b5213c7347cb48))\n* **button:** makes icon-buttons round for ripple and focus state ([98025aaf](https://github.com/angular/material/commit/98025aaf19796ca7c6c59ec37f37233a42787cc3))\n* **chips:** removes box-shadow from inline autocomplete ([bc407590](https://github.com/angular/material/commit/bc4075909baaa828b12d1327b7a57896e505c35a))\n* **demo:** use relative path to img src ([175fd54d](https://github.com/angular/material/commit/175fd54d16921e2263ac1f696be30ce58ea67a5d), closes [#2916](https://github.com/angular/material/issues/2916))\n* **docs:**\n  * use source path for github url ([0a1ed581](https://github.com/angular/material/commit/0a1ed5813e07ea9807ee88f9047c6970593dc399), closes [#2900](https://github.com/angular/material/issues/2900))\n  * use source rather than combined js ([fd8fcf22](https://github.com/angular/material/commit/fd8fcf22fa85ae8c9af59d59e9dc73be93d21c2b))\n* **list:** correctly proxy ng-disabled attrs ([a25bc0ea](https://github.com/angular/material/commit/a25bc0ea42cbaedd569d385d0c722702ae0bf60d))\n* **listItem:** fix ng-enter having animation ([41953d5a](https://github.com/angular/material/commit/41953d5a0ad3492082b3fd99a82e212c59e75750))\n* **md-icon:** change icon size back to 24px ([3b305a3d](https://github.com/angular/material/commit/3b305a3d5bb46e366c9b7bfb7a069ff040392529), closes [#2992](https://github.com/angular/material/issues/2992))\n* **minify:** tabsDirective template function works when minified ([c7ea4a78](https://github.com/angular/material/commit/c7ea4a7865dd1b6b128c88bfa57ea92b9a617afa))\n* **select:**\n  * respect id attributes if assigned ([fc90fd31](https://github.com/angular/material/commit/fc90fd3173569f60acf53a2318fe453b42dd221a))\n  * label not updating after objects resolved via promise ([74259976](https://github.com/angular/material/commit/742599769700e3a016db4454aa339bb3e35bf53f))\n* **subheader:** theme is applied to sticky clone ([e92686f0](https://github.com/angular/material/commit/e92686f0b400214ea0fd5209bff4923555a16bd4), closes [#2779](https://github.com/angular/material/issues/2779))\n* **tabs:**\n  * re-adds disconnected scopes for tab content ([e6f19d48](https://github.com/angular/material/commit/e6f19d4868059cd48e3dfd811273cff36c3ef9a4))\n  * uses `ng-if` to remove inactive tabs once their animation is complete ([8dcaea8a](https://github.com/angular/material/commit/8dcaea8af19a6dcc2d9cafdd2ebb4277e66e89ae))\n  * replaces pagination transition with `transform` rather than `left` for performan ([a8ff2ad1](https://github.com/angular/material/commit/a8ff2ad1779bdeabb2d960f69ebde23470353989))\n  * fix missing dependency ([0b35c9b4](https://github.com/angular/material/commit/0b35c9b4c068fe13071a0a85da08125e316093e4), closes [#2460](https://github.com/angular/material/issues/2460))\n* **theming:** remove bogus hue value from grey palette ([0c28cee2](https://github.com/angular/material/commit/0c28cee2aad29b47a7f6b93ca5c27bca0d833dc1))\n* **tooltip:** use label instead of aria-describedby ([198199c1](https://github.com/angular/material/commit/198199c1eae39dbc7d139db42c5d4d3919aaeab2))\n\n\n<a name=\"0.9.4\"></a>\n### 0.9.4  (2015-05-15)\n\nThis interim release **fixes** an incorrect deployment of `angular-material.js`; which added the Closure Library **Namespace** features using `goog.provide()`. Only source in `/modules/closure/**.js` should use this namespacing.\n#### Features\n\n* **build:** add script to snapshot docs site ([76e36722](https://github.com/angular/material/commit/76e36722e07846b518612e9073785a279b3027cd), closes [#2852](https://github.com/angular/material/issues/2852))\n\n\n#### Bug Fixes\n\n* **build:** fixes issue where JS files were being generated with Closure code ([ca940384](https://github.com/angular/material/commit/ca94038439982e81077020962042ec9f453dbf0e)), closes [#2852](https://github.com/angular/material/issues/2852))\n\n\n<a name=\"0.9.3\"></a>\n### 0.9.3  (2015-05-14)\n\nThis release is also using enhanced scripting to automate the build and release processes. Releases will now also deploy versioned docs to http://github.com/angular/code.material.angularjs.org.\n\n#### Bug Fixes\n\n* update rems to pixels ([08b89921](https://github.com/angular/material/commit/08b899210a963c87b1b70ccb88e2ee3191bc0647))\n* **autocomplete:** prevents `not found` message from displaying while results are loading ([3d5bd948](https://github.com/angular/material/commit/3d5bd94825688a6814266e7e1401b56e513f84c9))\n* **build:** enable build of component modules. ([8a886d79](https://github.com/angular/material/commit/8a886d7951e679174c7742d41a9a67c9f4462955))\n* **codepen:**\n  * escape ampersand in &nbsp; ([0a5603f8](https://github.com/angular/material/commit/0a5603f8bc31c76012bf25e3657cb6f908f3bae1), closes [#2827](https://github.com/angular/material/issues/2827))\n  * use https to avoid mixed content ([fbae0fcb](https://github.com/angular/material/commit/fbae0fcb697ecb959c3dc2922efe0fd8bb4a4124))\n* **dialog:**\n  * remove dialog wrapper from tab order ([dcb12a7c](https://github.com/angular/material/commit/dcb12a7c5ea8177de6f473bfe7bbf5c6d939bb75), closes [#2712](https://github.com/angular/material/issues/2712))\n  * styling custom dialog wrapped in form ([666630ca](https://github.com/angular/material/commit/666630cab10fff2bb66bd0e6aeec552b27352db5), closes [#2637](https://github.com/angular/material/issues/2637))\n  * style cleanup, button sizing ([9110d1e1](https://github.com/angular/material/commit/9110d1e1ace0b3d420d4ed329e61bde104ddea0d), closes [#2671](https://github.com/angular/material/issues/2671))\n* **gesture:** fix conflicts with Ionic ([05788d24](https://github.com/angular/material/commit/05788d242412f7b7d3babfab3931c0ee5a03aca2), closes [#1528](https://github.com/angular/material/issues/1528), [#1528](https://github.com/angular/material/issues/1528))\n* **list:**\n  * align icons to top ([a2b88bea](https://github.com/angular/material/commit/a2b88beae24127251c5844747b69f48ebeb120fa), closes [#2589](https://github.com/angular/material/issues/2589))\n  * support aria-label for primary action ([e9324a9e](https://github.com/angular/material/commit/e9324a9ebf3ecabf0397a83a5275608600fa8115), closes [#2773](https://github.com/angular/material/issues/2773))\n* **tabs:**\n  * corrects css bug with tab-data positioning ([a8fd0f4d](https://github.com/angular/material/commit/a8fd0f4dc14154b1b41137773e157b7574661cb8))\n  * reordering tabs should now work ([5bc3f232](https://github.com/angular/material/commit/5bc3f232f1850d80ec3dbf9bb7fbcf93b173f8fc))\n* **tests:** performance improvements and fixes to jasmine testing ([786b0ed3](https://github.com/angular/material/commit/786b0ed3652b7460c2c802efa1aa79972bd96f5d), closes [#2800](https://github.com/angular/material/issues/2800))\n* **toolbar:** align last icon button to spec ([f988255d](https://github.com/angular/material/commit/f988255d1a95e998e7e62b1e7b4d7c7687016ccb), closes [#2497](https://github.com/angular/material/issues/2497))\n* **tooltip:** update to spec, remove max-width ([8c60d9c7](https://github.com/angular/material/commit/8c60d9c7a63ab8598e7367bf7ef2b31afe1bdae6), closes [#656](https://github.com/angular/material/issues/656))\n\n\n#### Features\n\n* **docs:** edit code example in codepen ([5c37dc8c](https://github.com/angular/material/commit/5c37dc8c54ddd0e6ca3bd138665c4997c8189b52), closes [#2604](https://github.com/angular/material/issues/2604))\n\n\n\n<br/>\n<br>\n\n<a name=\"0.9.0\"></a>\n## 0.9.0  (2015-05-04)\n\n\n#### Features\n\n* **autocomplete:** adds support for messages to be displayed when no results are found ([e057e271](https://github.com/angular/material/commit/e057e27171f15b1923d740a27447e7fafa66673a), closes [#2574](https://github.com/angular/material/issues/2574), [#1525](https://github.com/angular/material/issues/1525))\n\n#### Breaking Changes\n\n* **styles:** removes global `line-height` and `font-size` from `html` and `body` ([666e3311](https://github.com/angular/material/commit/666e3311a8b66fb0910dc745192aaca23587bd29))\n* **icons:** namespaces built-in icons ([539ec5e3](https://github.com/angular/material/commit/539ec5e36281aa8a6f645376bcd4512911165fb9))\n* **gridlist:** `md-grid-tiles` must be direct children of `md-grid-list` ([5d9142ea](https://github.com/angular/material/commit/5d9142ea8d77e60350e8a7ddd02be6642218c0fa))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * improves logic behind scrolling items into view on keyboard navigation ([211a31ea](https://github.com/angular/material/commit/211a31ea363a721240d23b9f591e7652ab5f313e), closes [#2615](https://github.com/angular/material/issues/2615))\n  * addresses issue where dropdown shows if there is an initial value ([85846922](https://github.com/angular/material/commit/85846922934226d2d62646df06d96f644e332378), closes [#2517](https://github.com/angular/material/issues/2517))\n  * fixes positioning issue with clear button ([1fcb79a6](https://github.com/angular/material/commit/1fcb79a6e56e2c8d337c2875eca3740a8aafb235), closes [#2593](https://github.com/angular/material/issues/2593))\n* **button:** disable warn and accent buttons ([973c4d75](https://github.com/angular/material/commit/973c4d75847479d670dff620e1cc3104435bbcfc), closes [#2586](https://github.com/angular/material/issues/2586))\n* **compiler:** make bindToController vars available to instantiation fn ([e414091a](https://github.com/angular/material/commit/e414091ac0272652217010ca64ad96389f657e46))\n* **dialog:** makes sure that body is not more than 100% height when dialog is showing ([6806f554](https://github.com/angular/material/commit/6806f5546bd51929793b77d86675725670fa7bea))\n* **gridlist:**  noops layoutDelegate ([2b6dd4dc](https://github.com/angular/material/commit/2b6dd4dced54e62721a1339143cf7b8996ba9e88), closes [#2613](https://github.com/angular/material/issues/2613))\n* **icons:** namespaces built-in icons ([539ec5e3](https://github.com/angular/material/commit/539ec5e36281aa8a6f645376bcd4512911165fb9))\n* **input:**\n  * minimize overlapping on iOS ([ea817874](https://github.com/angular/material/commit/ea817874b0b46fbae883e5191b234d1d4e38179c))\n  * remove overflow-x causing drop on iOS ([f1df6dc0](https://github.com/angular/material/commit/f1df6dc09c20635d42ffaada32ae2f036666a5ba), closes [#2539](https://github.com/angular/material/issues/2539))\n* **list:** Do not ignore spaces in descendant textareas. ([f737fb04](https://github.com/angular/material/commit/f737fb04d4e93033365bb2a178c5ecbafaab42f0))\n* **select:**\n  * fix theming ([7e0a2aaa](https://github.com/angular/material/commit/7e0a2aaaf79e87da6b7536fcf4bf66f4213227e9))\n  * update rendering on option changes ([4e855c7f](https://github.com/angular/material/commit/4e855c7fb6dda3a24811597fdb10d2f62048920e))\n  * expose and preserve aria-label ([bd3d8fba](https://github.com/angular/material/commit/bd3d8fba5045bd4cfda5a46463ea15ecd23a30fc), closes [#1893](https://github.com/angular/material/issues/1893))\n  * rendering in input group ([aa9058fe](https://github.com/angular/material/commit/aa9058fe737f69d3d36fbffaebd7fb1774e9ee39))\n* **slider:** adds box-sizing to fix slider ripple positioning ([e982547b](https://github.com/angular/material/commit/e982547b0e8a0502c0180099e5a7b3f4c3431ffb))\n* **styles:** fixes rem syntax for negative values ([2fef6cad](https://github.com/angular/material/commit/2fef6cada79dc6a3b42f1ab14f8a143f7044ae48))\n* **tabs:**\n  * fixes `md-center-tabs` css bug ([44e6984a](https://github.com/angular/material/commit/44e6984ad36544326cccbbf34aeeb08337b41e2c), closes [#2638](https://github.com/angular/material/issues/2638))\n  * cleans up scope tree for tabs ([294e0664](https://github.com/angular/material/commit/294e06645c3a7b9323a95db10879844c0bbc9150), closes [#2600](https://github.com/angular/material/issues/2600))\n* **toolbar:**\n  * prevents transition lag on ng-if/ng-hide/ng-show ([544cb270](https://github.com/angular/material/commit/544cb270c65f86b44d9f882460ca784d43546b30), closes [#2663](https://github.com/angular/material/issues/2663))\n  * adds shadow when content moves under 'scroll shrink' toolbar ([92ed4657](https://github.com/angular/material/commit/92ed46578001eeb54c009bfc9f302be783f79137))\n  * sets icon color to primary contrast color within toolbars ([8ea0dc1d](https://github.com/angular/material/commit/8ea0dc1da8f75d8fdb1262e955156e8a62119a90), closes [#2622](https://github.com/angular/material/issues/2622))\n\n\n<a name=\"0.9.0-rc3\"></a>\n### 0.9.0-rc3  (2015-04-28)\n\n\n#### Features\n\n* **autocomplete:** allows tab or enter to select an item ([59015b09](https://github.com/angular/material/commit/59015b0991f06993b3eb70457716be97c7b6369d))\n* **button:** support angular-new-router ng-link ([4b9dcab5](https://github.com/angular/material/commit/4b9dcab5baf1e6794b8382ad997dc9047c58f3bd), closes [#2478](https://github.com/angular/material/issues/2478))\n* **tooltip:** Support hide-* show-* and user defined css using \"display: none;\" ([08132848](https://github.com/angular/material/commit/08132848b9702481a6dc46b0490ffa91646acdd2), closes [#2386](https://github.com/angular/material/issues/2386))\n\n\n#### Breaking Changes\n\n* content containers for `md-dialog` now require `md-dialog-content` to be more flexible with child content containers. This is more consistent with `md-card`, which uses `md-card-content`. ([9dc62403](https://github.com/angular/material/commit/9dc624033aac3714e97a8356b34508ffdcf02cf6))\n* md-input-containers no longer allow both label and placeholder to be used simultaneously. Now the placeholder value (if present) is transcluded as a label or ignored. When the placeholder value is ignored, a warning will be logged. ([d931c0d2](https://github.com/angular/material/commit/d931c0d237777c0197464277a5d8096bc3cbd698))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * adds support for the new `$animate.pin()` in `ng-animate@1.4.0-rc.1` ([790ccca6](https://github.com/angular/material/commit/790ccca695233e80f2720e3d4b2b67d2736b39fd))\n  * adds watcher for ngDisabled rather than 2-way binding ([973a2fca](https://github.com/angular/material/commit/973a2fcadfc0fb786635cabf7c6674e5027117c4), closes [#2160](https://github.com/angular/material/issues/2160))\n  * allow undefined `searchText` and `selectedItem` ([8fb60c34](https://github.com/angular/material/commit/8fb60c343a720a240ba8661f606ffe4479d05195), closes [#2515](https://github.com/angular/material/issues/2515))\n  * fixes issue where autocomplete suggestions were not hiding ([da0a4f06](https://github.com/angular/material/commit/da0a4f06c54248c6d73eba7767cdf06bc0225f57))\n  * fixes bug that prevented autocomplete results from displaying on focus if min-le ([5e72bb3d](https://github.com/angular/material/commit/5e72bb3db0b965fce0065cb12d56bcc6b122d8c5))\n* **bottomsheet:** fix button styles ([7bd97acc](https://github.com/angular/material/commit/7bd97acc60a895eea75978a95f0c43e8d6d3ebd2))\n* **build:**\n  * adds missing quotes for closure build ([041ffe94](https://github.com/angular/material/commit/041ffe943651de276c0558370e59f4a8ffde4863))\n  * adds method that was missing from previous update ([77420942](https://github.com/angular/material/commit/774209429e1232fd975610123beef7e9f6dc5fd9))\n* **button:**\n  * icon inherits colors ([92aff331](https://github.com/angular/material/commit/92aff331bd9397cc5469a70ca502dfc239239652), closes [#2434](https://github.com/angular/material/issues/2434), [#2551](https://github.com/angular/material/issues/2551), [#2586](https://github.com/angular/material/issues/2586))\n  * make buttons less opinionated ([482a916a](https://github.com/angular/material/commit/482a916ae72f01b6ed1383d36bcec120c02b256a), closes [#2580](https://github.com/angular/material/issues/2580), [#2438](https://github.com/angular/material/issues/2438))\n  * fixes typo in button scss file ([b742dfda](https://github.com/angular/material/commit/b742dfda81500852dcffbc3a19a9ec40d5f314b4), closes [#2432](https://github.com/angular/material/issues/2432))\n* **card:** md-action-bar renamed to .md-actions ([5610dc98](https://github.com/angular/material/commit/5610dc98798c4148ca284e3f61208cb494da75dc), closes [#2472](https://github.com/angular/material/issues/2472))\n* **chips:**\n  * fix $apply already in progress ([daf680f0](https://github.com/angular/material/commit/daf680f0bc3a6e6460e5ae6894893970e684c3dc), closes [#2458](https://github.com/angular/material/issues/2458))\n  * removes flicker when switching selected chip ([55fa76a0](https://github.com/angular/material/commit/55fa76a0a98e53ec91addaba5fdcba77cea17ef4))\n* **demo:** fix list demo secondary action. ([7e5d5e34](https://github.com/angular/material/commit/7e5d5e342fddc3d9f0ec1d5e1217b6eb8e6a6ec4), closes [#2471](https://github.com/angular/material/issues/2471))\n* **dialog:**\n  * use .md-primary color for actions ([4a648d55](https://github.com/angular/material/commit/4a648d55578a2d54e64bfc0b3f1dec5fa73bef57), closes [#2448](https://github.com/angular/material/issues/2448))\n  * Rename md-content to md-dialog-content ([9dc62403](https://github.com/angular/material/commit/9dc624033aac3714e97a8356b34508ffdcf02cf6), closes [#2514](https://github.com/angular/material/issues/2514))\n* **docs:** fix doc app toolbar breadcrumb when using back button ([58f2c481](https://github.com/angular/material/commit/58f2c481175a0bd27a6ea8754f4ba79fda8445ec), closes [#2464](https://github.com/angular/material/issues/2464))\n* **gridlist:** Tile ordering improved ([5d9142ea](https://github.com/angular/material/commit/5d9142ea8d77e60350e8a7ddd02be6642218c0fa), closes [#2553](https://github.com/angular/material/issues/2553), [#NaN](https://github.com/angular/material/issues/NaN))\n* **highlight:** adds missing characters to sanitize method ([ef0dce07](https://github.com/angular/material/commit/ef0dce076716669d1d9a6ca50a6d341fad774632), closes [#2292](https://github.com/angular/material/issues/2292))\n* **icon:** rem sizes, line-height for font icons ([860d1f67](https://github.com/angular/material/commit/860d1f67db2be427aff149cbd0c13f0f3d39e4ca), closes [#2597](https://github.com/angular/material/issues/2597))\n* **input:** improve layout when md-input-container has nested md-icon. ([2dbe6a97](https://github.com/angular/material/commit/2dbe6a973b546cc9cdf79ca5e8262188a2570bfc), closes [#2452](https://github.com/angular/material/issues/2452))\n* **interimElement:** fix default parent grabbing svg body ([952d5f50](https://github.com/angular/material/commit/952d5f508a618fccd002ac28b211bc02e8f76c8d))\n* **list:**\n  * prevents error when there are no child elements ([f66e4718](https://github.com/angular/material/commit/f66e4718451b90cd27f393a2bbc46e3e6891a61e))\n  * fixes line-height issues with list items and checkboxes/icons/switches ([4b045b58](https://github.com/angular/material/commit/4b045b5860cc5bebe6e7e17ca4c723a71a6abbfa))\n  * fixes checkbox styles for list items ([6a0b7015](https://github.com/angular/material/commit/6a0b70159fc6fc6eebbb08defc6ee57d62124cd3))\n* **mdUtil:**\n  * move comment nodes as well when reenabling scroll ([6a5a6a77](https://github.com/angular/material/commit/6a5a6a77a3c8eaa88a9ca234ab5f10e5e8b82da4), closes [#2592](https://github.com/angular/material/issues/2592))\n  * move comment nodes as well when disabling scroll ([160df4cf](https://github.com/angular/material/commit/160df4cf436ff22b487e4691dfb3b8034cc0da19), closes [#2456](https://github.com/angular/material/issues/2456))\n* **select:**\n  * add support for non-scrolling md-content ([88612d65](https://github.com/angular/material/commit/88612d6503ad3921a186ae3de4bb8422f6e76bce))\n  * fix window resize listeners breaking after select shown ([7c74050f](https://github.com/angular/material/commit/7c74050fd83311880de5d11eae9ac199f56f54b2))\n  * fix error when removing node on route change ([9d761878](https://github.com/angular/material/commit/9d7618781929f9983cb1550fe015b75182abbe26))\n* **tabs:**\n  * select/deselect methods will now be called in the proper scope ([02a4af56](https://github.com/angular/material/commit/02a4af565862d3da5caebbc059f388c942f11e1f), closes [#2489](https://github.com/angular/material/issues/2489))\n  * removes top border radius when tabs immediately follows md-toolbar ([6372111c](https://github.com/angular/material/commit/6372111c8048d0f13dc6d47609e777b8c26940ee), closes [#2394](https://github.com/angular/material/issues/2394))\n  * fixes styles for Firefox ([6996edd3](https://github.com/angular/material/commit/6996edd39378f366416c59dc8e781fecddad19b5), closes [#2543](https://github.com/angular/material/issues/2543))\n* **tests:** support for Angular 1.4 and improved use of angular-mocks. ([48ee9867](https://github.com/angular/material/commit/48ee9867cd44f7a387e78d4a323f5a9e44382550))\n\n\n<a name=\"0.9.0-rc2\"></a>\n### 0.9.0-rc2  (2015-04-20)\n\nThis RC2 release contains more polish and bug fixes to stabilize performance, layout, and improve the UX for Chips, List, Select, and Tabs.\n\n#### Features\n\n* **chips:**\n  * allows user to require a matched item - used with autocomplete ([736cbdb0](https://github.com/angular/material/commit/736cbdb096d4e064e1176e92eabddfe63288090c))\n  * adds keyboard shortcuts to chips component ([c62d4dfd](https://github.com/angular/material/commit/c62d4dfd0f8741d90a2c69873154f55c91c3e7e7))\n* **list:**\n  * extend typography styles ([70fc6290](https://github.com/angular/material/commit/70fc62907442cb5e1349dcc9f3c3bafc601245c6), closes [#2366](https://github.com/angular/material/issues/2366))\n  * add ripple to secondary to md-list actions ([927d8e56](https://github.com/angular/material/commit/927d8e5612c60afb7c18e4c697dc0e343f28e963))\n* **mdUtil:** add md-overflow-wrapper-shown class to DOM ([5a028092](https://github.com/angular/material/commit/5a028092c1236dc50ef428c4f3292b4641b831bd))\n\n\n#### Breaking Changes\n\n* List\n  * `md-item` has been renamed to `md-list-item`\n  * `md-item-content` element is now a `.md-list-item-text` class\n  * List styles of `.md-tile-left` changed to `.md-avatar` for avatar-like images\n  * `md-list-item` uses `.md-no-proxy` and `.md-no-style`\n* Tabs\n  * When using `md-tab-label`, the content of your tab **must** be wrapped in `md-tab-body`\n* Typography changes have significantly impacted the `<h1>`...`<h4>` types.\n\n ([f1db7534](https://github.com/angular/material/commit/f1db7534ae73de3820f0f84b6b2b40f4011770e0))\n\n#### Bug Fixes\n\n* **autocomplete:** fixes positioning logic to fire at the correct time ([8946322b](https://github.com/angular/material/commit/8946322b956ae6795e6ea0a700423469982bcdd5), closes [#2298](https://github.com/angular/material/issues/2298))\n* **button:**\n  * limit flat/raised button height ([9fc2c28b](https://github.com/angular/material/commit/9fc2c28b9084e6f5651a41540216045e176c93ef), closes [#2380](https://github.com/angular/material/issues/2380))\n  * address flat hover state ([1e7b9823](https://github.com/angular/material/commit/1e7b98235c004ae384946d71a8aa9ac71e434883), closes [#2382](https://github.com/angular/material/issues/2382))\n* **card:** action bar spacing, remove order attrs ([50ce4e8b](https://github.com/angular/material/commit/50ce4e8b053b3387a81d1a4d533af06be9ef1e5c), closes [#2403](https://github.com/angular/material/issues/2403))\n* **checkbox:** style checkbox without visual label ([ab264807](https://github.com/angular/material/commit/ab26480780677fae4dd9b5a6238fa531b50bed6e), closes [#2175](https://github.com/angular/material/issues/2175))\n* **chips:**\n  * adds better focus handling for chips ([def6d3a4](https://github.com/angular/material/commit/def6d3a41441481f7a85503a5eb666332e055e27))\n  * fixes issue where arrow keys switch active chip while editing input field ([1f261440](https://github.com/angular/material/commit/1f2614404a8d6cce45437f027662066f11ae35ef))\n  * fixes issue with deletion logic ([6d4ecbee](https://github.com/angular/material/commit/6d4ecbee951ad87a73277517bc15c3c64264c149))\n  * fixes shift+tab interaction with `md-chips` ([314aae1c](https://github.com/angular/material/commit/314aae1c345635f3ec1f67c842a38e19ee49b01e))\n  * adds aria-hidden to remove buttons ([79b07399](https://github.com/angular/material/commit/79b073992a2e59f449d93321d74912d7cbe2eed6), closes [#2345](https://github.com/angular/material/issues/2345))\n  * adds slightly better support for input types other than `text` ([d885d638](https://github.com/angular/material/commit/d885d638ac8f8d1c0660d30e6dfdca0fe780d0e8))\n  * prevents item deletion when text is selected ([b65236b7](https://github.com/angular/material/commit/b65236b70ae3d6eb86d3d78631144fe65848d4ca), closes [#2322](https://github.com/angular/material/issues/2322))\n* **dialog:** action spacing matches spec ([d7b23763](https://github.com/angular/material/commit/d7b23763c7f17581b15c4b049faa8b306b9aed2a), closes [#2389](https://github.com/angular/material/issues/2389))\n* **input:** expect input container to use placeholder for label fallback ([8410c0d6](https://github.com/angular/material/commit/8410c0d6c46def09674a09a052e8503d85577085), closes [#2397](https://github.com/angular/material/issues/2397))\n* **inputContainer:** style ng-messages as both element and attr ([a5d09af5](https://github.com/angular/material/commit/a5d09af5493531f48a6c3a59036579cfa974c048))\n* **interimElement:** add fallback to document.body if root node removed ([3b3d0205](https://github.com/angular/material/commit/3b3d020581593eba3eea7632d68acdeb15dc56ad))\n* **list:**\n  * check child element length before detecting proxies ([c964609e](https://github.com/angular/material/commit/c964609e1f8842418d8494fe6bb8f276885aafa6))\n  * add ripple, inherit from .md-button ([25cc5e8a](https://github.com/angular/material/commit/25cc5e8a9657f1d0731e6f11b4e44ad621bb3486), closes [#2395](https://github.com/angular/material/issues/2395))\n  * fix key hijacking ([e1ca13fd](https://github.com/angular/material/commit/e1ca13fdea90867e3ecb841caf20860accfd764c))\n* **mdList:** remove focus state on blur ([588e58cf](https://github.com/angular/material/commit/588e58cf6de9be13f77c820a1582f2d1a2c36cb0), closes [#2339](https://github.com/angular/material/issues/2339))\n* **select:**\n  * fix scrollbars not respecting parent overflow hidden ([b9ee6121](https://github.com/angular/material/commit/b9ee6121412d59895b43286f4eefd4418e9081aa))\n  * fix select backdrop closing when parent is destroyed ([2d66368c](https://github.com/angular/material/commit/2d66368cc31daf476bf786083a256d47a0e338ce))\n  * fix infinite loop condition ([6e3b43cc](https://github.com/angular/material/commit/6e3b43cc91df2fa84a8c3983763e432b906a5740))\n  * fix 1px error to match md-input-container style ([bd566a52](https://github.com/angular/material/commit/bd566a5217fedfb0731098795c6f45563c68716c))\n  * add tabindex, aria-disabled support ([40924003](https://github.com/angular/material/commit/409240037aee989926179e4e5d3137dd9704b008), closes [#2308](https://github.com/angular/material/issues/2308))\n  * fix restore focus on select close ([f55eeba0](https://github.com/angular/material/commit/f55eeba04150d0aecd2afe03c88009cf62293b9e))\n  * remove broken ARIA attributes ([aaa6e5aa](https://github.com/angular/material/commit/aaa6e5aaef73d8667339521aed08f42abee53b01))\n  * improve keyboard filtering ([f3c113c9](https://github.com/angular/material/commit/f3c113c9083dfd079c06e26bbcc8da5c52ba8586))\n  * improve disable scroll layout ([68395a25](https://github.com/angular/material/commit/68395a254e70a8e57ccd2e03019228bf158435a4))\n* **tabs:**\n  * tabs will no longer assume that all tabs have no content if the first one doesn't ([1b789fed](https://github.com/angular/material/commit/1b789fed4cf55443e2d106537e6912fa1df605e2), closes [#2398](https://github.com/angular/material/issues/2398))\n  * adds a queue for delayed function calls ([0e2ccd23](https://github.com/angular/material/commit/0e2ccd23dc220392c0082f9cb05ccfddf42d22a1), closes [#2402](https://github.com/angular/material/issues/2402))\n  * resolves issue where `md-tabs` is used within `ui-view` by removing hard require ([43508032](https://github.com/angular/material/commit/4350803267a8e19a15a240ccf657cd2ba098e0ae), closes [#2414](https://github.com/angular/material/issues/2414))\n  * apply ARIA only to dummy tabs ([5ad44728](https://github.com/angular/material/commit/5ad447284c7cda2261da1440819e3e0101a7b1ae))\n  * cleans up label/template fetch logic ([17aecd2d](https://github.com/angular/material/commit/17aecd2dbc3acfe48006ff5adb12cad5e15aa70b))\n  * id's should no longer cause issues when used within tab labels or contents ([ea185eab](https://github.com/angular/material/commit/ea185eabd13bbcce3e07628891836b0626f609e5), closes [#2326](https://github.com/angular/material/issues/2326))\n* **tests:** mock .flush() added for Angular 1.4.x ([1e3f1a59](https://github.com/angular/material/commit/1e3f1a591f8f2f7c6bd54153df080367970b8a2d))\n* **textfield:** removed unstable, deprecated textfield component Replaced with md-input-container ([b5c4390b](https://github.com/angular/material/commit/b5c4390bf7cb81809fea0df93c7d01e410b5585a))\n\n\n\n<a name=\"0.9.1-rc1\"></a>\n### 0.9.0-rc1  (2015-04-14)\n\nThe release of 0.9 is primarily focused on bug fixes and polish efforts. Also included in this upcoming release will be  added support for List items and controls, Chips, re-architected Tabs, and improvements to Gesture support and documentation.\n\n#### Features\n\n* **autocomplete:**\n  * adds `md-menu-class` to allow users to add a class to the dropdown menu for cust ([860897d9](https://github.com/angular/material/commit/860897d9c6f2db034ecb2e30dddd005bc174e00d))\n  * dropdown will now stretch to accomodate longer text ([b1343704](https://github.com/angular/material/commit/b13437044147cecf6835850c95fc764a67d466d0))\n  * adds support for `md-autocomplete-snap` to specify parent element for autocomple ([15d1db73](https://github.com/angular/material/commit/15d1db731eab44151543c2ec27323e0bc92f0878))\n  * `md-highlight-text` now supports custom flags ([1ac0c93c](https://github.com/angular/material/commit/1ac0c93c369b1e6652741abd640e0539090bb083), closes [#1799](https://github.com/angular/material/issues/1799))\n  * adds support for `name` attribute ([ebca76da](https://github.com/angular/material/commit/ebca76da4831c359547cce59d6378c9f0a93e913))\n  * adds support for floating labels ([f487248a](https://github.com/angular/material/commit/f487248a70c9bfd749953e98e3412240112f39a3))\n* **button:** support for link icon buttons ([1b9bafb5](https://github.com/angular/material/commit/1b9bafb5abd470e4e1bfd784484407588430083b), closes [#2265](https://github.com/angular/material/issues/2265))\n* **card:** add default background color ([3bc8b27b](https://github.com/angular/material/commit/3bc8b27be39d33a07a58c562e9efafa184fdd12d), closes [#1846](https://github.com/angular/material/issues/1846))\n* **chips:** initial commit Supports basic list mutation (add, remove items). ([713f7b67](https://github.com/angular/material/commit/713f7b67cd195d5abfde1540f26679d58f738bb5), closes [#2030](https://github.com/angular/material/issues/2030))\n* **gestures:** add  provider to all config and optional skipClickHijack() ([f28393df](https://github.com/angular/material/commit/f28393df73a4ef85c18f54bd99041a74382375fb))\n* **layout:** re-add offset attribute ([fecceeb5](https://github.com/angular/material/commit/fecceeb5158bbd78e848a449dd3840ccef76e1f6))\n* **list:** BREAKING: add list controls ([abb807d0](https://github.com/angular/material/commit/abb807d0dcb77b92132b5ab73d61f97aa953f461), closes [#2021](https://github.com/angular/material/issues/2021))\n* **mdButton:** add icon button for toolbars, etc. ([6ee9a190](https://github.com/angular/material/commit/6ee9a1901beaeed49055437f64506b42b3f33bc3), closes [#2091](https://github.com/angular/material/issues/2091), [#NaN](https://github.com/angular/material/issues/NaN))\n* **mdCard:** support md-card-footer ([ff794eca](https://github.com/angular/material/commit/ff794ecad8299f343d79501b470a914a75cdb6bc), closes [#1474](https://github.com/angular/material/issues/1474))\n* **radioButton:** allow theming on radio group ([30d0cc44](https://github.com/angular/material/commit/30d0cc4425c68571ec67bcca0ec4ba0925b18ed7), closes [#1746](https://github.com/angular/material/issues/1746))\n* **script:** Set ngModule to Closure namespace. ([ade76f95](https://github.com/angular/material/commit/ade76f95f38410a92ec07c4b02bff0c1df580efb), closes [#1709](https://github.com/angular/material/issues/1709))\n* **select:**\n  * truncate string to fit in single line ([1a81f0c6](https://github.com/angular/material/commit/1a81f0c6c98a2fe217f089c3457af5ee99ba61f5))\n  * add auto-inference of option value ([342af6a8](https://github.com/angular/material/commit/342af6a808c962ce02da26461b403aa4465f05cc))\n  * add psuedo-element to make auto complete work ([aa440efc](https://github.com/angular/material/commit/aa440efcb381a61abb49ea846d1fe0b458cc3a50))\n  * add support to select/focus by typing options ([f5d905a2](https://github.com/angular/material/commit/f5d905a203808c067195330675d6bdbad6f2be0c))\n  * add ngMultiple support to select ([9956f62d](https://github.com/angular/material/commit/9956f62d8652a4d335bfe2d759b12634ef8691c8))\n  * add styles for invalid ([ddf1198f](https://github.com/angular/material/commit/ddf1198fe7c7a5f2c344dced368da4b5f4e13d20))\n* **sidenav:**\n  * add focus override option and demo ([3ca2a637](https://github.com/angular/material/commit/3ca2a637f730b49dfdb89489cfc368372fb73c4e), closes [#1891](https://github.com/angular/material/issues/1891))\n  * add promise-based lookup .then(callbackFn) for deferred instances ([076a97db](https://github.com/angular/material/commit/076a97db299a42c35f315b032729da5500a24157), closes [#1311](https://github.com/angular/material/issues/1311))\n* **tabs:**\n  * adds support for `md-no-pagination` ([d0ddad1f](https://github.com/angular/material/commit/d0ddad1f467b9f001233e1dff708f3d7785f9bfc), closes [#1189](https://github.com/angular/material/issues/1189))\n  * adds support for `md-center-tabs` ([2de0cf26](https://github.com/angular/material/commit/2de0cf26a4e7fc985b6247039537311a7e7861c1), closes [#1992](https://github.com/angular/material/issues/1992))\n  * adds support for `label` attribute without tab content ([faab8883](https://github.com/angular/material/commit/faab88837c2f38b87adaa3bfe5de77f563f7899f), closes [#2068](https://github.com/angular/material/issues/2068))\n  * adds support for dynamic height based on tab contents ([efde63c4](https://github.com/angular/material/commit/efde63c4673ca60085013f9d4caa6121c8110c30), closes [#2088](https://github.com/angular/material/issues/2088))\n  * refactors tabs to function closer to spec ([f34eb800](https://github.com/angular/material/commit/f34eb800212b6daa11d3a23c14a5a173d9691cf3), closes [#1087](https://github.com/angular/material/issues/1087), [#1107](https://github.com/angular/material/issues/1107), [#1140](https://github.com/angular/material/issues/1140), [#1247](https://github.com/angular/material/issues/1247), [#1261](https://github.com/angular/material/issues/1261), [#1380](https://github.com/angular/material/issues/1380), [#1387](https://github.com/angular/material/issues/1387), [#1403](https://github.com/angular/material/issues/1403), [#1443](https://github.com/angular/material/issues/1443), [#1505](https://github.com/angular/material/issues/1505), [#1506](https://github.com/angular/material/issues/1506), [#1516](https://github.com/angular/material/issues/1516), [#1518](https://github.com/angular/material/issues/1518), [#1564](https://github.com/angular/material/issues/1564), [#1570](https://github.com/angular/material/issues/1570), [#1620](https://github.com/angular/material/issues/1620), [#1626](https://github.com/angular/material/issues/1626), [#1698](https://github.com/angular/material/issues/1698), [#1777](https://github.com/angular/material/issues/1777), [#1788](https://github.com/angular/material/issues/1788), [#1850](https://github.com/angular/material/issues/1850), [#1959](https://github.com/angular/material/issues/1959), [#1986](https://github.com/angular/material/issues/1986), [#2020](https://github.com/angular/material/issues/2020), [#1944](https://github.com/angular/material/issues/1944))\n* **tooltip:** adds `md-autohide` functionality ([b682e36a](https://github.com/angular/material/commit/b682e36a55c37f41cf9004645916cba07b6ef805), closes [#1689](https://github.com/angular/material/issues/1689))\n\n\n#### Breaking Changes\n\nGenerated HTML and style improvements:\n\n###### CSS\n* CSS Focus outlines not prevented by default\n* Box-sizing removed from body, applied to components\n* `textRendering: optimizeLegibility` removed from body, applied to a subset of elements\n* Font sizes, margins, padding in `rem` units\n* Roboto webfont included in SCSS\n* Typography: classes introduced for headings and body copy\n* High-contrast mode supported on Windows\n\n###### HTML\n* Docs: Pinch and zoom re-enabled in viewport\n\nBugs fixed:\n\n*  [#1087](https://github.com/angular/material/issues/1087), [#1107](https://github.com/angular/material/issues/1107), [#1140](https://github.com/angular/material/issues/1140), [#1247](https://github.com/angular/material/issues/1247), [#1261](https://github.com/angular/material/issues/1261)\n*  [#1380](https://github.com/angular/material/issues/1380), [#1387](https://github.com/angular/material/issues/1387), [#1403](https://github.com/angular/material/issues/1403), [#1443](https://github.com/angular/material/issues/1443), [#1505](https://github.com/angular/material/issues/1505)\n*  [#1506](https://github.com/angular/material/issues/1506), [#1516](https://github.com/angular/material/issues/1516), [#1518](https://github.com/angular/material/issues/1518), [#1564](https://github.com/angular/material/issues/1564), [#1570](https://github.com/angular/material/issues/1570)\n*  [#1620](https://github.com/angular/material/issues/1620), [#1626](https://github.com/angular/material/issues/1626), [#1698](https://github.com/angular/material/issues/1698), [#1777](https://github.com/angular/material/issues/1777), [#1788](https://github.com/angular/material/issues/1788)\n*  [#1850](https://github.com/angular/material/issues/1850), [#1959](https://github.com/angular/material/issues/1959), [#1986](https://github.com/angular/material/issues/1986), [#2020](https://github.com/angular/material/issues/2020)\n\n\n ([f34eb800](https://github.com/angular/material/commit/f34eb800212b6daa11d3a23c14a5a173d9691cf3))\n\n#### Bug Fixes\n\n* include Roboto as non-blocking <link> ([5936f7a0](https://github.com/angular/material/commit/5936f7a080faef5d6bfb53463815a0a6d989f739), closes [#2247](https://github.com/angular/material/issues/2247), [#NaN](https://github.com/angular/material/issues/NaN))\n* switch focus on keyboard, use .md-focused ([0e916bfc](https://github.com/angular/material/commit/0e916bfccbd2abd05508c6bde61eb513530c3331), closes [#1336](https://github.com/angular/material/issues/1336))\n* limit global list styles ([fde08cc1](https://github.com/angular/material/commit/fde08cc174a1516fcba97cf626861751d80cebfc))\n* refactor global CSS styles ([6af1546d](https://github.com/angular/material/commit/6af1546da48aa335ca65ff32f09e2d3b69d0a2d9), closes [#1442](https://github.com/angular/material/issues/1442), [#NaN](https://github.com/angular/material/issues/NaN))\n* **autocomplete:**\n  * fixes menu flicker ([9b2dc2c4](https://github.com/angular/material/commit/9b2dc2c472e3a8893114d8153a0734c80fe7fa6a))\n  * updates the z-index to account for use within sidenav or dialog ([3cc914d7](https://github.com/angular/material/commit/3cc914d7f31a230c500fb460e7bb0ee7fe9003b1), closes [#2202](https://github.com/angular/material/issues/2202))\n  * hitting enter with an item selected no longer resets the selected item ([7e666ab4](https://github.com/angular/material/commit/7e666ab4df3e866acae45bc50030042ad31a0b75), closes [#2183](https://github.com/angular/material/issues/2183))\n  * dropdown will shift if there is not enough space ([0b15c976](https://github.com/angular/material/commit/0b15c97629be75924653738687ffeff827fcdc22), closes [#2004](https://github.com/angular/material/issues/2004))\n  * moves autocomplete dropdown to nearest content container ([7f355f6d](https://github.com/angular/material/commit/7f355f6d787520cc6a047f46067971b25d79ee73), closes [#2013](https://github.com/angular/material/issues/2013), [#1961](https://github.com/angular/material/issues/1961), [#1670](https://github.com/angular/material/issues/1670))\n  * `md-min-length` now supports 0 as a value and will show dropdown on focus ([dcf92682](https://github.com/angular/material/commit/dcf92682ef199cc400af013a426fd2e952cd182e))\n  * `md-search-text-change` now fires when content is deleted from text ([f308779a](https://github.com/angular/material/commit/f308779a3553af6b46419aaeaa5e3bad9b27e832), closes [#2061](https://github.com/angular/material/issues/2061))\n  * item templates now handle child bindings in the correct scope ([2e157d2b](https://github.com/angular/material/commit/2e157d2bf89336ee404cfaea15e16cc5aeb6c8cf), closes [#2065](https://github.com/angular/material/issues/2065))\n  * adds a minimum width ([66fe5757](https://github.com/angular/material/commit/66fe5757fa946414a16b4a3058ecf22701315f2c), closes [#1853](https://github.com/angular/material/issues/1853))\n  * hides cancel button when field is disabled ([936b8816](https://github.com/angular/material/commit/936b88166fb4cc6d90ebdab78127926fc7cc89e6), closes [#1710](https://github.com/angular/material/issues/1710))\n  * adds support for `md-autofocus` ([c6374d9b](https://github.com/angular/material/commit/c6374d9bb17beca805d36c905eb3c8917a2084e8), closes [#1764](https://github.com/angular/material/issues/1764))\n  * accepts pre-selected values ([c3fcd0d8](https://github.com/angular/material/commit/c3fcd0d84e375ba8d77d6bf532904769eb433601), closes [#1779](https://github.com/angular/material/issues/1779))\n  * will no longer query when item is selected ([5f141269](https://github.com/angular/material/commit/5f14126954fa10911e00a8c18bf8a070133ae5de), closes [#1835](https://github.com/angular/material/issues/1835), [#1732](https://github.com/angular/material/issues/1732))\n  * disables browser autocomplete ([1a8b5658](https://github.com/angular/material/commit/1a8b5658a7e6cc37d307c725f9bb24d8e5dbd2e7), closes [#1849](https://github.com/angular/material/issues/1849))\n  * autocomplete now selects the first item by default and no longer hides results w ([4c2b086a](https://github.com/angular/material/commit/4c2b086a6bd38f1d6d4096b73a96d7523b0f09b9), closes [#1858](https://github.com/angular/material/issues/1858))\n  * adds support for `$http` promises ([de423ae4](https://github.com/angular/material/commit/de423ae48d593c08f0277376b7e3e80571a3ba48), closes [#1798](https://github.com/angular/material/issues/1798))\n* **bottomSheet:** make bottom sheet work with new md-list ([bc32eb4c](https://github.com/angular/material/commit/bc32eb4c3bd795ad9be0ba6412bb7bfcde6d681b))\n* **bower:** fixes bower warning ([c4979d68](https://github.com/angular/material/commit/c4979d680aaca4136dd0e9408ac76c3cb8351529), closes [#2165](https://github.com/angular/material/issues/2165))\n* **build:**\n  * do not bower install in github hook script ([859ecb56](https://github.com/angular/material/commit/859ecb568a7318b1f334f6e210680c4d03e4d110))\n  * remove bower dependency, update npm to install angular, update Jasmine 2 ([9398a7a9](https://github.com/angular/material/commit/9398a7a9d0c97eff5e35d24348d89bec85bebd34), closes [#1962](https://github.com/angular/material/issues/1962))\n* **button:**\n  * update to use .md-focused ([7d1608e6](https://github.com/angular/material/commit/7d1608e6b776cc695a5426b35fd0e0abff8f0970))\n  * safari background FAB colors ([0178b895](https://github.com/angular/material/commit/0178b8955f6bf2120a3a32fa8c51398557c9c059), closes [#2011](https://github.com/angular/material/issues/2011))\n  * hover, disabled, alignment, docs ([a936e1ed](https://github.com/angular/material/commit/a936e1edc964b69ffe5bf96905e348fc6f4c6b4d), closes [#1607](https://github.com/angular/material/issues/1607), [#NaN](https://github.com/angular/material/issues/NaN))\n  * prevents transition from firing on ng-leave ([9aedd741](https://github.com/angular/material/commit/9aedd7413835b9333154e3b3f082ee94c4f89d49), closes [#936](https://github.com/angular/material/issues/936))\n  * Support ui-sref attribute natively. ([7b743ed4](https://github.com/angular/material/commit/7b743ed4c62e2680c350d56daf57b202f15e63bf))\n  * fixes ripple on fab buttons in safari ([a1c011ef](https://github.com/angular/material/commit/a1c011ef729c091d82f070b87b84f98fd685690c), closes [#1856](https://github.com/angular/material/issues/1856))\n* **card:** add correct themed background color ([9af45d37](https://github.com/angular/material/commit/9af45d37d635b31ae9fa1117db3edfd2e07f15ab))\n* **checkbox:**\n  * update to grid units, demo cleanup ([bc1c4e0f](https://github.com/angular/material/commit/bc1c4e0f290739088b7da7d51744c603ea107079))\n  * disable checkboxes with tabindex=-1 ([3c0fed99](https://github.com/angular/material/commit/3c0fed997bacc58f9bad49aa6a4f96f06db08402), closes [#2087](https://github.com/angular/material/issues/2087))\n  * support for ng-checked ([2680cf15](https://github.com/angular/material/commit/2680cf1565afb4a8858737f0201933a400b9059e), closes [#1550](https://github.com/angular/material/issues/1550))\n  * ngModel intial value used correctly with events ([942d0b9a](https://github.com/angular/material/commit/942d0b9a87b1478917325ccac011c2f4f5a5b3e1), closes [#1550](https://github.com/angular/material/issues/1550))\n  * make enter toggle checkboxes ([57610eae](https://github.com/angular/material/commit/57610eaea680871b2751f078a7132e983c6f24e8))\n* **chips:**\n  * sets `md-autoselect` for contact chips ([eb9f5646](https://github.com/angular/material/commit/eb9f56466a02e44321c8fa50c09f5689836a5be3), closes [#2294](https://github.com/angular/material/issues/2294))\n  * fixes issue when removing chips via button ([59d359ce](https://github.com/angular/material/commit/59d359ce1d2ca9629876bf3c07b4801d1c253d1b), closes [#74](https://github.com/angular/material/issues/74))\n  * when adding items, duplicates will now be skipped ([1ba926bc](https://github.com/angular/material/commit/1ba926bc347f93ce9ff2bff77bd492a39f393fa6))\n  * only add chip item if it is truthy. fixes #2116 ([d154a8e4](https://github.com/angular/material/commit/d154a8e4b465a94e6dda18333e797216e8a9a558), closes [#2120](https://github.com/angular/material/issues/2120))\n* **dialog:**\n  * fix backdrop position with parent scrolled ([74601d03](https://github.com/angular/material/commit/74601d0341609d072c5350b63da515b9af54a095))\n  * cross-browser layout, a11y issues ([0b0ed233](https://github.com/angular/material/commit/0b0ed2339e1ec32e34d20daa18cadd4ef89d5f86), closes [#1340](https://github.com/angular/material/issues/1340), [#NaN](https://github.com/angular/material/issues/NaN))\n* **divider:** make divider work with new md-list ([ebcd7f04](https://github.com/angular/material/commit/ebcd7f043457c189f731bf3d40a8d6004e6e4af1))\n* **docs:** use node_modules/angularytics ([b8cc062a](https://github.com/angular/material/commit/b8cc062a36d0e957e626e630dd4a8734ba29785f))\n* **gesture:** don't stop hijacking clicks on ios & android when jquery is loaded ([81bcf7fd](https://github.com/angular/material/commit/81bcf7fd15fd76f054814b34d8a877168fc6225c), closes [#1869](https://github.com/angular/material/issues/1869), [#1842](https://github.com/angular/material/issues/1842))\n* **gestures:**\n  * attach event listeners once when multiple ng-apps are running ([6d566762](https://github.com/angular/material/commit/6d566762f22049fbfe10dd9187e04f305a7f9ae7), closes [#2173](https://github.com/angular/material/issues/2173))\n  * disable click hijack on mobile if jQuery is present ([2c57a828](https://github.com/angular/material/commit/2c57a8289f73265ca41fc8b2fbbe173a80073caa), closes [#1915](https://github.com/angular/material/issues/1915))\n  * gestures initialize only on use instead of load ([63c87096](https://github.com/angular/material/commit/63c87096f2e1d18c38fe0895434b087bfd517a3b), closes [#2074](https://github.com/angular/material/issues/2074))\n* **gridlist:**\n  * The gridlist will now lay out everytime a tile is added ([aca5944d](https://github.com/angular/material/commit/aca5944d9d12f92b75e4bcf3de8865475b3105e8), closes [#2227](https://github.com/angular/material/issues/2227))\n  * Now supports custom interpolation symbols ([f037b8cb](https://github.com/angular/material/commit/f037b8cb9e4db8b0ba0d1830fe872f9537e91779), closes [#1874](https://github.com/angular/material/issues/1874), [#NaN](https://github.com/angular/material/issues/NaN))\n  * update calcs for safari ([33049cff](https://github.com/angular/material/commit/33049cff96cd643e76159fc2d72cbd9fb911245c), closes [#2066](https://github.com/angular/material/issues/2066))\n  * typo in gridlist demo ([8849fe19](https://github.com/angular/material/commit/8849fe19595dbaf2515ad590fe2f9029c70b54e4))\n* **icon:**\n  * remove invalid danger style ([360e2b60](https://github.com/angular/material/commit/360e2b6097f97189e41b9f1da2c95ba4043193e7))\n  * Fix issue with resizing SVGs when jQuery included. ([c4e8c1c4](https://github.com/angular/material/commit/c4e8c1c429e1333b8b8ecee0033fe4c695c60c3d), closes [#1803](https://github.com/angular/material/issues/1803))\n* **icons:**\n  * disable pointer events on SVG(s). ([a7d9fa32](https://github.com/angular/material/commit/a7d9fa32209378b92ebddcbd2c11a85cea612a3b), closes [#2048](https://github.com/angular/material/issues/2048))\n  * fix default icon color to match spec ([6fc26fab](https://github.com/angular/material/commit/6fc26fabfc97ea1d677eefec912ed1b5a8bbaca0))\n* **input:**\n  * float labels support dir=rtl ([b88b744f](https://github.com/angular/material/commit/b88b744f325c79db728df83652db08865ac29b7d), closes [#964](https://github.com/angular/material/issues/964))\n  * Only make invalid input label red when it's floating ([6d368505](https://github.com/angular/material/commit/6d3685059f0e5c47e1051e2c8accc53bf62a5b3d), closes [#1928](https://github.com/angular/material/issues/1928))\n  * delegate clicks in IE10 ([d0b427d6](https://github.com/angular/material/commit/d0b427d63e5fac31d0cec18c5df8158e2c083c9a), closes [#1394](https://github.com/angular/material/issues/1394))\n  * improve  textarea appearance on firefox and IE ([a693dabd](https://github.com/angular/material/commit/a693dabdafa72a07e6422b94e5f927328cee94ef), closes [#1157](https://github.com/angular/material/issues/1157))\n  * input validation and visual error indicators fixed ([c818da75](https://github.com/angular/material/commit/c818da75c89043a81de6234120315d7d48abc782), closes [#1606](https://github.com/angular/material/issues/1606))\n* **list:**\n  * add missing interpolation character ([07e82015](https://github.com/angular/material/commit/07e82015bbe4d5b40eb36a1077c509a6f7597b33))\n  * focus covers whole row, IE11 layout fix ([b47a8787](https://github.com/angular/material/commit/b47a8787fba6d9f7bda6f695ee0c8a9904df65c1), closes [#2222](https://github.com/angular/material/issues/2222))\n  * adds role attributes in compile rather than link for performance improvements ([38f04230](https://github.com/angular/material/commit/38f04230a3064f84701a1c7eca862fd6bb2c256f))\n* **md-select:** Track disabled state ([dc93bffe](https://github.com/angular/material/commit/dc93bffe25cd5b2c28e6eac7adfe954c69c672c6))\n* **mdButton:** focus styles only on keyboard ([dfb4d1ab](https://github.com/angular/material/commit/dfb4d1abd9ed82cb2b68980ae580f3a434ff3f1c), closes [#1423](https://github.com/angular/material/issues/1423))\n* **progressCircular:** fixes animation in IE11 ([d5b77bdc](https://github.com/angular/material/commit/d5b77bdcfe21cb898ea21461e180da2daad89886), closes [#387](https://github.com/angular/material/issues/387))\n* **radioButton:** fix googly eyed radio-buttons ([bffa15ab](https://github.com/angular/material/commit/bffa15abc37698a9e8b663db1a9ce4a8250b27a4))\n* **ripple:**\n  * fixes ripple positioning ([087c3dcf](https://github.com/angular/material/commit/087c3dcf2443ee49bf86a2c87fcaab014e47751f))\n  * fixes issues with ripples on items below the fold ([e0f9fe98](https://github.com/angular/material/commit/e0f9fe98b24e028f80acf662b8a69e2f582529f2), closes [#2028](https://github.com/angular/material/issues/2028), [#1526](https://github.com/angular/material/issues/1526))\n* **select:**\n  * greatly improve scroll disable compatability ([614630d7](https://github.com/angular/material/commit/614630d730f24df9ad3e9ee91f061049d615738a))\n  * fix invalid css ([2f9eef70](https://github.com/angular/material/commit/2f9eef70b5503b4fcb5c7cbe09712700403cc5a3))\n  * make select focus states match ui-spec ([42db19dd](https://github.com/angular/material/commit/42db19dd5571eb88ba8d2a9667d183d9f3d61da7))\n  * bug using select attr with inferred value ([e20b1906](https://github.com/angular/material/commit/e20b1906c4c732b5b9baf708eaebd25de93dc9cb))\n  * fix scrollbar margin of select parent ([f3cd5b9c](https://github.com/angular/material/commit/f3cd5b9c21e75794b689f8f4ba33d5dfec3d2fd9))\n  * make select positioning factor in scroll bar width ([e18450fb](https://github.com/angular/material/commit/e18450fb53d4566e19b847e1606a2c9d00fe18cf))\n  * reposition select on resize events ([0fe35cc8](https://github.com/angular/material/commit/0fe35cc8a896ac8db734e8f06766774cbe337211))\n  * fix md-on-show not hiding spinner for non-async ([13b9c697](https://github.com/angular/material/commit/13b9c6978426dd82bfc669ca653e84d35373fb67))\n  * make constrained select fit to top/left first ([f6f2187c](https://github.com/angular/material/commit/f6f2187cc92055cafbb440ff021093bfccaa72c3))\n  * BREAKING: make select more inline with md-input-container styles ([a67a6a2e](https://github.com/angular/material/commit/a67a6a2e7f7d6ff88ae48e405828b542481d2468))\n  * fix alignment of select dropdown arrow ([5c853e66](https://github.com/angular/material/commit/5c853e6654d1e2279833edccdbc142a577e3a338))\n  * fix firefox select positioning, page moving on open ([a15347cd](https://github.com/angular/material/commit/a15347cd24255492ed5a36e9bbd2920e45c629e1))\n* **sidenav:** improve API usage for $animate enter/leave ([4245bcf7](https://github.com/angular/material/commit/4245bcf7f1000ab8960dda27d47cb34a8ddb7583), closes [#2261](https://github.com/angular/material/issues/2261))\n* **subheader:** fix width styling while scrolling ([2f335732](https://github.com/angular/material/commit/2f33573258466be877c3399b1033ad71dc612283))\n* **tabs:**\n  * resets offset if the user resizes causing pagination to no longer be necessary ([bd1c973a](https://github.com/angular/material/commit/bd1c973a1d13490dfc8ad38aa8cd7ffc633aa6fc))\n  * fixes styles for `md-align-tabs=\"bottom\"` ([0dabfc5c](https://github.com/angular/material/commit/0dabfc5cd1bccd51c221e8af8ea4ddda35f21df1))\n  * fixes Safari issue regarding dynamic tabs transitions ([4ac7dc03](https://github.com/angular/material/commit/4ac7dc037aecce6721d6656e9a2fb773b852ae15))\n  * fixes flicker issue with dynamic height ([48eeb627](https://github.com/angular/material/commit/48eeb627ddf497a241ec5e4686f333d5b56769fe))\n  * fixes styles for `md-border-bottom` and `md-align-tabs` ([9affd121](https://github.com/angular/material/commit/9affd1216174d31e92be54e0d0c1ec1698ed483f), closes [#2119](https://github.com/angular/material/issues/2119))\n  * adds support for height changes in between tab switches ([64c4585b](https://github.com/angular/material/commit/64c4585b0bc3bcb16a2f196f26ceaa8cb420b679), closes [#2088](https://github.com/angular/material/issues/2088), [#2177](https://github.com/angular/material/issues/2177))\n  * resolves issue where code was attempting to fire after the tabs array had been r ([f15fd050](https://github.com/angular/material/commit/f15fd0502463ffcd436d4768771ea4ccdc378fcf))\n  * re-added `md-on-select` and `md-on-deselect` events to `md-tab` directive ([c84899df](https://github.com/angular/material/commit/c84899df1036804db1b435ca4c6f92e01c7e12e6))\n  * applies correct styles for tabs living inside md-toolbar ([4c59c5c5](https://github.com/angular/material/commit/4c59c5c58906e3b7cb6da36f25426767b3949c4e), closes [#2067](https://github.com/angular/material/issues/2067))\n  * updates CSS so that tabs support scrolling when necessary ([9f0d428c](https://github.com/angular/material/commit/9f0d428c9de64ddcb08bbe269044b88d0dae0d23), closes [#2088](https://github.com/angular/material/issues/2088))\n* **theming:**\n  * fix theming in safari ([1ebc42ec](https://github.com/angular/material/commit/1ebc42ec4ad457602a634f8fb0562128dc3e701c))\n  * add support for background hues ([0df4b16e](https://github.com/angular/material/commit/0df4b16eca2c8af9805615da646d38db04a33d7f))\n  * change default background palette, document theming ([57deba10](https://github.com/angular/material/commit/57deba108b5075fff2fb869d252b923569091398))\n* **toast:** style tweaks for desktop rendering, fix opacity ([860a55ec](https://github.com/angular/material/commit/860a55ec7d5aaf337f671645d226da566b23b596))\n* **toolbar:** md-button style cleanup ([1c19272a](https://github.com/angular/material/commit/1c19272a70e7690a5689bbd5f33a338c078a795c), closes [#2267](https://github.com/angular/material/issues/2267), [#2146](https://github.com/angular/material/issues/2146))\n* **tooltip:**\n  * fixes positioning bug in Safari ([f62fd480](https://github.com/angular/material/commit/f62fd480fdb5aa4f044f69691aedee31932af638), closes [#1883](https://github.com/angular/material/issues/1883))\n  * tooltip will no longer be pushed up if there is room for it within its `offsetPa ([6e576c02](https://github.com/angular/material/commit/6e576c02dfebab5474c43d6069247ed32942e3e3))\n  * fixes tooltip position when body has a margin ([00f4cc6d](https://github.com/angular/material/commit/00f4cc6d1329f618d595f887c0a13371bcff2d9e), closes [#1883](https://github.com/angular/material/issues/1883))\n  *\n\n<a name=\"0.8.3\"></a>\n### 0.8.3  (2015-03-03)\n\n\n#### Features\n\n* **ripple:** smooths out ripple animations ([ac47ca6c](https://github.com/angular/material/commit/ac47ca6c1df6a873615445d8c1f0cbb3eb3764f7), closes [#1750](https://github.com/angular/material/issues/1750))\n\n\n#### Bug Fixes\n\n* **autocomplete:** clicking on the scrollbar in the dropdown will no longer cause the list to hide ([2731f107](https://github.com/angular/material/commit/2731f1078efdd3c546629376ed71c7068501daf3), closes [#1739](https://github.com/angular/material/issues/1739))\n* **gestures:** resolves jQuery conflict with $mdGesture ([79505888](https://github.com/angular/material/commit/7950588882557a6d1670e2029ddda76d12027c45))\n* **select:**\n  * support rtl direction ([59e30a39](https://github.com/angular/material/commit/59e30a392ed7f0dc43ec71db22b60fcaa800ba7e))\n  * make md-option work with ng-selected ([425a76a3](https://github.com/angular/material/commit/425a76a3a5b4bce767e0f8ad766d7a8773e5463f))\n  * make select work with ng-disabled ([60514054](https://github.com/angular/material/commit/60514054984c3d1c5577c5150e80e7ca9e3a4083))\n  * fix select not setting initial value ([6dc46d52](https://github.com/angular/material/commit/6dc46d52dea21c4de3dc7984fb56d99076fdd1e6))\n  * fix closing select a second time on firefox ([e49a20e8](https://github.com/angular/material/commit/e49a20e85d808ca0533afc40ee11f8337535c315))\n  * fix positioning / sizing on firefox ([67618dc8](https://github.com/angular/material/commit/67618dc8fb5a81b23ed33879b062a6e316477a4a))\n  * fix resetting value for selects without placeholder ([2a0ea163](https://github.com/angular/material/commit/2a0ea1630fb286099a8c27e5035cadc5cc1ed0b8))\n  * fix empty select breaking page ([6e7b36cf](https://github.com/angular/material/commit/6e7b36cfa388227e3879120d3c332fc76e095e32))\n  * make select consistent with md-input ([6aa1c8a7](https://github.com/angular/material/commit/6aa1c8a782b67aee3a31f9ed38c99aebfdb3b1a9))\n  * positioning when to close to bottom or right ([cf78ba9f](https://github.com/angular/material/commit/cf78ba9f1fce7fdc3e613b3c83a4056ed8fb2e40))\n\n\n<a name=\"0.8.2\"></a>\n### 0.8.2  (2015-02-27)\n\n\n#### Features\n\n* **autocomplete:** adds support for `md-delay` to wait until the user stops typing to poll for resu ([70a884a1](https://github.com/angular/material/commit/70a884a164f20b7cfde0c08f66712f86c4789f13))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * cleans up watchers when elements are removed ([7fc0d02c](https://github.com/angular/material/commit/7fc0d02c6009c0c5f688d84cbd76afb9f4262541), closes [#1692](https://github.com/angular/material/issues/1692))\n  * prevents aria message on selection ([e2148f13](https://github.com/angular/material/commit/e2148f13aa802196505106e776a959a648a38010))\n  * addresses accessibility issues ([0bd7afb8](https://github.com/angular/material/commit/0bd7afb81755ea2815c8af646d692e045509f014), closes [#1473](https://github.com/angular/material/issues/1473))\n  * change events will no longer be called on load ([c58d930e](https://github.com/angular/material/commit/c58d930e293ec4105e49391f67d8b31218d474ad))\n* **button:** allow attribute syntax for md-button. ([fc223b0c](https://github.com/angular/material/commit/fc223b0c9f92f03e4a1f2f9d53ac14d699ff02a2), closes [#1661](https://github.com/angular/material/issues/1661))\n* **core:** Remove redeclared variable declaration. ([3454db3c](https://github.com/angular/material/commit/3454db3c3feb8f5f35bad7815a84a26c67c4dd58), closes [#1697](https://github.com/angular/material/issues/1697))\n* **input:**\n  * resolves on-focus validation checks ([2f17c8f4](https://github.com/angular/material/commit/2f17c8f44a628daf4e81bc576a85f27697dd54ab))\n  * error states and  improved for input fields ([747eb9c3](https://github.com/angular/material/commit/747eb9c3f493dfc338901f66108042ca78b5936e), closes [#1485](https://github.com/angular/material/issues/1485), [#1633](https://github.com/angular/material/issues/1633), [#1629](https://github.com/angular/material/issues/1629))\n* **select:**\n  * when nothing selected, focus first option ([50b5d923](https://github.com/angular/material/commit/50b5d923ef92d7fb664bde605c821e643aa1f152))\n  * make space not scroll select ([b8da17a0](https://github.com/angular/material/commit/b8da17a07c0b532527193ed0626cd1e9cd8b319e))\n  * make sure arrow keys always focus next/prev option ([e441abaf](https://github.com/angular/material/commit/e441abaf91aeb706c8fb773b67bde40fb225601d))\n  * render label on external model updates ([6baed64c](https://github.com/angular/material/commit/6baed64c6c20eeabacf8e737e16e5b39de5f39ea))\n  * fix updating of values on change and init ([0e21b3bc](https://github.com/angular/material/commit/0e21b3bc0bb96c9e9982ebd74a4b810e02a2935f))\n  * change placeholder computation to be handled internally ([b4c0a86e](https://github.com/angular/material/commit/b4c0a86eb3c094c5c897895a4bec392b37923f5f))\n  * fix duplicate options when using ng-repeat ([9e0ca443](https://github.com/angular/material/commit/9e0ca4430f9f3add077a21ccb5a963e48a7f7d83))\n  * fix chrome double scroll bars ([4d722ecf](https://github.com/angular/material/commit/4d722ecf9f8240f47e6e8989afcc5388c99669b4))\n* **tooltip:** fixes `md-direction` attribute functionality ([93080cae](https://github.com/angular/material/commit/93080cae36e1bea653b39c85d9345afe798de59f), closes [#1673](https://github.com/angular/material/issues/1673))\n\n\n<a name=\"0.8.1\"></a>\n### 0.8.1  (2015-02-24)\n\n\n#### Features\n\n* **select:**\n  * set label value based on md-option text ([ee4c7c18](https://github.com/angular/material/commit/ee4c7c1809558a51a58928e9fbe06ab16686742a))\n  * add disabled support ([0c0f25ce](https://github.com/angular/material/commit/0c0f25ce5bb4e1a4467617541cffdb24d36f8ec7))\n  * add ng-change support ([f4ce10ee](https://github.com/angular/material/commit/f4ce10eea6590ac431b7b15c44242b76219e1f7f))\n\n\n#### Bug Fixes\n\n* **select:**\n  * keyboard controls in IE ([69053a30](https://github.com/angular/material/commit/69053a30c869c6ccdf8bcfcaaba451900f38e2ba))\n  * fix overflow scroll on IE ([c5c5f860](https://github.com/angular/material/commit/c5c5f8603e631665d93c018bc6f94df2c4125eab))\n  * prevent select from closing a dialog on click away ([c573c8cd](https://github.com/angular/material/commit/c573c8cd28c66b3c74f6f6ad482ff0c0b3844ff6))\n  * stop position from going past bottom of screen ([805ed1b4](https://github.com/angular/material/commit/805ed1b49369269c0f9606d9f9c812cc8658d954))\n  * fix select with 0 options positioning ([5a82426e](https://github.com/angular/material/commit/5a82426ed23724a1860bb7b5efa3e28326512716))\n  * support custom interpolate symbols ([20b66111](https://github.com/angular/material/commit/20b6611107332b7cd36b93fc1398263c3ad328ae))\n  * remove placeholder for falsey, but defined values ([9497f063](https://github.com/angular/material/commit/9497f063a2f5b118077aaba0cdc3df851754629c))\n  * close md-select-menu if md-select is removed ([5e02ad94](https://github.com/angular/material/commit/5e02ad948fc4e68d81b18234102e47e643917b97))\n\n\n\n<a name=\"0.8.0\"></a>\n### 0.8.0  (2015-02-23)\n\n\n#### Features\n\n* **select:**\n  * add ng-change support ([f4ce10ee](https://github.com/angular/material/commit/f4ce10eea6590ac431b7b15c44242b76219e1f7f))\n  * add select component and functionality ([786cb3b1](https://github.com/angular/material/commit/786cb3b1642be623b21551e4c8aff9c11d53ca13), closes [#1562](https://github.com/angular/material/issues/1562))\n* **autocomplete:** added initial files for autocomplete ([0bd8cf1c](https://github.com/angular/material/commit/0bd8cf1c31bc3a00513b91d2a200e9cc6818f2d0), closes [#1418](https://github.com/angular/material/issues/1418))\n* **dialog:** add ability to specify theme on alert and confirm presets ([c97f48b7](https://github.com/angular/material/commit/c97f48b7ad6515fe211cb1528ba9c2df14c98b18))\n* **gridlist:** Initial gridList implementation ([ef4aff00](https://github.com/angular/material/commit/ef4aff00f05136cfdeb149b151c85c4cae7a0228))\n* **icon:** implemented md-icon for font-faces and svgs ([b7d09d7e](https://github.com/angular/material/commit/b7d09d7e247d3055e53f438b5528ce9e36ecbc66), closes [#1438](https://github.com/angular/material/issues/1438))\n* **input:** adds `no-float` class to disable floating label animations ([33f677e5](https://github.com/angular/material/commit/33f677e53f97a8dacfae173120dbda369bd734ee), closes [#201](https://github.com/angular/material/issues/201), [#1392](https://github.com/angular/material/issues/1392))\n* **tabs:** changes default state of tabs to be transparent. ([732cbc9c](https://github.com/angular/material/commit/732cbc9c3abc1b001e0c425272ab49aa4f4e2d44), closes [#1250](https://github.com/angular/material/issues/1250), [#1393](https://github.com/angular/material/issues/1393))\n* **toast:**\n  * add ability to specify theme for simple preset ([2fef2207](https://github.com/angular/material/commit/2fef22078497d6f444511032bcef1e9900a5103a))\n  * proper toast queing behavior ([74fe8706](https://github.com/angular/material/commit/74fe87068212e233a8b8ed2a3029d0cf491cd53e))\n  * update toast content dynamicly using $mdToast.updateContent ([0e161cb7](https://github.com/angular/material/commit/0e161cb7f9ab02c3774c7071f45bba4a8f97e49b))\n* **tooltip:** adds `md-direction` so that users can specify tooltip direction ([9c69c5cd](https://github.com/angular/material/commit/9c69c5cd4f5ada823cc12bc93246f3c847ecb23d), closes [#1220](https://github.com/angular/material/issues/1220), [#1410](https://github.com/angular/material/issues/1410))\n\n\n#### Bug Fixes\n\n* **autocomplete:**\n  * hitting Enter will now trigger the submit method on parent form tags ([da084fc5](https://github.com/angular/material/commit/da084fc55fe67fa9c5094b73187953423317f5aa), closes [#1530](https://github.com/angular/material/issues/1530))\n  * fixes issue with click events not firing ([e088f6ac](https://github.com/angular/material/commit/e088f6aceb108449b7e6786ef3f1329d805a8001), closes [#1513](https://github.com/angular/material/issues/1513))\n* **dialog:** correct opening position for showing a dialog ([150efe62](https://github.com/angular/material/commit/150efe620f98059f18f6088551d10e3a97984fca))\n* **docs:** toolbar button overlap on mobile ([7391cad4](https://github.com/angular/material/commit/7391cad4a040ca674af4135d7336d852125c2d59))\n* **gridlist:**\n  * Tile removal now supports ngAnimate ([1d8e7832](https://github.com/angular/material/commit/1d8e7832dc6f0c7b20aefd704d8eeaba90cc763c), closes [#1559](https://github.com/angular/material/issues/1559), [#1560](https://github.com/angular/material/issues/1560))\n  * add ngInject annotation support for GridLayoutFactory - $mdGridLayout ([c045f542](https://github.com/angular/material/commit/c045f5425fd4c2dc45a366a2dad66bd675ee1cf1))\n  * Throws error on invalid or missing colCount to avoid infinite loops ([39f4f26a](https://github.com/angular/material/commit/39f4f26ad1fb8ec6b96254620a1b9dcc1525694a))\n  * Adds grid height calculation ([0196014d](https://github.com/angular/material/commit/0196014db76eef8931b5d5b32f94a4fa7d3db675))\n  * Prevents media from being unwatched immediately ([a4104215](https://github.com/angular/material/commit/a4104215be8c3aa902095dcb182d28b05ff3b79e))\n* **icon:**\n  * improve error recovery and item caching ([603e5d68](https://github.com/angular/material/commit/603e5d68623dda4003917989e752fda4e603f36a), closes [#1477](https://github.com/angular/material/issues/1477))\n  * add support for themes with md-primary, etc. ([cdea9a2d](https://github.com/angular/material/commit/cdea9a2d586f82a1048eff9c0b834e7428049a81))\n* **input:**\n  * fix hidden textarea height issue ([efbd414a](https://github.com/angular/material/commit/efbd414a4d5af7b5144f1d08522e46cc043b627d), closes [#1356](https://github.com/angular/material/issues/1356))\n  * improve use of placeholder and floating label ([f704dda6](https://github.com/angular/material/commit/f704dda627c2a030e0bdda44f6cb12ac59e951e0), closes [#1409](https://github.com/angular/material/issues/1409))\n  * hide input text character overflow ([e290b536](https://github.com/angular/material/commit/e290b536a0f7daecbc095a59d3d641f9105e1f15), closes [#1461](https://github.com/angular/material/issues/1461))\n  * improve error checking UX for required inputs ([c1d59aba](https://github.com/angular/material/commit/c1d59aba9f7aa1b30d4664e90ba44235510c9acc), closes [#1491](https://github.com/angular/material/issues/1491), [#1485](https://github.com/angular/material/issues/1485))\n* **layout:** fix responsive breakpoint dead-zones ([ecf6edef](https://github.com/angular/material/commit/ecf6edef9e1ff9a931a77a4665b075faf1988759))\n* **mdButton:** add default color, update docs ([a80804b5](https://github.com/angular/material/commit/a80804b5c1f3ccf554c76e3cad221b750c939a6f), closes [#1486](https://github.com/angular/material/issues/1486))\n* **select:** fixes scrollbar and padding issues ([5d7b63b0](https://github.com/angular/material/commit/5d7b63b0ff286ef0fbeffac3cf61283f4f782e13))\n* **tooltip:** content text was semi-opaque ([42cff135](https://github.com/angular/material/commit/42cff135320727b3615c3cd00300c923112e142d), closes [#1480](https://github.com/angular/material/issues/1480), [#1492](https://github.com/angular/material/issues/1492))\n* **autocomplete:** selected item now properly updates ([1307b945](https://github.com/angular/material/commit/1307b94592c128b31aee7dc8012fa74d2526768f), closes [#1468](https://github.com/angular/material/issues/1468))\n* **button:** remove underline on href button hover ([c19cd433](https://github.com/angular/material/commit/c19cd433eb75fb3b6a9507f8eb36e6e9916f50d3))\n* **card:** fixes selector to be more specific ([2f840b2a](https://github.com/angular/material/commit/2f840b2a221959a9101471ccb86da7a216ab80fd))\n* **gesture:** fix gesture event dispatching with jQuery ([88813b78](https://github.com/angular/material/commit/88813b78cae831b28e2e8d0eb37c32269034bfad), closes [#1367](https://github.com/angular/material/issues/1367))\n* **input:** check invalid model immediately and setInvalid() if needed ([e0f53ddd](https://github.com/angular/material/commit/e0f53ddda7d080e80c08d5106b5586b697ea8e87), closes [#372](https://github.com/angular/material/issues/372))\n* **mdIcon:**\n  * support aria-label on mdRadioButton ([bbbec18e](https://github.com/angular/material/commit/bbbec18e5a9d79dd2957ddaad36993f80b879ce4))\n  * label docs, support from parent el ([f764c049](https://github.com/angular/material/commit/f764c049c9128909fc86a26ffddcb9b6db9dd8f6), closes [#1458](https://github.com/angular/material/issues/1458), [#1460](https://github.com/angular/material/issues/1460))\n* **mdInput:** css cascades from disabled fieldset ([66fa1e3e](https://github.com/angular/material/commit/66fa1e3e276ddf33d669da0ef4d13c73c668e654), closes [#895](https://github.com/angular/material/issues/895))\n* **mdMedia:** fix media listeners not firing on non-chrome browsers ([0dfcaf55](https://github.com/angular/material/commit/0dfcaf553c94935945c7b74b584abd8b73abd40c))\n* **mdTabs:** use md-icon for pagination arrows ([517623e7](https://github.com/angular/material/commit/517623e721cd1d9a104aec2bee22a23889944b3a), closes [#1464](https://github.com/angular/material/issues/1464), [#1466](https://github.com/angular/material/issues/1466))\n* **sidenav:** properly sets width of sidenav ([0318ca44](https://github.com/angular/material/commit/0318ca44ca1d256d50cd1de675c92c8bf4b2bcb1), closes [#957](https://github.com/angular/material/issues/957))\n* **slider:**\n  * updates positioning method to prevent overflow issues ([fb3623a1](https://github.com/angular/material/commit/fb3623a1da832a43fdccb7402ecfd206248639c9), closes [#1343](https://github.com/angular/material/issues/1343), [#1431](https://github.com/angular/material/issues/1431), [#1391](https://github.com/angular/material/issues/1391))\n  * BREAKING: change default color to accent ([3ea349fc](https://github.com/angular/material/commit/3ea349fc7aef2fb22109b69c5c4fb466a4607989))\n* **subheader:** fix subheaders within dialogs ([55084143](https://github.com/angular/material/commit/550841433586d1bbc0a94ef5c0c2ef50e45e28c1))\n* **theming:** fix typo in warning message ([8a6eb7e8](https://github.com/angular/material/commit/8a6eb7e88c7317f755789ba3f2bfe3f88a288b81))\n* **toast:** fix minified toast controller injections ([5c5106e4](https://github.com/angular/material/commit/5c5106e48725cbc7b46269339a33be084ce4aeff))\n* **tooltip:** now works inside elements without pointer events ([3d010cd8](https://github.com/angular/material/commit/3d010cd831c7377e2ebef0df0d897788130cab9f))\n\n\n<a name=\"0.7.1\"></a>\n### 0.7.1  (2015-01-30)\n\n#### Features\n\n* **bottomSheet:** disable scroll on parent when bottom sheet is shown ([8273126c](https://github.com/angular/material/commit/8273126c99304b315632c377ff22717acb45f03b))\n* **button:** adds attribute override for ripple size ([b7c43a10](https://github.com/angular/material/commit/b7c43a10071455e9024fe403d6b696b664c36df4), closes [#1088](https://github.com/angular/material/issues/1088))\n* **gestures:** add built in gesture system, remove HammerJS ([8364fb57](https://github.com/angular/material/commit/8364fb57a9ac1b211c09ff564fea6ad0dea94e61))\n* **input:** make input placeholder attr work ([f1d7f830](https://github.com/angular/material/commit/f1d7f830bf2f12dab288c46a5fc2919d5d608110), closes [#1279](https://github.com/angular/material/issues/1279))\n* **mdInputContainer:** add mdIsError expr, defaults to $touched && $invalid ([c3cad666](https://github.com/angular/material/commit/c3cad666368cc238644b6c9b1aaf1260cd763187), closes [#1267](https://github.com/angular/material/issues/1267))\n* **sidenav:**\n  * make it thinner on <360px wide screens ([6ee3346e](https://github.com/angular/material/commit/6ee3346e301e979e89bf6f43449b6c4a51d78670))\n  * expose isLockedOpen for sidenav instances ([ba71a598](https://github.com/angular/material/commit/ba71a5987d4600128d6a1c14a479cac37a308d28))\n* **theming:**\n  * add warnings when using unregistered themes ([f6f56c98](https://github.com/angular/material/commit/f6f56c989bab062462a4dbf4ece59fd744c6ec3b))\n  * warn for same palette as primary and accent ([1c973330](https://github.com/angular/material/commit/1c973330c68e0c653a19f4408a373741107eb0e3))\n  * fix strong light colors vs normal light colors, as per spec ([dd5b9549](https://github.com/angular/material/commit/dd5b9549f4241eadacb4fe92db574b1bcd9771d5))\n  * rename palette methods, change default palettes ([0e0846fe](https://github.com/angular/material/commit/0e0846feb562d32079eff427abbc045f2681c24e), closes [#1252](https://github.com/angular/material/issues/1252))\n  * change default color of components that should be accent ([f2996b73](https://github.com/angular/material/commit/f2996b734fd7574ad484f258f1fd674de62d64b5))\n* **toolbar:** add shadow to toolbar ([4e47a174](https://github.com/angular/material/commit/4e47a174659e768e0b506d7ea937aadb67818d56))\n\n\n#### Breaking Changes\n\n* As per the\n[spec](https://material.io/archive/guidelines/style/color.html#color-color-system)\nthis commit changes the default color palette of FABs, checkboxes, radio\nbuttons, sliders and switches to the accent palette.\n\ncloses #1255\n\n ([f2996b73](https://github.com/angular/material/commit/f2996b734fd7574ad484f258f1fd674de62d64b5))\n\n\n#### Bug Fixes\n\n* **card:** fixes selector to be more specific ([2f840b2a](https://github.com/angular/material/commit/2f840b2a221959a9101471ccb86da7a216ab80fd))\n* **gesture:**\n  * make sure clicks properly support keys ([c6d24eb2](https://github.com/angular/material/commit/c6d24eb2dfb7c3c23f08e09ae7f22812fe395516))\n  * fix firefox keyboard events ([79196c3d](https://github.com/angular/material/commit/79196c3df13906c0221a9f0b4e2bab9c0c25825e))\n  * only hijack click events on mobile devices ([ade65b60](https://github.com/angular/material/commit/ade65b6023021350a9a6d50d5d3245104766fe82))\n* **theming:**\n  * fix warning for `changeTheme` being wrong ([f44bf604](https://github.com/angular/material/commit/f44bf6040dea4c1816922f595ec7e38213f914c6))\n* **checkbox:**\n  * make `mdAria` check linked element ([3346532c](https://github.com/angular/material/commit/3346532ca1deba489fb79bccc0047f4f9f10e8da))\n* **build:**\n  * add annotations to `rAfDecorator`, remove unused args ([c4927f9e](https://github.com/angular/material/commit/c4927f9e4ca1ffd21550e5eefb08b34c8840d02b))\n  * add annotation to `swipe.js` ([22040c77](https://github.com/angular/material/commit/22040c77b4f82dd9845ad6bcfab9ab62a534170c))\n* **button:**\n  * change default style of fab to white instead of transparent ([04feeb83](https://github.com/angular/material/commit/04feeb836ae5508d4c0349f125d13b75dd63b7b3))\n  * default background-color on fab buttons on toolbar ([08ebff44](https://github.com/angular/material/commit/08ebff4405f75d305c24eca3549668bbc84d7ce8))\n* **card:**\n  * allow img to have a wrapper ([349b521e](https://github.com/angular/material/commit/349b521e550c48a55713659d8d6fc2f4e1719a74))\n* **dialog:** fix overlay not covering, dialog position in overlay ([1d5ef95d](https://github.com/angular/material/commit/1d5ef95d2a1daa91bcad98d460eec49923ea5233))\n* **input:**\n  * dont add focus/blur class if readonly ([6333b72c](https://github.com/angular/material/commit/6333b72c2cd50d848924e694237772371fefa759), closes [#1203](https://github.com/angular/material/issues/1203))\n  * fix input padding & border on iOS ([7dab2060](https://github.com/angular/material/commit/7dab2060dd6f1c07dcb7186a1de360c20d3014fd), closes [#1164](https://github.com/angular/material/issues/1164))\n  * remove default Firefox invalid input styling ([ba65437b](https://github.com/angular/material/commit/ba65437b452835c96bba9a7681710aec253264de), closes [#1165](https://github.com/angular/material/issues/1165))\n  * add check for input value on blur ([ec53d1a1](https://github.com/angular/material/commit/ec53d1a1d02a92e3c8d71c25d354784709124fee), closes [#1201](https://github.com/angular/material/issues/1201))\n* **layout:** fix IE11 layout ([74fe3eb1](https://github.com/angular/material/commit/74fe3eb19b097611ed17f2f1459a5682b043387a), closes [#1227](https://github.com/angular/material/issues/1227))\n* **mdSwitch:** add missing styles to switch ([54338d7d](https://github.com/angular/material/commit/54338d7d4220fd0bb88af3e3b584c70fe5ac37ab), closes [#912](https://github.com/angular/material/issues/912))\n* **ripple:** fixes size issue with ripple on switches ([c435409b](https://github.com/angular/material/commit/c435409bfdcda51c5ba164c9013a3da1e5a03ce6))\n* **slider:**\n  * don't run touchend listener if disabled ([5bbd23d6](https://github.com/angular/material/commit/5bbd23d6ad6d944806943786a748329428620e79), closes [#1308](https://github.com/angular/material/issues/1308))\n  * make modelValue be set on pressdown ([7028a750](https://github.com/angular/material/commit/7028a75058338533696d75d532e7f13f6d6f1fff), closes [#1296](https://github.com/angular/material/issues/1296))\n  * fix thumb positioning so that it works when not visible ([41c2d65d](https://github.com/angular/material/commit/41c2d65d2d4344687959c0d13c2cf48b0c90a880), closes [#1210](https://github.com/angular/material/issues/1210))\n* **styles:** fix subheader z-index, button md-mini class, md-no-bar. ([dde9ab79](https://github.com/angular/material/commit/dde9ab7987c8df787ff72c3ce46b9247ffdf7aad), closes [#1182](https://github.com/angular/material/issues/1182), [#1034](https://github.com/angular/material/issues/1034), [#1173](https://github.com/angular/material/issues/1173), [#1194](https://github.com/angular/material/issues/1194))\n* **switch:** set tabindex to -1 while disabled ([19f47b5d](https://github.com/angular/material/commit/19f47b5dcbf3006fbc14a08d909bc0265058dfe0))\n* **tabs:**\n  * adds fix for css transition on theme change ([312dcc6c](https://github.com/angular/material/commit/312dcc6c51f81de8284f43959c30d51e286bca29), closes [#1033](https://github.com/angular/material/issues/1033))\n  * remove bad opacity on focus state ([72ced4b5](https://github.com/angular/material/commit/72ced4b5b93fd82dc3e7382850f964baffbda32c))\n  * prevents multiple pagination clicks during animation ([299e1556](https://github.com/angular/material/commit/299e15569783d4f666863ac3e9f6ceed237b6cf0), closes [#1207](https://github.com/angular/material/issues/1207))\n* **toast:**\n  * fix highlighting of action buttons ([53cffe29](https://github.com/angular/material/commit/53cffe2945006ea9f5e2171fa2fbaf73b7ac6d27))\n  * fix excess padding on md-action ([0f40a843](https://github.com/angular/material/commit/0f40a8431f5b807d43c2054c64d40008213d4cf5))\n\n\n<a name=\"0.7.0\"></a>\n### 0.7.0  (2015-01-24)\n\n\n#### Bug Fixes\n\n* **input:**\n  * fix bug regarding `md-maxlength` value changes ([b432277d](https://github.com/angular/material/commit/b432277d59614d2d23e4f651a1b3c46d76ec50ae))\n\n<a name=\"0.7.0-rc3\"></a>\n### 0.7.0-rc3  (2015-01-14)\n\n\n#### Bug Fixes\n\n* allow user selection when swipe listener is enabled ([520faa72](https://github.com/angular/material/commit/520faa72e8a1ebf9112d615097e939349997fc51), closes [#838](https://github.com/angular/material/issues/838))\n* **button:**\n  * fixes vertical alignment issue with `md-fab` button ([f71eb32a](https://github.com/angular/material/commit/f71eb32a0070bdbf6ea5613d7dce32a8fa22a02c), closes [#914](https://github.com/angular/material/issues/914))\n  * adds a safe disabled-check for ripples ([9091741f](https://github.com/angular/material/commit/9091741f80002352ef16901d7abdd860631dce68), closes [#1029](https://github.com/angular/material/issues/1029))\n  * fix usages with ngDisabled ([416079b7](https://github.com/angular/material/commit/416079b787becfe584d0633ae8e7946e4309f438), closes [#1074](https://github.com/angular/material/issues/1074))\n* **dialog:**\n  * fix dialog alignment in IE11 ([240c03aa](https://github.com/angular/material/commit/240c03aa188520a20e0416095c20ace8a685fca3), closes [#790](https://github.com/angular/material/issues/790))\n  * fix margin-top when layout is row ([191df15a](https://github.com/angular/material/commit/191df15abf13cae397f7e9c3c73db956842dfee3))\n* **input:** fix label inputs with specified types ([747c6acb](https://github.com/angular/material/commit/747c6acb1835ce388215d8ecc0794ec4da67a43b))\n* **layout:** make sure hide-gt-* and show-gt-* work together properly ([d149f36b](https://github.com/angular/material/commit/d149f36b6ab2a24d22e0246d4db8c030dcb84f96), closes [#772](https://github.com/angular/material/issues/772))\n* **radioGroup:** fix render call happing before radioGroup init ([68e350d1](https://github.com/angular/material/commit/68e350d11dcd15ae07c495e6859ba32f47d79836))\n* **subheader:** make content clickable ([7178b6d6](https://github.com/angular/material/commit/7178b6d674336a8d9ee718b58fb2f1aece85c80b), closes [#554](https://github.com/angular/material/issues/554))\n* **tabs:**\n  * fix overflow leaking out tab-content ([dec2ac42](https://github.com/angular/material/commit/dec2ac42ebec04070e81fe1a664e7be906f0b4a4))\n  * factors `me-active` attribute into selection logic to prevent unnecessary `md-on ([6a087a01](https://github.com/angular/material/commit/6a087a01656b3e8f6ba2e87b40b0611519b75c2b), closes [#868](https://github.com/angular/material/issues/868))\n  * adds a delayed call to update the ink bar after a tab is removed ([1a1095b0](https://github.com/angular/material/commit/1a1095b0fae19e4b6df80027f57870e7aff7b97f), closes [#573](https://github.com/angular/material/issues/573))\n* **theming:** make switch, checkbox, radio button default to primary color for consistency ([8cbfeadf](https://github.com/angular/material/commit/8cbfeadfb32e19e855b6280983784fe0a8a516cb))\n\n\n#### Features\n\n* **input:** add error states, md-maxlength ([a2bc3c68](https://github.com/angular/material/commit/a2bc3c68551b4915c40a4eca9ec48fa9ec61f6b7))\n* **layout:** add flex-order-{sm,gt-sm,md,gt-md,lg,gt-lg} attributes ([3e453078](https://github.com/angular/material/commit/3e4530785c29650ff46cf7688f0b154adb9a7042))\n* **tooltip:** add configurable md-delay attr, default 400ms. ([e4ed530d](https://github.com/angular/material/commit/e4ed530d8000b6e31c9e4e7d52e402b9b76debd2), closes [#713](https://github.com/angular/material/issues/713))\n\n\n<a name=\"0.7.0-rc2\"></a>\n### 0.7.0-rc2  (2015-01-08)\n\n\n#### Bug Fixes\n\n* **$mdUtil:** fix bugs in iterator's `next()`/`previous()` methods Refactor for DRY-ness `next ([124466e7](https://github.com/angular/material/commit/124466e71945a4515a7b5742310594e8753c4314))\n* **$mdComponentRegistry:** gracefully recover if no md-component-id is specified ([bf2266f1](https://github.com/angular/material/commit/bf2266f15a6d2c8cc299f083544955b1d1f0dc69))\n* **demos:** tab dynamic demo removes use of on-select expressions ([4db16c17](https://github.com/angular/material/commit/4db16c17fa617c53fd8436de00386826e08b602b))\n* **mdDialog:**\n  * fix dialog border radius visual overflow glitch ([9b162202](https://github.com/angular/material/commit/9b162202721a2a60884e8edf4e02f754e9bef447), closes [#1015](https://github.com/angular/material/issues/1015))\n  * prevent null-pointer error with popInTarget ([b36282a5](https://github.com/angular/material/commit/b36282a586d700831006c750d1df743bb16c6194), closes [#1061](https://github.com/angular/material/issues/1061))\n* **input:** fix height on IE11 ([dc31ee53](https://github.com/angular/material/commit/dc31ee53bb88dcc782b7aaa9c9ade31085ab3e69))\n* **layout:**\n  * fix 'layout-padding' rule not having comma ([b35be936](https://github.com/angular/material/commit/b35be936cab8118c7de483c5065b6db56018e855), closes [#952](https://github.com/angular/material/issues/952))\n  * layout-fill in firefox ([31d3c123](https://github.com/angular/material/commit/31d3c123185c6fe3e0db95674cccefb2b8884bca))\n  * layout-wrap fixed and documented ([8f937bd2](https://github.com/angular/material/commit/8f937bd2df7e43d0343f5e89e154f6b0a3c89ecc))\n* **mdButton:**\n  * fix fab vertical positioning ([641e2272](https://github.com/angular/material/commit/641e2272ce1cad731a59f015bede4a97fa2fca53), closes [#1031](https://github.com/angular/material/issues/1031))\n  * fix error when md-button is disabled anchor ([48e5a8bc](https://github.com/angular/material/commit/48e5a8bc365e89f1d0446758a7211f5773956443), closes [#1074](https://github.com/angular/material/issues/1074))\n* **mdCard:** add an md-card-content container inside md-card for content ([28a4f8ff](https://github.com/angular/material/commit/28a4f8ff4d3b1d7b123152a01ef71e767fc315ff), closes [#265](https://github.com/angular/material/issues/265))\n* **mdMedia:** avoid unnecessary digest and make changes apply quicker ([98247bcf](https://github.com/angular/material/commit/98247bcf22df9ef96e4dd0197d61e6b9b69e1b6d), closes [#978](https://github.com/angular/material/issues/978))\n* **mdRadioButton:** Loosen equality check ([ca3e4c30](https://github.com/angular/material/commit/ca3e4c306af3e4a49670a379d759f0448b42ca95), closes [#1112](https://github.com/angular/material/issues/1112))\n* **mdToolbar:** Toolbar flow on medium screens ([bfc947f6](https://github.com/angular/material/commit/bfc947f66b2a2568dc76ca3278eb9b5f83424a2f))\n* **mdUtil:**\n  * fix `throttle()` delay check ([fdb923e4](https://github.com/angular/material/commit/fdb923e40f98422ff75cbcaf137ead2233c64c68), closes [#977](https://github.com/angular/material/issues/977))\n  * remove/delete cacheFactory keys when clearing/destroying cache ([8736c7cc](https://github.com/angular/material/commit/8736c7ccf019df417e6b7834b55a1cc157a6ac64))\n* **mdRadioButton:** arrowkey navigation with disabled buttons ([f520d507](https://github.com/angular/material/commit/f520d50710e6e93686736c4f5a97e54bb9bb7518), closes [#1040](https://github.com/angular/material/issues/1040))\n* **mdSidenav:** Fix tests and typo ([c0e2b0fb](https://github.com/angular/material/commit/c0e2b0fbba0006ab2ea8930544c380d207dfea1a))\n* **mdTabs:**\n  * make md-tab-label visible on IE11 ([b85ad629](https://github.com/angular/material/commit/b85ad6296f49be7fa5ce95cbbbec49d650912e46), closes [#1057](https://github.com/angular/material/issues/1057))\n  * pagination only call watcher() when it's a function ([e952ab41](https://github.com/angular/material/commit/e952ab4100826a5ff2e36efe71d5d6b8d49df2b2), closes [#1073](https://github.com/angular/material/issues/1073))\n  * delays disconnect until after the digest is finished ([78ba497e](https://github.com/angular/material/commit/78ba497e443ca31e8a8c97f11db281f743f6aca0), closes [#1048](https://github.com/angular/material/issues/1048))\n* **theming:**\n  * switch accent palette to use accent hues ([002d8bfd](https://github.com/angular/material/commit/002d8bfde5aa0c240ebd054297227e499f9c3bf4))\n  * allow hex values with uppercase letters ([9b45af50](https://github.com/angular/material/commit/9b45af50fd894d9e9451b833bb9c2edb1ff2e750), closes [#1014](https://github.com/angular/material/issues/1014))\n\n\n#### Features\n\n* **mdDialog:** disable scrolling on parent while showing dialog ([993fa2bc](https://github.com/angular/material/commit/993fa2bc00598dd18227b12bb197f2d9c667ea75))\n* **input:**\n  * add <md-input-container> parent for inputs/textareas, deprecate md-text-float ([60fcd6f4](https://github.com/angular/material/commit/60fcd6f4d8b895162b37a940c3f33164d8044382), closes [#993](https://github.com/angular/material/issues/993), [#553](https://github.com/angular/material/issues/553), [#654](https://github.com/angular/material/issues/654), [#993](https://github.com/angular/material/issues/993))\n  * support md-warn for theming ([6acacc53](https://github.com/angular/material/commit/6acacc5382940a7ce1b393d0f4cdda6a0ffa615c), closes [#1137](https://github.com/angular/material/issues/1137))\n* **textarea:** make textarea autogrow with size of content ([1c653696](https://github.com/angular/material/commit/1c65369629080ddb6b2c4a981ae00533f5c303b1), closes [#565](https://github.com/angular/material/issues/565))\n* **layout:** add layout-align-{sm,gt-sm,md,gt-md,lg,gt-lg} attrs ([8550bd6c](https://github.com/angular/material/commit/8550bd6c9353914083bf75328c0160027202d237), closes [#631](https://github.com/angular/material/issues/631))\n* **mdRadioGroup:** Radio submits on keydown/enter ([03c75927](https://github.com/angular/material/commit/03c7592798f904ac7a59b4a1c580672ca7c4789f), closes [#577](https://github.com/angular/material/issues/577))\n* **mdSlider:** make discrete track ticks themable ([91bc598f](https://github.com/angular/material/commit/91bc598fab00150e26b11a2c7a0e7c9b3b364bec), closes [#621](https://github.com/angular/material/issues/621))\n* **mdSwitch:** add grab/grabbing cursor during drag ([c60640bf](https://github.com/angular/material/commit/c60640bf4305cbd42d899db5b2adfe8601096d1b), closes [#983](https://github.com/angular/material/issues/983))\n* **mdTabs:** adds default transitions for tab content ([3ee83a64](https://github.com/angular/material/commit/3ee83a645b9e4da8f4c0f2e6cbf772f504d8e9a9), closes [#1044](https://github.com/angular/material/issues/1044), [#717](https://github.com/angular/material/issues/717), [#811](https://github.com/angular/material/issues/811))\n* **$mdToast:** add mdToast#showSimple shortcut method ([dd960c6f](https://github.com/angular/material/commit/dd960c6fce3dfc041ab2ee6c27f6574cfae75185))\n\n\n#### Breaking Changes\n\n* md-text-float has been deprecated due to flaws (explanation in [#547](https://github.com/angular/material/issues/547)).\n\nTo create an input, you now must use the native `<input>` and `<textarea>`\nelements, with a `<md-input-container>` parent around each\n`<input>` or `<textarea>`.\n\nChange your code from this:\n\n```html\n<md-text-float label=\"First Name\" ng-model=\"firstName\"></md-text-float>\n```\n\nTo this:\n\n```html\n<md-input-container>\n  <label>First Name</label>\n  <input ng-model=\"firstName\">\n</md-input-container>\n```\n\n* md-card now requires a separate `md-card-content` element\ncontaining the card's content.  This was done to fix padding problems\nwith the content.\n\nChange your code from this:\n\n```html\n<md-card>\n  <img src=\"img/washedout.png\" alt=\"Washed Out\">\n  <h2>Paracosm</h2>\n  <p>\n    The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n    two most important words in Ernest Greene's musical language: feel it.\n  </p>\n</md-card>\n```\n\nTo this:\n\n```html\n<md-card>\n  <img src=\"img/washedout.png\" alt=\"Washed Out\">\n  <md-card-content>\n    <h2>Paracosm</h2>\n    <p>\n      The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n      two most important words in Ernest Greene's musical language: feel it.\n    </p>\n  </md-card-content>\n</md-card>\n```\n\n ([28a4f8ff](https://github.com/angular/material/commit/28a4f8ff4d3b1d7b123152a01ef71e767fc315ff))\n\n\n<a name=\"0.7.0-rc1\"></a>\n### 0.7.0-rc1  (2014-12-19)\n\n\n#### Bug Fixes\n\n* **$$interimElement:** make templates work with custom interpolation symbols ([d5aa68d1](https://github.com/angular/material/commit/d5aa68d1d7b146a30c45580d10c2e70bc736db95))\n* **build:** correct  in buildConfig.js ([6caccf75](https://github.com/angular/material/commit/6caccf7577aeb877ce294111adb4e21a74cad171), closes [#981](https://github.com/angular/material/issues/981))\n* **button:** fix hover on flat buttons ([de587772](https://github.com/angular/material/commit/de58777211bad5b5c31d5a7afe16adc498569be7))\n* **checkbox:**\n  * only add focus border if label is not empty ([74973487](https://github.com/angular/material/commit/749734876d9c39021b1d210f89ff51e1ca3c77e9), closes [#944](https://github.com/angular/material/issues/944))\n  * added css support for disabled states ([d1920839](https://github.com/angular/material/commit/d19208397c946222c28ce1d6644930bb1c255e83))\n* **demo:** Update slider demo to work in IE11 ([39559808](https://github.com/angular/material/commit/395598089bef548b76282679da71a05aeab1bf25), closes [#653](https://github.com/angular/material/issues/653))\n* **filenames:** updated component .scss names to match conventions ([629b753f](https://github.com/angular/material/commit/629b753ff348b805e4ff73a2f66d354f2d42841d))\n* **layout:** `flex=\"n\"` attrs set height for column layout, width for row ([d3577798](https://github.com/angular/material/commit/d3577798c7384a003f0fa548e948c6201e86491d), closes [#937](https://github.com/angular/material/issues/937))\n* **mdToast:** Puts index above dialog ([4ae4e072](https://github.com/angular/material/commit/4ae4e072020fe1e59da69e23500c134463936ee7), closes [#903](https://github.com/angular/material/issues/903))\n* **switch:** only add focus border if label is not empty ([9c24cc93](https://github.com/angular/material/commit/9c24cc93497aa228a9513e40c15303edd73d865c), closes [#944](https://github.com/angular/material/issues/944))\n* **tooltip:** fix bugs in Safari & Firefox, as well as scrolling bugs ([0d265292](https://github.com/angular/material/commit/0d2652928b11e899f7a88a6f497720226d65f228), closes [#593](https://github.com/angular/material/issues/593))\n\n\n#### Features\n\n* **theming:** use $mdThemingProvider ([47f0d09e](https://github.com/angular/material/commit/47f0d09e9ebd87891703fa2b7e81355ce3952a86))\n\n\n#### Breaking Changes\n\n* Themes are no longer defined by linked CSS files.\n\nThemes are now defined through Javascript only. A 'theme template' is\nbundled into angular-material.js, and then Javascript is used to\ngenerate theme css for every theme the user defines.\n\nThe `default` theme is still shipped with angular-material.\n\nIf you used another theme (for example, the `purple` theme), change your code from this:\n\n```html\n<link rel=\"stylesheet\" href=\"/themes/purple-theme.css\">\n<div md-theme=\"purple\">\n  <md-button class=\"md-primary\">Purple</md-button>\n</div>\n```\n\nTo this:\n\n```js\nvar app = angular.module('myApp', ['ngMaterial']);\napp.config(function($mdThemingProvider) {\n  //will use the colors from default theme for any color not defined.\n  $mdThemingProvider.theme('purple')\n    .primaryColor('purple');\n});\n```\n```html\n<div md-theme=\"purple\">\n  <md-button class=\"md-primary\">Purple</md-button>\n</div>\n```\n\nFor more information, read the updated [Theme](https://material.angularjs.org/#/Theming/01_introduction) documentation -  ([47f0d09e](https://github.com/angular/material/commit/47f0d09e9ebd87891703fa2b7e81355ce3952a86))\n\n\n<a name=\"0.6.1\"></a>\n## 0.6.1  (2014-12-08)\n\n#### Bug Fixes\n\n* **checkbox:**\n  * fixes issue where double-clicking checkboxes causes text selection ([5d2e7d47](https://github.com/angular/material/commit/5d2e7d47ff88e2a0c52382baf56a7101c2e1c16b), closes [#588](https://github.com/angular/material/issues/588))\n  * expands the checkbox click radius ([9cd24e2e](https://github.com/angular/material/commit/9cd24e2e21ee3e1c0abd57a30f501165f942f541), closes [#379](https://github.com/angular/material/issues/379))\n* **compiler:** trim whitespace from templates (effects toast, bottomSheet, etc) ([3be3a527](https://github.com/angular/material/commit/3be3a527da3a5a6f47370cde0f4ba734ff2f9f85))\n* **dialog:** transition in and out properly to/from click element ([1f5029d0](https://github.com/angular/material/commit/1f5029d0a7643fa1aa3fb970c281e261ac4de24d), closes [#568](https://github.com/angular/material/issues/568))\n* **layout:** make [hide] attr work properly with all device sizes ([c0bbad20](https://github.com/angular/material/commit/c0bbad209c2008bbe881fe896d4bc0cec018305b))\n* **mdMedia:** support all prefixes: sm,gt-sm,md,gt-md,lg,gt-lg ([c1cb9951](https://github.com/angular/material/commit/c1cb99512c1dc226f59fa3c6fe397af887263cb3))\n* **ripple:** fixes an error caused when clicking on disabled checkboxes ([8a1718d7](https://github.com/angular/material/commit/8a1718d7aac6660060ad2265ce6cd7e2c4d87e2c))\n* **slider:**\n  * update the thumb text when the model is updated ([2ca21f8b](https://github.com/angular/material/commit/2ca21f8bfcf28938dde98b44b6596f43caa95a2d), closes [#791](https://github.com/angular/material/issues/791))\n  * reposition when min or max is updated ([bd6478b9](https://github.com/angular/material/commit/bd6478b958ed464bed8608335d6304b8ec644fa7), closes [#799](https://github.com/angular/material/issues/799))\n* **tabs:**\n  * do not focus until pagination transition is done ([bb9bc82c](https://github.com/angular/material/commit/bb9bc82c4a89ba5796292111f9317cbd203bbf9f), closes [#781](https://github.com/angular/material/issues/781))\n  * dont use focusin event on firefox ([5559ac63](https://github.com/angular/material/commit/5559ac63ed460bb7ee8d3e4b409b9deebac9394a), closes [#781](https://github.com/angular/material/issues/781))\n* **toolbar:** use accent color for buttons inside ([12d458e3](https://github.com/angular/material/commit/12d458e3985cba5940107c302887f856837fd226))\n* **tooltip:** make it appear above dialogs ([a3ce7d84](https://github.com/angular/material/commit/a3ce7d84ec39771ecbfbf6ad8106a05c9a0bd319), closes [#735](https://github.com/angular/material/issues/735))\n\n\n#### Features\n\n* **layout:** add both layout-margin and layout-padding attributes ([5caa22b2](https://github.com/angular/material/commit/5caa22b2c444485b3d340cda662d8808b1fc381d), closes [#830](https://github.com/angular/material/issues/830))\n* **toast:** simple with content string: '$mdToast.simple('my-content')` ([554beff3](https://github.com/angular/material/commit/554beff3089e680c4c63b17bf271910f668a7140), closes [#833](https://github.com/angular/material/issues/833))\n\n\n\n<a name=\"0.6.0-rc3\"></a>\n## 0.6.0-rc3  (2014-11-26)\n\n\n#### Bug Fixes\n\n* **dialog:** correct the opening position when opening from a button ([22865394](https://github.com/angular/material/commit/228653942b32e4bf9d7a07af5a8203e4c2052132), closes [#757](https://github.com/angular/material/issues/757))\n* **hide:** make hide-gt-* attrs work properly with larger show attrs ([7fc6b423](https://github.com/angular/material/commit/7fc6b42314fbeb9024ba482a8407737100837604))\n* **ripple:** prevent null error while using ripple ([6d81ded1](https://github.com/angular/material/commit/6d81ded16b871ee5772ce8e0d06690c5c210c0ca))\n\n\n<a name=\"0.6.0-rc2\"></a>\n## 0.6.0-rc2  (2014-11-24)\n\nThis version introduces more breaking layout changes, ripple improvements,\naria improvements, bug fixes, and documentation enhancements.\n\n\n#### Bug Fixes\n\n* **button:** add override for transitions on ng-hide ([8fa652cf](https://github.com/angular/material/commit/8fa652cfb85aca2fe454c97b81ab306a4f9eb5e9), closes [#678](https://github.com/angular/material/issues/678))\n* **layout:** add [flex-{sm,md,etc}] attr for 100% flex on screen size ([7acca432](https://github.com/angular/material/commit/7acca432aa0e18cebf1420d00ccc24e011fd9f53), closes [#706](https://github.com/angular/material/issues/706))\n* **ripple:**\n  * fix ripple bug with checkboxes in lists ([7d99f701](https://github.com/angular/material/commit/7d99f701f8eaafc8a3d1210182e82f63ec99fffb), closes [#679](https://github.com/angular/material/issues/679))\n  * fix bug with vertical ripple alignment ([5cdcf29a](https://github.com/angular/material/commit/5cdcf29a524d5f371d5f9170129e5166a8ac5b27), closes [#725](https://github.com/angular/material/issues/725))\n* **sidenav:** use flex display when opened ([ae1c1528](https://github.com/angular/material/commit/ae1c15281f5b07426c97cee16ae1efb836168679), closes [#737](https://github.com/angular/material/issues/737))\n\n#### Features\n\n* **mdAria:** checks child nodes for aria-label ([d515a6c2](https://github.com/angular/material/commit/d515a6c27e7fcdddc3ab7c7e88c93ef9b285dc7e), closes [#567](https://github.com/angular/material/issues/567))\n* **mdBottomSheet:** add escape to close functionality ([d4b4480e](https://github.com/angular/material/commit/d4b4480ee5ae025c9d0dbab86a37a2294a09234e))\n* **tabs:** ink ripple color syncs with ink bar ([9c56383b](https://github.com/angular/material/commit/9c56383b63f33aa9c4478ff0d1de6f1422938d4e))\n\n\n#### Breaking Changes\n\n* The -phone, -tablet, -pc, and -tablet-landscape\nattribute suffixes have been removed and replaced with -sm, -md, and -lg\nattributes.\n\n* hide-sm means hide only on small devices (phones).\n* hide-md means hide only on medium devices (tablets)\n* hide-lg means hide only on large devices (rotated tablets).\n\nAdditionally, three new attribute suffixes have been provided for more flexibility:\n\n* hide-gt-sm means hide on devices with size greater than small\n (bigger than phones).\n* hide-gt-md means hide on devices with size greater than medium\n (bigger than tablets)\n* hide-gt-lg means hide on devices with size greater than large\n (bigger than rotated tablets).\n\nSee the [layout options\nsection](http://material.angularjs.org/#/layout/options)\nof the website for up-to-date information.\n\n ([a659c543](https://github.com/angular/material/commit/a659c5432f95fa62ee79977d2a2d45221600c077))\n\n\n<a name=\"0.6.0-rc1\"></a>\n## 0.6.0-rc1  (2014-11-18)\n\nv0.6.0-rc1 releases the following changes:\n\n- improvements to the ink Ripple effects\n- namespace prefixing Material attributes\n- revised the Layout system to be more intuitive and responsive\n- added enhancements for modular builds and distrbution for each component\n- improved minification and SHA tags for each deployed .js and .css file\n- numerous bug fixes to improve stability, adds responsive features, and enhances API documentation.\n\n#### Bug Fixes\n\n* **button:** fix css for md-fab icon position when href is present ([a7763fde](https://github.com/angular/material/commit/a7763fde0e62a36f31ee318349a847bee2fed4f0), closes [#591](https://github.com/angular/material/issues/591))\n* **card:** make md-card themeable ([55cdb5b7](https://github.com/angular/material/commit/55cdb5b7e78c3d70a7b205cf15f2ba05fb5d54b2), closes [#619](https://github.com/angular/material/issues/619))\n* **demos:** dialog, bottomsheet, and toast now display within properly within the bounding d ([5909f0a5](https://github.com/angular/material/commit/5909f0a56ea6e0ca04eb08df4b8b680eef771a50))\n* **docs:**\n  * fix error in flex docs ([a02469b2](https://github.com/angular/material/commit/a02469b23632e04bdd107949bec2561213ddf59a))\n  * improve responsive docs ([4a846b4c](https://github.com/angular/material/commit/4a846b4c2f87d29ee746b855a030d01af7ea1f4e))\n* **layout:** updates layout attributes in index template ([669d0048](https://github.com/angular/material/commit/669d0048e6397e9056a4e3cf4b936d1197979d87))\n* **md-button:** improve a11y: make title, aria-label work ([ff576289](https://github.com/angular/material/commit/ff576289bfed2eeec08ee7d743ddcaf0c441e3c7), closes [#512](https://github.com/angular/material/issues/512))\n* **ripple:** fix ripple sometimes appearing when the element is disabled ([58eaef49](https://github.com/angular/material/commit/58eaef49e931e4e7137a59485db627f461e594b7))\n* **sidenav:**\n  * make backdrop invisible when sidenav is locked-open ([4a75d599](https://github.com/angular/material/commit/4a75d5990176e1902db8626156f8518346ce0e60))\n  * clean registry when element is destroyed ([e7a3bd8d](https://github.com/angular/material/commit/e7a3bd8d03306593dbee292db85ed8147ae934eb), closes [#473](https://github.com/angular/material/issues/473))\n* **slider:** update discrete slider thumb text while dragging ([2877585e](https://github.com/angular/material/commit/2877585e6dbbf44199428c59601e954a3b31f1e1), closes [#622](https://github.com/angular/material/issues/622))\n* **themes:** bring blue, red, and green colors up to latest spec ([de3ff4b8](https://github.com/angular/material/commit/de3ff4b800955d204a8cce504332bd8d52f5b2cf))\n\n#### Features\n\n* **layout:**\n  * add new layout system ([d51a44c5](https://github.com/angular/material/commit/d51a44c5629763cb52c61df39881ef665448734e))\n  * add `layout-wrap` attribute to set flex-wrap to wrap ([4f755eab](https://github.com/angular/material/commit/4f755eab67046864e61eba8f4345688bed461863), closes [#634](https://github.com/angular/material/issues/634))\n* **styles:** add 'swift' css transitions to all components according to spec ([15bb142c](https://github.com/angular/material/commit/15bb142c0aa53e5fcfa421526a5fb0ab1c3e9b1e), closes [#611](https://github.com/angular/material/issues/611))\n* **mdThemingProvider:** add alwaysWatchTheme options, fix docs ([0a404088](https://github.com/angular/material/commit/0a4040886f288ed22fd0fef182eace13150cd732))\n* **radioGroup:** add up/down arrow navigation ([367e47db](https://github.com/angular/material/commit/367e47dbabf638154cd8155d9132f01aa05cd81b), closes [#538](https://github.com/angular/material/issues/538))\n* **tabs:** add accessibility links between tabs and content ([5d3bab56](https://github.com/angular/material/commit/5d3bab566ec71ff9f4a65faad7ef2674cd04c1b9))\n* **bottomSheet:** focus the first available button on open ([768cc098](https://github.com/angular/material/commit/768cc098fdc4b09e1c5f3faab526a7ed9e324702), closes [#571](https://github.com/angular/material/issues/571))\n* **interimElement:** allow options.parent to be a selector ([342051e0](https://github.com/angular/material/commit/342051e0af2ca5cd42555b30a47249006d6228b7), closes [#640](https://github.com/angular/material/issues/640))\n* **mdDialog:** enhance show API with *confirm()* and *alert()* builder functions. ([12b8cbc06](https://github.com/angular/material/commit/12b8cbc06065669df6b22b9bdbb6764398ff26fb). <br/>See [Demos](https://material.angularjs.org/#/demo/material.components.dialog) JavaScript source\n```js\n$mdDialog.show(\n      $mdDialog.alert()\n        .title('This is an alert title')\n        .content('You can specify some description text in here.')\n        .ariaLabel('Password notification')\n        .ok('Got it!')\n        .targetEvent(ev)\n    );\n```\n\n\n#### Breaking Changes\n\n* To provide improved clarity and easier usages, the Layout system has been revised ([d51a44c5](https://github.com/angular/material/commit/d51a44c5629763cb52c61df39881ef665448734e)). <br/>See the updated [Layout sections](https://material.angularjs.org/#/layout/container) for details. We associate labels with specific breakpoints:\n\n| Label | Size (dp) | Attribute |\n|--------|--------|--------|\n| Phone | 0  &lt;= size &lt;= 600 | layout-sm |\n| Tablet | 600  &gt; size &lt;= 960 | layout-md |\n| Tablet-Landscape | 960  &gt;= size &lt;= 1200 | layout-lg |\n| PC | &gt; 1200 | layout-gt-lg |\n\n> **<u>Example 1</u>**: To use a *horizontal* layout and responsively change to *vertical* for screen sizes < 600 dp:\n>```html\n<!-- original  '<div layout=\"vertical\" layout-sm=\"horizontal\">'  becomes -->\n<div layout=\"row\" layout-sm=\"column\">\n> ```\n>\n> **<u>Example 2</u>**: To use a *horizontal* layout and change to *vertical* for *phone* and *tablet* screen sizes:\n>```html\n<!-- original  '<div layout=\"vertical\" layout-md=\"horizontal\">'  becomes -->\n<div layout=\"row\" layout-sm=\"column\" layout-md=\"column\">\n```\n> **<u>Example 3</u>**: To show an element except when on a *phone* (or smaller) screen size:\n>```html\n<!-- original  '<div hide show-sm>'  becomes -->\n<div hide-sm>\n```\n> **<u>Example 4</u>**: To always hide an element, but show it only on phone (or smaller) devices:\n>```html\n<!-- original  '<div hide-sm>'  becomes -->\n<div hide show-sm>\n```\n\n* For performance, the *disabled* attribute is no longer supported; instead the *ng-disabled* attribute is now read to check if a component is disabled. ([2ece8cd7](https://github.com/angular/material/commit/2ece8cd794c4c28df4fb6a7683492da71aa2c382))\n> If you use the `disabled` attribute on a component to set whether\nit is disabled, change it to an ng-disabled expression.\n> Change your code from this:\n> ```html\n> <md-checkbox disabled></md-checkbox>\n> ```\n> To this:\n> ```html\n> <md-checkbox ng-disabled=\"true\"></md-checkbox>\n> ```\n\n* All material component attributes and are now namespaced with the `md-` prefix; these changes do not affect ng- prefixes or standard html5 prefixes ([eb2f2f8a](https://github.com/angular/material/commit/eb2f2f8a8c668142742e4b4c1e18cf6d91a533db)). Affected attributes:\n\n  * &lt;md-button **md-no-ink**=\"\" &gt;\n  * &lt;md-content&gt;    ([92b76435](https://github.com/angular/material/commit/92b76435df5cb88c7bba3289c04daf17c911eee0))\n    - **md-scroll-x**\n    - **md-scroll-y**\n    - **md-scroll-xy**\n  * &lt;md-divider **md-inset**=\"\" &gt;\n  * &lt;md-linear-progress **md-buffer-value**=\"someValue\" **md-mode**=\"query\" &gt;\n  * &lt;md-circular-rogress **md-mode**=\"query\" **md-diameter**=\"60\" &gt;\n  * &lt;md-sidenav&gt;\n    - **md-is-open**=\"isOpen\"\n    - **md-is-locked-open**=\"isLockedOpen\"\n    - **md-component-id**=\"my-sidenav\"\n  * &lt;md-tabs&gt;\n    - **md-selected**=\"selectedIndex\"\n    - **md-on-select**=\"doSomething()\"\n    - **md-on-deselect**=\"doSomething()\"\n    - **md-active**=\"tabIsActive\"\n  * &lt;md-text-float **md-fid**=\"someId\"&gt;\n\n* When using the `<md-button>` directive, the compiled element will now be a normal `<a>` or `<button>` element with the *class=\"md-button\"* attribute. ([d835f9ee](https://github.com/angular/material/commit/d835f9ee7e35ea72dc6a7bd154163386ea0f3ce3))\n> Any css referencing the `md-button` element selector\nshould now reference the `.md-button` class selector. Change your CSS overrides from this:\n>\n>```css\n>md-button {\n>  color: red;\n>}\n>```\n>\n>To this:\n>\n>```css\n>.md-button {\n>  color: red;\n>}\n>```\n\n\n<a name=\"0.5.0\"></a>\n## 0.5.1  (2014-10-31)\n\nVersion 0.5.0 introduces [theming support](https://material.angularjs.org/#/Theming/01_introduction), improves stability, adds responsive features, and enhances API documentation.\n\n#### Features\n\n* **theming:** introduce theming support, documented at [Theming Introduction](https://material.angularjs.org/#/Theming/01_introduction) ([80768270](https://github.com/angular/material/commit/807682707045de90d30a0718b3df963fef0dafc8))\n* **sidenav:**\n  * add `is-open` attribute binding ([f66795e8](https://github.com/angular/material/commit/f66795e8378299ccd84aea69a72f5cc0704589bc))\n  * add `is-locked-open` attribute binding with media query support ([105b0e0a](https://github.com/angular/material/commit/105b0e0ae6b2d30385d2aa8bee6190dd7ce1775c), closes [#446](https://github.com/angular/material/issues/446))\n\n#### Bug Fixes\n\n* **mdAria**: add better warnings ([3368c931](https://github.com/angular/material/commit/3368c931cee4638dac6dc26f7a4d8b37dc6e4858), closes [#366](https://github.com/angular/material/issues/366))\n* **md-input-group:** disable with ARIA ([72bad32a](https://github.com/angular/material/commit/72bad32ae4d48049e52602a4feda8eef9fbe6f0c))\n* **slider:** slider default value in ng-repeat corrected ([b652d863](https://github.com/angular/material/commit/b652d8634d2177ef8ec44cd163b4cf6d348c4795), closes [#479](https://github.com/angular/material/issues/479))\n* **css:**\n  * add autoprefixer support for firefox and ie ([a1bea485](https://github.com/angular/material/commit/a1bea485c7b97974f82a3a81b440964d70514eca))\n  * fix invalid flex properties ([c1d9b5a2](https://github.com/angular/material/commit/c1d9b5a2f58e33cdcffc85484ddce421121d2636))\n  * remove deprecated css properties ([c7e3a83c](https://github.com/angular/material/commit/c7e3a83c28cd145e77cc7d61db918cc881d1ea7c))\n* **textFloat:**\n  * improved logic to determine if md-input has a value ([5c407b5f](https://github.com/angular/material/commit/5c407b5fdfcf1c69cf69c06427ab0b166fecbed7))\n  * improve ARIA pairing links between label and input ([457b3750](https://github.com/angular/material/commit/457b37506c9f076b42e76cd8c1f591087d729a50), closes [#483](https://github.com/angular/material/issues/483))\n  * added support for label/hint expressions ([3674a514](https://github.com/angular/material/commit/3674a51437871a2366a65636127f8c6a6010f560), closes [#462](https://github.com/angular/material/issues/462))\n  * fix keyboard tabbing support ([27f43751](https://github.com/angular/material/commit/27f43751be83a7b3e3a1a92d052fe1e016525ff1), closes [#458](https://github.com/angular/material/issues/458))\n\n#### Breaking Changes\n\n* **colors:**\n  * The `md-theme-*` classes have all been removed, in favor of themes.\n  * Instead, use `md-primary` and `md-warn` classes on an element when a theme is set.\n* **bottomSheet:**\n  * `list` class has been renamed to `md-list`\n  * `grid` class has been renamed to `md-grid`\n  * `has-header` class has been renamed to `md-has-header`\n  * `grid-text` class has been renamed to `md-grid-text`.\n* **button:**\n  * `md-button-colored` class has been changed to `md-primary` and `md-warn` color classes.\n  * All classes that start with `md-button-fab` now start with `md-fab`.\n    * `md-button-fab` to `md-fab`.\n    * `md-button-fab-top-left` to `md-fab-top-left`\n    * `md-button-fab-top-right` to `md-fab-top-right`\n    * `md-button-fab-bottom-left` to `md-fab-bottom-left`\n    * `md-button-fab-bottom-right` to `md-fab-bottom-right`\n  * `md-button-cornered` class has been changed to `md-cornered`\n  * `md-button-icon` class has been changed to `md-icon`\n  * `md-button-raised` class has been changed to `md-raised`\n* **content:** `md-content-padding` class has been renamed to `md-padding`.\n* **dialog:**\n  * `dialog-content` class has been removed. Use an `md-content` element instead.\n  * `dialog-actions` has been renamed to `md-actions`\n* **subheader:** `md-subheader-colored` is now `md-primary`.\n* **textFloat:**\n  * use of `<md-input-group>` is deprecated, `<md-text-float>` markup can be used for most cases\n* **toast:** `toast-action` has been renamed to `md-action`\n* **toolbar:**\n  * `md-toolbar-tall` class has been renamed to `md-tall`\n  * `md-toolbar-medium-tall` class has been renamed to `md-medium-tall`\n* **whiteframe:** md-whiteframe-z\\* classes no longer set z-index, only shadow\n\n<a name=\"0.4.2\"></a>\n## 0.4.2  (2014-10-16)\n\nThis release adds support for the [official Angular 1.3 release](https://github.com/angular/angular.js/blob/master/CHANGELOG.md) and includes improvements to both the document generator and component demos.\n\n> Note that `<md-input-group>` and `<md-input>` are deprecated in favor on `<md-text-float>`. While both directives are still available for more granular control, developers are encouraged to use the `<md-text-float>` directive whenever possible.\n\n\n#### Features\n\n* **text-float:** Add floating label text field ([25cf6f1](https://github.com/angular/material/commit/25cf6f116b9d3044894aaf6d3244c5395cd4a6c2))\n\n\n#### Bug Fixes\n\n* Focus management for docs views ([9afe28a8](https://github.com/angular/material/commit/9afe28a87fdd2840428f904345442dcfc898708f))\n* **bottomSheet:** use position:fixed so it does not move ([bfaf96d8](https://github.com/angular/material/commit/bfaf96d875665fff3cbc2158d05a5be54c85c9cf))\n* **ripple:** use contentParent scroll offset ([4c0c50e4](https://github.com/angular/material/commit/4c0c50e4036b880b67cd40d885d322a326a84e68), closes [#416](https://github.com/angular/material/issues/416))\n* **slider:**\n  * disabled sliders still usable w/ keys ([f78f1b34](https://github.com/angular/material/commit/f78f1b3467a6c38f2d91921917b677de8c2d3a3c))\n  * disabled discrete sliders still usable ([1f5ce090](https://github.com/angular/material/commit/1f5ce090c6df413d612a92d5807ae01896b0c058))\n* **subheader:** sort items correctly in browsers that dont support true/false ([d8e5079e](https://github.com/angular/material/commit/d8e5079e32224b3522aa9e5ebef03185d6f6bf4d), closes [#438](https://github.com/angular/material/issues/438))\n* **tabs:** remove tabs all at once on controller destroy ([7237767d](https://github.com/angular/material/commit/7237767dc3e847e5ff24470177e736b962b86377), closes [#437](https://github.com/angular/material/issues/437))\n\n<a name=\"0.4.1\"></a>\n## 0.4.1  (2014-10-15)\n\nVersion 0.4.1 changes the prefix for all services and directives from 'material' to 'md'.\n\nTo migrate your code, replace all instances of 'material' in your project with 'md':\n\n```sh\nsed -i '' 's/material/md/g' $(echo my-material-project/app/**/*.{js,html,css})\n```\n\nAdditionally, `material-linear-progress` has been renamed to `md-progress-linear` and `material-circular-progress` has been renamed to `md-progress-circular`.\n\n`angular-aria` is now a dependency. Be sure to include angular-aria.js before angular-material. See https://github.com/angular/bower-material#usage.\n\n<a name=\"0.4\"></a>\n## 0.4.0  (2014-10-06)\n\nVersion 0.4 incorporates four (4) new components: [circular progress](https://material.angularjs.org/#/material.components.progressCircular/readme/overview), [subheader](https://material.angularjs.org/#/material.components.subheader/readme/overview), [tooltip](https://material.angularjs.org/#/material.components.tooltip/readme/overview) and [bottom sheet](https://material.angularjs.org/#/material.components.bottomSheet/readme/overview). A [new API](#v0.4-breaking) has also been introduced for `$materialDialog` and `$materialToast`. Additionally, many small component functionality and performance issues have been resolved.\n\nv0.4 is tested on desktop Chrome, Safari and Firefox, as well as Android 4.4+ and iOS7.\n\n<a name=\"v0.4-breaking\"></a>\n#### Breaking Changes\n\nThe services `$materialDialog` and `$materialToast` have changed API(s). See section at bottom for [Change Details](#v0.4-breaking-details).\n\n#### Bug Fixes\n\n* **button:**\n  * no underline when button has a href ([948aef0d](https://github.com/angular/material/commit/948aef0db53e6fc7f679d913f08c4a80869d209d))\n  * disabled raised and fab buttons don't hover on focus ([6d0ca8fb](https://github.com/angular/material/commit/6d0ca8fb0c9946a8adef2161c95b1439977dd7e1), closes [#358](https://github.com/angular/material/issues/358))\n* **checkbox:** resolve TypeError for inputDirective.link ([4da56732](https://github.com/angular/material/commit/4da5673272599d5eb70bd82f54bfeefaa260c970))\n* **dialog:** cancel instead of hiding when user escapes/clicks out ([0cc21d47](https://github.com/angular/material/commit/0cc21d47e1f6c20ee5a9f15559771dbacaef1120))\n* **interimElement:** make cancel and hide not fail when no element is shown ([6162156d](https://github.com/angular/material/commit/6162156d13762b25fd4bd0110f4bc263ab9652c4))\n* **progress-linear:** Add aria, tests and better animations ([3b386276](https://github.com/angular/material/commit/3b3862765a5c70b6369bfc0fd6b0a30811382984), closes [#297](https://github.com/angular/material/issues/297))\n* **radio:** Radio button a11y ([05ed42de](https://github.com/angular/material/commit/05ed42de4fb52ec916b2fcc6e5a78d2d5ea164ad), closes [#310](https://github.com/angular/material/issues/310))\n* **toolbar:** Demo correct heading levels ([fd7697d6](https://github.com/angular/material/commit/fd7697d6697710fcfab1c1d02d8306b50897236f))\n* **ripple:**\n  * make detach method work properly ([c3d858a2](https://github.com/angular/material/commit/c3d858a24e1a931d073a17b3185c2cd79b2628de))\n  * ripple container self-removal NPE fixed. ([664ab996](https://github.com/angular/material/commit/664ab99621ca6fb52fc53ced877324a1b767347b))\n* **sidenav:**\n  * add `display: none;` while closed ([8f104012](https://github.com/angular/material/commit/8f10401265d13c6b35467a82362a0765cb9b2d2e), closes [#300](https://github.com/angular/material/issues/300))\n  * always leave >=56px of room, no matter the screensize ([13a26670](https://github.com/angular/material/commit/13a26670bbf8265ce235a37f642c05f17a2ea569), closes [#346](https://github.com/angular/material/issues/346))\n* **slider:** discrete mode supports live dragging and snap-to ([b231f1c0](https://github.com/angular/material/commit/b231f1c031918efedc96217349a45f3fba6d4726), closes [#331](https://github.com/angular/material/issues/331))\n* **textfield:**\n  * ng-model bindings now working and demo rendering fixed. ([e8f456fc](https://github.com/angular/material/commit/e8f456fcc77937d61f587eae0cbe6b93f943dc18))\n  * match float-label (light theme) specifications ([63eeb47f](https://github.com/angular/material/commit/63eeb47fe2ad38da6acb5b1854fae28e5e59abb6))\n\n#### Features\n\n* **progress-circular:** Add circular progress component ([07d56533](https://github.com/angular/material/commit/07d5653350d1ef2a9aa86689653bce62350bdb31), closes [#365](https://github.com/angular/material/issues/365))\n* **subheader:** add subheader component with sticky scroll ([7787c9cc](https://github.com/angular/material/commit/7787c9cc9cacde77fdef06b75ea231a58ed814ce), closes [#216](https://github.com/angular/material/issues/216))\n* **tooltip:** add tooltip component ([9f9b0897](https://github.com/angular/material/commit/9f9b0897b22b017b5e03754c4deac7a189b72235), closes [#354](https://github.com/angular/material/issues/354))\n* **bottomSheet** add bottomSheet component ([3be359c](https://github.com/angular/material/commit/3be359cc9aabed1613a51090c08f82abd3fa2bc3))\n\n\n<br/>\n<a name=\"v0.4-breaking-details\"></a>\n#### Details on Breaking Changes\n\n**1) $materialDialog**:\n\nChange your code from this:\n\n```js\nvar hideDialog = $materialDialog(options);\nhideDialog();\n```\n\nTo this:\n\n```js\n$materialDialog\n  .show(options)\n  .then(\n  function success(response) {},\n  function cancelled(reason) {}\n   );\n\n// Hides the dialog last shown with `show()`\n// and resolves the show() promise with `response`\n\n$materialDialog.hide(response);\n\n// Hides the dialog last shown and rejects the `show()`\n// promise with the `reason`\n\n$materialDialog.cancel(reason);\n```\n\nNote: If you previously provided a `controller` option to `$materialDialog`, that controller would be injected with a `$hideDialog` function. This feature no longer exists; use `$materialDialog.hide()`.\n\n<br/>\n\n**2) $materialToast**:\n\nChange your code from this:\n\n```js\nvar hideToast = $materialToast(options);\nhideToast();\n```\n\nTo this:\n\n```js\n$materialToast\n  .show(options)\n  .then(\n  function success(response) {},\n  function cancelled(reason) {}\n  );\n\n\n// Hides the dialog last shown with `show()`\n// and resolves the show() promise with `response`\n\n$materialToast.hide(response);\n\n// Hides the dialog last shown and rejects the `show()`\n// promise with the `reason`\n\n$materialToast.cancel(reason);\n\n```\n<br/>\nNote: If you previously provided a `controller` option to `$materialToast`, that controller would be injected with a `$hideToast` function. This feature no longer exists; use `$materialToast.hide()`.\n\n\n\n<a name=\"0.0.3\"></a>\n## v0.0.3  (2014-09-19)\n\nv0.0.3 includes many bug fixes, performance, and usability improvements to existing components, as well as introducing the slider, switch, divider, and linear progress components.\n\nAdditionally, accessibility support is added to material-button, material-checkbox, material-radio-button, material-slider, material-dialog and material-list. With added ARIA support including roles, states and properties, Angular Material directives now also communicate to users of assistive technologies. Additionally, tabIndex and focus management are handled dynamically where appropriate.\n\n0.0.3 is tested on desktop Chrome, Safari and Firefox, as well as Android 4.4+ and iOS 7+. Also tested with VoiceOver on OSX and iOS7, ChromeVox, JAWS, NVDA and ZoomText.\n\n#### Bug Fixes\n\n* **button:** don't use angular transclusion at all, manual only ([6b322729](https://github.com/angular/material/commit/6b32272908b8bbc2f171b4441a54e75dec3f66d9))\n* **card:** make it use up proper width with margin ([f33185ff](https://github.com/angular/material/commit/f33185ff9f7e7cc500b4cc75e26e2659f845c418), closes [#247](https://github.com/angular/material/issues/247))\n* **demo:** tab demos improved layout and accessibility ([8915c324](https://github.com/angular/material/commit/8915c32484f6ee663b2e8e61f070fc8f7cf1de5c))\n* **dialog:** use position:fixed instead of absolute ([6ba874d8](https://github.com/angular/material/commit/6ba874d8b70abc0a17314668734218fdaf756c42), closes [#249](https://github.com/angular/material/issues/249))\n* **iterator:** update add()/remove() logic ([6a596b32](https://github.com/angular/material/commit/6a596b326856d81b52ec5d21fba63afc25e9f37a))\n* **material-dialog:** Focus mgmt, ARIA attributes ([fe054ae6](https://github.com/angular/material/commit/fe054ae6cd7883c300b623d83e89211f8814d756))\n* **material-list:** Add semantics ([6e48cd35](https://github.com/angular/material/commit/6e48cd35b9b72ea07bab64c53756adfb1aafc97a))\n* **material-slider:** Adds missing ARIA role ([903cbc06](https://github.com/angular/material/commit/903cbc06df59d0cfb6d1545ae94763dcd63c7929))\n* **ripple:**\n  * fix bug with ripple and many clicks ([c2105c05](https://github.com/angular/material/commit/c2105c0599bf2f1fa9e0b1383f19c3e8d4a19c45))\n  * make checkbox only scale up to 1.0, looks good on ios ([ed65da9b](https://github.com/angular/material/commit/ed65da9b568d6b2c4ce4c99f5403f9bb86571af1))\n  * use css animations for performance ([96014e08](https://github.com/angular/material/commit/96014e08b47a5dc2e98dbccc7bd56af6a8f5670f))\n* **slider:** watch ngDisabled expr on non-isolate parent scope ([5f1923d5](https://github.com/angular/material/commit/5f1923d5d03061c3074899e590860c8d96b0eba3), closes [#272](https://github.com/angular/material/issues/272))\n* **switch:** correctly adjust when label will not fit on one line ([e912a838](https://github.com/angular/material/commit/e912a8386e6e6d3f0994bcf47db3cab7103dd947), closes [#80](https://github.com/angular/material/issues/80))\n* **tabs:**\n  * make the ink ripple use the color of the ink bar. ([c5ca159a](https://github.com/angular/material/commit/c5ca159aca912db1fc7cc1665306929f2f6d7046), closes [#280](https://github.com/angular/material/issues/280))\n  * don't paginate on initial load when width is 0 ([5f5435d1](https://github.com/angular/material/commit/5f5435d1b8f22c1202fe6fec0b895887e5cc03c5), closes [#271](https://github.com/angular/material/issues/271))\n  * use position: absolute container to fix ios bugs ([7d0a282f](https://github.com/angular/material/commit/7d0a282f9f6e00f55639bbc864edd4520a040785), closes [#220](https://github.com/angular/material/issues/220))\n  * Tab pagination/selection now works properly on iOS ([3410650d](https://github.com/angular/material/commit/3410650dcf21ad581c363f82f49453cb20f3342d), closes [#220](https://github.com/angular/material/issues/220), [#231](https://github.com/angular/material/issues/231))\n  * Tab pagination/selection now works properly on iOS ([c77c0e26](https://github.com/angular/material/commit/c77c0e260a151ec38801aeabd60dff29e3386ba2), closes [#220](https://github.com/angular/material/issues/220), [#231](https://github.com/angular/material/issues/231))\n  * remove window resize listener on $destroy ([4b887f1e](https://github.com/angular/material/commit/4b887f1e4f87cb51b9e5c99e24455de71a19906c), closes [#254](https://github.com/angular/material/issues/254))\n* **toolbar:**\n  * make scrollShrink work with transforms, better performance ([cf1ab59f](https://github.com/angular/material/commit/cf1ab59f7450be20cbddefe54a42c20e7fc16a58), closes [#295](https://github.com/angular/material/issues/295))\n  * typo onScroll -> onContentScroll ([cf31b1a5](https://github.com/angular/material/commit/cf31b1a58672ed70c20ccbc7c6856c62987b144d))\n\n\n#### Features\n\n* add hammerjs dependency ([e383e4f4](https://github.com/angular/material/commit/e383e4f4dc7a03f36ce874d25521ca2d3bf3f227))\n* **$materialToast:** add swipe-to-close functionality ([22285dc4](https://github.com/angular/material/commit/22285dc46d69771d56f4ea00e7df6fe1a95e4ae0))\n* **divider:** add implementation of the divider component ([e3aceeae](https://github.com/angular/material/commit/e3aceeae827a0a6ca132404aaaf4d1d90ebb84ae), closes [#194](https://github.com/angular/material/issues/194))\n* **docs:** added support for the doc app to show its associated Git SHA id/link ([02d2e5d2](https://github.com/angular/material/commit/02d2e5d2c3729314a46f0d864412a5445b9477cf))\n* **progressLinear:** Add linear progress indicator ([f87d0452](https://github.com/angular/material/commit/f87d0452453825f121773dec27f3cfd921bd9588), closes [#187](https://github.com/angular/material/issues/187))\n* **material-dialog:** on open focus `.dialog-close` or the last button ([8f756fc6](https://github.com/angular/material/commit/8f756fc608a38979e64ab258e2943778bb36bfd9), closes [#222](https://github.com/angular/material/issues/222))\n* **material-switch:** add switch component ([4975c743](https://github.com/angular/material/commit/4975c7432b814c1e401a48c8e5601ec7a30fa477), closes [#80](https://github.com/angular/material/issues/80))\n* **slider:** add full-featured slider component ([5ea4dbc2](https://github.com/angular/material/commit/5ea4dbc2cbb778884bb164d91fcf9b6262987e52), closes [#260](https://github.com/angular/material/issues/260), [#31](https://github.com/angular/material/issues/31))\n* **switch:** add focus styles ([8878ca7a](https://github.com/angular/material/commit/8878ca7aed861ac4c667cc96de61b8c2e09f9bac))\n* **tabs:** improvements to pagination, disabled tabs, and tab navigation. ([b4244bf3](https://github.com/angular/material/commit/b4244bf3a2d9b97c78361fd0b0189919a710e394))\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2022 Google LLC. https://angularjs.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Material Design for AngularJS Apps\n[![npm version](https://badge.fury.io/js/angular-material.svg)](https://www.npmjs.com/package/angular-material)\n[![Build Status](https://travis-ci.org/angular/material.svg)](https://travis-ci.org/angular/material)\n\n[Material Design](https://material.io/archive/guidelines/) is a specification for a\nunified system of visual, motion, and interaction design that adapts across different devices. Our\ngoal is to deliver a lean, lightweight set of AngularJS-native UI elements that implement the\nmaterial design specification for use in AngularJS single-page applications (SPAs).\n\n**AngularJS Material** is an implementation of Google's \n[Material Design Specification (2014-2017)](https://material.io/archive/guidelines/material-design/)\nfor [AngularJS](https://angularjs.org) (v1.x) developers.\n\nFor an implementation of the [Material Design Specification (2018+)](https://material.io/design/),\nplease see the [Angular Material](https://material.angular.io/) project which is built for\n[Angular](https://angular.io) (v2+) developers.\n\n### <a name=\"lts\"></a> End-of-Life\n\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n\nFind details on reporting security issues\n[here](https://github.com/angular/material/blob/master/SECURITY.md).\n\n![venn diagram](https://cloud.githubusercontent.com/assets/210413/5077572/30dfc2f0-6e6a-11e4-9723-07c918128f4f.png)\n\nAngularJS Material includes a rich set of reusable, well-tested, and accessible UI components.\n\nQuick Links:\n\n*  [API & Demos](#demos)\n*  [Building](#building)\n*  [Installing](#installing)\n\n\nPlease note that using the latest version of AngularJS Material requires the use of\n**[AngularJS](https://angularjs.org/) 1.7.2** or higher.\n\nAngularJS Material supports the browser versions defined in the `browserslist` field\nof our [package.json](package.json). Find out more on our\n[docs site](https://material.angularjs.org/latest/#browser-support).\n\nAngularJS Material supports the screen reader versions listed\n[here](https://material.angularjs.org/latest/#screen-reader-support).\n\n## <a name=\"demos\"></a> Online Documentation and Demos\n\n<div style=\"border: 1px solid #ccc\">\n  <img src=\"https://user-images.githubusercontent.com/3506071/93010488-11578980-f55b-11ea-9ea3-c4a7bffd20b9.png\" style=\"display:block;\">\n</div><br>\n\n- Visit [material.angularjs.org](https://material.angularjs.org/) online to review the API, see the\n  components in action via live demos, and to read our detailed guides which include the layout system,\n  theming system, typography, and more.\n- Or you can build the documentation and demos locally; see\n  [Build Docs & Demos](https://github.com/angular/material/tree/master/docs/README.md) for details.\n\n## <a name=\"building\"></a> Building\n\nDevelopers can build AngularJS Material using NPM and gulp.\n\nFirst install or update your local project's **npm** dependencies:\n\n```bash\nnpm install\n```\n\nInstall Gulp v3 globally:\n\n```bash\nnpm install -g gulp@3\n```\n\nThen run the **gulp** tasks:\n\n```bash\n# To build `angular-material.js/.css` and `Theme` files in the `/dist` directory\ngulp build\n\n# To build the AngularJS Material Docs and Demos in `/dist/docs` directory\ngulp docs\n```\n\nFor development, use the `docs:watch` **NPM** script to run in dev mode:\n\n```bash\n# To build the AngularJS Material Source, Docs, and Demos in watch mode\nnpm run docs:watch\n```\n\nFor more details on how the build process works and additional commands (available for testing and\ndebugging) developers should read the [Build Guide](docs/guides/BUILD.md).\n\n## <a name=\"installing\"></a> Installing Build (Distribution Files)\n\n#### NPM\n\nFor developers not interested in building the AngularJS Material library... use **NPM** to install\nand use the AngularJS Material distribution files.\n\nChange to your project's root directory.\n\n```bash\n# To get the latest stable version, use NPM from the command line.\nnpm install angular-material --save\n\n# To get the most recent, latest committed-to-master version use:\nnpm install http://github.com/angular/bower-material#master --save\n```\n\n#### Other Dependency Managers\n\nVisit our [distribution repository](https://github.com/angular/bower-material/blob/master/README.md)\nfor more details on how to install and use the AngularJS Material distribution files within your local\nproject.\n\n#### CDN\n\nCDN versions of AngularJS Material are available.\n\nWith the Google CDN, you will not need to download local copies of the distribution files. Instead,\nsimply reference the CDN urls to easily use those remote library files. This is especially useful\nwhen using online tools such as [CodePen](http://codepen.io/) or [Plunker](http://plnkr.co/).\n\n```html\n  <head>\n\n    <!-- AngularJS Material CSS now available via Google CDN; version 1.2.1 used here -->\n   <link rel=\"stylesheet\" href=\"https://ajax.googleapis.com/ajax/libs/angular_material/1.2.1/angular-material.min.css\">\n\n  </head>\n  <body>\n\n    <!-- AngularJS Material Dependencies -->\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-animate.min.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-aria.min.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-messages.min.js\"></script>\n\n    <!-- AngularJS Material Javascript now available via Google CDN; version 1.2.1 used here -->\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angular_material/1.2.1/angular-material.min.js\"></script>\n  </body>\n```\n\nDevelopers seeking the latest, most-current build versions can use [GitCDN.xyz](https://gitcdn.xyz/) to\npull directly from our [distribution repository](https://github.com/angular/bower-material):\n\n```html\n  <head>\n\n    <!-- AngularJS Material CSS using GitCDN to load directly from `bower-material/master` -->\n    <link rel=\"stylesheet\" href=\"https://gitcdn.xyz/cdn/angular/bower-material/master/angular-material.css\">\n\n  </head>\n  <body>\n\n    <!-- AngularJS Material Dependencies -->\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-animate.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-aria.js\"></script>\n    <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-messages.min.js\"></script>\n\n    <!-- AngularJS Material Javascript using GitCDN to load directly from `bower-material/master` -->\n    <script src=\"https://gitcdn.xyz/cdn/angular/bower-material/master/angular-material.js\"></script>\n\n  </body>\n```\n\nOnce you have all the necessary assets installed, add `ngMaterial` and `ngMessages` as dependencies for your\napp:\n\n```javascript\nangular.module('myApp', ['ngMaterial', 'ngMessages']);\n```\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n**AngularJS Material support has officially ended as of January 2022.**\n[See what ending support means](https://docs.angularjs.org/misc/version-support-status)\nand [read the end of life announcement](https://goo.gle/angularjs-end-of-life). Visit\n[material.angular.io](https://material.angular.io) for the actively supported Angular Material.\n\nPlease [use the latest AngularJS][latest-ng] and [AngularJS Material][releases] possible and keep in\nmind the guidance around AngularJS' [expression language][ng-expressions].\n\n## Supported Versions\n\n| Version | Supported | Status            | Comments |\n|---------|-----------|-------------------|----------|\n| 1.2.x   | :x:       | All support ended |          |\n| 1.1.x   | :x:       | All support ended |          |\n| <1.1.x  | :x:       | All support ended |          |\n\n[latest-ng]: https://docs.angularjs.org/guide/security#use-the-latest-angularjs-possible\n[releases]: https://github.com/angular/material/releases\n[ng-expressions]: https://docs.angularjs.org/guide/security#angularjs-templates-and-expressions\n"
  },
  {
    "path": "config/.jshintrc",
    "content": "{\n  \"sub\": true,\n  \"multistr\": true,\n  \"-W018\": true,\n  \"expr\": true,\n  \"boss\": true,\n  \"laxbreak\": true,\n  \"esversion\": 9,\n  \"predef\": [\"angular\"]\n}\n"
  },
  {
    "path": "config/build.config.js",
    "content": "const pkg = require('../package.json');\n\nmodule.exports = {\n  ngVersion: '1.8.2',\n  version: pkg.version,\n  repository: pkg.repository.url\n    .replace(/^git/,'https')\n    .replace(/(\\.git)?\\/?$/,'')\n};\n"
  },
  {
    "path": "config/karma-circleci.conf.js",
    "content": "const baseKarma = require('./karma.conf.js');\n\nmodule.exports = function(config) {\n  baseKarma(config);\n\n  // Override defaults with custom CI settings\n  config.set({\n    colors: false,\n    singleRun: true,\n    autoWatch: false,\n    browsers: ['ChromeHeadlessNoSandbox', 'FirefoxHeadless'],\n    customLaunchers: {\n      ChromeHeadlessNoSandbox: {\n        base: 'ChromeHeadless',\n        flags: ['--no-sandbox']\n      },\n      FirefoxHeadless: {\n        base: 'Firefox',\n        flags: ['-headless'],\n      },\n    },\n    plugins: [\n      require(\"karma-jasmine\"),\n      require(\"karma-chrome-launcher\"),\n      require('karma-firefox-launcher'),\n      require('karma-junit-reporter')\n    ],\n    junitReporter: {\n      outputDir: 'artifacts/junit/karma'\n    },\n    client: {\n      // Do not clear the context as this can cause reload failures with Jasmine\n      clearContext: false\n    }\n  });\n};\n"
  },
  {
    "path": "config/karma-docs.conf.js",
    "content": "const path = require('path');\n\n// Used for running unit tests against the docs site\n// Unit tests can be run using gulp docs-karma\nmodule.exports = function(config) {\n\n  // releaseMode is a custom configuration option.\n  const testSrc = [\n    'docs/spec/**/*.spec.js'\n  ];\n  let dependencies = process.env.KARMA_TEST_JQUERY ?\n    ['node_modules/jquery/dist/jquery.js'] : [];\n\n  dependencies = dependencies.concat([\n    'node_modules/angular/angular.js',\n    'node_modules/angular-animate/angular-animate.js',\n    'node_modules/angular-aria/angular-aria.js',\n    'node_modules/angular-messages/angular-messages.js',\n    'node_modules/angular-route/angular-route.js',\n    'node_modules/angular-mocks/angular-mocks.js',\n    'node_modules/moment/moment.js',\n    'dist/angular-material.js',\n    'config/test-utils.js',\n    'dist/docs/docs.js',\n    'dist/docs/docs-demo-scripts.js'\n  ]);\n\n  config.set({\n\n    basePath: path.join(__dirname, '/..'),\n    frameworks: ['jasmine'],\n    files: dependencies.concat(testSrc),\n\n    port: 9877,\n    reporters: ['progress'],\n    colors: true,\n\n    // Continuous Integration mode\n    // enable / disable watching file and executing tests whenever any file changes\n    autoWatch: false,\n    singleRun: false,\n\n    // Start these browsers, currently available:\n    // - Chrome\n    // - ChromeCanary\n    // - Firefox\n    // - Opera (has to be installed with `npm install karma-opera-launcher`)\n    // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)\n    // - PhantomJS\n    // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)\n    browsers: ['Chrome']\n  });\n\n};\n"
  },
  {
    "path": "config/karma-jenkins.conf.js",
    "content": "const baseKarma = require('./karma.conf.js');\n\nmodule.exports = function(config) {\n  baseKarma(config);\n\n  // Override defaults with custom CI settings\n  config.set({\n    colors: false,\n    singleRun: true,\n    autoWatch: false,\n    logLevel: config.LOG_DEBUG,\n\n    // Only launch one browser at a time since doing multiple can cause disconnects/issues\n    concurrency: 1,\n\n    browsers: ['Chrome'],\n\n    client: {\n      // Do not clear the context as this can cause reload failures with Jasmine\n      clearContext: false\n    }\n  });\n};\n"
  },
  {
    "path": "config/karma-sauce.conf.js",
    "content": "const baseKarma = require('./karma.conf.js');\nconst sauceBrowsers = require('./sauce-browsers.json');\n\nif (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {\n  throw new Error('Environment variables SAUCE_USERNAME and SAUCE_ACCESS_KEY must be set to run saucelabs with Karma.');\n}\n\nprocess.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY.split('').reverse().join('');\n\nmodule.exports = function(config) {\n\n  baseKarma(config);\n\n\n  config.set({\n    // Maximum 10 browsers - SauceLabs limit\n    // Those pre-configured browsers will always run in the CI Release Mode to confirm, that all\n    // previous jobs have passed.\n    browsers: ['SL_CHROME'],   // , 'SL_FIREFOX', 'SL_IE11'],\n    customLaunchers: sauceBrowsers,\n\n    captureTimeout: 180 * 1000,\n    browserDisconnectTimeout: 180 * 1000,\n    browserNoActivityTimeout: 180 * 1000,\n\n    transports: ['polling'],\n    reporters: ['dots', 'saucelabs'],\n\n    sauceLabs: {\n      testName: 'AngularJS Material 1.x Unit Tests',\n      tunnelIdentifier: process.env.TRAVIS_JOB_ID,\n      build: 'Build ' + process.env.TRAVIS_JOB_ID,\n\n      // Don't start the Sauce Connector. We use the integrated from Travis CI.\n      startConnect: false,\n      recordVideo: false,\n      recordScreenshots: false,\n      options: {\n        'command-timeout': 600,\n        'idle-timeout': 600,\n        'max-duration': 5400\n      }\n    },\n\n    singleRun: true,\n    autoWatch: false\n  });\n\n};\n"
  },
  {
    "path": "config/karma-travis.conf.js",
    "content": "const baseKarma = require('./karma.conf.js');\n\nmodule.exports = function(config) {\n  baseKarma(config);\n\n  // Override defaults with custom CI settings\n  config.set({\n    colors: false,\n    singleRun: true,\n    autoWatch: false,\n\n    browsers: ['ChromeHeadlessNoSandbox', 'FirefoxHeadless'],\n    customLaunchers: {\n      ChromeHeadlessNoSandbox: {\n        base: 'ChromeHeadless',\n        flags: ['--no-sandbox']\n      },\n      FirefoxHeadless: {\n        base: 'Firefox',\n        flags: ['-headless'],\n      },\n    },\n\n    client: {\n      // Do not clear the context as this can cause reload failures with Jasmine\n      clearContext: false\n    }\n  });\n};\n"
  },
  {
    "path": "config/karma.conf.js",
    "content": "const path = require('path');\n\nmodule.exports = function(config) {\n\n  const UNCOMPILED_SRC = [\n\n    // To enable use of `gulp karma-watch`,\n    // don't use the dist/angular-material.js.\n    // 'dist/angular-material.js',   // Un-minified source\n\n\n    // Test utilities, source, and specifications.\n    // We are explicit like this because we don't want to put\n    // demos in the tests, and Karma doesn't support advanced\n    // globbing.\n\n    'dist/angular-material.css',\n\n    'src/core/**/*.js',\n    'src/components/*/*.js',\n    'src/components/*/js/*.js',\n\n    'src/**/*.spec.js'\n  ];\n\n  const COMPILED_SRC = [\n    'dist/angular-material.min.css',\n    'dist/angular-material.min.js',   // Minified source\n    'src/**/*.spec.js'\n  ];\n\n  let dependencies = process.env.KARMA_TEST_JQUERY ? ['node_modules/jquery/dist/jquery.js'] : [];\n  dependencies = dependencies.concat([\n    'node_modules/angular/angular.js',\n    'node_modules/angular-animate/angular-animate.js',\n    'node_modules/angular-aria/angular-aria.js',\n    'node_modules/angular-messages/angular-messages.js',\n    'node_modules/angular-sanitize/angular-sanitize.js',\n    'node_modules/angular-touch/angular-touch.js',\n    'node_modules/angular-mocks/angular-mocks.js',\n    'node_modules/moment/moment.js',\n    'test/angular-material-mocks.js',\n    'test/angular-material-spec.js'\n  ]);\n\n  const testSrc = process.env.KARMA_TEST_COMPRESSED ? COMPILED_SRC : UNCOMPILED_SRC;\n\n  config.set({\n    basePath: path.join(__dirname, '/..'),\n    plugins: [\n      require(\"karma-jasmine\"),\n      require(\"karma-chrome-launcher\"),\n      require('karma-firefox-launcher'),\n      require('karma-browserstack-launcher'),\n      require('karma-sauce-launcher')\n    ],\n    frameworks: ['jasmine'],\n    files: dependencies.concat(testSrc),\n\n    browserDisconnectTimeout: 10000,\n    browserDisconnectTolerance: 3,\n    browserNoActivityTimeout: 10000,\n    captureTimeout: 10000,\n\n    logLevel: config.LOG_DEBUG,\n    port: 9876,\n    reporters: ['progress'],\n    colors: true,\n\n    // Continuous Integration mode\n    // enable / disable watching file and executing tests whenever any file changes\n    singleRun: false,\n    autoWatch: true,\n\n    // Try Websocket for a faster transmission first. Fallback to polling if necessary.\n    transports: ['websocket', 'polling'],\n\n    browserConsoleLogOptions: {\n      terminal: true,\n      level: 'log'\n    },\n\n    // Start these browsers, currently available:\n    // - Chrome\n    // - ChromeCanary\n    // - ChromeHeadless\n    // - Firefox\n    // - FirefoxHeadless\n    // - Opera (has to be installed with `npm install karma-opera-launcher`)\n    // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)\n    // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)\n    browsers: ['ChromeHeadless', 'FirefoxHeadless'],\n    customLaunchers: {\n      FirefoxHeadless: {\n        base: 'Firefox',\n        flags: ['-headless'],\n      },\n    },\n\n    client: {\n      // Do not clear the context as this can cause reload failures with Jasmine\n      clearContext: false\n    }\n  });\n};\n"
  },
  {
    "path": "config/ngModuleData.js",
    "content": "/**\n * The AngularJS Material module `ngMaterial` is generated by scanning all Material components\n * for valid module definitions. @see gulp-utils.js  ::buildNgMaterialDefinition()\n *\n * angular.module('ngMaterial', [\n *    \"ng\",\"ngAnimate\",\"ngAria\",\n *    \"material.core\",\"material.core.gestures\",\"material.core.layout\",\"material.core.theming.palette\",\n *    ...\n *  ]);\n *\n */\n\n// Define patterns for AngularJS Module definitions\n\nconst MATERIAL_ONLY = /\\.module\\(['|\"](material\\.[a-zA-Z\\-.]*)['|\"]\\s*,(\\s*\\[([^\\]]*)])/;\nconst ANY = /\\.module\\(('[^']*'|\"[^\"]*\")\\s*,(?:\\s*\\[([^\\]]+)])?/;\n\n/**\n * Find module definition s that match the module definition pattern\n */\nfunction buildScanner(pattern) {\n\n  return function findPatternIn(content) {\n    let dependencies;\n    const match = pattern.exec(content || '');\n    const moduleName = match ? match[1].replace(/'/gi,'') : null;\n    const depsMatch = match && match[2] && match[2].trim();\n\n    if (depsMatch) {\n      dependencies = depsMatch.split(/\\s*,\\s*/).map(function(dep) {\n        dep = dep.trim().slice(1, -1); // remove quotes\n        return dep;\n      });\n    }\n\n    return match ? {\n      name         : moduleName || '',\n      module       : moduleName || '',\n      dependencies : dependencies || []\n    } : null;\n  };\n}\n\nmodule.exports = {\n  material : buildScanner(MATERIAL_ONLY),\n  any      : buildScanner(ANY)\n};\n"
  },
  {
    "path": "config/sauce-browsers.json",
    "content": "{\n  \"SL_CHROME\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"chrome\",\n    \"platform\": \"Windows 10\",\n    \"version\": \"latest\"\n  },\n  \"SL_CHROMEBETA\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"chrome\",\n    \"version\": \"beta\"\n  },\n  \"SL_CHROMEDEV\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"chrome\",\n    \"version\": \"dev\"\n  },\n  \"SL_FIREFOX\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"firefox\",\n    \"version\": \"latest-1\"\n  },\n  \"SL_FIREFOXBETA\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"firefox\",\n    \"version\": \"beta\"\n  },\n  \"SL_FIREFOXDEV\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"firefox\",\n    \"version\": \"dev\"\n  },\n  \"SL_SAFARI7\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"safari\",\n    \"platform\": \"OS X 10.9\",\n    \"version\": \"7\"\n  },\n  \"SL_SAFARI8\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"safari\",\n    \"platform\": \"OS X 10.10\",\n    \"version\": \"8\"\n  },\n  \"SL_SAFARI9\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"safari\",\n    \"platform\": \"OS X 10.11\",\n    \"version\": \"9.0\"\n  },\n  \"SL_IOS7\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"iphone\",\n    \"platform\": \"OS X 10.10\",\n    \"version\": \"7.1\"\n  },\n  \"SL_IOS8\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"iphone\",\n    \"platform\": \"OS X 10.10\",\n    \"version\": \"8.4\"\n  },\n  \"SL_IOS9\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"iphone\",\n    \"platform\": \"OS X 10.10\",\n    \"version\": \"9.1\"\n  },\n  \"SL_IE9\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"internet explorer\",\n    \"platform\": \"Windows 2008\",\n    \"version\": \"9\"\n  },\n  \"SL_IE10\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"internet explorer\",\n    \"platform\": \"Windows 2012\",\n    \"version\": \"10\"\n  },\n  \"SL_IE11\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"internet explorer\",\n    \"platform\": \"Windows 10\",\n    \"version\": \"11.103\"\n  },\n  \"SL_EDGE\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"microsoftedge\",\n    \"platform\": \"Windows 10\",\n    \"version\": \"20.10240\"\n  },\n  \"SL_ANDROID4.1\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"android\",\n    \"platform\": \"Linux\",\n    \"version\": \"4.1\"\n  },\n  \"SL_ANDROID4.2\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"android\",\n    \"platform\": \"Linux\",\n    \"version\": \"4.2\"\n  },\n  \"SL_ANDROID4.3\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"android\",\n    \"platform\": \"Linux\",\n    \"version\": \"4.3\"\n  },\n  \"SL_ANDROID4.4\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"android\",\n    \"platform\": \"Linux\",\n    \"version\": \"4.4\"\n  },\n  \"SL_ANDROID5\": {\n    \"base\": \"SauceLabs\",\n    \"browserName\": \"android\",\n    \"platform\": \"Linux\",\n    \"version\": \"5.1\"\n  },\n  \"BS_CHROME\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"chrome\",\n    \"os\": \"OS X\",\n    \"os_version\": \"Yosemite\"\n  },\n  \"BS_FIREFOX\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"firefox\",\n    \"os\": \"Windows\",\n    \"os_version\": \"10\"\n  },\n  \"BS_SAFARI7\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"safari\",\n    \"os\": \"OS X\",\n    \"os_version\": \"Mavericks\"\n  },\n  \"BS_SAFARI8\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"safari\",\n    \"os\": \"OS X\",\n    \"os_version\": \"Yosemite\"\n  },\n  \"BS_SAFARI9\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"safari\",\n    \"os\": \"OS X\",\n    \"os_version\": \"El Capitan\"\n  },\n  \"BS_SAFARI10\": {\n      \"base\": \"BrowserStack\",\n      \"browser\": \"safari\",\n      \"os\": \"OS X\",\n      \"os_version\": \"Sierra\"\n    },\n  \"BS_IOS7\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"iPhone 5S\",\n    \"os\": \"ios\",\n    \"os_version\": \"7.0\",\n    \"resolution\": \"1024x768\"\n  },\n  \"BS_IOS8\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"iPhone 6\",\n    \"os\": \"ios\",\n    \"os_version\": \"8.3\",\n    \"resolution\": \"1024x768\"\n  },\n  \"BS_IOS9\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"iPhone 6S\",\n    \"os\": \"ios\",\n    \"os_version\": \"9.0\",\n    \"resolution\": \"1024x768\"\n  },\n  \"BS_IE9\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"ie\",\n    \"browser_version\": \"9.0\",\n    \"os\": \"Windows\",\n    \"os_version\": \"7\"\n  },\n  \"BS_IE10\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"ie\",\n    \"browser_version\": \"10.0\",\n    \"os\": \"Windows\",\n    \"os_version\": \"8\"\n  },\n  \"BS_IE11\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"ie\",\n    \"browser_version\": \"11.0\",\n    \"os\": \"Windows\",\n    \"os_version\": \"10\"\n  },\n  \"BS_EDGE\": {\n    \"base\": \"BrowserStack\",\n    \"browser\": \"edge\",\n    \"os\": \"Windows\",\n    \"os_version\": \"10\"\n  },\n  \"BS_WINDOWSPHONE\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"Nokia Lumia 930\",\n    \"os\": \"winphone\",\n    \"os_version\": \"8.1\"\n  },\n  \"BS_ANDROID5\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"Google Nexus 5\",\n    \"os\": \"android\",\n    \"os_version\": \"5.0\"\n  },\n  \"BS_ANDROID4.4\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"HTC One M8\",\n    \"os\": \"android\",\n    \"os_version\": \"4.4\"\n  },\n  \"BS_ANDROID4.3\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"Samsung Galaxy S4\",\n    \"os\": \"android\",\n    \"os_version\": \"4.3\"\n  },\n  \"BS_ANDROID4.2\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"Google Nexus 4\",\n    \"os\": \"android\",\n    \"os_version\": \"4.2\"\n  },\n  \"BS_ANDROID4.1\": {\n    \"base\": \"BrowserStack\",\n    \"device\": \"Google Nexus 7\",\n    \"os\": \"android\",\n    \"os_version\": \"4.1\"\n  }\n}\n"
  },
  {
    "path": "docs/README.md",
    "content": "AngularJS Material Docs\n-------------\n\n- [How to build the documentation](guides/BUILD.md#livedocs)\n"
  },
  {
    "path": "docs/app/css/highlightjs-material.css",
    "content": "hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0;\n  background: #0C2238;\n  color: white;\n  font-family: Menlo, Monaco, \"Andale Mono\", \"lucida console\", \"Courier New\", monospace;\n  line-height: 1.45;\n  tab-size: 2;\n  -webkit-font-smoothing: auto;\n  -webkit-text-size-adjust: none;\n  position: relative;\n  border-radius: 2px;\n  margin: 0 0 1em;\n}\n\nhljs:before {\n  content: attr(lang);\n  display: block;\n  background: #1C5792;\n  color: white;\n  line-height: 48px;\n  padding: 0 16px;\n  border-radius: 2px 2px 0 0;\n}\n\nhljs.no-header:before {\n  display: none;\n}\n\n.hljs-tag,\n.hljs-tag .hljs-title,\n.hljs-keyword,\n.hljs-literal,\n.hljs-strong,\n.hljs-change,\n.hljs-winutils,\n.hljs-flow,\n.nginx .hljs-title,\n.tex .hljs-special {\n  color: #E5C3A2;\n}\n\nhljs {\n  color: #ddd;\n}\n\nhljs .hljs-constant,\n.asciidoc .hljs-code,\n.markdown .hljs-code {\n\tcolor: #80CBC4;\n}\n\n.hljs-code,\n.hljs-class .hljs-title,\n.hljs-header {\n\tcolor: white;\n}\n\n.hljs-link_label,\n.hljs-attribute,\n.hljs-symbol,\n.hljs-symbol .hljs-string,\n.hljs-value,\n.hljs-params,\n.hljs-regexp {\n  color: #7DB9F4;\n}\n\n.hljs-link_url,\n.hljs-tag .hljs-value,\n.hljs-string,\n.hljs-bullet,\n.hljs-subst,\n.hljs-title,\n.hljs-emphasis,\n.hljs-type,\n.hljs-preprocessor,\n.hljs-pragma,\n.ruby .hljs-class .hljs-parent,\n.hljs-built_in,\n.django .hljs-template_tag,\n.django .hljs-variable,\n.smalltalk .hljs-class,\n.hljs-javadoc,\n.django .hljs-filter .hljs-argument,\n.smalltalk .hljs-localvars,\n.smalltalk .hljs-array,\n.hljs-attr_selector,\n.hljs-pseudo,\n.hljs-addition,\n.hljs-stream,\n.hljs-envvar,\n.apache .hljs-tag,\n.apache .hljs-cbracket,\n.tex .hljs-command,\n.hljs-prompt,\n.hljs-name {\n  color: #9ccc65;\n}\n\n.hljs-comment,\n.hljs-annotation,\n.smartquote,\n.hljs-blockquote,\n.hljs-horizontal_rule,\n.hljs-decorator,\n.hljs-pi,\n.hljs-doctype,\n.hljs-deletion,\n.hljs-shebang,\n.apache .hljs-sqbracket,\n.tex .hljs-formula {\n  color: #6d8c9b;\n}\n\n.coffeescript .javascript,\n.javascript .xml,\n.tex .hljs-formula,\n.xml .javascript,\n.xml .vbscript,\n.xml .css,\n.xml .hljs-cdata {\n  opacity: 0.5;\n}\n"
  },
  {
    "path": "docs/app/css/layout-demo.css",
    "content": "demo-include {\n  display: block;\n}\n\n/* For documentation printing purposes, set background color */\n@media print {\n  .demo-content {\n    background-color: white !important;\n  }\n}\n\n.colorNested .demo-content > div div  {\n  padding: 8px;\n  box-shadow: 0px 2px 5px 0 rgba(0,0,0,0.26);\n  opacity: 0.9;\n  color: white;\n  text-align: center;\n}\n\n.colorNested-noPad .demo-content > div div  {\n  box-shadow: 0px 2px 5px 0 rgba(0,0,0,0.26);\n  opacity: 0.9;\n  color: white;\n  text-align: center;\n}\n\n.colorNested .demo-content > div div:nth-child(1),\n.colorNested-noPad .demo-content > div div:nth-child(1) {\n  background-color: #009688;\n}\n.colorNested .demo-content > div div:nth-child(2),\n.colorNested-noPad .demo-content > div div:nth-child(2) {\n  background-color: #3949ab;\n}\n.colorNested .demo-content > div div:nth-child(3),\n.colorNested-noPad .demo-content > div div:nth-child(3) {\n  background-color: #9c27b0;\n}\n.colorNested .demo-content > div div:nth-child(4),\n.colorNested-noPad .demo-content > div div:nth-child(4) {\n  background-color: #8bc34a;\n}\n.colorNested .demo-content > div div:nth-child(5),\n.colorNested-noPad .demo-content > div div:nth-child(5)  {\n  background-color: #deb867;\n}\n.colorNested .demo-content > div div:nth-child(6),\n.colorNested-noPad .demo-content > div div:nth-child(6) {\n  background-color: #FF5722;\n}\n.colorNested .demo-content > div div:nth-child(7),\n.colorNested-noPad .demo-content > div div:nth-child(7)  {\n  background-color: #03A9F4;\n}\n\n.layout-content md-divider {\n  margin-top: 16px;\n}\n\n.layout-demo :not(.layout-row),\n.layout-demo :not(.layout-column) {\n  border: 1px solid #eee;\n  padding: 8px;\n}\n\n.layout-content .demo-box {\n  box-shadow: 0px 1px 3px 0 rgba(0,0,0,0.26);\n  padding: 16px;\n}\n\n.layout-panel-parent {\n  height: 200px;\n  width: 100%;\n  position: relative;\n  z-index: 2;\n}\n[ng-panel] {\n  transition: 0.45s cubic-bezier(0.35, 0, 0.25, 1);\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n}\n[ng-panel].ng-enter {\n  transform: translate3d(0, -15%, 0);\n  opacity: 0.1;\n  z-index: 1;\n}\n[ng-panel].ng-enter.ng-enter-active,\n[ng-panel].ng-leave {\n  transform: translate3d(0, 0, 0);\n  opacity: 1;\n}\n[ng-panel].ng-leave.ng-leave-active {\n  transform: translate3d(0, 0, 0);\n  opacity: 0.5;\n}\n[ng-panel] .demo-content {\n  background: white;\n}\n@media screen and (-ms-high-contrast: active) {\n  .colorNested  > div {\n    border: 1px solid #fff !important;\n  }\n}\n"
  },
  {
    "path": "docs/app/css/style.css",
    "content": "\nhtml {\n  font-size: 62.5%;\n  line-height: 1.4;\n}\nbody {\n  font-size: 1.6rem;\n}\n\n/* This styling should be not applied to codepen demos, so we need to add a unique identifier. */\nbody.docs-body {\n  overflow: hidden;\n  max-width: 100%;\n  max-height: 100%;\n}\n\n.md-api-table {\n  margin-bottom: 16px;\n  max-width: 100%;\n  width: 100%;\n  border-spacing: 0;\n  border-radius: 2px;\n  overflow: hidden;\n}\n\n/* Center the doc tool icons at the top */\n.docs-tools .md-button.md-icon-button {\n  min-height: 0;\n  height: auto;\n}\n\n.docs-anchor,\n.docs-anchor:visited {\n  color: inherit;\n}\n\n.md-fab.docs-scroll-fab {\n  position: fixed !important;\n\n  transform: scale(0);\n  transition: transform 0.2s;\n}\n\n.docs-scroll-fab.scrolling {\n  transform: scale(1);\n}\n\n#license-footer {\n  align-self: flex-end;\n  padding: 16px 32px;\n  width: 100%;\n\n  text-align: center;\n  font-size: small;\n  border-top: 1px solid #ddd;\n}\n\n.training_link {\n  color: #D32F2F;\n  text-transform: none;\n}\n\n.training_site {\n  text-transform: none;\n}\n\n.training_info {\n  text-transform: none;\n}\n/***************\n * TYPE DEFAULTS\n ***************/\na {\n  text-decoration: none;\n  font-weight: 400;\n  transition: border-bottom 0.35s;\n  color: #1565C0;\n}\na:visited {\n  color: #7e57c2;\n}\nh1, h2, h3, h4, h5, h6 {\n  margin-bottom: 1rem;\n  margin-top: 1rem;\n}\nh1 {\n  font-size: 3.400rem;\n  font-weight: 400;\n  line-height: 4rem;\n}\nh2 {\n  font-size: 2.400rem;\n  font-weight: 400;\n  line-height: 3.2rem;\n}\nh3 {\n  font-size: 2.000rem;\n  font-weight: 500;\n  letter-spacing: 0.005em;\n}\nh4 {\n  font-size: 1.600rem;\n  font-weight: 400;\n  letter-spacing: 0.010em;\n  line-height: 2.4rem;\n}\np {\n  font-size: 1.6rem;\n  font-weight: 400;\n  letter-spacing: 0.010em;\n  line-height: 1.6em;\n  margin: 0.8em 0 1.6em;\n}\nstrong {\n  font-weight: 500;\n}\n\n.md-api-table td,\n.md-api-table th {\n  padding: 12px 16px;\n  text-align: left;\n}\n\n.md-api-table td {\n  vertical-align: top;\n}\n.md-api-table td.description *:first-child {\n  margin-top: 0;\n}\n.md-api-table td.description *:last-child {\n  margin-bottom: 0;\n}\n.md-api-table tr:nth-child(odd) td {\n  background-color: #E3ECF5;\n}\n.md-api-table tr:nth-child(even) td {\n  background-color: #D1DEEC;\n}\n.md-api-table th {\n  background-color: #1976D2;\n  color: white;\n}\n.md-api-table code,\n.md-api-table a {\n  background-color: rgba(255, 255, 255, 0.25);\n}\n\nblockquote {\n  border-left: 3px solid rgba(0, 0, 0, 0.12);\n  font-style: italic;\n  margin-left: 0;\n  padding-left: 16px;\n}\nul {\n  margin: 0;\n  padding: 0;\n}\nmain ul:not(.md-autocomplete-suggestions) li:not(.md-nav-item) {\n  margin-left: 16px;\n  padding: 0;\n  margin-top: 3px;\n  list-style-position: inside;\n}\nmain ul:not(.md-autocomplete-suggestions) li:not(.md-nav-item):first-child {\n  margin-top: 0;\n}\n/************\n * UTILS\n ************/\nul.skip-links li {\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\nul.skip-links li a {\n  color: white;\n  margin: 0.9em 0 0.5em 0.5em !important;\n  right: 0;\n  position: absolute;\n  top: 0;\n  z-index: 2;\n}\nul.skip-links li a md-icon {\n  color: white;\n}\n.md-breadcrumb:focus {\n  outline: #BDBDC0 solid 2px;\n}\n/*******************\n * CODE HIGHLIGHTING\n *******************/\npre {\n  white-space: pre;\n  white-space: pre-wrap;\n  word-wrap: break-word;\n}\n\npre > code.highlight {\n  padding: 16px;\n  font-weight: 400;\n}\n\npre, code {\n  margin: 0;\n  padding: 0;\n  font-family: Menlo, Monaco, \"Andale Mono\", \"lucida console\", \"Courier New\", monospace;\n  overflow-wrap: break-word;\n}\n\n\npre > code.highlight {\n  background-color: transparent;\n  font-weight: 400;\n  padding: 16px;\n}\n\ncode {\n  font-size: 1.4rem;\n  background: rgba(0, 0, 0, 0.05);\n}\n\ncode.highlight {\n  display: block;\n  overflow-wrap: break-word;\n}\n\ncode:not(.highlight) {\n  color: #1565C0;\n  margin-left: 1px;\n  margin-right: 1px;\n  padding: 0.125em 0.35em;\n  border-radius: 2px;\n}\n.layout-content code.highlight {\n  margin-bottom: 15px;\n}\n/************\n * DOCS MENU\n ************/\n.site-sidenav {\n  background: #106CC8;\n}\n.site-sidenav md-content {\n  background: transparent;\n}\n.site-sidenav,\n.site-sidenav.md-locked-open-add-active,\n.site-sidenav.md-locked-open {\n  width:     272px;\n  min-width: 272px;\n  max-width: 272px;\n}\n.site-sidenav > * {\n  min-width: 218px;\n}\n\n.docs-menu,\n.docs-menu ul {\n  list-style: none;\n  padding: 0;\n  max-width: 100%;\n  overflow-x: hidden;\n}\nul.docs-menu li {\n  margin: 0;\n}\n.docs-menu > li:nth-child(1) {\n  border-top: none;\n}\n.md-whiteframe-glow-z1 {\n  box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.14),\n              0 0 2px 2px rgba(0, 0, 0, 0.098),\n              0 0 5px 1px rgba(0, 0, 0, 0.084);\n}\n.docs-menu > li {\n  border-bottom: 1px solid #267ED5;\n}\n\n.docs-menu .md-button {\n  border-radius: 0;\n  color: white;\n  cursor: pointer;\n  display: block;\n  align-items: inherit;\n  line-height: 40px;\n  margin: 0;\n  max-height: 40px;\n  overflow: hidden;\n  padding: 0 16px;\n  text-align: left;\n  text-decoration: none;\n  white-space: normal;\n  width: 100%;\n}\n\nhtml[dir=rtl] .docs-menu .md-button,\nbody[dir=rtl] .docs-menu .md-button {\n  unicode-bidi: embed;\n  text-align: right;\n}\n\n\n.docs-menu .md-button:hover,\n.docs-menu .md-button:focus {\n  background: #1D77D5 !important;\n}\n.docs-menu .md-button md-icon {\n  color: white;\n}\n\n.docs-menu md-select {\n /* Override md-select margins.  With margins the menu will look incorrect and causes mobile list\n    to not be scrollable.\n  */\n  margin: 0;\n  width: 100%;\n}\n\n.docs-menu md-select md-select-label {\n  justify-content: flex-end;\n  padding-top: 10px;\n}\n\n.docs-menu md-select md-select-label span {\n  margin-right: auto;\n  padding-left: 13px;\n}\n\n.docs-menu md-select .md-select-icon {\n  margin-right: 28px;\n}\n\n.docs-menu button.md-button::-moz-focus-inner {\n  padding: 0;\n}\n.docs-menu .md-button.active {\n  background: #1D77D5;\n}\n.menu-heading {\n  display: block;\n  line-height: 32px;\n  margin: 0;\n  padding: 8px 16px 0;\n  text-align: left;\n  width: 100%;\n  color: white;\n  font-weight: 700;\n  font-size: 12px;\n}\n\nhtml[dir=rtl] .menu-heading,\nbody[dir=rtl] .menu-heading {\n  unicode-bidi: embed;\n  text-align: right;\n}\n\n.menu-toggle-list {\n  overflow: hidden;\n  position: relative;\n  z-index: 1;\n  height: 0;\n}\n.docs-menu .menu-toggle-list a.md-button {\n  display: block;\n  padding: 0 16px 0 32px;\n  text-transform: none;\n  text-rendering: optimizeLegibility;\n  font-weight: 500;\n}\n\n.parent-list-item:last-child {\n  margin-bottom: 20px;\n\n  /* Prevent the hidden License link from causing a double bottom-border */\n  border-bottom: none;\n}\n.md-button-toggle .md-toggle-icon {\n  display: block;\n  margin-left: auto;\n  speak: none;\n  vertical-align: middle;\n  transform: rotate(180deg);\n  transition: transform 0.3s ease-in-out;\n}\n.md-button-toggle .md-toggle-icon.toggled {\n  transform: rotate(0deg);\n}\n\n/* End Docs Menu */\n\n.docs-logo {\n  text-align: center;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  padding: 0 0 16px;\n  margin: 0 auto;\n}\n.docs-logo:focus {\n  outline: none;\n}\n.docs-logo > img {\n  margin-top: 19px;\n  height: 120px;\n  width: auto;\n  display: block;\n  transform-origin: 50% 0;\n  transform: scale(1.2);\n}\n.nav-header {\n  background-color: #106CC8;\n  background: linear-gradient(#185694, #106cc8);\n  border-bottom: 1px solid #1D77D5;\n  flex-shrink: 0;\n  z-index: 2;\n}\na.docs-logo {\n  border-bottom: none;\n}\n.docs-logotype {\n  color: white;\n  text-align: center;\n  font-weight: 400;\n  font-size: 26px;\n  margin-bottom: 1rem;\n  margin-top: 21px;\n}\n.docs-menu-separator-icon {\n  margin: 0;\n}\n.docs-menu-separator-icon img {\n  height: 16px;\n}\n.md-breadcrumb {\n  font-size: 24px !important;\n  font-weight: 400 !important;\n}\n.md-breadcrumb-page {\n  display: inline-block;\n  word-wrap: break-word;\n}\n.docs-toolbar-tools {\n  max-width: 864px;\n  padding: 0;\n  margin: 0 24px;\n  width: auto;\n}\n.docs-tools .md-button,\n.docs-tools .md-button md-icon {\n  color: #666 !important;\n}\n@media (max-width: 400px) {\n  .docs-tools {\n    display: none;\n  }\n}\n.layout-content,\n.doc-content {\n  max-width: 864px;\n  margin: 16px;\n  box-sizing: border-box;\n}\ndocs-demo {\n  display: block;\n  margin-top: 16px;\n}\n.doc-description p {\n  margin-top: 0;\n}\n.demo-container {\n  border-radius: 4px;\n  margin-bottom: 16px;\n  transition: 0.02s padding cubic-bezier(0.35, 0, 0.25, 1);\n  position: relative;\n  padding-bottom: 0;\n}\n.demo-source-tabs {\n  z-index: 1;\n  transition: all 0.45s cubic-bezier(0.35, 0, 0.25, 1);\n  height: 448px;\n  background: #fff;\n  overflow: hidden;\n}\n.demo-source-tabs md-tabs-wrapper {\n  background-color: #2C80D2 !important;\n}\n\nmd-tabs.demo-source-tabs md-tab,\nmd-tabs.demo-source-tabs .md-header {\n  background-color: #444444 !important;\n}\n\n\nmd-tabs.demo-source-tabs md-tab-label {\n  color: #ccc !important;\n}\n\nmd-tabs.demo-source-tabs .active md-tab-label {\n  color: #fff !important;\n}\n\n.demo-source-tabs.ng-hide {\n  min-height: 0;\n  height: 0;\n}\n.demo-source-tabs {\n  position: relative;\n  width: 100%;\n  z-index: 0;\n}\n.demo-content {\n  position: relative;\n  display: flex;\n  overflow: hidden;\n}\n.small-demo .demo-source-tabs:not(.ng-hide) {\n  height: 224px;\n}\n.small-demo .demo-content {\n  min-height: 128px;\n}\n.doc-content > * {\n  flex: 1 1 auto;\n}\n.demo-content > * {\n  flex: 1 1 100%;\n}\n.demo-content > div[layout-fill] {\n  min-height: 448px;\n}\n.demo-content > div.layout-fill {\n  min-height: 448px;\n}\n.small-demo .demo-content > div[layout-fill] {\n  min-height: 224px;\n}\n.small-demo .demo-content > div.layout-fill {\n  min-height: 224px;\n}\n.layout-content .small-demo .demo-content > div[layout],\n.layout-options .small-demo .demo-content > div.layout {\n  min-height: auto !important;\n  max-height: auto !important;\n  height: 128px !important;\n}\n.small-demo .demo-toolbar,\n.small-demo .md-toolbar-tools {\n  min-height: 48px;\n  max-height: 48px;\n}\n\nmd-toolbar.demo-toolbar {\n  border-radius: 3px 3px 0 0;\n  box-shadow: 0 1px rgba(255, 255, 255, 0.1);\n}\nmd-toolbar.demo-toolbar md-tab-label {\n  color: #99E4EE;\n}\nmd-toolbar.demo-toolbar .md-button:hover {\n  background: rgba(0,0,0,0.1);\n}\nmd-toolbar.demo-toolbar .md-button.active, md-toolbar.demo-toolbar .md-button.active md-icon {\n  color: #418CD6;\n}\n\nmd-toolbar.demo-toolbar .md-button {\n  transition: all 0.3s linear;\n  color: #616161;\n}\n.demo-source-container {\n  display: block;\n  border: 1px solid #ddd;\n  background-color: #f6f6f6;\n  height: 400px;\n}\n.demo-source-container hljs {\n  margin-bottom: 0;\n  border-radius: 0;\n}\n.show-source div[demo-include] {\n  border-top: #ddd solid 2px;\n}\n.docs-list {\n  padding: 16px;\n}\n.docs-descriptions h4 {\n  margin: 0;\n}\n.docs-list md-divider {\n  margin: 8px 0;\n}\n.docs-list li {\n  list-style: none;\n  margin: 0 0 8px;\n}\n.docs-output {\n\n}\n\n/***************************\n * End Of Life (EOL) Banner\n ***************************/\n.eol-notice {\n  background: #ECEFF1;\n  padding: 4px 16px;\n  font-size: 13px;\n  margin: 0;\n}\n.eol-notice div {\n  max-width: 864px;\n  text-align: center;\n}\n\n/***************\n * Landing Page\n ***************/\nmain .doc-content ul.buckets {\n  margin: 24px 0 24px -8px;\n  padding: 0;\n  position: relative;\n}\nmain .doc-content ul.buckets li {\n  list-style: none;\n  margin: 0;\n  text-align: center;\n}\nmain .doc-content ul.buckets li md-card md-card-content {\n  padding: 0;\n}\nmain .doc-content ul.buckets li a {\n  display: block;\n  font-weight: 500;\n  padding: 16px 0;\n  text-decoration: none;\n  background-color: #f6f6f6 !important;\n  box-shadow: none !important;\n  margin-right: 0;\n  margin-top: 0;\n}\nmain .doc-content ul.buckets li a,\nmain .doc-content ul.buckets li a md-icon {\n  color: #666 !important;\n  transition: all 0.15s cubic-bezier(0.35, 0, 0.25, 1);\n}\nmain .doc-content ul.buckets li a:hover,\nmain .doc-content ul.buckets li a:focus,\nmain .doc-content ul.buckets li a:hover md-icon,\nmain .doc-content ul.buckets li a:focus md-icon {\n  color: #106CC8 !important;\n  background-color: #ebebeb !important;\n}\n/************\n * API DOCS\n ************/\n.api-options-bar .md-button {\n  margin: 4px;\n  padding: 4px;\n}\n.api-options-bar .md-button:hover,\n.api-options-bar .md-button:focus {\n  background: rgba(0, 0, 0, 0.2);\n}\n.api-options-bar.with-icon md-icon {\n  position: absolute;\n  top: -3px;\n  left: 2px;\n}\n.api-options-bar.with-icon .md-button span {\n  margin-left: 22px;\n}\n\nheader.api-profile-header > h2 {\n  margin: 0;\n  color: #164371;\n}\n\n.api-params-item {\n  min-height: 72px;\n}\n.api-params-label {\n  margin-right: 8px;\n  text-align: center;\n  margin-top: 14px;\n  align-self: flex-start;\n}\n.api-params-title {\n  color: #888;\n}\n\n.api-params-content ul {\n  padding-left: 4px;\n}\nul.methods > li {\n  margin: 0 0 48px;\n}\n\nul.methods .method-function-syntax {\n  font-weight: normal;\n  font-size: 2.0rem;\n  margin: 0;\n}\n\nh3 .method-function-syntax {\n  display: block;\n  padding: 0 16px;\n  background: #1C5792;\n  color: white;\n  line-height: 48px;\n}\n\n@media (max-width: 600px) {\n  ul.methods > li {\n    padding-left: 0;\n    border-left: none;\n    list-style: default;\n  }\n  ul.methods .method-function-syntax {\n    font-size: 1.4rem;\n  }\n}\n\n.demo-source-container pre,\n.demo-source-container code {\n  min-height: 100%;\n}\n\nmd-content.demo-source-container {\n  background-color: transparent;\n  border: none;\n}\n.demo-container > md-tabs {\n  border-radius: 0;\n}\nmd-content.demo-source-container > hljs,\nmd-content.demo-source-container > hljs > pre,\nmd-content.demo-source-container > hljs > pre > code.highlight {\n  min-height: 100%;\n}\n\n.dashed-bottom {\n  border-bottom: dashed 1px rgb(224, 224, 224);\n  padding-bottom: 10px;\n}\n\n.dashed-top {\n  border-top: dashed 1px rgb(224, 224, 224);\n  margin-top: 10px;\n}\n\n.api-section, .api-param-section {\n  margin: 3em 0 0;\n}\n.api-section h3 {\n  padding-top: 20px;\n}\n.responsive-video {\n  height: 0;\n  overflow: hidden;\n  padding-bottom: 75%;\n  position: relative;\n}\n.responsive-video iframe {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n\nul.no-style {\n  padding: 0;\n  list-style: none;\n}\n\nul.methods {\n  padding: 0;\n  list-style: none;\n}\nul.methods > li:first-child > *:first-child {\n  padding-top: 0;\n}\n\n\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n  display: none !important;\n}\n\n.version-picker {\n  background: #1D77D5 !important;\n  border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n  margin-bottom: 1px !important;\n}\n.version-picker .menu-toggle-list {\n  background: transparent !important;\n}\nmd-icon.block {\n  color: #106CC8;\n  display: block;\n  height: 50px;\n  width:  50px;\n}\n.doc-demo-content {\n  padding: 0;\n}\ndocs-demo .doc-demo-content {\n  margin: 16px;\n}\n.site-content-toolbar {\n  z-index: 3;\n}\n.service-desc {\n  overflow: hidden;\n  background: #E3ECF5;\n  padding: 16px;\n  margin: 0 0 8px;\n}\n.service-desc > p:first-child {\n  margin-top: 0;\n}\n.service-desc > p:last-child {\n  margin-bottom: 0;\n}\n.service-desc code {\n  background-color: rgba(255, 255, 255, 0.25);\n}\n\n/* Styles for Windows High Contrast mode */\n@media screen and (-ms-high-contrast: active) {\n  a {\n    text-decoration: underline;\n  }\n  iframe, hljs pre {\n    border: 1px solid #fff;\n  }\n}\n\n.no-transition {\n  transition: none !important;\n}\n\ntable.attributes, table.md-api-table {\n  padding-left:15px;\n  margin-bottom: 20px;\n}\ntable.attributes  tr  td:first-child {\n  font-weight: bold;\n  background-color: #DBEEF5;\n}\ntable.attributes  tr  td:last-child {\n  padding-left: 10px;\n}\n\ntable.md-api-table:not(.md-css-table)  tr  td:first-child {\n  font-weight: bold;\n}\n\ntable.md-css-table .md-css-selector {\n  display: block;\n  padding: 8px 16px;\n\n  /* Offset the padding of the <td> element */\n  margin: -12px -16px 12px -16px;\n\n  background-color: #0C2238;\n  color: #9ccc65;\n}\n\n/* Fix some odd bottom margin */\ntable.md-css-table td p {\n  margin: 0.8em 0;\n}\n\n.layout_note {\n  font-size: 0.9em;\n  margin: -5px 40px 0 20px;\n  color: rgb(1, 57, 114);\n  background-color: rgba(156, 204, 101,0.4);\n  padding: 20px;\n}\n\n.contributor_tables {\n  padding-left: 25px;\n}\n\n.contributor_tables > table {\n  padding-top: 10px;\n  padding-bottom: 10px;\n}\n\ntable.custom-table {\n  margin: 24px 2px;\n  box-shadow: 0 1px 2px rgba(10, 16, 20, 0.24), 0 0 2px rgba(10, 16, 20, 0.12);\n  border-radius: 2px;\n  background: #fafafa;\n  color: rgba(0,0,0,0.87);\n  border-spacing: 0;\n}\ntable.custom-table thead > {\n  vertical-align: middle;\n  border-color: inherit;\n}\ntable.custom-table thead > tr {\n  vertical-align: inherit;\n  border-color: inherit;\n}\ntable.custom-table thead > tr > th {\n  background: rgba(219, 219, 219, 0.2);\n  border-bottom: 1px solid #dbdbdb;\n  color: #333;\n  font-size: 12px;\n  font-weight: 500;\n  padding: 8px 24px;\n  text-align: left;\n  text-transform: uppercase;\n  line-height: 28px;\n}\ntable.custom-table tbody > tr > th,\ntable.custom-table tbody > tr > td {\n  border-bottom: 1px solid #dbdbdb;\n  padding: 16px;\n  text-align: left;\n  line-height: 24px;\n  vertical-align: top;\n}\n@media (max-width: 480px) {\n  table.custom-table tbody > tr > th:before,\n  table.custom-table tbody > tr > td:before {\n    display: inline-block;\n  }\n}\ntable.custom-table tbody > tr > td {\n  letter-spacing: 0.3px;\n}\n@media (max-width: 480px) {\n  table.custom-table tbody > tr > td tr td:first-child {\n    background-color: #dbdbdb;\n  }\n}\ntable.custom-table tbody > tr > th:first-child {\n  border-right: 1px solid #dbdbdb;\n}\ntable.custom-table tbody > tr > th {\n  background: rgba(219, 219, 219, 0.2);\n  font-weight: 600;\n  max-width: 100px;\n}\ntable.custom-table tbody > tr >:last-child td {\n  border: none;\n}\n\n/* Provide some layout/padding enhancements for mobile/small devices */\n@media(max-width: 500px) {\n  /* Reduce the size of the nav logo/header */\n  .docs-logo > img {\n    height: 75px;\n    margin-top: 10px;\n  }\n\n  .docs-logo h1 {\n    font-size: 18px;\n    line-height: 2rem;\n  }\n\n  /* Reduce the padding around standard doc content */\n  .docs-ng-view .doc-content {\n    margin: 8px;\n    padding: 0;\n  }\n\n  /* Reduce the padding around doc demos */\n  .docs-ng-view docs-demo {\n    padding: 0;\n  }\n\n  .docs-ng-view docs-demo:first-child {\n    margin-top: 0;\n  }\n\n  .docs-ng-view docs-demo .doc-demo-content {\n    margin: 0;\n  }\n}\n"
  },
  {
    "path": "docs/app/js/anchor.js",
    "content": "(function() {\n  angular\n    .module('docsApp')\n    .directive('h4', MdAnchorDirective)\n    .directive('h3', MdAnchorDirective)\n    .directive('h2', MdAnchorDirective)\n    .directive('h1', MdAnchorDirective);\n\n  function MdAnchorDirective($mdUtil, $compile, $rootScope) {\n\n    /** @const @type {RegExp} */\n    var unsafeCharRegex = /[&\\s+$,:;=?@\"#{}|^~[`%!'\\]./()*\\\\]/g;\n\n    return {\n      restrict: 'E',\n      scope: {},\n      require: '^?mdContent',\n      link: postLink\n    };\n\n    function postLink(scope, element, attr, ctrl) {\n\n      // Only create anchors when being inside of a md-content.\n      // Don't create anchors for menu headers as they have no associated content.\n      if (!ctrl || element[0].classList && element[0].classList.contains('menu-heading')) {\n        return;\n      }\n\n      var anchorEl = $compile('<a class=\"docs-anchor\" ng-href=\"{{ href }}\" name=\"{{ name }}\"></a>')(scope);\n\n      // Wrap contents inside of the anchor element.\n      anchorEl.append(element.contents());\n\n      // Append the anchor element to the directive element.\n      element.append(anchorEl);\n\n      // Delay the URL creation, because the inner text might be not interpolated yet.\n      $mdUtil.nextTick(createContentURL);\n\n      /**\n       * Creates URL from the text content of the element and writes it into the scope.\n       */\n      function createContentURL() {\n        var path = '';\n        var name = element.text();\n        // Use $window.location.pathname to get the path with the baseURL included.\n        // $location.path() does not include the baseURL. This is important to support how the docs\n        // are deployed with baseURLs like /latest, /HEAD, /1.1.13, etc.\n        if (scope.$root.$window && scope.$root.$window.location) {\n          path = scope.$root.$window.location.pathname;\n        }\n        name = name\n          .trim()                           // Trim text due to browsers extra whitespace.\n          .replace(/'/g, '')                // Transform apostrophes words to a single one.\n          .replace(unsafeCharRegex, '-')    // Replace unsafe chars with a dash symbol.\n          .replace(/-{2,}/g, '-')           // Remove repeating dash symbols.\n          .replace(/^-|-$/g, '')            // Remove preceding or ending dashes.\n          .toLowerCase();                   // Link should be lower-case for accessible URL.\n        scope.name = name;\n        scope.href = path + '#' + name;\n      }\n    }\n  }\n\n  // Manually specify $inject because Strict DI is enabled.\n  MdAnchorDirective.$inject = ['$mdUtil', '$compile'];\n\n})();\n"
  },
  {
    "path": "docs/app/js/app.js",
    "content": "angular.module('docsApp', ['angularytics', 'ngRoute', 'ngMessages', 'ngMaterial'], [\n  'SERVICES',\n  'COMPONENTS',\n  'DEMOS',\n  'PAGES',\n  '$routeProvider',\n  '$locationProvider',\n  '$mdThemingProvider',\n  '$mdIconProvider',\nfunction(SERVICES, COMPONENTS, DEMOS, PAGES,\n    $routeProvider, $locationProvider, $mdThemingProvider, $mdIconProvider) {\n\n  $locationProvider.html5Mode(true);\n\n  $routeProvider\n    .when('/', {\n      templateUrl: 'partials/home.tmpl.html'\n    })\n    .when('/layout/:tmpl', {\n      templateUrl: function(params){\n        return 'partials/layout-' + params.tmpl + '.tmpl.html';\n      }\n    })\n    .when('/layout/', {\n      redirectTo:  '/layout/introduction'\n    })\n    .when('/demo/', {\n      redirectTo: DEMOS[0].url\n    })\n    .when('/api/', {\n      redirectTo: COMPONENTS[0].docs[0].url\n    })\n    .when('/getting-started', {\n      templateUrl: 'partials/getting-started.tmpl.html'\n    })\n    .when('/contributors', {\n      templateUrl: 'partials/contributors.tmpl.html'\n    })\n    .when('/license', {\n      templateUrl: 'partials/license.tmpl.html'\n    });\n  $mdThemingProvider.definePalette('docs-blue', $mdThemingProvider.extendPalette('blue', {\n    '50': '#DCEFFF',\n    '100': '#AAD1F9',\n    '200': '#7BB8F5',\n    '300': '#4C9EF1',\n    '400': '#1C85ED',\n    '500': '#106CC8',\n    '600': '#0159A2',\n    '700': '#025EE9',\n    '800': '#014AB6',\n    '900': '#013583',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 400 A100 A200',\n    'contrastStrongLightColors': '500 600 700 800 900 A400 A700'\n  }));\n\n  $mdThemingProvider.definePalette('docs-red', $mdThemingProvider.extendPalette('red', {\n    'A100': '#DE3641'\n  }));\n\n  $mdThemingProvider.definePalette('docs-warn', $mdThemingProvider.extendPalette('deep-orange', {\n    '500': '#d32f2f' // Override 500 with 700 hue for improved contrast on flat buttons\n  }));\n\n  $mdThemingProvider.theme('docs-dark', 'default')\n    .primaryPalette('yellow')\n    .dark();\n\n  $mdThemingProvider.theme('site-toolbar')\n    .primaryPalette('grey', {\n      'default': '100'\n    });\n\n  $mdIconProvider.icon('md-toggle-arrow', 'img/icons/toggle-arrow.svg', 48);\n  $mdIconProvider\n    .iconSet('communication', 'img/icons/sets/communication-icons.svg', 24)\n    .iconSet('device', 'img/icons/sets/device-icons.svg', 24)\n    .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n    .iconSet('symbol', 'img/icons/sets/symbol-icons.svg', 24)\n    .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n\n  $mdThemingProvider.theme('default')\n    .primaryPalette('docs-blue')\n    .accentPalette('docs-red')\n    .warnPalette('docs-warn');\n\n  $mdThemingProvider.enableBrowserColor();\n\n  angular.forEach(PAGES, function(pages, area) {\n    angular.forEach(pages, function(page) {\n      $routeProvider\n        .when(page.url, {\n          templateUrl: page.outputPath,\n          controller: 'GuideCtrl'\n        });\n    });\n  });\n\n  angular.forEach(COMPONENTS, function(component) {\n    angular.forEach(component.docs, function(doc) {\n      $routeProvider.when('/' + doc.url, {\n        templateUrl: doc.outputPath,\n        resolve: {\n          component: function() { return component; },\n          doc: function() { return doc; }\n        },\n        controller: 'ComponentDocCtrl'\n      });\n    });\n  });\n\n  angular.forEach(SERVICES, function(service) {\n    $routeProvider.when('/' + service.url, {\n      templateUrl: service.outputPath,\n      resolve: {\n        component: function() { return { isService: true } },\n        doc: function() { return service; }\n      },\n      controller: 'ComponentDocCtrl'\n    });\n  });\n\n  angular.forEach(DEMOS, function(componentDemos) {\n    var demoComponent;\n\n    COMPONENTS.forEach(function(component) {\n      if (componentDemos.moduleName === component.name) {\n        demoComponent = component;\n        component.demoUrl = componentDemos.url;\n      }\n    });\n\n    demoComponent = demoComponent || angular.extend({}, componentDemos);\n    $routeProvider.when('/' + componentDemos.url, {\n      templateUrl: 'partials/demo.tmpl.html',\n      controller: 'DemoCtrl',\n      resolve: {\n        component: function() { return demoComponent; },\n        demos: function() { return componentDemos.demos; }\n      }\n    });\n  });\n\n  $routeProvider.otherwise('/');\n\n  // Change hash prefix of the AngularJS router, because we use the hash symbol for anchor links.\n  // The hash will be not used by the docs, because we use the HTML5 mode for our links.\n  $locationProvider.hashPrefix('!');\n\n}])\n\n.config(['$mdGestureProvider', 'AngularyticsProvider', function($mdGestureProvider, AngularyticsProvider) {\n  $mdGestureProvider.skipClickHijack();\n  AngularyticsProvider.setEventHandlers(['GoogleUniversal']);\n}])\n\n.run(['$rootScope', '$window', 'Angularytics', function($rootScope, $window, Angularytics) {\n  Angularytics.init();\n  $rootScope.$window = $window;\n}])\n\n.factory('menu', [\n  'SERVICES',\n  'COMPONENTS',\n  'DEMOS',\n  'PAGES',\n  '$location',\n  '$rootScope',\n  '$http',\n  '$window',\nfunction(SERVICES, COMPONENTS, DEMOS, PAGES, $location, $rootScope, $http, $window) {\n\n  var version = {};\n\n  var sections = [{\n    name: 'Getting Started',\n    url: 'getting-started',\n    type: 'link'\n  }];\n\n  var demoDocs = [];\n  angular.forEach(DEMOS, function(componentDemos) {\n    demoDocs.push({\n      name: componentDemos.label,\n      url: componentDemos.url\n    });\n  });\n\n  sections.push({\n    name: 'Demos',\n    pages: demoDocs.sort(sortByName),\n    type: 'toggle'\n  });\n\n  sections.push();\n\n  sections.push({\n    name: 'Customization',\n    type: 'heading',\n    children: [\n      {\n        name: 'CSS',\n        type: 'toggle',\n        pages: [{\n            name: 'Typography',\n            url: 'CSS/typography',\n            type: 'link'\n          },\n          {\n            name : 'Button',\n            url: 'CSS/button',\n            type: 'link'\n          },\n          {\n            name : 'Checkbox',\n            url: 'CSS/checkbox',\n            type: 'link'\n          }]\n      },\n      {\n        name: 'Theming',\n        type: 'toggle',\n        pages: [\n          {\n            name: 'Introduction and Terms',\n            url: 'Theming/01_introduction',\n            type: 'link'\n          },\n          {\n            name: 'Declarative Syntax',\n            url: 'Theming/02_declarative_syntax',\n            type: 'link'\n          },\n          {\n            name: 'Configuring a Theme',\n            url: 'Theming/03_configuring_a_theme',\n            type: 'link'\n          },\n          {\n            name: 'Multiple Themes',\n            url: 'Theming/04_multiple_themes',\n            type: 'link'\n          },\n          {\n            name: 'Under the Hood',\n            url: 'Theming/05_under_the_hood',\n            type: 'link'\n          },\n          {\n            name: 'Browser Color',\n            url: 'Theming/06_browser_color',\n            type: 'link'\n          }\n        ]\n      },\n      {\n        name: 'Performance',\n        type: 'toggle',\n        pages: [{\n            name: 'Internet Explorer',\n            url: 'performance/internet-explorer',\n            type: 'link'\n          }]\n      }\n    ]\n  });\n\n  var docsByModule = {};\n  var apiDocs = {};\n  COMPONENTS.forEach(function(component) {\n    component.docs.forEach(function(doc) {\n      if (angular.isDefined(doc.private)) return;\n      apiDocs[doc.type] = apiDocs[doc.type] || [];\n      apiDocs[doc.type].push(doc);\n\n      docsByModule[doc.module] = docsByModule[doc.module] || [];\n      docsByModule[doc.module].push(doc);\n    });\n  });\n\n  SERVICES.forEach(function(service) {\n    if (angular.isDefined(service.private)) return;\n    apiDocs[service.type] = apiDocs[service.type] || [];\n    apiDocs[service.type].push(service);\n\n    docsByModule[service.module] = docsByModule[service.module] || [];\n    docsByModule[service.module].push(service);\n  });\n\n  sections.push({\n    name: 'API Reference',\n    type: 'heading',\n    children: [\n    {\n      name: 'Layout',\n      type: 'toggle',\n      pages: [{\n        name: 'Introduction',\n        id: 'layoutIntro',\n        url: 'layout/introduction'\n      },\n      {\n        name: 'Layout Containers',\n        id: 'layoutContainers',\n        url: 'layout/container'\n      },\n      {\n        name: 'Layout Children',\n        id: 'layoutGrid',\n        url: 'layout/children'\n      },\n      {\n        name: 'Child Alignment',\n        id: 'layoutAlign',\n        url: 'layout/alignment'\n      },\n      {\n        name: 'Extra Options',\n        id: 'layoutOptions',\n        url: 'layout/options'\n      },\n      {\n        name: 'Troubleshooting',\n        id: 'layoutTips',\n        url: 'layout/tips'\n      }]\n    },\n    {\n      name: 'Services',\n      pages: apiDocs.service.sort(sortByName),\n      type: 'toggle'\n    },{\n      name: 'Types',\n      pages: apiDocs.type.sort(sortByName),\n      type: 'toggle'\n    },{\n      name: 'Directives',\n      pages: apiDocs.directive.sort(sortByName),\n      type: 'toggle'\n    }]\n  });\n\n  sections.push({\n    name: 'Migration to Angular',\n    url: 'migration',\n    type: 'link'\n  });\n\n  sections.push({\n    name: 'Contributors',\n    url: 'contributors',\n    type: 'link'\n  });\n\n  sections.push({\n    name: 'License',\n    url:  'license',\n    type: 'link',\n\n    // Add a hidden section so that the title in the toolbar is properly set\n    hidden: true\n  });\n\n  function sortByName(a,b) {\n    return a.name < b.name ? -1 : 1;\n  }\n\n  var self;\n\n  $rootScope.$on('$locationChangeSuccess', onLocationChange);\n\n  $http.get(\"/docs.json\")\n      .then(function(response) {\n        response = response.data;\n        var versionId = getVersionIdFromPath();\n        var head = { type: 'version', url: '/HEAD', id: 'head', name: 'HEAD (master)', github: '' };\n        var commonVersions = versionId === 'head' ? [] : [head];\n        var knownVersions = getAllVersions();\n        var listVersions = knownVersions.filter(removeCurrentVersion);\n        var currentVersion = getCurrentVersion() || {name: 'local'};\n        version.current = currentVersion;\n        sections.unshift({\n          name: 'Documentation Version',\n          type: 'heading',\n          className: 'version-picker',\n          children: [{\n            name: currentVersion.name,\n            type: 'toggle',\n            pages: commonVersions.concat(listVersions)\n          }]\n        });\n        function removeCurrentVersion (version) {\n          switch (versionId) {\n            case version.id: return false;\n            case 'latest': return !version.latest;\n            default: return true;\n          }\n        }\n        function getAllVersions () {\n          if (response && response.versions && response.versions.length) {\n            return response.versions.map(function(version) {\n              var latest = response.latest === version;\n              return {\n                type: 'version',\n                url: '/' + version,\n                name: getVersionFullString({ id: version, latest: latest }),\n                id: version,\n                latest: latest,\n                github: 'tree/v' + version\n              };\n            });\n          }\n\n          return [];\n        }\n        function getVersionFullString (version) {\n          return version.latest\n              ? 'Latest Release (' + version.id + ')'\n              : 'Release ' + version.id;\n        }\n        function getCurrentVersion () {\n          switch (versionId) {\n            case 'head': return head;\n            case 'latest': return knownVersions.filter(getLatest)[0];\n            default: return knownVersions.filter(getVersion)[0];\n          }\n          function getLatest (version) { return version.latest; }\n          function getVersion (version) { return versionId === version.id; }\n        }\n        function getVersionIdFromPath () {\n          var path = $window.location.pathname;\n          if (path.length < 2) path = 'HEAD';\n          return path.match(/[^/]+/)[0].toLowerCase();\n        }\n      });\n\n  return self = {\n    version:  version,\n    sections: sections,\n\n    selectSection: function(section) {\n      self.openedSection = section;\n    },\n    toggleSelectSection: function(section) {\n      self.openedSection = (self.openedSection === section ? null : section);\n    },\n    isSectionSelected: function(section) {\n      return self.openedSection === section;\n    },\n\n    selectPage: function(section, page) {\n      self.currentSection = section;\n      self.currentPage = page;\n    },\n    isPageSelected: function(page) {\n      return self.currentPage === page;\n    }\n  };\n\n  function onLocationChange() {\n    var path = $location.path();\n    var introLink = {\n      name: \"Introduction\",\n      url:  \"/\",\n      type: \"link\"\n    };\n\n    if (path === '/') {\n      self.selectSection(introLink);\n      self.selectPage(introLink, introLink);\n      return;\n    }\n\n    var matchPage = function(section, page) {\n      if (path.indexOf(page.url) !== -1) {\n        self.selectSection(section);\n        self.selectPage(section, page);\n      }\n    };\n\n    sections.forEach(function(section) {\n      if (section.children) {\n        // matches nested section toggles, such as API or Customization\n        section.children.forEach(function(childSection){\n          if (childSection.pages){\n            childSection.pages.forEach(function(page){\n              matchPage(childSection, page);\n            });\n          }\n        });\n      }\n      else if (section.pages) {\n        // matches top-level section toggles, such as Demos\n        section.pages.forEach(function(page) {\n          matchPage(section, page);\n        });\n      }\n      else if (section.type === 'link') {\n        // matches top-level links, such as \"Getting Started\"\n        matchPage(section, section);\n      }\n    });\n  }\n}])\n\n.directive('menuLink', ['scrollCache', function(scrollCache) {\n  return {\n    scope: {\n      section: '='\n    },\n    templateUrl: 'partials/menu-link.tmpl.html',\n    link: function($scope, $element) {\n      var controller = $element.parent().controller();\n\n      $scope.isSelected = function() {\n        return controller.isSelected($scope.section);\n      };\n\n      $scope.focusSection = function() {\n        // set flag to be used later when\n        // $locationChangeSuccess calls openPage()\n        controller.autoFocusContent = true;\n        // set flag to be used later when $routeChangeStart saves scroll position\n        scrollCache.linkClicked = true;\n      };\n    }\n  };\n}])\n\n.directive('menuToggle', ['$mdUtil', '$animateCss', '$$rAF', function($mdUtil, $animateCss, $$rAF) {\n  return {\n    scope: {\n      section: '='\n    },\n    templateUrl: 'partials/menu-toggle.tmpl.html',\n    link: function($scope, $element) {\n      var controller = $element.parent().controller();\n\n      // Used for toggling the visibility of the accordion's content, after\n      // all of the animations are completed. This prevents users from being\n      // allowed to tab through to the hidden content.\n      $scope.renderContent = false;\n\n      $scope.isOpen = function() {\n        return controller.isOpen($scope.section);\n      };\n\n      $scope.toggle = function() {\n        controller.toggleOpen($scope.section);\n      };\n\n      $mdUtil.nextTick(function() {\n        $scope.$watch(function () {\n          return controller.isOpen($scope.section);\n        }, function (open) {\n          var $ul = $element.find('ul');\n          var $li = $ul[0].querySelector('a.active');\n\n          if (open) {\n            $scope.renderContent = true;\n          }\n\n          $$rAF(function() {\n            var targetHeight = open ? $ul[0].scrollHeight : 0;\n\n            $animateCss($ul, {\n              easing: 'cubic-bezier(0.35, 0, 0.25, 1)',\n              to: { height: targetHeight + 'px' },\n              duration: 0.75 // seconds\n            }).start().then(function() {\n              var $li = $ul[0].querySelector('a.active');\n\n              $scope.renderContent = open;\n\n              if (open && $li && $ul[0].scrollTop === 0) {\n                var activeHeight = $li.scrollHeight;\n                var activeOffset = $li.offsetTop;\n                var offsetParent = $li.offsetParent;\n                var parentScrollPosition = offsetParent ? offsetParent.offsetTop : 0;\n\n                // Reduce it a bit (2 list items' height worth) so it doesn't touch the nav\n                var negativeOffset = activeHeight * 2;\n                var newScrollTop = activeOffset + parentScrollPosition - negativeOffset;\n\n                $mdUtil.animateScrollTo(document.querySelector('.docs-menu').parentNode, newScrollTop);\n              }\n            });\n          });\n        });\n      });\n\n      var parentNode = $element[0].parentNode.parentNode.parentNode;\n      if (parentNode.classList.contains('parent-list-item')) {\n        var heading = parentNode.querySelector('h2');\n        $element[0].firstChild.setAttribute('aria-describedby', heading.id);\n      }\n    }\n  };\n}])\n\n.controller('DocsCtrl', [\n  '$scope',\n  'COMPONENTS',\n  'BUILDCONFIG',\n  '$mdSidenav',\n  '$timeout',\n  '$mdDialog',\n  'menu',\n  '$location',\n  '$rootScope',\n  '$mdUtil',\nfunction($scope, COMPONENTS, BUILDCONFIG, $mdSidenav, $timeout, $mdDialog, menu, $location, $rootScope, $mdUtil) {\n  var self = this;\n\n  $scope.COMPONENTS = COMPONENTS;\n  $scope.BUILDCONFIG = BUILDCONFIG;\n  $scope.menu = menu;\n\n  $scope.path = path;\n  $scope.goHome = goHome;\n  $scope.openMenu = openMenu;\n  $scope.closeMenu = closeMenu;\n  $scope.isSectionSelected = isSectionSelected;\n  $scope.scrollTop = scrollTop;\n\n  // Grab the current year so we don't have to update the license every year\n  $scope.thisYear = (new Date()).getFullYear();\n\n  $rootScope.$on('$locationChangeSuccess', openPage);\n  $scope.focusMainContent = focusMainContent;\n\n  // Define a fake model for the related page selector\n  Object.defineProperty($rootScope, \"relatedPage\", {\n    get: function () { return null; },\n    set: angular.noop,\n    enumerable: true,\n    configurable: true\n  });\n\n  $rootScope.redirectToUrl = function(url) {\n    $location.path(url);\n    $timeout(function () { $rootScope.relatedPage = null; }, 100);\n  };\n\n  // Methods used by menuLink and menuToggle directives\n  this.isOpen = isOpen;\n  this.isSelected = isSelected;\n  this.toggleOpen = toggleOpen;\n  this.autoFocusContent = false;\n\n\n  var mainContentArea = document.querySelector(\"main\");\n  var mainContentHeader = mainContentArea.querySelector(\".md-breadcrumb\");\n  var scrollContentEl = mainContentArea.querySelector('md-content[md-scroll-y]');\n\n\n  // *********************\n  // Internal methods\n  // *********************\n\n  function closeMenu() {\n    $timeout(function() { $mdSidenav('left').close(); });\n  }\n\n  function openMenu() {\n    $timeout(function() { $mdSidenav('left').open(); });\n  }\n\n  function path() {\n    return $location.path();\n  }\n\n  function scrollTop() {\n    $mdUtil.animateScrollTo(scrollContentEl, 0, 200);\n  }\n\n  function goHome($event) {\n    menu.selectPage(null, null);\n    $location.path('/');\n  }\n\n  function openPage() {\n    $scope.closeMenu();\n\n    if (self.autoFocusContent) {\n      focusMainContent();\n      self.autoFocusContent = false;\n    }\n  }\n\n  function focusMainContent($event) {\n    $scope.closeMenu();\n    // prevent skip link from redirecting\n    if ($event) { $event.preventDefault(); }\n\n    $timeout(function(){\n      mainContentHeader.focus();\n    }, 90);\n\n  }\n\n  function isSelected(page) {\n    return menu.isPageSelected(page);\n  }\n\n  function isSectionSelected(section) {\n    var selected = false;\n    var openedSection = menu.openedSection;\n    if (openedSection === section){\n      selected = true;\n    }\n    else if (section.children) {\n      section.children.forEach(function(childSection) {\n        if (childSection === openedSection){\n          selected = true;\n        }\n      });\n    }\n    return selected;\n  }\n\n  function isOpen(section) {\n    return menu.isSectionSelected(section);\n  }\n\n  function toggleOpen(section) {\n    menu.toggleSelectSection(section);\n  }\n}])\n\n.controller('HomeCtrl', [\n  '$scope',\n  '$rootScope',\nfunction($scope, $rootScope) {\n  $rootScope.currentComponent = $rootScope.currentDoc = null;\n}])\n\n\n.controller('GuideCtrl', [\n  '$rootScope', '$http',\nfunction($rootScope, $http) {\n  $rootScope.currentComponent = $rootScope.currentDoc = null;\n  if (!$rootScope.contributors) {\n    $http\n      .get('./contributors.json')\n      .then(function(response) {\n        $rootScope.github = response.data;\n      })\n  }\n}])\n\n.controller('LayoutCtrl', [\n  '$scope',\n  '$attrs',\n  '$location',\n  '$rootScope',\nfunction($scope, $attrs, $location, $rootScope) {\n  $rootScope.currentComponent = $rootScope.currentDoc = null;\n\n  $scope.exampleNotEditable = true;\n  $scope.layoutDemo = {\n    mainAxis: 'center',\n    crossAxis: 'center',\n    direction: 'row'\n  };\n  $scope.layoutAlign = function() {\n    return $scope.layoutDemo.mainAxis +\n     ($scope.layoutDemo.crossAxis ? ' ' + $scope.layoutDemo.crossAxis : '')\n  };\n}])\n\n.controller('LayoutTipsCtrl', [\nfunction() {\n  var self = this;\n\n  /*\n   * Flex Sizing - Odd\n   */\n  self.toggleButtonText = \"Hide\";\n\n  self.toggleContentSize = function() {\n    var contentEl = angular.element(document.getElementById('toHide'));\n\n    contentEl.toggleClass(\"ng-hide\");\n\n    self.toggleButtonText = contentEl.hasClass(\"ng-hide\") ? \"Show\" : \"Hide\";\n  };\n}])\n\n.controller('ComponentDocCtrl', [\n  '$scope',\n  'doc',\n  'component',\n  '$rootScope',\nfunction($scope, doc, component, $rootScope) {\n  $rootScope.currentComponent = component;\n  $rootScope.currentDoc = doc;\n}])\n\n.controller('DemoCtrl', [\n  '$rootScope',\n  '$scope',\n  'component',\n  'demos',\n  '$templateRequest',\nfunction($rootScope, $scope, component, demos, $templateRequest) {\n  $rootScope.currentComponent = component;\n  $rootScope.currentDoc = null;\n\n  $scope.demos = [];\n\n  angular.forEach(demos, function(demo) {\n    // Get displayed contents (un-minified)\n    var files = [demo.index]\n      .concat(demo.js || [])\n      .concat(demo.css || [])\n      .concat(demo.html || []);\n    files.forEach(function(file) {\n      file.httpPromise = $templateRequest(file.outputPath)\n        .then(function(response) {\n          file.contents = response\n            .replace('<head/>', '');\n          return file.contents;\n        });\n    });\n    demo.$files = files;\n    $scope.demos.push(demo);\n  });\n\n  $scope.demos = $scope.demos.sort(function(a,b) {\n    return a.name > b.name ? 1 : -1;\n  });\n\n}])\n\n.filter('nospace', function () {\n  return function (value) {\n    return (!value) ? '' : value.replace(/ /g, '');\n  };\n})\n.filter('humanizeDoc', function() {\n  return function(doc) {\n    if (!doc) return;\n    if (doc.type === 'directive') {\n      return doc.name.replace(/([A-Z])/g, function($1) {\n        return '-'+$1.toLowerCase();\n      });\n    }\n    return doc.label || doc.name;\n  };\n})\n\n.filter('directiveBrackets', function() {\n  return function(str, restrict) {\n    if (restrict) {\n      // If it is restricted to only attributes\n      if (!restrict.element && restrict.attribute) {\n        return '[' + str + ']';\n      }\n\n      // If it is restricted to elements and isn't a service\n      if (restrict.element && str.indexOf('-') > -1) {\n        return '<' + str + '>';\n      }\n\n      // TODO: Handle class/comment restrictions if we ever have any to document\n    }\n\n    // Just return the original string if we don't know what to do with it\n    return str;\n  };\n})\n\n/** Directive which applies a specified class to the element when being scrolled */\n.directive('docsScrollClass', function() {\n  return {\n    restrict: 'A',\n    link: function(scope, element, attr) {\n\n      var scrollParent = element.parent();\n      var isScrolling = false;\n\n      // Initial update of the state.\n      updateState();\n\n      // Register a scroll listener, which updates the state.\n      scrollParent.on('scroll', updateState);\n\n      function updateState() {\n        var newState = scrollParent[0].scrollTop !== 0;\n\n        if (newState !== isScrolling) {\n          element.toggleClass(attr.docsScrollClass, newState);\n        }\n\n        isScrolling = newState;\n      }\n    }\n  };\n})\n\n.factory('scrollCache', function() {\n  var cache = {};\n  var linkClicked = false;\n\n  function setScroll(key, scrollPostion) {\n    cache[key] = scrollPostion;\n  }\n\n  function getScroll(key) {\n    return cache[key] || 0;\n  }\n\n  return {\n    getScroll: getScroll,\n    setScroll: setScroll,\n    linkClicked: linkClicked\n  };\n})\n\n/**\n * This directive caches the scroll position for each route + templateUrl combination.\n * This helps in restoring the scroll when the user uses back or forward navigation to return\n * to a page.\n */\n.directive('cacheScrollPosition', ['$route', '$mdUtil', '$timeout', '$location', '$anchorScroll',\n  'scrollCache',\nfunction($route, $mdUtil, $timeout, $location, $anchorScroll, scrollCache) {\n  var mainContentArea = document.querySelector(\"main\");\n  var scrollContentEl = mainContentArea.querySelector('md-content[md-scroll-y]');\n\n  /**\n   * @param {Object} event Synthetic event object\n   * @param {Object} next Future route information\n   * @param {Object} current Current route information\n   */\n  var handleRouteChangeStart = function (event, next, current) {\n    // store scroll position for the current path + template\n    if ($route.current) {\n      scrollCache.setScroll(current.loadedTemplateUrl + \":\" + current.$$route.originalPath,\n        scrollContentEl.scrollTop);\n    }\n\n    // set scroll to 0 for next route, if explicitly clicked on link.\n    if (scrollCache.linkClicked) {\n      scrollCache.setScroll(next.$$route.templateUrl + \":\" + next.$$route.originalPath, 0);\n      scrollCache.linkClicked = false;\n    }\n  };\n\n  /**\n   * @param {Object} event Synthetic event object\n   * @param {Object} current Current route information\n   */\n  var handleRouteChangeSuccess = function (event, current) {\n    // if hash is specified explicitly, it trumps previously stored scroll position\n    if ($location.hash()) {\n      $anchorScroll();\n    } else {\n      // Get previous scroll position; if none, scroll to the top of the page\n      var prevScrollPos = scrollCache.getScroll(current.loadedTemplateUrl + \":\" +\n        current.$$route.originalPath);\n\n      $timeout(function() {\n        $mdUtil.animateScrollTo(scrollContentEl, prevScrollPos);\n      }, 0);\n    }\n  };\n\n  return function(scope) {\n    scope.$on('$routeChangeStart', handleRouteChangeStart);\n    scope.$on('$routeChangeSuccess', handleRouteChangeSuccess);\n  }\n}]);\n"
  },
  {
    "path": "docs/app/js/codepen.js",
    "content": "(function() {\n  angular.module('docsApp')\n    .factory('codepenDataAdapter', CodepenDataAdapter)\n    .factory('codepen', ['$demoAngularScripts', '$document', 'codepenDataAdapter', Codepen]);\n\n  // Provides a service to open a code example in CodePen.\n  function Codepen($demoAngularScripts, $document, codepenDataAdapter) {\n\n    // The following URL used to be HTTP and not HTTPS to allow us to do localhost testing\n    // It's no longer working, for more info:\n    // https://blog.codepen.io/2017/03/31/codepen-going-https/\n    var CODEPEN_API = 'https://codepen.io/pen/define/';\n\n    return {\n      editOnCodepen: editOnCodepen\n    };\n\n    // Creates a CodePen from the given demo model by posting to CodePen's API\n    // using a hidden form. The hidden form is necessary to avoid a CORS issue.\n    // See http://blog.codepen.io/documentation/api/prefill\n    function editOnCodepen(demo) {\n      var externalScripts = $demoAngularScripts.all();\n      externalScripts.push('https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.js');\n      // Needed for contact chips demos\n      externalScripts.push('https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js');\n      var data = codepenDataAdapter.translate(demo, externalScripts);\n      var form = buildForm(data);\n      $document.find('body').append(form);\n      form[0].submit();\n      form.remove();\n    }\n\n    // Builds a hidden form with data necessary to create a CodePen.\n    function buildForm(data) {\n      var form = angular.element(\n        '<form style=\"display: none;\" method=\"post\" target=\"_blank\" action=\"' +\n          CODEPEN_API +\n          '\"></form>'\n      );\n      var input = '<input type=\"hidden\" name=\"data\" value=\"' + escapeJsonQuotes(data) + '\" />';\n      form.append(input);\n      return form;\n    }\n\n    // Recommended by CodePen to escape quotes.\n    // See http://blog.codepen.io/documentation/api/prefill\n    function escapeJsonQuotes(json) {\n      return JSON.stringify(json)\n        .replace(/'/g, \"&amp;apos;\")\n        .replace(/\"/g, \"&amp;quot;\")\n        /**\n         * CodePen was unescaping &lt; (<) and &gt; (>) which caused, on some demos,\n         * an unclosed elements (like <md-select>).\n         * Used different unicode lookalike characters so it won't be considered as an element\n         */\n        .replace(/&amp;lt;/g, \"&#x02C2;\") // http://graphemica.com/%CB%82\n        .replace(/&amp;gt;/g, \"&#x02C3;\"); // http://graphemica.com/%CB%83\n    }\n  }\n\n  // Translates demo metadata and files into CodePen's post form data.  See api documentation for\n  // additional fields not used by this service. http://blog.codepen.io/documentation/api/prefill\n  function CodepenDataAdapter() {\n\n    // The following URL's need to use `localhost` as these values get replaced during release\n    var CORE_JS  = 'http://localhost:8080/angular-material.js';\n    var CORE_CSS = 'http://localhost:8080/angular-material.css';\n    var DOC_CSS  = 'http://localhost:8080/docs.css';              // CSS overrides for custom docs\n\n    var LINK_FONTS_ROBOTO = '<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic\">';\n\n    var UNSECURE_CACHE_JS = 'http://ngmaterial.assets.s3.amazonaws.com/svg-assets-cache.js';\n    var ASSET_CACHE_JS = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/svg-assets-cache.js';\n\n    return {\n      translate: translate\n    };\n\n    // Translates a demo model to match CodePen's post data\n    // See http://blog.codepen.io/documentation/api/prefill\n    function translate(demo, externalScripts) {\n      var files = demo.files;\n\n      return appendLicenses({\n        title: demo.title,\n        html: processHtml(demo),\n        head: LINK_FONTS_ROBOTO,\n\n        js: processJs(files.js),\n        css: mergeFiles(files.css).join(' '),\n\n        js_external: externalScripts.concat([ASSET_CACHE_JS, CORE_JS]).join(';'),\n        css_external: [CORE_CSS, DOC_CSS].join(';')\n      });\n    }\n\n    // Modifies index.html with necessary changes in order to display correctly in CodePen\n    // See each processor to determine how each modifies the html\n    function processHtml(demo) {\n\n      var allContent = demo.files.index.contents;\n\n      var processors = [\n        applyAngularAttributesToParentElement,\n        insertTemplatesAsScriptTags,\n        htmlEscapeAmpersand\n      ];\n\n      processors.forEach(function(processor) {\n        allContent = processor(allContent, demo);\n      });\n\n      return allContent;\n    }\n\n    /**\n     * Append MIT License information to all CodePen source samples(HTML, JS, CSS)\n     */\n    function appendLicenses(data) {\n\n      data.html = appendLicenseFor(data.html, 'html');\n      data.js   = appendLicenseFor(data.js, 'js');\n      data.css  = appendLicenseFor(data.css, 'css');\n\n      function appendLicenseFor(content, lang) {\n            var commentStart = '', commentEnd = '';\n\n        switch (lang) {\n          case 'html' : commentStart = '<!--'; commentEnd = '-->'; break;\n          case 'js'   : commentStart = '/**';  commentEnd = '**/'; break;\n          case 'css'  : commentStart = '/*';   commentEnd = '*/';  break;\n        }\n\n        return content + '\\n\\n'+\n          commentStart + '\\n'+\n          'Copyright 2020 Google LLC. All Rights Reserved. \\n'+\n          'Use of this source code is governed by an MIT-style license that can be found\\n'+\n          'in the LICENSE file at http://material.angularjs.org/HEAD/license.\\n'+\n          commentEnd;\n      }\n\n      return data;\n    }\n\n\n    // Applies modifications the JavaScript prior to sending to CodePen.\n    // Currently merges js files and replaces the module with the CodePen\n    // module. See documentation for replaceDemoModuleWithCodepenModule.\n    function processJs(jsFiles) {\n      var mergedJs = mergeFiles(jsFiles).join(' ');\n      var script = replaceDemoModuleWithCodepenModule(mergedJs);\n      return script;\n    }\n\n    // Maps file contents to an array\n    function mergeFiles(files) {\n      return files.map(function(file) {\n        return file.contents;\n      });\n    }\n\n    // Adds class to parent element so that styles are applied correctly.\n    // Adds ng-app attribute. This is the same module name provided in the asset-cache.js\n    function applyAngularAttributesToParentElement(html, demo) {\n      var tmp;\n\n      // Grab only the DIV for the demo...\n      angular.forEach(angular.element(html), function(it, key) {\n        if ((it.nodeName != \"SCRIPT\") && (it.nodeName != \"#text\")) {\n          tmp = angular.element(it);\n        }\n      });\n\n      tmp.addClass(demo.id);\n      tmp.attr('ng-app', 'MyApp');\n      return tmp[0].outerHTML;\n    }\n\n    // Adds templates inline in the html, so that templates are cached in the example.\n    function insertTemplatesAsScriptTags(indexHtml, demo) {\n      if (demo.files.html.length) {\n        var tmp = angular.element(indexHtml);\n        angular.forEach(demo.files.html, function(template) {\n          tmp.append(\"<script type='text/ng-template' id='\" +\n                     template.name + \"'>\" +\n                     template.contents +\n                     \"</script>\");\n        });\n        return tmp[0].outerHTML;\n      }\n      return indexHtml;\n    }\n\n    // Escapes ampersands so that after CodePen unescapes the html the escaped code block\n    // uses the correct escaped characters.\n    function htmlEscapeAmpersand(html) {\n      return html\n        .replace(/&/g, \"&amp;\");\n    }\n\n    // Required to make CodePen work. Demos define their own module when running on the\n    // docs site.  In order to ensure the CodePen example can use the svg-asset-cache.js, the\n    // module needs to match so that the $templateCache is populated with the necessary\n    // assets.\n    function replaceDemoModuleWithCodepenModule(file) {\n      var matchAngularModule =  /\\.module\\(('[^']*'|\"[^\"]*\")\\s*,(\\s*\\[([^\\]]*)\\]\\s*\\))/ig;\n      var modules = \"['ngMaterial', 'ngMessages', 'material.svgAssetsCache']\";\n\n      // See scripts.js for list of external AngularJS libraries used for the demos.\n\n      return file.replace(matchAngularModule, \".module('MyApp', \"+ modules + \")\");\n    }\n  }\n})();\n"
  },
  {
    "path": "docs/app/js/css-api-table.js",
    "content": "(function() {\n  angular.module('docsApp')\n    .directive('docsCssApiTable', DocsCssApiTableDirective)\n    .directive('docsCssSelector', DocsCssSelectorDirective);\n\n  function DocsCssApiTableDirective() {\n    return {\n      restrict: 'E',\n      transclude: true,\n\n      bindToController: true,\n      controller: function() {},\n      controllerAs: '$ctrl',\n\n      scope: {},\n\n      template:\n      '<table class=\"md-api-table md-css-table\">' +\n      '  <thead>' +\n      '    <tr><th>Available Selectors</th></tr>' +\n      '  </thead>' +\n      '  <tbody ng-transclude>' +\n      '  </tbody>' +\n      '</table>'\n    }\n  }\n\n  function DocsCssSelectorDirective() {\n    return {\n      restrict: 'E',\n      transclude: true,\n      replace: true,\n\n      bindToController: true,\n      controller: function() {},\n      controllerAs: '$ctrl',\n\n      scope: {\n        code: '@'\n      },\n\n      template:\n      '<tr>' +\n      '  <td>' +\n      '    <code class=\"md-css-selector\">{{$ctrl.code}}</code>' +\n      '    <span ng-transclude></span>' +\n      '  </td>' +\n      '</tr>'\n    }\n  }\n})();\n"
  },
  {
    "path": "docs/app/js/demo.js",
    "content": "angular.module('docsApp')\n.directive('layoutAlign', function() { return angular.noop; })\n.directive('layout', function() { return angular.noop; })\n.directive('docsDemo', ['$mdUtil', function($mdUtil) {\n  return {\n    restrict: 'E',\n    scope: true,\n    templateUrl: 'partials/docs-demo.tmpl.html',\n    transclude: true,\n    controller: ['$scope', '$element', '$attrs', '$interpolate', 'codepen', DocsDemoCtrl],\n    controllerAs: 'demoCtrl',\n    bindToController: true\n  };\n\n  function DocsDemoCtrl($scope, $element, $attrs, $interpolate, codepen) {\n    var self = this;\n\n    self.interpolateCode = angular.isDefined($attrs.interpolateCode);\n    self.demoId = $interpolate($attrs.demoId || '')($scope.$parent);\n    self.demoTitle = $interpolate($attrs.demoTitle || '')($scope.$parent);\n    self.demoModule = $interpolate($attrs.demoModule || '')($scope.$parent);\n\n    $attrs.$observe('demoTitle',  function(value) { self.demoTitle  = value || self.demoTitle; });\n    $attrs.$observe('demoId',     function(value) { self.demoId     = value || self.demoId; });\n    $attrs.$observe('demoModule', function(value) { self.demoModule = value || self.demoModule;  });\n\n    self.files = {\n      css: [], js: [], html: []\n    };\n\n    self.addFile = function(name, contentsPromise) {\n      var file = {\n        name: convertName(name),\n        contentsPromise: contentsPromise,\n        fileType: name.split('.').pop()\n      };\n      contentsPromise.then(function(contents) {\n        file.contents = contents;\n      });\n\n      if (name === 'index.html') {\n        self.files.index = file;\n      } else if (name === 'readme.html') {\n       self.demoDescription = file;\n      } else {\n        self.files[file.fileType] = self.files[file.fileType] || [];\n        self.files[file.fileType].push(file);\n      }\n\n      self.orderedFiles = []\n        .concat(self.files.index || [])\n        .concat(self.files.js || [])\n        .concat(self.files.css || [])\n        .concat(self.files.html || []);\n\n    };\n\n    self.editOnCodepen = function() {\n      codepen.editOnCodepen({\n        title: self.demoTitle,\n        files: self.files,\n        id: self.demoId,\n        module: self.demoModule\n      });\n    };\n\n    function convertName(name) {\n      switch (name) {\n        case \"index.html\" : return \"HTML\";\n        case \"script.js\" : return \"JS\";\n        case \"style.css\" : return \"CSS\";\n        case \"style.global.css\" : return \"CSS\";\n        default : return name;\n      }\n    }\n\n  }\n}])\n.directive('demoFile', ['$q', '$interpolate', function($q, $interpolate) {\n  return {\n    restrict: 'E',\n    require: '^docsDemo',\n    compile: compile\n  };\n\n  function compile(element, attr) {\n    var contentsAttr = attr.contents;\n    var html = element.html();\n    var name = attr.name;\n    element.contents().remove();\n\n    return function postLink(scope, element, attr, docsDemoCtrl) {\n      docsDemoCtrl.addFile(\n        $interpolate(name)(scope),\n        $q.when(scope.$eval(contentsAttr) || html)\n      );\n      element.remove();\n    };\n  }\n}])\n\n.filter('toHtml', ['$sce', function($sce) {\n  return function(str) {\n    return $sce.trustAsHtml(str);\n  };\n}]);\n"
  },
  {
    "path": "docs/app/js/demoInclude.js",
    "content": "angular.module('docsApp').directive('demoInclude', [\n  '$q',\n  '$compile',\n  '$timeout',\nfunction($q, $compile, $timeout) {\n  return {\n    restrict: 'E',\n    link: postLink\n  };\n\n  function postLink(scope, element, attr) {\n    var demoContainer;\n\n    // Interpret the expression given as `demo-include files=\"something\"`\n    var files = scope.$eval(attr.files) || {};\n    var ngModule = scope.$eval(attr.module) || '';\n\n    $timeout(handleDemoIndexFile);\n\n    /**\n     * Fetch the index file, and if it contains its own ngModule\n     * then bootstrap a new angular app with that ngModule. Otherwise, compile\n     * the demo into the current ng-app.\n     */\n    function handleDemoIndexFile() {\n      files.index.contentsPromise.then(function(contents) {\n        demoContainer = angular.element(\n          '<div class=\"demo-content ' + ngModule + '\">'\n        );\n\n        var isStandalone = !!ngModule;\n        var demoScope;\n        var demoCompileService;\n        if (isStandalone) {\n          angular.bootstrap(demoContainer[0], [ngModule]);\n          demoScope = demoContainer.scope();\n          demoCompileService = demoContainer.injector().get('$compile');\n          scope.$on('$destroy', function() {\n            demoScope.$destroy();\n          });\n\n        } else {\n          demoScope = scope.$new();\n          demoCompileService = $compile;\n        }\n\n        // Once everything is loaded, put the demo into the DOM\n        $q.all([\n          handleDemoStyles(),\n          handleDemoTemplates()\n        ]).finally(function() {\n          demoScope.$evalAsync(function() {\n            element.append(demoContainer);\n            demoContainer.html(contents);\n            demoCompileService(demoContainer.contents())(demoScope);\n          });\n        });\n      });\n\n    }\n\n\n    /**\n     * Fetch the demo styles, and append them to the DOM.\n     */\n    function handleDemoStyles() {\n      return $q.all(files.css.map(function(file) {\n        return file.contentsPromise;\n      }))\n      .then(function(styles) {\n        styles = styles.join('\\n'); // join styles as one string\n\n        var styleElement = angular.element('<style>' + styles + '</style>');\n        document.body.appendChild(styleElement[0]);\n\n        scope.$on('$destroy', function() {\n          styleElement.remove();\n        });\n      });\n\n    }\n\n    /**\n     * Fetch the templates for this demo, and put the templates into\n     * the demo app's templateCache, with a url that allows the demo apps\n     * to reference their templates local to the demo index file.\n     *\n     * For example, make it so the dialog demo can reference templateUrl\n     * 'my-dialog.tmpl.html' instead of having to reference the url\n     * 'generated/material.components.dialog/demo/demo1/my-dialog.tmpl.html'.\n     */\n    function handleDemoTemplates() {\n      return $q.all(files.html.map(function(file) {\n\n        return file.contentsPromise.then(function(contents) {\n          // Get the $templateCache instance that goes with the demo's specific ng-app.\n          var demoTemplateCache = demoContainer.injector().get('$templateCache');\n          demoTemplateCache.put(file.name, contents);\n\n          scope.$on('$destroy', function() {\n            demoTemplateCache.remove(file.name);\n          });\n\n        });\n\n      }));\n\n    }\n\n  }\n\n}]);\n"
  },
  {
    "path": "docs/app/js/highlight-angular.js",
    "content": "angular.module('docsApp')\n.directive('hljs', ['$timeout', '$q', '$interpolate', function($timeout, $q, $interpolate) {\n  return {\n    restrict: 'E',\n    compile: function(element, attr) {\n      var code;\n      // No attribute? code is the content\n      if (!attr.code) {\n        code = element.html();\n        element.empty();\n      }\n\n      return function(scope, element, attr) {\n\n        if (attr.code) {\n          // Attribute? code is the evaluation\n          code = scope.$eval(attr.code);\n        }\n        var shouldInterpolate = scope.$eval(attr.shouldInterpolate);\n\n        $q.when(code).then(function(code) {\n          if (code) {\n            if (shouldInterpolate) {\n              code = $interpolate(code)(scope);\n            }\n            var contentParent = angular.element(\n              '<pre><code class=\"highlight\" ng-non-bindable></code></pre>'\n            );\n            element.append(contentParent);\n            // Defer highlighting 1-frame to prevent GA interference...\n            $timeout(function() {\n              render(code, contentParent);\n            }, 34, false);\n          }\n        });\n\n        function render(contents, parent) {\n          var codeElement = parent.find('code');\n\n          // Strip excessive newlines and the leading/trailing newline (otherwise the whitespace\n          // calculations below are not correct).\n          var strippedContents = contents.replace(/\\n{2,}/g, '\\n\\n').replace(/^\\n/, '').replace(/\\n$/, '');\n          var lines = strippedContents.split('\\n');\n\n          // Make it so each line starts at 0 whitespace\n          var firstLineWhitespace = lines[0].match(/^\\s*/)[0];\n          var startingWhitespaceRegex = new RegExp('^' + firstLineWhitespace);\n          lines = lines.map(function(line) {\n            return line\n              .replace(startingWhitespaceRegex, '')\n              .replace(/\\s+$/, '');\n          });\n\n          var highlightedCode = hljs.highlight(attr.language || attr.lang, lines.join('\\n'), true);\n          highlightedCode.value = highlightedCode.value\n            .replace(/=<span class=\"hljs-value\">\"\"<\\/span>/gi, '')\n            .replace('<head>', '')\n            .replace('<head/>', '');\n          codeElement.append(highlightedCode.value).addClass('highlight');\n        }\n      };\n    }\n  };\n}]);\n"
  },
  {
    "path": "docs/app/js/highlight.pack.js",
    "content": "/*! highlight.js v9.15.6 | BSD3 License | git.io/hljslicense */\n!function(e){var n=\"object\"==typeof window&&window||\"object\"==typeof self&&self;\"undefined\"!=typeof exports?e(exports):n&&(n.hljs=e({}),\"function\"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var E=[],u=Object.keys,N={},g={},n=/^(no-?highlight|plain|text)$/i,R=/\\blang(?:uage)?-([\\w-]+)\\b/i,t=/((^(<[^>]+>|\\t|)+|(?:\\n)))/gm,r={case_insensitive:\"cI\",lexemes:\"l\",contains:\"c\",keywords:\"k\",subLanguage:\"sL\",className:\"cN\",begin:\"b\",beginKeywords:\"bK\",end:\"e\",endsWithParent:\"eW\",illegal:\"i\",excludeBegin:\"eB\",excludeEnd:\"eE\",returnBegin:\"rB\",returnEnd:\"rE\",relevance:\"r\",variants:\"v\",IDENT_RE:\"IR\",UNDERSCORE_IDENT_RE:\"UIR\",NUMBER_RE:\"NR\",C_NUMBER_RE:\"CNR\",BINARY_NUMBER_RE:\"BNR\",RE_STARTERS_RE:\"RSR\",BACKSLASH_ESCAPE:\"BE\",APOS_STRING_MODE:\"ASM\",QUOTE_STRING_MODE:\"QSM\",PHRASAL_WORDS_MODE:\"PWM\",C_LINE_COMMENT_MODE:\"CLCM\",C_BLOCK_COMMENT_MODE:\"CBCM\",HASH_COMMENT_MODE:\"HCM\",NUMBER_MODE:\"NM\",C_NUMBER_MODE:\"CNM\",BINARY_NUMBER_MODE:\"BNM\",CSS_NUMBER_MODE:\"CSSNM\",REGEXP_MODE:\"RM\",TITLE_MODE:\"TM\",UNDERSCORE_TITLE_MODE:\"UTM\",COMMENT:\"C\",beginRe:\"bR\",endRe:\"eR\",illegalRe:\"iR\",lexemesRe:\"lR\",terminators:\"t\",terminator_end:\"tE\"},b=\"</span>\",h={classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")}function d(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function p(e){return n.test(e)}function l(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function M(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:\"start\",offset:t,node:r}),t=e(r,t),d(r).match(/br|hr|img|input/)||a.push({event:\"stop\",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(c){function s(e){return e&&e.source||e}function o(e,n){return new RegExp(s(e),\"m\"+(c.cI?\"i\":\"\")+(n?\"g\":\"\"))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){var r={},a=function(t,e){c.cI&&(e=e.toLowerCase()),e.split(\" \").forEach(function(e){var n=e.split(\"|\");r[n[0]]=[t,n[1]?Number(n[1]):1]})};\"string\"==typeof t.k?a(\"keyword\",t.k):u(t.k).forEach(function(e){a(e,t.k[e])}),t.k=r}t.lR=o(t.l||/\\w+/,!0),e&&(t.bK&&(t.b=\"\\\\b(\"+t.bK.split(\" \").join(\"|\")+\")\\\\b\"),t.b||(t.b=/\\B|\\b/),t.bR=o(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\\B|\\b/),t.e&&(t.eR=o(t.e)),t.tE=s(t.e)||\"\",t.eW&&e.tE&&(t.tE+=(t.e?\"|\":\"\")+e.tE)),t.i&&(t.iR=o(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return(n=\"self\"===e?t:e).v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return l(n,{v:null},e)})),n.cached_variants||n.eW&&[l(n)]||[n];var n})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?\"\\\\.?(?:\"+e.b+\")\\\\.?\":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?o(function(e,n){for(var t=/\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./,r=0,a=\"\",i=0;i<e.length;i++){var c=r,o=s(e[i]);for(0<i&&(a+=n);0<o.length;){var u=t.exec(o);if(null==u){a+=o;break}a+=o.substring(0,u.index),o=o.substring(u.index+u[0].length),\"\\\\\"==u[0][0]&&u[1]?a+=\"\\\\\"+String(Number(u[1])+c):(a+=u[0],\"(\"==u[0]&&r++)}}return a}(i,\"|\"),!0):{exec:function(){return null}}}}(c)}function C(e,n,o,t){function u(e,n,t,r){var a='<span class=\"'+(r?\"\":h.classPrefix);return(a+=e+'\">')+n+(t?\"\":b)}function s(){g+=null!=E.sL?function(){var e=\"string\"==typeof E.sL;if(e&&!N[E.sL])return _(R);var n=e?C(E.sL,R,!0,i[E.sL]):O(R,E.sL.length?E.sL:void 0);return 0<E.r&&(d+=n.r),e&&(i[E.sL]=n.top),u(n.language,n.value,!1,!0)}():function(){var e,n,t,r,a,i,c;if(!E.k)return _(R);for(r=\"\",n=0,E.lR.lastIndex=0,t=E.lR.exec(R);t;)r+=_(R.substring(n,t.index)),a=E,i=t,c=f.cI?i[0].toLowerCase():i[0],(e=a.k.hasOwnProperty(c)&&a.k[c])?(d+=e[1],r+=u(e[0],_(t[0]))):r+=_(t[0]),n=E.lR.lastIndex,t=E.lR.exec(R);return r+_(R.substr(n))}(),R=\"\"}function l(e){g+=e.cN?u(e.cN,\"\",!0):\"\",E=Object.create(e,{parent:{value:E}})}function r(e,n){if(R+=e,null==n)return s(),0;var t=function(e,n){var t,r,a;for(t=0,r=n.c.length;t<r;t++)if(v(n.c[t].bR,e))return n.c[t].endSameAsBegin&&(n.c[t].eR=(a=n.c[t].bR.exec(e)[0],new RegExp(a.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\"),\"m\"))),n.c[t]}(n,E);if(t)return t.skip?R+=n:(t.eB&&(R+=n),s(),t.rB||t.eB||(R=n)),l(t),t.rB?0:n.length;var r,a,i=function e(n,t){if(v(n.eR,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.eW)return e(n.parent,t)}(E,n);if(i){var c=E;for(c.skip?R+=n:(c.rE||c.eE||(R+=n),s(),c.eE&&(R=n));E.cN&&(g+=b),E.skip||E.sL||(d+=E.r),(E=E.parent)!==i.parent;);return i.starts&&(i.endSameAsBegin&&(i.starts.eR=i.eR),l(i.starts)),c.rE?0:n.length}if(r=n,a=E,!o&&v(a.iR,r))throw new Error('Illegal lexeme \"'+n+'\" for mode \"'+(E.cN||\"<unnamed>\")+'\"');return R+=n,n.length||1}var f=S(e);if(!f)throw new Error('Unknown language: \"'+e+'\"');m(f);var a,E=t||f,i={},g=\"\";for(a=E;a!==f;a=a.parent)a.cN&&(g=u(a.cN,\"\",!0)+g);var R=\"\",d=0;try{for(var c,p,M=0;E.t.lastIndex=M,c=E.t.exec(n);)p=r(n.substring(M,c.index),c[0]),M=c.index+p;for(r(n.substr(M)),a=E;a.parent;a=a.parent)a.cN&&(g+=b);return{r:d,value:g,language:e,top:E}}catch(e){if(e.message&&-1!==e.message.indexOf(\"Illegal\"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(S).filter(s).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function B(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&\"\\n\"===e?\"<br>\":h.tabReplace?n.replace(/\\t/g,h.tabReplace):\"\"}):e}function c(e){var n,t,r,a,i,c,o,u,s,l,f=function(e){var n,t,r,a,i=e.className+\" \";if(i+=e.parentNode?e.parentNode.className:\"\",t=R.exec(i))return S(t[1])?t[1]:\"no-highlight\";for(n=0,r=(i=i.split(/\\s+/)).length;n<r;n++)if(p(a=i[n])||S(a))return a}(e);p(f)||(h.useBR?(n=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\")).innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\"):n=e,i=n.textContent,r=f?C(f,i,!0):O(i),(t=M(n)).length&&((a=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a=\"\",i=[];function c(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset<n[0].offset?e:n:\"start\"===n[0].event?e:n:e.length?e:n}function o(e){a+=\"<\"+d(e)+E.map.call(e.attributes,function(e){return\" \"+e.nodeName+'=\"'+_(e.value).replace('\"',\"&quot;\")+'\"'}).join(\"\")+\">\"}function u(e){a+=\"</\"+d(e)+\">\"}function s(e){(\"start\"===e.event?o:u)(e.node)}for(;e.length||n.length;){var l=c();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=c())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(o)}else\"start\"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,M(a),i)),r.value=B(r.value),e.innerHTML=r.value,e.className=(c=e.className,o=f,u=r.language,s=o?g[o]:u,l=[c.trim()],c.match(/\\bhljs\\b/)||l.push(\"hljs\"),-1===c.indexOf(s)&&l.push(s),l.join(\" \").trim()),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function o(){if(!o.called){o.called=!0;var e=document.querySelectorAll(\"pre code\");E.forEach.call(e,c)}}function S(e){return e=(e||\"\").toLowerCase(),N[e]||N[g[e]]}function s(e){var n=S(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=B,a.highlightBlock=c,a.configure=function(e){h=l(h,e)},a.initHighlighting=o,a.initHighlightingOnLoad=function(){addEventListener(\"DOMContentLoaded\",o,!1),addEventListener(\"load\",o,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){g[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=S,a.autoDetection=s,a.inherit=l,a.IR=a.IDENT_RE=\"[a-zA-Z]\\\\w*\",a.UIR=a.UNDERSCORE_IDENT_RE=\"[a-zA-Z_]\\\\w*\",a.NR=a.NUMBER_RE=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",a.CNR=a.C_NUMBER_RE=\"(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",a.BNR=a.BINARY_NUMBER_RE=\"\\\\b(0b[01]+)\",a.RSR=a.RE_STARTERS_RE=\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",a.BE=a.BACKSLASH_ESCAPE={b:\"\\\\\\\\[\\\\s\\\\S]\",r:0},a.ASM=a.APOS_STRING_MODE={cN:\"string\",b:\"'\",e:\"'\",i:\"\\\\n\",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:\"string\",b:'\"',e:'\"',i:\"\\\\n\",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:\"comment\",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:\"doctag\",b:\"(?:TODO|FIXME|NOTE|BUG|XXX):\",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C(\"//\",\"$\"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C(\"/\\\\*\",\"\\\\*/\"),a.HCM=a.HASH_COMMENT_MODE=a.C(\"#\",\"$\"),a.NM=a.NUMBER_MODE={cN:\"number\",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:\"number\",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:\"number\",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:\"number\",b:a.NR+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",r:0},a.RM=a.REGEXP_MODE={cN:\"regexp\",b:/\\//,e:/\\/[gimuy]*/,i:/\\n/,c:[a.BE,{b:/\\[/,e:/\\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:\"title\",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:\"title\",b:a.UIR,r:0},a.METHOD_GUARD={b:\"\\\\.\\\\s*\"+a.UIR,r:0},a});hljs.registerLanguage(\"bash\",function(e){var t={cN:\"variable\",v:[{b:/\\$[\\w\\d#@][\\w\\d_]*/},{b:/\\$\\{(.*?)}/}]},s={cN:\"string\",b:/\"/,e:/\"/,c:[e.BE,t,{cN:\"variable\",b:/\\$\\(/,e:/\\)/,c:[e.BE]}]};return{aliases:[\"sh\",\"zsh\"],l:/\\b-?[a-z\\._]+\\b/,k:{keyword:\"if then else elif fi for while in do done case esac function\",literal:\"true false\",built_in:\"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp\",_:\"-ne -eq -lt -gt -f -d -e -s -l -a\"},c:[{cN:\"meta\",b:/^#![^\\n]+sh\\s*$/,r:10},{cN:\"function\",b:/\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,rB:!0,c:[e.inherit(e.TM,{b:/\\w[\\w\\d_]*/})],r:0},e.HCM,s,{cN:\"string\",b:/'/,e:/'/},t]}});hljs.registerLanguage(\"shell\",function(s){return{aliases:[\"console\"],c:[{cN:\"meta\",b:\"^\\\\s{0,3}[\\\\w\\\\d\\\\[\\\\]()@-]*[>%$#]\",starts:{e:\"$\",sL:\"bash\"}}]}});hljs.registerLanguage(\"xml\",function(s){var e={eW:!0,i:/</,r:0,c:[{cN:\"attr\",b:\"[A-Za-z0-9\\\\._:-]+\",r:0},{b:/=\\s*/,r:0,c:[{cN:\"string\",endsParent:!0,v:[{b:/\"/,e:/\"/},{b:/'/,e:/'/},{b:/[^\\s\"'=<>`]+/}]}]}]};return{aliases:[\"html\",\"xhtml\",\"rss\",\"atom\",\"xjb\",\"xsd\",\"xsl\",\"plist\"],cI:!0,c:[{cN:\"meta\",b:\"<!DOCTYPE\",e:\">\",r:10,c:[{b:\"\\\\[\",e:\"\\\\]\"}]},s.C(\"\\x3c!--\",\"--\\x3e\",{r:10}),{b:\"<\\\\!\\\\[CDATA\\\\[\",e:\"\\\\]\\\\]>\",r:10},{cN:\"meta\",b:/<\\?xml/,e:/\\?>/,r:10},{b:/<\\?(php)?/,e:/\\?>/,sL:\"php\",c:[{b:\"/\\\\*\",e:\"\\\\*/\",skip:!0},{b:'b\"',e:'\"',skip:!0},{b:\"b'\",e:\"'\",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:\"tag\",b:\"<style(?=\\\\s|>|$)\",e:\">\",k:{name:\"style\"},c:[e],starts:{e:\"</style>\",rE:!0,sL:[\"css\",\"xml\"]}},{cN:\"tag\",b:\"<script(?=\\\\s|>|$)\",e:\">\",k:{name:\"script\"},c:[e],starts:{e:\"<\\/script>\",rE:!0,sL:[\"actionscript\",\"javascript\",\"handlebars\",\"xml\"]}},{cN:\"tag\",b:\"</?\",e:\"/?>\",c:[{cN:\"name\",b:/[^\\/><\\s]+/,r:0},e]}]}});hljs.registerLanguage(\"markdown\",function(e){return{aliases:[\"md\",\"mkdown\",\"mkd\"],c:[{cN:\"section\",v:[{b:\"^#{1,6}\",e:\"$\"},{b:\"^.+?\\\\n[=-]{2,}$\"}]},{b:\"<\",e:\">\",sL:\"xml\",r:0},{cN:\"bullet\",b:\"^([*+-]|(\\\\d+\\\\.))\\\\s+\"},{cN:\"strong\",b:\"[*_]{2}.+?[*_]{2}\"},{cN:\"emphasis\",v:[{b:\"\\\\*.+?\\\\*\"},{b:\"_.+?_\",r:0}]},{cN:\"quote\",b:\"^>\\\\s+\",e:\"$\"},{cN:\"code\",v:[{b:\"^```w*s*$\",e:\"^```s*$\"},{b:\"`.+?`\"},{b:\"^( {4}|\\t)\",e:\"$\",r:0}]},{b:\"^[-\\\\*]{3,}\",e:\"$\"},{b:\"\\\\[.+?\\\\][\\\\(\\\\[].*?[\\\\)\\\\]]\",rB:!0,c:[{cN:\"string\",b:\"\\\\[\",e:\"\\\\]\",eB:!0,rE:!0,r:0},{cN:\"link\",b:\"\\\\]\\\\(\",e:\"\\\\)\",eB:!0,eE:!0},{cN:\"symbol\",b:\"\\\\]\\\\[\",e:\"\\\\]\",eB:!0,eE:!0}],r:10},{b:/^\\[[^\\n]+\\]:/,rB:!0,c:[{cN:\"symbol\",b:/\\[/,e:/\\]/,eB:!0,eE:!0},{cN:\"link\",b:/:\\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage(\"typescript\",function(e){var r=\"[A-Za-z$_][0-9A-Za-z$_]*\",t={keyword:\"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise\"},n={cN:\"meta\",b:\"@\"+r},a={b:\"\\\\(\",e:/\\)/,k:t,c:[\"self\",e.QSM,e.ASM,e.NM]},o={cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:t,c:[e.CLCM,e.CBCM,n,a]};return{aliases:[\"ts\"],k:t,c:[{cN:\"meta\",b:/^\\s*['\"]use strict['\"]/},e.ASM,e.QSM,{cN:\"string\",b:\"`\",e:\"`\",c:[e.BE,{cN:\"subst\",b:\"\\\\$\\\\{\",e:\"\\\\}\"}]},e.CLCM,e.CBCM,{cN:\"number\",v:[{b:\"\\\\b(0[bB][01]+)\"},{b:\"\\\\b(0[oO][0-7]+)\"},{b:e.CNR}],r:0},{b:\"(\"+e.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[e.CLCM,e.CBCM,e.RM,{cN:\"function\",b:\"(\\\\(.*?\\\\)|\"+e.IR+\")\\\\s*=>\",rB:!0,e:\"\\\\s*=>\",c:[{cN:\"params\",v:[{b:e.IR},{b:/\\(\\s*\\)/},{b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:t,c:[\"self\",e.CLCM,e.CBCM]}]}]}],r:0},{cN:\"function\",b:\"function\",e:/[\\{;]/,eE:!0,k:t,c:[\"self\",e.inherit(e.TM,{b:r}),o],i:/%/,r:0},{bK:\"constructor\",e:/\\{/,eE:!0,c:[\"self\",o]},{b:/module\\./,k:{built_in:\"module\"},r:0},{bK:\"module\",e:/\\{/,eE:!0},{bK:\"interface\",e:/\\{/,eE:!0,k:\"interface extends\"},{b:/\\$[(.]/},{b:\"\\\\.\"+e.IR,r:0},n,a]}});hljs.registerLanguage(\"css\",function(e){var c={b:/[A-Z\\_\\.\\-]+\\s*:/,rB:!0,e:\";\",eW:!0,c:[{cN:\"attribute\",b:/\\S/,e:\":\",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\\w-]+\\(/,rB:!0,c:[{cN:\"built_in\",b:/[\\w-]+/},{b:/\\(/,e:/\\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:\"number\",b:\"#[0-9A-Fa-f]+\"},{cN:\"meta\",b:\"!important\"}]}}]};return{cI:!0,i:/[=\\/|'\\$]/,c:[e.CBCM,{cN:\"selector-id\",b:/#[A-Za-z0-9_-]+/},{cN:\"selector-class\",b:/\\.[A-Za-z0-9_-]+/},{cN:\"selector-attr\",b:/\\[/,e:/\\]/,i:\"$\"},{cN:\"selector-pseudo\",b:/:(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+/},{b:\"@(font-face|page)\",l:\"[a-z-]+\",k:\"font-face page\"},{b:\"@\",e:\"[{;]\",i:/:/,c:[{cN:\"keyword\",b:/\\w+/},{b:/\\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:\"selector-tag\",b:\"[a-zA-Z-][a-zA-Z0-9_-]*\",r:0},{b:\"{\",e:\"}\",i:/\\S/,c:[e.CBCM,c]}]}});hljs.registerLanguage(\"less\",function(e){var r=\"[\\\\w-]+\",t=\"(\"+r+\"|@{\"+r+\"})\",a=[],c=[],s=function(e){return{cN:\"string\",b:\"~?\"+e+\".*?\"+e}},b=function(e,r,t){return{cN:e,b:r,r:t}},n={b:\"\\\\(\",e:\"\\\\)\",c:c,r:0};c.push(e.CLCM,e.CBCM,s(\"'\"),s('\"'),e.CSSNM,{b:\"(url|data-uri)\\\\(\",starts:{cN:\"string\",e:\"[\\\\)\\\\n]\",eE:!0}},b(\"number\",\"#[0-9A-Fa-f]+\\\\b\"),n,b(\"variable\",\"@@?\"+r,10),b(\"variable\",\"@{\"+r+\"}\"),b(\"built_in\",\"~?`[^`]*?`\"),{cN:\"attribute\",b:r+\"\\\\s*:\",e:\":\",rB:!0,eE:!0},{cN:\"meta\",b:\"!important\"});var i=c.concat({b:\"{\",e:\"}\",c:a}),o={bK:\"when\",eW:!0,c:[{bK:\"and not\"}].concat(c)},u={b:t+\"\\\\s*:\",rB:!0,e:\"[;}]\",r:0,c:[{cN:\"attribute\",b:t,e:\":\",eE:!0,starts:{eW:!0,i:\"[<=$]\",r:0,c:c}}]},l={cN:\"keyword\",b:\"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\\\b\",starts:{e:\"[;{}]\",rE:!0,c:c,r:0}},C={cN:\"variable\",v:[{b:\"@\"+r+\"\\\\s*:\",r:15},{b:\"@\"+r}],starts:{e:\"[;}]\",rE:!0,c:i}},p={v:[{b:\"[\\\\.#:&\\\\[>]\",e:\"[;{}]\"},{b:t,e:\"{\"}],rB:!0,rE:!0,i:\"[<='$\\\"]\",r:0,c:[e.CLCM,e.CBCM,o,b(\"keyword\",\"all\\\\b\"),b(\"variable\",\"@{\"+r+\"}\"),b(\"selector-tag\",t+\"%?\",0),b(\"selector-id\",\"#\"+t),b(\"selector-class\",\"\\\\.\"+t,0),b(\"selector-tag\",\"&\",0),{cN:\"selector-attr\",b:\"\\\\[\",e:\"\\\\]\"},{cN:\"selector-pseudo\",b:/:(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+/},{b:\"\\\\(\",e:\"\\\\)\",c:i},{b:\"!important\"}]};return a.push(e.CLCM,e.CBCM,l,C,u,p),{cI:!0,i:\"[=>'/<($\\\"]\",c:a}});hljs.registerLanguage(\"json\",function(e){var i={literal:\"true false null\"},n=[e.QSM,e.CNM],r={e:\",\",eW:!0,eE:!0,c:n,k:i},t={b:\"{\",e:\"}\",c:[{cN:\"attr\",b:/\"/,e:/\"/,c:[e.BE],i:\"\\\\n\"},e.inherit(r,{b:/:/})],i:\"\\\\S\"},c={b:\"\\\\[\",e:\"\\\\]\",c:[e.inherit(r)],i:\"\\\\S\"};return n.splice(n.length,0,t,c),{c:n,k:i,i:\"\\\\S\"}});hljs.registerLanguage(\"scss\",function(e){var t={cN:\"variable\",b:\"(\\\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\\\b\"},i={cN:\"number\",b:\"#[0-9A-Fa-f]+\"};e.CSSNM,e.QSM,e.ASM,e.CBCM;return{cI:!0,i:\"[=/|']\",c:[e.CLCM,e.CBCM,{cN:\"selector-id\",b:\"\\\\#[A-Za-z0-9_-]+\",r:0},{cN:\"selector-class\",b:\"\\\\.[A-Za-z0-9_-]+\",r:0},{cN:\"selector-attr\",b:\"\\\\[\",e:\"\\\\]\",i:\"$\"},{cN:\"selector-tag\",b:\"\\\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\\\b\",r:0},{b:\":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)\"},{b:\"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)\"},t,{cN:\"attribute\",b:\"\\\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\\\b\",i:\"[^\\\\s]\"},{b:\"\\\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\\\b\"},{b:\":\",e:\";\",c:[t,i,e.CSSNM,e.QSM,e.ASM,{cN:\"meta\",b:\"!important\"}]},{b:\"@\",e:\"[{;]\",k:\"mixin include extend for if else each while charset import debug media page content font-face namespace warn\",c:[t,e.QSM,e.ASM,i,e.CSSNM,{b:\"\\\\s[A-Za-z0-9_.-]+\",r:0}]}]}});hljs.registerLanguage(\"javascript\",function(e){var r=\"[A-Za-z$_][0-9A-Za-z$_]*\",t={keyword:\"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise\"},a={cN:\"number\",v:[{b:\"\\\\b(0[bB][01]+)\"},{b:\"\\\\b(0[oO][0-7]+)\"},{b:e.CNR}],r:0},n={cN:\"subst\",b:\"\\\\$\\\\{\",e:\"\\\\}\",k:t,c:[]},c={cN:\"string\",b:\"`\",e:\"`\",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:[\"js\",\"jsx\"],k:t,c:[{cN:\"meta\",r:10,b:/^\\s*['\"]use (strict|asm)['\"]/},{cN:\"meta\",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\\s*/,r:0,c:[{b:r+\"\\\\s*:\",rB:!0,r:0,c:[{cN:\"attr\",b:r,r:0}]}]},{b:\"(\"+e.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[e.CLCM,e.CBCM,e.RM,{cN:\"function\",b:\"(\\\\(.*?\\\\)|\"+r+\")\\\\s*=>\",rB:!0,e:\"\\\\s*=>\",c:[{cN:\"params\",v:[{b:r},{b:/\\(\\s*\\)/},{b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\\/\\w+|\\w+\\/)>/,sL:\"xml\",c:[{b:/<\\w+\\s*\\/>/,skip:!0},{b:/<\\w+/,e:/(\\/\\w+|\\w+\\/)>/,skip:!0,c:[{b:/<\\w+\\s*\\/>/,skip:!0},\"self\"]}]}],r:0},{cN:\"function\",bK:\"function\",e:/\\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,c:s}],i:/\\[|%/},{b:/\\$[(.]/},e.METHOD_GUARD,{cN:\"class\",bK:\"class\",e:/[{;=]/,eE:!0,i:/[:\"\\[\\]]/,c:[{bK:\"extends\"},e.UTM]},{bK:\"constructor get set\",e:/\\{/,eE:!0}],i:/#(?!!)/}});\n"
  },
  {
    "path": "docs/app/js/ngPanel.js",
    "content": "/**\n * ngPanel by @matsko\n * https://github.com/matsko/ng-panel\n */\nangular.module('docsApp')\n  .directive('ngPanel', ['$animate', function($animate) {\n    return {\n      restrict: 'EA',\n      transclude: 'element',\n      terminal: true,\n      compile: function(elm, attrs) {\n        var attrExp = attrs.ngPanel || attrs['for'];\n        var regex = /^(\\S+)(?:\\s+track by (.+?))?$/;\n        var match = regex.exec(attrExp);\n\n        var watchCollection = true;\n        var objExp = match[1];\n        var trackExp = match[2];\n        if (trackExp) {\n          watchCollection = false;\n        } else {\n          trackExp = match[1];\n        }\n\n        return function(scope, $element, attrs, ctrl, $transclude) {\n          var previousElement, previousScope;\n          scope[watchCollection ? '$watchCollection' : '$watch'](trackExp, function(value) {\n            if (previousElement) {\n              $animate.leave(previousElement);\n            }\n            if (previousScope) {\n              previousScope.$destroy();\n              previousScope = null;\n            }\n            var record = watchCollection ? value : scope.$eval(objExp);\n            previousScope = scope.$new();\n            $transclude(previousScope, function(element) {\n              previousElement = element;\n              $animate.enter(element, null, $element);\n            });\n          });\n        };\n      }\n    };\n  }]);\n"
  },
  {
    "path": "docs/app/js/preload.js",
    "content": ""
  },
  {
    "path": "docs/app/js/scripts.js",
    "content": "(function() {\n  angular.module('docsApp')\n    .factory('$demoAngularScripts', ['BUILDCONFIG', DemoAngularScripts]);\n\n  function DemoAngularScripts(BUILDCONFIG) {\n    var scripts = [\n      'angular.js',\n      'angular-animate.min.js',\n      'angular-route.min.js',\n      'angular-aria.min.js',\n      'angular-messages.min.js'\n    ];\n\n    return {\n      all: allAngularScripts\n    };\n\n    function allAngularScripts() {\n      return scripts.map(fullPathToScript);\n    }\n\n    function fullPathToScript(script) {\n      return \"https://ajax.googleapis.com/ajax/libs/angularjs/\" + BUILDCONFIG.ngVersion + \"/\" + script;\n    }\n  }\n})();\n"
  },
  {
    "path": "docs/app/partials/contributors.tmpl.html",
    "content": "<div ng-controller=\"GuideCtrl\" class=\"doc-content\">\n  <md-content>\n    <p>\n      We are thankful for the amazing community and <em>contributors</em> to AngularJS Material.<br/>\n      Shown below is a list of all our contributors: developers who submitted fixes and improvements to AngularJS Material.\n    </p>\n    <md-divider></md-divider>\n\n    <h2>Contributors</h2>\n\n    <p style=\"margin-top:-10px;\"> (sorted by number of commits)</p>\n    <br/>\n\n    <div class=\"contributor_tables\">\n\n      <!-- Use the 'contributors.json' generated by 'gulp build-contributors' -->\n\n      <table ng-repeat=\"row in github.contributors\"> \n        <thead>\n        <tr>\n          <th style=\"text-align:center\" ng-repeat=\"user in row\">\n            <a href=\"{{user.html_url}}\" >\n              <img  alt=\"{{user.login}}\"\n                    ng-src=\"{{user.avatar_url}}\"\n                    width=\"{{github.imageSize}}\" class=\"md-avatar\">\n            </a>\n          </th>\n        </tr>\n        </thead>\n        <tbody>\n        <tr>\n          <td style=\"text-align:center\" ng-repeat=\"user in row\">\n            <a href=\"{{user.html_url}}\" class=\"md-primary\">{{user.login}}</a>\n          </td>\n          <td></td>\n        </tr>\n        </tbody>\n      </table>\n\n    </div>\n  </md-content>\n</div>\n"
  },
  {
    "path": "docs/app/partials/demo.tmpl.html",
    "content": "<docs-demo\n    ng-repeat=\"demo in demos\"\n    demo-id=\"{{demo.id}}\"\n    demo-title=\"{{demo.label}}\"\n    demo-module=\"{{demo.ngModule.module}}\">\n  <demo-file\n      ng-repeat=\"file in demo.$files\"\n      name=\"{{file.name}}\"\n      contents=\"file.httpPromise\"></demo-file>\n</docs-demo>\n"
  },
  {
    "path": "docs/app/partials/docs-demo.tmpl.html",
    "content": "<div class=\"doc-demo-content doc-content\">\n  <div flex layout=\"column\" style=\"z-index:1\">\n\n    <div class=\"doc-description\" ng-bind-html=\"demoCtrl.demoDescription.contents | toHtml\"></div>\n\n    <div ng-transclude></div>\n\n    <section class=\"demo-container md-whiteframe-z1\"\n      ng-class=\"{'show-source': demoCtrl.$showSource}\" >\n\n      <md-toolbar class=\"demo-toolbar md-primary\">\n        <div class=\"md-toolbar-tools\">\n          <h3>{{demoCtrl.demoTitle}}</h3>\n          <span flex></span>\n          <md-button\n            class=\"md-icon-button\"\n            aria-label=\"View Source\"\n            ng-class=\"{ active: demoCtrl.$showSource }\"\n            ng-click=\"demoCtrl.$showSource = !demoCtrl.$showSource\">\n              <md-tooltip md-autohide>View Source</md-tooltip>\n              <md-icon md-svg-src=\"img/icons/ic_code_24px.svg\"></md-icon>\n          </md-button>\n          <md-button\n              ng-hide=\"{{exampleNotEditable}}\"\n              hide-sm\n              ng-click=\"demoCtrl.editOnCodepen()\"\n              aria-label=\"Edit on CodePen\"\n              class=\"md-icon-button\">\n            <md-tooltip md-autohide>Edit on CodePen</md-tooltip>\n            <md-icon md-svg-src=\"img/icons/codepen-logo.svg\"></md-icon>\n          </md-button>\n        </div>\n      </md-toolbar>\n\n      <!-- Source views -->\n      <md-tabs class=\"demo-source-tabs md-primary\" ng-show=\"demoCtrl.$showSource\" style=\"min-height: 0;\">\n        <md-tab ng-repeat=\"file in demoCtrl.orderedFiles\" label=\"{{file.name}}\">\n          <md-content md-scroll-y class=\"demo-source-container\">\n            <hljs class=\"no-header\" code=\"file.contentsPromise\" lang=\"{{file.fileType}}\" should-interpolate=\"demoCtrl.interpolateCode\">\n            </hljs>\n          </md-content>\n        </md-tab>\n      </md-tabs>\n\n      <!-- Live Demos -->\n      <demo-include files=\"demoCtrl.files\" module=\"demoCtrl.demoModule\" class=\"{{demoCtrl.demoId}}\">\n      </demo-include>\n    </section>\n\n  </div>\n</div>\n"
  },
  {
    "path": "docs/app/partials/getting-started.tmpl.html",
    "content": "<div ng-controller=\"GuideCtrl\" class=\"doc-content\">\n  <md-content>\n    <p>\n      <h2><em>New to AngularJS?</em> Before getting into AngularJS Material, it might be helpful to:</h2>\n    </p>\n    <p>\n      <ul>\n        <li>\n          Watch videos about <a\n            href=\"https://egghead.io/courses/angularjs-fundamentals\" target=\"_blank\"\n            title=\"AngularJS Framework\">AngularJS Fundamentals</a>\n        </li>\n        <li>\n          Read the\n          <a href=\"https://material.io/archive/guidelines/\" target=\"_blank\"\n             title=\"Material Design\">Material Design </a> specifications for components,\n          animations, styles, and layouts.\n        </li>\n      </ul>\n    </p>\n    <h2>How do I start with AngularJS Material?</h2>\n    <ul style=\"margin-bottom: 2em;\">\n      <li>\n        Get jump started with a free 30-minute video course: <a\n          href=\"https://egghead.io/courses/introduction-to-angular-material\" target=\"_blank\"\n          title=\"AngularJS Framework\">Introduction to AngularJS Material</a>\n      </li>\n      <li>\n        <a href=\"https://stackblitz.com/edit/angularjs-material-blank?file=app%2Fapp.template.html\"\n           target=\"_blank\" title=\"Blank AngularJS Material StackBlitz Demo\">\n          Start with a blank application on StackBlitz</a>\n      </li>\n      <li>\n        Test drive AngularJS Material examples on\n        <a href=\"https://codepen.io/team/AngularMaterial/\"\n           target=\"_blank\" title=\"AngularJS Material CodePen Examples\">\n          CodePen</a>\n      </li>\n      <li>\n        Checkout our\n        <a href=\"https://github.com/Splaktar/angularjs-angular-material-hybrid-demo\" target=\"_blank\"\n           title=\"AngularJS Material, Angular Material, TypeScript, Angular CLI repository\">\n        AngularJS Material + Angular Material + TypeScript + Angular CLI</a> repository\n      </li>\n      <li style=\"margin-bottom: 30px;\">\n        Checkout the <a href=\"https://github.com/angular/material-start/tree/typescript\" target=\"_blank\"\n           title=\"Material Start - Typescript and SystemJS\">AngularJS Material + TypeScript + SystemJS</a>\n        repository\n      </li>\n      <li>Use the \"Edit on CodePen\" button on any of our Demos<br/>\n        <img\n            src=\"https://cloud.githubusercontent.com/assets/210413/11568997/ed86795a-99b4-11e5-898e-1da172be80da.png\"\n            style=\"width:75%; margin: 10px 30px 0 0\" alt=\"Image with arrow to Edit on CodePen button\">\n      </li>\n    </ul>\n    <h3>Our CodePen Community</h3>\n    <p>\n      You can also visit our\n      <a href=\"https://codepen.io/team/AngularMaterial/\" target=\"_blank\"\n         title=\"Codepen Community\">CodePen Community</a> to explore more\n      <a href=\"https://codepen.io/team/AngularMaterial/pens/public/\" target=\"_blank\">samples</a>,\n      <a href=\"https://codepen.io/team/AngularMaterial/collections/public/\" target=\"_blank\">collections</a>, and ideas.\n    </p>\n    <br/>\n\n    <h3>Installing the AngularJS Material Libraries</h3>\n\n    <p>\n      You can\n      <a href=\"https://github.com/angular/bower-material/#installing-angularjs-material\"\n         target=\"_blank\">install the AngularJS Material library</a>\n      (and its dependent libraries) in your local project using\n      <a href=\"https://www.npmjs.com/\" target=\"_blank\">NPM</a>.\n    </p>\n\n    <p>\n      AngularJS Material also integrates with some additional, optional libraries which you may elect\n      to include:\n    </p>\n\n    <ul style=\"margin-bottom: 2em;\">\n      <li>\n        <a href=\"https://docs.angularjs.org/api/ngMessages\">ngMessages</a>\n        - Provides a consistent mechanism for displaying form errors and other messages.\n          <strong>Required</strong> for some AngularJS Material components like\n          <code>md-input</code>.\n      </li>\n      <li>\n        <a href=\"https://docs.angularjs.org/api/ngSanitize\">ngSanitize</a>\n        - The ngSanitize module provides functionality to sanitize HTML content in Material\n        components.\n      </li>\n\n      <li>\n        <a href=\"https://docs.angularjs.org/api/ngRoute\">ngRoute</a>\n        - Provides a clean routing system for your application.\n      </li>\n    </ul>\n\n    <br/>\n\n    <h3>Unsupported Integrations</h3>\n    <p>\n      AngularJS Material has known integration issues with the following libraries:\n    </p>\n    <ul style=\"margin-bottom: 2em;\">\n      <li>\n        <a href=\"https://docs.angularjs.org/api/ngTouch\">ngTouch</a>\n        - AngularJS Material conflicts with ngTouch for click, tap, and swipe support on touch-enabled\n        devices.\n      </li>\n\n      <li>\n        <a href=\"https://ionicframework.com/docs/v1/overview/\">Ionic v1</a>\n        - Has built-in touch support that interferes with AngularJS Material's mobile gesture features.\n          Ionic v1 is no longer officially supported by the Ionic team.\n      </li>\n    </ul>\n\n    <br/>\n    <h2>Getting help with AngularJS Material</h2>\n    <ul style=\"margin-bottom: 2em;\">\n      <li>StackOverflow's\n        <a href=\"https://stackoverflow.com/questions/tagged/angularjs-material\" target=\"_blank\"\n           title=\"AngularJS Material tag on StackOverflow\">\n          [angularjs-material] tag</a> is a good resources for solving problems.\n      </li>\n    </ul>\n  </md-content>\n</div>\n"
  },
  {
    "path": "docs/app/partials/home.tmpl.html",
    "content": "<div ng-controller=\"HomeCtrl\" class=\"doc-content\">\n  <md-content>\n    <h2 class=\"md-headline\" style=\"margin-top: 0;\">What is AngularJS Material?</h2>\n    <p>\n      AngularJS Material is an implementation of Google's\n      <a href=\"https://material.io/archive/guidelines/\" target=\"_blank\" rel=\"noopener\">\n        Material Design Specification (2014-2017)</a>.\n      This project provides a set of reusable, well-tested, and accessible UI components for\n      <a href=\"https://angularjs.org\" target=\"_blank\" rel=\"noopener\">AngularJS</a> developers.\n    </p>\n    <p>\n      AngularJS Material Long Term Support (LTS) has officially ended as of January 2022.\n      <a href=\"#long-term-support\">Find out more</a>.\n    </p>\n    <ul class=\"buckets\" layout layout-align=\"center center\" layout-wrap>\n      <li flex=\"50\" flex-gt-md=\"25\" ng-repeat=\"(index, link) in [\n        { href: './getting-started', icon: 'school', text: 'Getting Started' },\n        { href: './contributors', icon: 'school', text: 'Contributors' },\n        { href: './demo', icon: 'play_circle_fill', text: 'Demos' },\n        { href: './CSS/typography', icon: 'build', text: 'Customization' },\n        { href: './api', icon: 'code', text: 'API Reference' }\n      ]\">\n        <md-button\n            class=\"md-primary md-raised\"\n            ng-href=\"{{link.href}}\"\n            aria-label=\"{{link.text}}\">\n          <md-icon class=\"block\" md-svg-src=\"img/icons/ic_{{link.icon}}_24px.svg\"></md-icon>\n          {{link.text}}\n        </md-button>\n      </li>\n    </ul>\n\n    <h2 class=\"md-headline\">AngularJS versus Angular?</h2>\n    <p>\n      The AngularJS Material library is a mature and stable product that is ready for production\n      use. Developers should note that AngularJS Material works only with\n      <a href=\"https://angularjs.org/\" target=\"_blank\" rel=\"noopener\">AngularJS 1.x</a>.\n      AngularJS 1.x\n      <a href=\"https://docs.angularjs.org/misc/version-support-status\" target=\"_blank\" rel=\"noopener\">\n      Long Term Support (LTS)</a> has ended as of January 2022.\n    </p>\n    <i>\n      The Angular Material and Angular Component Dev Kit (CDK) libraries (for Angular v2+) can be found in the\n      <a href=\"https://github.com/angular/components\" target=\"_blank\" rel=\"noopener\">angular/components</a>\n      GitHub repository.\n    </i>\n    <br/>\n    <br/>\n    <h2 class=\"md-headline\">The Latest Material Design</h2>\n    <p>\n      The latest update to Material Design\n      (<a href=\"https://www.youtube.com/playlist?list=PLJ21zHI2TNh-rX-Xr_xi9KIEcbdee_1Ah\" target=\"_blank\" rel=\"noopener\">video playlist</a>)\n      was announced at Google I/O in May 2018\n      (<a href=\"https://design.google/library/io-2018-our-definitive-guide-design/\" target=\"_blank\" rel=\"noopener\">recap blog post</a>).\n      For an implementation of this new\n      <a href=\"https://material.io/design\" target=\"_blank\" rel=\"noopener\">Material Design Specification</a>,\n      please see the <a href=\"https://github.com/angular/components\" target=\"_blank\" rel=\"noopener\">Angular Material</a>\n      project which is built for <a href=\"https://angular.io\" target=\"_blank\" rel=\"noopener\">Angular</a>\n      developers.\n    </p>\n    <h2 id=\"long-term-support\" class=\"md-headline\">End-Of-Life</h2>\n    <p>\n      <strong>AngularJS Material support has officially ended as of January 2022.</strong>\n      <a href=\"https://docs.angularjs.org/misc/version-support-status\" target=\"_blank\" rel=\"noopener\">See what ending support means</a>\n      and <a href=\"https://goo.gle/angularjs-end-of-life\" target=\"_blank\" rel=\"noopener\">read the end of life announcement</a>.\n      Visit <a href=\"https://material.angular.io\" target=\"_blank\" rel=\"noopener\">material.angular.io</a>\n      for the actively supported Angular Material.\n    </p>\n    <p>\n      Find details on reporting security issues\n      <a href=\"https://github.com/angular/material/blob/master/SECURITY.md\">here</a>.\n    </p>\n    <h2 class=\"md-headline\">Change Log</h2>\n    <p>\n      Please refer to our changelog for up-to-date listings of all v1.x improvements and breaking\n      changes.\n    </p>\n     <ul class=\"buckets\" layout layout-align=\"center center\" layout-wrap>\n      <li flex=\"100\" flex-gt-xs=\"50\" ng-repeat=\"(index, link) in [\n        {\n          href: 'https://github.com/angular/material/blob/master/CHANGELOG.md',\n          icon: 'access_time',\n          text: 'Changelog'\n        }\n      ]\">\n        <md-button\n            class=\"md-primary md-raised\"\n            ng-href=\"{{link.href}}\"\n            aria-label=\"{{link.text}}\">\n          <md-icon class=\"block\" md-svg-src=\"img/icons/ic_{{link.icon}}_24px.svg\"></md-icon>\n          {{link.text}}<br/>\n          <div style=\"text-transform: none;margin-top:-15px;font-size:1.0em;\">\n            AngularJS Material v1.x\n          </div>\n        </md-button>\n      </li>\n    </ul>\n\n    <h2 class=\"md-headline\">Browser Support</h2>\n    <p>\n      AngularJS Material generally supports browsers that fall into these categories\n    </p>\n    <ul>\n      <li>Greater than 0.5% global usage</li>\n      <li>Last two major versions of Evergreen browsers</li>\n      <li>Firefox ESR</li>\n      <li>Not considered \"dead\" browsers</li>\n    </ul>\n    <br/>\n    <h3>The following table provides a more detailed view:</h3>\n    <table class=\"custom-table\">\n      <tbody>\n      <tr>\n        <th>\n          Browser\n        </th>\n        <th>\n          Supported Versions\n        </th>\n      </tr>\n      <tr>\n        <td>\n          Chrome<br/>Chrome for Android<br/>Edge<br/>Safari<br/>Opera\n        </td>\n        <td>\n          last 2 major versions\n        </td>\n      </tr>\n      <tr>\n        <td>\n          Firefox\n        </td>\n        <td>\n          last 2 major versions<br/>ESR\n        </td>\n      </tr>\n      <tr>\n        <td>\n          IE<br/>IE Mobile\n        </td>\n        <td>\n          11\n        </td>\n      </tr>\n      <tr>\n        <td>\n          Firefox for Android<br/>UC\n        </td>\n        <td>\n          latest version\n        </td>\n      </tr>\n      <tr>\n        <td>\n          Samsung Internet\n        </td>\n        <td>\n          12.x\n        </td>\n      </tr>\n      <tr>\n        <td>\n          Opera for Android\n        </td>\n        <td>\n          Mini all\n        </td>\n      </tr>\n      </tbody>\n    </table>\n\n    <h2 class=\"md-headline\">Screen Reader Support</h2>\n    <p>\n      AngularJS Material is built based on the\n      <a href=\"https://www.w3.org/TR/wai-aria-1.0/\" target=\"_blank\" rel=\"noopener\">\n        WAI-ARIA 1.0 W3C Recommendation</a>.\n    </p>\n    <h3>\n      AngularJS Material supports the following screen readers:\n    </h3>\n    <table class=\"custom-table\">\n      <tbody>\n      <tr>\n        <th>\n          Screen Reader\n        </th>\n        <th>\n          Supported Versions\n        </th>\n      </tr>\n      <tr>\n        <td>\n          NVDA<br/>JAWS\n        </td>\n        <td>\n          2019.x<br/>2020.x\n        </td>\n      </tr>\n      <tr>\n        <td>\n          Android Accessibility Suite\n        </td>\n        <td>\n          8.1.x<br/>8.2.x\n        </td>\n      </tr>\n      <tr>\n        <td>\n          ChromeVox on Chrome OS<br/>VoiceOver on macOS/iOS\n        </td>\n        <td>\n          last 2 major versions\n        </td>\n      </tr>\n      </tbody>\n    </table>\n\n    <md-divider></md-divider>\n\n    <br/>\n    <h2 class=\"md-headline\">Training Videos:</h2>\n    <p>\n      Here are some video courses that will help jump start your development with AngularJS Material.\n    </p>\n    <ul class=\"buckets\" layout layout-align=\"center center\" layout-wrap>\n      <li flex=\"100\" flex-gt-xs=\"50\" ng-repeat=\"(index, link) in [\n        { href: 'https://egghead.io/series/angular-material-introduction', icon: 'ondemand_video', text: 'Introduction to AngularJS Material', site : 'EggHead', access : 'free'},\n        { href: 'https://app.pluralsight.com/player?author=ajden-towfeek&name=angular-material-fundamentals-m0&mode=live&clip=0&course=angular-material-fundamentals', icon: 'ondemand_video', text: 'AngularJS Material Fundamentals', site : 'Pluralsight', access: 'member'}\n      ]\">\n        <md-button\n            class=\"md-primary md-raised\"\n            target=\"_blank\"\n            aria-label=\"{{link.text}}\"\n            ng-href=\"{{link.href}}\">\n          <md-icon class=\"block\" md-svg-src=\"img/icons/ic_{{link.icon}}_24px.svg\"></md-icon>\n          {{link.site}} | <span class=\"training_link\">{{link.text}}</span> | <span class=\"training_info\">{{link.access}}</span>\n        </md-button>\n      </li>\n    </ul>\n\n    <br/>\n    <h2 class=\"md-headline\">Conference Presentations:</h2>\n    <p>\n      Here are some conference presentations that will provide overviews for your development with\n      AngularJS Material.\n    </p>\n    <ul class=\"buckets\" layout layout-align=\"center center\" layout-wrap>\n      <li flex=\"100\" flex-gt-xs=\"50\" ng-repeat=\"(index, link) in [\n        { href: 'https://www.youtube.com/watch?v=rRiV_b3WsoY', icon: 'ondemand_video', text: 'AngularJS Material v1.1.0 Updates', site : 'ng-conf',  date: '2016'},\n        { href: 'https://www.youtube.com/watch?v=6PMe_wc0SjI', icon: 'ondemand_video', text: 'Adaptive UI with AngularJS Material', site : 'DevFest NC',  date: '2015'},\n        { href: 'https://www.youtube.com/watch?v=Qi31oO5u33U', icon: 'ondemand_video', text: 'Building with AngularJS Material', site : 'ng-conf',  date: '2015'},\n        { href: 'https://www.youtube.com/watch?v=363o4i0rdvU', icon: 'ondemand_video', text: 'AngularJS Material in Practice', site : 'AngularConnect', date:'2015'}\n      ]\">\n        <md-button\n            class=\"md-primary md-raised\"\n            target=\"_blank\"\n            aria-label=\"{{link.text}}\"\n            ng-href=\"{{link.href}}\">\n          <md-icon class=\"block\" md-svg-src=\"img/icons/ic_{{link.icon}}_24px.svg\"></md-icon>\n          <span class=\"training_site\">{{link.site}}</span> | <span class=\"training_link\">{{link.text}}</span> | <span class=\"training_info\">{{link.date}}</span>\n        </md-button>\n      </li>\n    </ul>\n\n    <br/>\n    <p class=\"md-caption\" style=\"text-align: center; margin-bottom: 0;\">\n      These docs were generated from\n      (<a ng-href=\"{{BUILDCONFIG.repository}}/{{menu.version.current.github}}\" target=\"_blank\"\n          rel=\"noopener\">v{{BUILDCONFIG.version}} - SHA {{BUILDCONFIG.commit.substring(0,7)}}</a>)\n      on (<strong>{{BUILDCONFIG.date}}</strong>) GMT.\n    </p>\n  </md-content>\n</div>\n\n"
  },
  {
    "path": "docs/app/partials/layout-alignment.tmpl.html",
    "content": "<div ng-controller=\"LayoutCtrl\" class=\"layout-content\" ng-cloak>\n\n  <p>\n    The <code>layout-align</code> directive takes two words.\n    The first word says how the children will be aligned in the layout's direction, and the second word says how the children will be aligned perpendicular to the layout's direction.</p>\n\n    <p>Only one value is required for this directive.\n    For example, <code>layout=\"row\" layout-align=\"center\"</code> would make the elements\n    center horizontally and use the default behavior vertically.</p>\n\n    <p><code>layout=\"column\" layout-align=\"center end\"</code> would make\n    children align along the center vertically and along the end (right) horizontally. </p>\n\n\n  <table class=\"md-api-table\">\n         <thead>\n           <tr>\n             <th>API</th>\n             <th>Sets child alignments within the layout container</th>\n           </tr>\n         </thead>\n          <tr>\n            <td>layout-align</td>\n            <td>Sets default alignment unless overridden by another breakpoint.</td>\n          </tr>\n          <tr>\n           <td>layout-align-xs</td>\n           <td>width &lt; <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-gt-xs</td>\n           <td>width &gt;= <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-sm</td>\n           <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-gt-sm</td>\n           <td>width &gt;= <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-md</td>\n           <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-gt-md</td>\n           <td>width &gt;= <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-lg</td>\n           <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-gt-lg</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>layout-align-xl</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n        </table>\n\n  <br/>\n\n  <p>\n   Below is an interactive demo that lets you explore the visual results of the different settings:\n  </p>\n\n  <div>\n    <docs-demo demo-title='layout=\"{{layoutDemo.direction}}\" &nbsp; &nbsp; &nbsp; layout-align=\"{{layoutAlign()}}\"'\n               class=\"small-demo colorNested\" interpolate-code=\"true\">\n      <demo-file name=\"index.html\">\n        <div layout=\"{{layoutDemo.direction}}\" layout-align=\"{{layoutAlign()}}\">\n          <div>one</div>\n          <div>two</div>\n          <div>three</div>\n        </div>\n      </demo-file>\n    </docs-demo>\n  </div>\n\n  <div layout=\"column\" layout-gt-sm=\"row\" layout-align=\"space-around\">\n\n    <div>\n      <md-subheader>Layout Direction</md-subheader>\n      <md-radio-group ng-model=\"layoutDemo.direction\">\n        <md-radio-button value=\"row\">row</md-radio-button>\n        <md-radio-button value=\"column\">column</md-radio-button>\n      </md-radio-group>\n    </div>\n    <div>\n      <md-subheader>Alignment in Layout Direction ({{layoutDemo.direction == 'row' ? 'horizontal' : 'vertical'}})</md-subheader>\n      <md-radio-group ng-model=\"layoutDemo.mainAxis\">\n        <md-radio-button value=\"\">none</md-radio-button>\n        <md-radio-button value=\"start\">start (default)</md-radio-button>\n        <md-radio-button value=\"center\">center</md-radio-button>\n        <md-radio-button value=\"end\">end</md-radio-button>\n        <md-radio-button value=\"space-around\">space-around</md-radio-button>\n        <md-radio-button value=\"space-between\">space-between</md-radio-button>\n      </md-radio-group>\n    </div>\n    <div>\n      <md-subheader>Alignment in Perpendicular Direction ({{layoutDemo.direction == 'column' ? 'horizontal' : 'vertical'}})</md-subheader>\n      <md-radio-group ng-model=\"layoutDemo.crossAxis\">\n        <md-radio-button value=\"none\"><em>none</em></md-radio-button>\n        <md-radio-button value=\"start\">start</md-radio-button>\n        <md-radio-button value=\"center\">center</md-radio-button>\n        <md-radio-button value=\"end\">end</md-radio-button>\n        <md-radio-button value=\"stretch\">stretch (default)</md-radio-button>\n      </md-radio-group>\n    </div>\n\n  </div>\n</div>\n"
  },
  {
    "path": "docs/app/partials/layout-children.tmpl.html",
    "content": "<div ng-controller=\"LayoutCtrl\" class=\"layout-content\" ng-cloak>\n\n  <h3>Children within a Layout Container</h3>\n\n  <p>\n    To customize the size and position of elements in a layout <b>container</b>, use the\n    <code>flex</code>, <code>flex-order</code>, and <code>flex-offset</code> attributes on the\n    container's <b>child</b> elements:\n  </p>\n\n  <docs-demo demo-title=\"Flex Directive\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\">\n        <div flex=\"20\">\n          [flex=\"20\"]\n        </div>\n        <div flex=\"70\">\n          [flex=\"70\"]\n        </div>\n        <div flex hide-sm hide-xs>\n          [flex]\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    Add the <code>flex</code> directive to a layout's child element and the element will flex\n    (grow or shrink) to fit the area unused by other elements. <code>flex</code> defines how the\n    element will adjust its size with respect to its <b>parent</b> container and the other elements\n    within the container.\n  </p>\n\n  <docs-demo demo-title=\"Flex Percent Values\" class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-wrap>\n        <div flex=\"30\">\n          [flex=\"30\"]\n        </div>\n        <div flex=\"45\">\n          [flex=\"45\"]\n        </div>\n        <div flex=\"25\">\n          [flex=\"25\"]\n        </div>\n        <div flex=\"33\">\n          [flex=\"33\"]\n        </div>\n        <div flex=\"66\">\n          [flex=\"66\"]\n        </div>\n        <div flex=\"50\">\n          [flex=\"50\"]\n        </div>\n        <div flex>\n          [flex]\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n\n  <p>\n    A layout child's <code>flex</code> directive can be given an integer value from 0-100.\n    The element will stretch to the percentage of available space matching the value. Currently, the <code>flex</code>\n    directive value is restricted to multiples of five, 33 or 66.\n  </p>\n\n  <p> For example: <code>flex=\"5\", flex=\"20\", flex=\"33\", flex=\"50\", flex=\"66\", flex=\"75\", ... flex=\"100\"</code>.</p>\n\n  <docs-demo demo-title=\"Responsive Flex Directives\" class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\">\n        <div flex-gt-sm=\"66\" flex=\"33\">\n          flex 33% on mobile, <br/>and 66% on gt-sm devices.\n        </div>\n        <div flex-gt-sm=\"33\" flex=\"66\">\n          flex 66% on mobile, <br/>and 33% on gt-sm devices.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    You can specify multiple <code>flex</code> directives on the same element in order to create\n    flexible responsive behaviors across device sizes.\n  </p>\n  <p>\n    Please take care not to overlap these directives, for example:\n    <code>flex=\"100\" flex-md=\"50\" flex-gt-sm=\"25\"</code>. In this example, there are two directives\n    that apply to \"medium\" devices (<code>50</code> and <code>25</code>).\n  </p>\n  <p>\n    The below example demonstrates how to use multiple <code>flex</code> directives overrides to\n    achieve a desirable outcome:\n  </p>\n\n  <docs-demo demo-title=\"Overriding Responsive Flex Directives\" class=\"colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-wrap>\n        <div flex=\"100\" flex-gt-sm=\"33\">\n          flex 100% on mobile, <br/>and 33% on gt-sm devices.\n        </div>\n        <div flex=\"100\" flex-gt-sm=\"66\">\n          flex 100% on mobile, <br/>and 66% on gt-sm devices.\n        </div>\n        <div flex=\"100\" flex-md=\"50\" flex-gt-md=\"25\">\n          flex 100% on mobile, 50% on md, and 25% on gt-md devices.\n        </div>\n        <div flex=\"100\" flex-md=\"50\" flex-gt-md=\"25\">\n          flex 100% on mobile, 50% on md, and 25% on gt-md devices.\n        </div>\n        <div flex=\"100\" flex-md=\"50\" flex-gt-md=\"25\">\n          flex 100% on mobile, 50% on md, and 25% on gt-md devices.\n        </div>\n        <div flex=\"100\" flex-md=\"50\" flex-gt-md=\"25\">\n          flex 100% on mobile, 50% on md, and 25% on gt-md devices.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    When a responsive layout directive like <code>layout-gt-sm</code> is active, any flex directives\n    within that layout, that you want applied, should be active at the same time. This means that\n    the flex directives that match up with <code>layout-gt-sm</code> would be\n    <code>flex-gt-sm</code> and not just <code>flex</code>.\n  </p>\n  <p>\n    This example demonstrates what happens when the proper flex suffix is omitted. In this case, the\n    <code>flex=\"66\"</code> directive is interpreted in context of the <code>layout=\"column\"</code>\n    layout. This is most likely not desirable.\n  </p>\n\n  <docs-demo demo-title=\"Incorrect use of Flex Directives within Responsive Layouts\"\n             class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"column\" layout-gt-sm=\"row\">\n        <!-- In order to work within a layout-gt-sm, the flex directive needs to match.\n             flex-gt-sm=\"33\" will work when layout-gt-sm=\"row\" is active, but flex=\"33\" would\n              only apply when layout=\"column\" is active. -->\n        <div flex-gt-sm=\"33\">\n          column layout on mobile, <br/>flex 33% on gt-sm devices.\n        </div>\n        <!-- In this case, we failed to use the gt-sm suffix with the flex directive,\n             resulting in undesirable behavior. -->\n        <div flex=\"66\">\n          [flex 66%]\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    Here's the same example as above with the correct <code>flex-gt-sm=\"66\"</code> directive:\n  </p>\n\n  <docs-demo demo-title=\"Use of Responsive Flex Directives within Responsive Layouts\"\n             class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"column\" layout-gt-sm=\"row\">\n        <div flex-gt-sm=\"33\">\n          column layout on mobile, <br/>flex 33% on gt-sm devices.\n        </div>\n        <div flex-gt-sm=\"66\">\n          column layout on mobile, <br/>flex 66% on gt-sm devices.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    See the <a href=\"layout/options\">layout options page</a> for more information on responsive flex\n    directives like <code>hide-sm</code> and <code>layout-wrap</code> used in the above examples.\n  </p>\n\n  <br/>\n  <hr>\n  <br/>\n\n  <h3>Additional Flex Values</h3>\n\n  <p>\n    There are additional flex values provided by AngularJS Material to improve flexibility and to make the API\n    easier to understand.\n  </p>\n\n  <docs-demo demo-title=\"Other Flex Values\" class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-wrap>\n        <div flex=\"none\">\n          [flex=\"none\"]\n        </div>\n        <div flex>\n          [flex]\n        </div>\n        <div flex=\"nogrow\">\n          [flex=\"nogrow\"]\n        </div>\n        <div flex=\"grow\">\n          [flex=\"grow\"]\n        </div>\n        <div flex=\"initial\">\n          [flex=\"initial\"]\n        </div>\n        <div flex=\"auto\">\n          [flex=\"auto\"]\n        </div>\n        <div flex=\"noshrink\">\n          [flex=\"noshrink\"]\n        </div>\n        <div flex=\"0\">\n          [flex=\"0\"]\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n\n  <table class=\"md-api-table\">\n    <tr>\n      <td>flex</td>\n      <td>\n        Will grow and shrink as needed. Starts with a size of 0%. Same as <code>flex=\"0\"</code>.\n        <br />\n        <br />\n        <b>Note:</b> There is a known bug with this attribute in IE11 when the parent container has\n        no explicit height set. See our\n        <a ng-href=\"layout/tips#layout-column-0px-ie11\">Troubleshooting</a> page for more info.\n      </td>\n    </tr>\n    <tr>\n      <td>flex=\"none\"</td>\n      <td>Will not grow or shrink. Sized based on its <code>width</code> and <code>height</code> values.</td>\n    </tr>\n    <tr>\n      <td>flex=\"initial\"</td>\n      <td>Will shrink as needed. Starts with a size based on its <code>width</code> and <code>height</code> values.</td>\n    </tr>\n    <tr>\n      <td>flex=\"auto\"</td>\n      <td>Will grow and shrink as needed. Starts with a size based on its <code>width</code> and <code>height</code> values.</td>\n    </tr>\n    <tr>\n      <td>flex=\"grow\"</td>\n      <td>Will grow and shrink as needed. Starts with a size of 100%. Same as <code>flex=\"100\"</code>.</td>\n    </tr>\n    <tr>\n      <td>flex=\"nogrow\"</td>\n      <td>Will shrink as needed, but won't grow. Starts with a size based on its <code>width</code> and <code>height</code> values.</td>\n    </tr>\n    <tr>\n      <td>flex=\"noshrink\"</td>\n      <td>Will grow as needed, but won't shrink. Starts with a size based on its <code>width</code> and <code>height</code> values.</td>\n    </tr>\n  </table>\n\n\n  <br/>\n  <hr>\n  <br/>\n\n  <h3>Ordering HTML Elements</h3>\n\n  <p>\n    Add the <code>flex-order</code> directive to a layout child to set its\n    order position within the layout container. Any integer value from -20 to 20 is accepted.\n  </p>\n\n  <docs-demo demo-title=\"Flex-Order Directive\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\">\n        <div flex flex-order=\"-1\">\n          <p>[flex-order=\"-1\"]</p>\n        </div>\n        <div flex flex-order=\"1\" flex-order-gt-md=\"3\">\n          <p hide-gt-md>[flex-order=\"1\"]</p>\n          <p hide show-gt-md>[flex-order-gt-md=\"3\"]</p>\n        </div>\n        <div flex flex-order=\"2\">\n          <p>[flex-order=\"2\"]</p>\n        </div>\n        <div flex flex-order=\"3\" flex-order-gt-md=\"1\">\n          <p hide-gt-md>[flex-order=\"3\"]</p>\n          <p hide show-gt-md>[flex-order-gt-md=\"1\"]</p>\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <table class=\"md-api-table\">\n      <thead>\n        <tr>\n          <th>API</th>\n          <th>Device <b>width</b> when breakpoint overrides default</th>\n        </tr>\n      </thead>\n       <tr>\n         <td>flex-order</td>\n         <td>Sets default layout order unless overridden by another breakpoint.</td>\n       </tr>\n    <tr>\n        <td>flex-order-xs</td>\n           <td>width &lt; <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-gt-xs</td>\n           <td>width &gt;= <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-sm</td>\n           <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-gt-sm</td>\n           <td>width &gt;= <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-md</td>\n           <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-gt-md</td>\n           <td>width &gt;= <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-lg</td>\n           <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-gt-lg</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-order-xl</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n     </table>\n\n\n  <p>\n    See the <a href=\"layout/options\">layout options page</a> for more information on directives like\n    <code>hide</code>, <code>hide-gt-md</code>, and <code>show-gt-md</code> used in the above examples.\n  </p>\n\n  <br/>\n  <hr>\n  <br/>\n\n  <h3>Add Offsets to the Preceding HTML Elements</h3>\n\n  <p>\n    Add the <code>flex-offset</code> directive to a layout child to set its\n    offset percentage within the layout container. Values must be multiples\n    of <code>5</code> or <code>33</code> / <code>66</code>. These offsets establish a <code>margin-left</code>\n    with respect to the preceding element or the containers left boundary.\n  </p>\n\n  <p>\n      When using <code>flex-offset</code> the margin-left offset is applied... regardless of your choice of <code>flex-order</code>.\n      or if you use a <code>flex-direction: reverse</code>.\n    </p>\n\n  <docs-demo demo-title=\"Flex-Offset Directive\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\">\n        <div flex=\"66\" flex-offset=\"15\">\n          [flex-offset=\"15\"]\n          [flex=\"66\"]\n        </div>\n        <div flex>\n          [flex]\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <table class=\"md-api-table\">\n        <thead>\n          <tr>\n            <th>API</th>\n            <th>Device width when breakpoint overrides default</th>\n          </tr>\n        </thead>\n         <tr>\n           <td>flex-offset</td>\n           <td>Sets default margin-left offset (<b>%-based</b>) unless overridden by another breakpoint.</td>\n         </tr>\n    <tr>\n           <td>flex-offset-xs</td>\n           <td>width &lt; <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-gt-xs</td>\n           <td>width &gt;= <b>600</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-sm</td>\n           <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-gt-sm</td>\n           <td>width &gt;= <b>960</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-md</td>\n           <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-gt-md</td>\n           <td>width &gt;= <b>1280</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-lg</td>\n           <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-gt-lg</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n         <tr>\n           <td>flex-offset-xl</td>\n           <td>width &gt;= <b>1920</b>px</td>\n         </tr>\n       </table>\n\n\n</div>\n"
  },
  {
    "path": "docs/app/partials/layout-container.tmpl.html",
    "content": "<div ng-controller=\"LayoutCtrl\" class=\"layout-content\" ng-cloak>\n\n  <h3>Layout and Containers</h3>\n\n  <p>\n    Use the <code>layout</code> directive on a container element to specify the layout direction for its children:\n    horizontally in a row (<code>layout=\"row\"</code>) or vertically in a column (<code>layout=\"column\"</code>).\n    Note that <code>row</code> is the default layout direction if you specify the <code>layout</code> directive without a value.\n  </p>\n\n  <table>\n    <tr>\n      <td style=\"font-weight: bold; background-color: #DBEEF5\">row</td>\n      <td style=\"padding-left: 10px;\">Items arranged horizontally. <code>max-height = 100%</code> and <code>max-width</code>  is the width of the items in the container.</td>\n    </tr>\n    <tr>\n      <td style=\"font-weight: bold; background-color: #DBEEF5 \">column</td>\n      <td style=\"padding-left: 10px;\">Items arranged vertically. <code>max-width = 100%</code>  and <code>max-height</code> is the height of the items in the container.</td>\n    </tr>\n  </table>\n\n  <br/>\n\n  <docs-demo demo-title=\"Layout Directive\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n    <div layout=\"row\">\n      <div flex>First item in row</div>\n      <div flex>Second item in row</div>\n    </div>\n    <div layout=\"column\">\n      <div flex>First item in column</div>\n      <div flex>Second item in column</div>\n    </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n      Note that <code>layout</code> only affects the flow direction for that container's <b>immediate</b> children.\n    </p>\n\n  <hr>\n\n  <br/>\n  <h3>Layouts and Responsive Breakpoints</h3>\n\n  <p>\n    As discussed in the <a href=\"layout/introduction\">Layout Introduction page</a> you can\n    make your layout change depending upon the device view size by using <b>breakpoint alias</b> suffixes.\n   </p>\n\n  <p>\n    To make your layout automatically change depending upon the device screen size, use one to the following <code>layout</code>\n    APIs to set the layout direction for devices with view widths:\n  </p>\n\n   <table class=\"md-api-table\">\n    <thead>\n      <tr>\n        <th>API</th>\n        <th>Device width when breakpoint overrides default</th>\n      </tr>\n    </thead>\n     <tr>\n       <td>layout</td>\n       <td>Sets default layout direction unless overridden by another breakpoint.</td>\n     </tr>\n     <tr>\n       <td>layout-xs</td>\n       <td>width &lt; <b>600</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-gt-xs</td>\n       <td>width &gt;= <b>600</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-sm</td>\n       <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-gt-sm</td>\n       <td>width &gt;= <b>960</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-md</td>\n       <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-gt-md</td>\n       <td>width &gt;= <b>1280</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-lg</td>\n       <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-gt-lg</td>\n       <td>width &gt;= <b>1920</b>px</td>\n     </tr>\n     <tr>\n       <td>layout-xl</td>\n       <td>width &gt;= <b>1920</b>px</td>\n     </tr>\n   </table>\n   <br/>\n\n  <p><a\n      href=\"https://camo.githubusercontent.com/ad81ae92f8b4285747ce4e48007bf3f104dd5630/687474703a2f2f6d6174657269616c2d64657369676e2e73746f726167652e676f6f676c65617069732e636f6d2f7075626c6973682f6d6174657269616c5f765f342f6d6174657269616c5f6578745f7075626c6973682f3042386f6c5631354a3761625053474678656d46695156527462316b2f6c61796f75745f61646170746976655f627265616b706f696e74735f30312e706e67\"\n      target=\"_blank\" style=\"text-decoration: none;border: 0 none;\">\n      <img\n      src=\"https://camo.githubusercontent.com/ad81ae92f8b4285747ce4e48007bf3f104dd5630/687474703a2f2f6d6174657269616c2d64657369676e2e73746f726167652e676f6f676c65617069732e636f6d2f7075626c6973682f6d6174657269616c5f765f342f6d6174657269616c5f6578745f7075626c6973682f3042386f6c5631354a3761625053474678656d46695156527462316b2f6c61796f75745f61646170746976655f627265616b706f696e74735f30312e706e67\"\n      alt=\"\"\n      style=\"max-width:100%;text-decoration: none;border: 0 none;\"></a>\n  </p>\n\n\n  <p>\n    For the demo below, as you shrink your browser window width notice the flow direction changes to <code>column</code>\n    for mobile devices (<code>xs</code>). And as you expand it will reset to <code>row</code>\n    for <code>gt-sm</code> view sizes.\n\n  </p>\n\n  <docs-demo demo-title=\"Responsive Layouts\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-xs=\"column\">\n        <div flex>\n          I'm above on mobile, and to the left on larger devices.\n        </div>\n        <div flex>\n          I'm below on mobile, and to the right on larger devices.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n\n\n  <p>\n    See the <a href=\"layout/options\">Layout Options page</a> for more options such as padding, alignments, etc.\n  </p>\n\n\n\n </div>\n\n"
  },
  {
    "path": "docs/app/partials/layout-introduction.tmpl.html",
    "content": "<div ng-controller=\"LayoutCtrl\" class=\"layout-content\" ng-cloak>\n\n  <h3>Overview</h3>\n  <p>\n    AngularJS Material's Layout features provide sugar to enable developers to more easily create modern,\n    responsive layouts on top of CSS3 <a href=\"http://www.w3.org/TR/css3-flexbox/\">flexbox</a>.\n    The layout API consists of a set of AngularJS directives that can\n    be applied to any of your application's HTML content.\n  </p>\n\n\n  <p>\n    Using <b> HTML Directives</b> as the API provides an easy way to set a value (eg. <code>layout=\"row\"</code>) and\n    helps with separation of concerns: Attributes define layout while CSS classes assign styling.\n  </p>\n\n\n  <table class=\"md-api-table\">\n    <thead>\n    <tr>\n      <th>HTML Markup API</th>\n      <th>Allowed values (raw or interpolated)</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n      <td>layout</td>\n      <td><code>row | column</code></td>\n    </tr>\n    <tr>\n      <td>flex</td>\n      <td> integer (increments of 5 for 0%->100%, 100%/3, 200%/3)</td>\n    </tr>\n    <tr>\n      <td>flex-order</td>\n      <td>integer values from -20 to 20</td>\n    </tr>\n    <tr>\n      <td>flex-offset</td>\n      <td>integer (increments of 5 for 0%->95%, 100%/3, 200%/3)</td>\n    </tr>\n    <tr>\n      <td>layout-align</td>\n      <td><code>start|center|end|space-around|space-between</code> <code>start|center|end|stretch</code></td>\n    </tr>\n    <tr>\n      <td>layout-fill</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>layout-wrap</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>layout-nowrap</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>layout-margin</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>layout-padding</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>show</td>\n      <td></td>\n    </tr>\n    <tr>\n      <td>hide</td>\n      <td></td>\n    </tr>\n    </tbody>\n  </table>\n\n\n  <p>And if we use Breakpoints as specified in Material Design:</p>\n  <p><a\n      href=\"https://camo.githubusercontent.com/ad81ae92f8b4285747ce4e48007bf3f104dd5630/687474703a2f2f6d6174657269616c2d64657369676e2e73746f726167652e676f6f676c65617069732e636f6d2f7075626c6973682f6d6174657269616c5f765f342f6d6174657269616c5f6578745f7075626c6973682f3042386f6c5631354a3761625053474678656d46695156527462316b2f6c61796f75745f61646170746976655f627265616b706f696e74735f30312e706e67\"\n      target=\"_blank\"><img\n      src=\"https://camo.githubusercontent.com/ad81ae92f8b4285747ce4e48007bf3f104dd5630/687474703a2f2f6d6174657269616c2d64657369676e2e73746f726167652e676f6f676c65617069732e636f6d2f7075626c6973682f6d6174657269616c5f765f342f6d6174657269616c5f6578745f7075626c6973682f3042386f6c5631354a3761625053474678656d46695156527462316b2f6c61796f75745f61646170746976655f627265616b706f696e74735f30312e706e67\"\n      alt=\"Breakpoints as specified in the Material Design Spec\"\n      style=\"max-width:100%;\"></a>\n  </p>\n\n\n  <p>We can associate breakpoints with mediaQuery definitions using breakpoint <strong>alias(es)</strong>:</p>\n\n  <table class=\"md-api-table\">\n    <thead>\n    <tr>\n      <th>Breakpoint</th>\n      <th>MediaQuery (pixel range)</th>\n    </tr>\n    </thead>\n    <tbody>\n    <tr>\n      <td>xs</td>\n      <td>'(max-width: <b>599</b>px)'</td>\n    </tr>\n    <tr>\n      <td>gt-xs</td>\n      <td>'(min-width: <b>600</b>px)'</td>\n    </tr>\n    <tr>\n      <td>sm</td>\n      <td>'(min-width: <b>600</b>px) and (max-width: <b>959</b>px)'</td>\n    </tr>\n    <tr>\n      <td>gt-sm</td>\n      <td>'(min-width: <b>960</b>px)'</td>\n    </tr>\n    <tr>\n      <td>md</td>\n      <td>'(min-width: <b>960</b>px) and (max-width: <b>1279</b>px)'</td>\n    </tr>\n    <tr>\n      <td>gt-md</td>\n      <td>'(min-width: <b>1280</b>px)'</td>\n    </tr>\n    <tr>\n      <td>lg</td>\n      <td>'(min-width: <b>1280</b>px) and (max-width: <b>1919</b>px)'</td>\n    </tr>\n    <tr>\n      <td>gt-lg</td>\n      <td>'(min-width: <b>1920</b>px)'</td>\n    </tr>\n    <tr>\n      <td>xl</td>\n      <td>'(min-width: <b>1920</b>px)'</td>\n    </tr>\n    </tbody>\n  </table>\n\n  <br/>\n  <hr>\n  <h3>\n    API with Responsive Breakpoints\n  </h3>\n\n  <p>Now we can combine the breakpoint <code>alias</code> with the Layout API to easily support Responsive breakpoints\n    with our simple Layout markup convention. The <code>alias</code> is simply used as <b>suffix</b> extensions to the Layout\n    API keyword.\n    <br/>e.g.\n  </p>\n\n  <p>\n    This notation results in, for example, the following table for the <code>layout</code> and <code>flex</code> APIs:\n  </p>\n\n  <table class=\"md-api-table\">\n      <thead>\n      <tr>\n        <th>layout API</th>\n        <th>flex API</th>\n        <th>Activates when device</th>\n      </tr>\n      </thead>\n      <tr>\n        <td>layout</td>\n        <td>flex</td>\n        <td>Sets default layout direction &amp; flex unless overridden by another breakpoint.</td>\n      </tr>\n      <tr>\n        <td>layout-xs</td>\n        <td>flex-xs</td>\n        <td>width &lt; <b>600</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-gt-xs</td>\n        <td>flex-gt-xs</td>\n        <td>width &gt;= <b>600</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-sm</td>\n        <td>flex-sm</td>\n        <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-gt-sm</td>\n        <td>flex-gt-sm</td>\n        <td>width &gt;= <b>960</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-md</td>\n        <td>flex-md</td>\n        <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-gt-md</td>\n        <td>flex-gt-md</td>\n        <td>width &gt;= <b>1280</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-lg</td>\n        <td>flex-lg</td>\n        <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-gt-lg</td>\n        <td>flex-gt-lg</td>\n        <td>width &gt;= <b>1920</b>px</td>\n      </tr>\n      <tr>\n        <td>layout-xl</td>\n        <td>flex-xl</td>\n        <td>width &gt;= <b>1920</b>px</td>\n      </tr>\n    </table>\n\n  <p>Below is an example usage of the Responsive Layout API:</p>\n\n  <hljs lang=\"html\">\n    <div layout='column' class=\"zero\">\n\n      <div flex=\"33\" flex-md=\"{{ vm.box1Width }}\" class=\"one\"></div>\n      <div flex=\"33\" layout=\"{{ vm.direction }}\" layout-md=\"row\" class=\"two\">\n\n        <div flex=\"20\" flex-md=\"10\" hide-lg class=\"two_one\"></div>\n        <div flex=\"30px\" show hide-md=\"{{ vm.hideBox }}\" flex-md=\"25\" class=\"two_two\"></div>\n        <div flex=\"20\" flex-md=\"65\" class=\"two_three\"></div>\n\n      </div>\n      <div flex class=\"three\"></div>\n\n    </div>\n  </hljs>\n\n  <br/>\n\n  <p>\n  This Layout API means it is much easier to set up and maintain flexbox layouts vs. defining everything via CSS.\n  The developer uses the Layout HTML API to specify <b><i>intention</i></b> and the Layout engine handles all the issues of CSS flexbox styling.\n  </p>\n\n  <p class=\"layout_note\">\n    The Layout engine will log console warnings when it encounters conflicts or known issues.\n  </p>\n\n\n  <br/><br/>\n  <hr>\n  <br/>\n\n  <h3>Under-the-Hood</h3>\n\n  <p>\n    Due to performance problems when using Attribute Selectors with <b>Internet Explorer</b> browsers; see the following for more details:\n  </p>\n\n  <p>\n    Layout directives dynamically generate class selectors at runtime. And the Layout CSS classNames and styles have each been\n    predefined in the <code>angular-material.css</code> stylesheet.\n  </p>\n\n  <p class=\"layout_note\">\n    Developers should continue to use Layout directives in the HTML\n    markup as the classes may change between releases.\n  </p>\n\n  <p>\n    Let's see how this directive-to-className transformation works. Consider the simple use of the <code>layout</code> and <code>flex</code> directives (API):\n  </p>\n\n  <hljs lang=\"html\">\n    <div>\n\n      <div layout=\"row\">\n\n        <div flex>First item in row</div>\n        <div flex=\"20\">Second item in row</div>\n\n      </div>\n      <div layout=\"column\">\n\n        <div flex=\"66\">First item in column</div>\n        <div flex=\"33\">Second item in column</div>\n\n      </div>\n\n    </div>\n  </hljs>\n\n\n  <p>\n    At runtime, these attributes are transformed to CSS classes.\n  </p>\n\n  <hljs lang=\"html\">\n    <div>\n\n      <div class=\"ng-scope layout-row\">\n\n        <div class=\"flex\">First item in row</div>\n        <div class=\"flex-20\">Second item in row</div>\n\n      </div>\n      <div class=\"ng-scope layout-column\">\n\n        <div class=\"flex-33\">First item in column</div>\n        <div class=\"flex-66\">Second item in column</div>\n\n      </div>\n\n    </div>\n  </hljs>\n\n  <p>\n    Using the style classes above defined in <code>angular-material.css</code>\n  </p>\n\n  <hljs lang=\"css\">\n\n    .flex {\n      -webkit-flex: 1 1 0%;\n          -ms-flex: 1 1 0%;\n              flex: 1 1 0%;\n      box-sizing: border-box;\n    }\n    .flex-20 {\n      -webkit-flex: 1 1 20%;\n          -ms-flex: 1 1 20%;\n              flex: 1 1 20%;\n      max-width: 20%;\n      max-height: 100%;\n      box-sizing: border-box;\n    }\n\n    .layout-row .flex-33 {\n      -webkit-flex: 1 1 calc(100% / 3);\n          -ms-flex: 1 1 calc(100% / 3);\n              flex: 1 1 calc(100% / 3);\n      box-sizing: border-box;\n    }\n\n    .layout-row  .flex-66 {\n      -webkit-flex: 1 1 calc(200% / 3);\n          -ms-flex: 1 1 calc(200% / 3);\n              flex: 1 1 calc(200% / 3);\n      box-sizing: border-box;\n    }\n\n\n    .layout-row .flex-33 {\n      max-width: calc(100% / 3);\n      max-height: 100%;\n    }\n\n    .layout-row  .flex-66 {\n      max-width: calc(200% / 3);\n      max-height: 100%;\n    }\n\n    .layout-column .flex-33 {\n      max-width: 100%;\n      max-height: calc(100% / 3);\n    }\n\n    .layout-column  .flex-66 {\n      max-width: 100%;\n      max-height: calc(200% / 3);\n    }\n  </hljs>\n\n</div>\n"
  },
  {
    "path": "docs/app/partials/layout-options.tmpl.html",
    "content": "<div ng-controller=\"LayoutCtrl\" class=\"layout-content layout-options\" ng-cloak>\n\n  <docs-demo demo-title=\"Responsive Layout\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-sm=\"column\">\n        <div flex>\n          I'm above on mobile, and to the left on larger devices.\n        </div>\n        <div flex>\n          I'm below on mobile, and to the right on larger devices.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    See the <a href=\"layout/container\">Container Elements</a> page for a basic explanation\n    of layout directives.\n    <br/>\n    To make your layout change depending upon the device screen size, there are\n    other <code>layout</code> directives available:\n  </p>\n\n  <table class=\"md-api-table\">\n    <thead>\n    <tr>\n      <th>API</th>\n      <th>Activates when device</th>\n    </tr>\n    </thead>\n    <tr>\n      <td>layout</td>\n      <td>Sets default layout direction unless overridden by another breakpoint.</td>\n    </tr>\n    <tr>\n      <td>layout-xs</td>\n      <td>width &lt; <b>600</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-gt-xs</td>\n      <td>width &gt;= <b>600</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-sm</td>\n      <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-gt-sm</td>\n      <td>width &gt;= <b>960</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-md</td>\n      <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-gt-md</td>\n      <td>width &gt;= <b>1280</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-lg</td>\n      <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-gt-lg</td>\n      <td>width &gt;= <b>1920</b>px</td>\n    </tr>\n    <tr>\n      <td>layout-xl</td>\n      <td>width &gt;= <b>1920</b>px</td>\n    </tr>\n  </table>\n  <br/>\n\n  <br/>\n  <hr>\n  <br/>\n\n  <h3>Layout Margin, Padding, Wrap and Fill</h3>\n  <br/>\n\n\n  <docs-demo demo-title=\"Layout Margin, Padding, and Fill\" class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-margin>\n        <div flex>Parent layout and this element have margins.</div>\n      </div>\n      <div layout=\"row\" layout-padding>\n        <div flex>Parent layout and this element have padding.</div>\n      </div>\n      <div layout=\"row\" layout-fill style=\"min-height: 224px;\">\n        <div flex>Parent layout is set to fill available space.</div>\n      </div>\n      <div layout=\"row\" layout-padding layout-margin layout-fill style=\"min-height: 224px;\">\n        <div flex>I am using all three at once.</div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    <code>layout-margin</code> adds margin around each <code>flex</code> child. It also adds a margin to the layout\n    container itself.\n    <br/>\n    <code>layout-padding</code> adds padding inside each <code>flex</code> child. It also adds padding to the layout\n    container itself.\n    <br/>\n    <code>layout-fill</code> forces the layout element to fill its parent container.\n  </p>\n\n\n  <p>Here is a non-trivial group of <code>flex</code> elements using <code>layout-wrap</code></p>\n\n  <docs-demo demo-title=\"Wrap\" class=\"small-demo colorNested-noPad\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\" layout-wrap>\n        <div flex=\"33\">[flex=33]</div>\n        <div flex=\"66\">[flex=66]</div>\n        <div flex=\"66\">[flex=66]</div>\n        <div flex=\"33\">[flex=33]</div>\n        <div flex=\"33\">[flex=33]</div>\n        <div flex=\"33\">[flex=33]</div>\n        <div flex=\"33\">[flex=33]</div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    <code>layout-wrap</code> allows <code>flex</code> children to wrap within the container if the elements use more\n    than 100%.\n    <br/>\n  </p>\n\n  <br/>\n\n  <br/>\n    <hr>\n    <br/>\n\n    <h3>Show &amp; Hide </h3>\n\n  <p>Use the <code>show</code> <code>hide</code> APIs to responsively show or hide elements. While these work similar\n  to <code>ng-show</code> and <code>ng-hide</code>, these AngularJS Material Layout directives are mediaQuery-aware.\n  </p>\n\n  <docs-demo demo-title=\"Hide and Show Directives\" class=\"small-demo colorNested\">\n    <demo-file name=\"index.html\">\n      <div layout=\"row\">\n        <div hide show-gt-sm flex>\n          Only show on gt-sm devices.\n        </div>\n        <div hide-gt-sm flex>\n          Shown on small and medium.<br/>\n          Hidden on gt-sm devices.\n        </div>\n        <div show hide-gt-md flex>\n          Shown on small and medium size devices.<br/>\n          Hidden on gt-md devices.\n        </div>\n        <div hide show-md flex>\n          Shown on medium size devices only.\n        </div>\n        <div hide show-gt-lg flex>\n          Shown on devices larger than 1200px wide only.\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n  <br/>\n  <table class=\"md-api-table\">\n    <thead>\n      <tr>\n        <th>hide (display: none)</th>\n        <th>show (negates hide)</th>\n        <th>Activates when:</th>\n      </tr>\n    </thead>\n    <tr>\n      <td>hide-xs</td>\n      <td>show-xs</td>\n      <td>width &lt; <b>600</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-gt-xs</td>\n      <td>show-gt-xs</td>\n      <td>width &gt;= <b>600</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-sm</td>\n      <td>show-sm</td>\n      <td><b>600</b>px &lt;= width &lt; <b>960</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-gt-sm</td>\n      <td>show-gt-sm</td>\n      <td>width &gt;= <b>960</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-md</td>\n      <td>show-md</td>\n      <td><b>960</b>px &lt;= width &lt; <b>1280</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-gt-md</td>\n      <td>show-gt-md</td>\n      <td>width &gt;= <b>1280</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-lg</td>\n      <td>show-lg</td>\n      <td><b>1280</b>px &lt;= width &lt; <b>1920</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-gt-lg</td>\n      <td>show-gt-lg</td>\n      <td>width &gt;= <b>1920</b>px</td>\n    </tr>\n    <tr>\n      <td>hide-xl</td>\n      <td>show-xl</td>\n      <td>width &gt;= <b>1920</b>px</td>\n    </tr>\n  </table>\n\n\n</div>\n"
  },
  {
    "path": "docs/app/partials/layout-tips.tmpl.html",
    "content": "<style>\n  ul.spaced li {\n    margin-bottom: 15px;\n  }\n</style>\n<div ng-controller=\"LayoutTipsCtrl as tips\" class=\"layout-content\">\n  <h3>Overview</h3>\n\n  <p>\n    The AngularJS Material Layout system uses the current\n    <a href=\"http://www.w3.org/TR/css3-flexbox/\">Flexbox</a> feature set. More importantly, it also\n    adds syntactic sugar to allow developers to easily and quickly add Responsive features to HTML\n    containers and elements.\n  </p>\n\n  <p>\n    As you use the Layout features, you may encounter scenarios where the layouts do not render as\n    expected; especially with IE 10 and 11 browsers. There may also be cases where you need to add\n    custom HTML, CSS and Javascript to achieve your desired results.\n  </p>\n\n\n  <br/>\n  <hr/>\n\n  <h3>Resources</h3>\n\n  <p>\n    If you are experiencing an issue in a particular browser, we highly recommend using the\n    following resources for known issues and workarounds.\n  </p>\n\n  <ul>\n    <li><a href=\"https://github.com/philipwalton/flexbugs#flexbugs\" target=\"_blank\">FlexBugs</a></li>\n    <li><a href=\"https://philipwalton.github.io/solved-by-flexbox/\" target=\"_blank\">Solved by FlexBugs</a></li>\n    <li><a href=\"http://philipwalton.com/articles/normalizing-cross-browser-flexbox-bugs/\" target=\"_blank\">Normalizing Cross-browser Flexbox Bugs</a></li>\n    <li style=\"margin-bottom: 20px;\"><a href=\"http://caniuse.com/#search=flex\" target=\"_blank\">Can I use flexbox...? ( see the <code>Known Issues</code> tab)</a></li>\n    <li><a href=\"https://groups.google.com/forum/#!forum/ngmaterial\">AngularJS Material Forum</a></li>\n    <li style=\"margin-top: 20px;\"><a href=\"https://css-tricks.com/snippets/css/a-guide-to-flexbox/\" target=\"_blank\">A Complete Guide to Flexbox</a></li>\n    <li style=\"margin-bottom: 20px;\"><a href=\"https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties\" target=\"_blank\">A Visual Guide to CSS3 Flexbox Properties</a></li>\n  </ul>\n\n\n  <br/>\n  <hr/>\n\n  <h3>General Tips</h3>\n\n  <p>\n    Below, you will find solutions to some of the more common scenarios and problems that may arise\n    when using Material's Layout system. The following sections offer general guidelines and tips when using the <code>flex</code> and\n        <code>layout</code> directives within your own applications.\n  </p>\n\n  <ul class=\"spaced\">\n    <li>\n      When building your application's Layout, it is usually best to start with a mobile version\n      that looks and works correctly, and then apply styling for larger devices using the\n      <code>flex-gt-*</code> or <code>hide-gt-*</code> attributes. This approach typically leads\n      to less frustration than starting big and attempting to fix issues on smaller devices.\n    </li>\n\n    <li>\n      Some elements like <code>&lt;fieldset&gt;</code> and <code>&lt;button&gt;</code> do not always\n      work correctly with flex. Additionally, some of the AngularJS Material components provide their\n      own styles. If you are having difficulty with a specific element/component, but not\n      others, try applying the flex attributes to a parent or child <code>&lt;div&gt;</code> of the\n      element instead.\n    </li>\n\n    <li>\n      Some Flexbox properties such as <code>flex-direction</code> <u>cannot</u> be animated.\n    </li>\n\n    <li>\n      Flexbox can behave differently on different browsers. You should test as many as possible on\n      a regular basis so that you can catch and fix layout issues more quickly.\n    </li>\n  </ul>\n\n  <br/>\n  <hr/>\n\n  <h3>Layout Column</h3>\n\n  <p>\n    In some scenarios <code>layout=\"column\"</code> and breakpoints (xs, gt-xs, xs, gt-sm, etc.) may not work\n    as expected due to CSS specificity rules.\n  </p>\n\n  <div class=\"md-whiteframe-3dp\" style=\"height: 700px\">\n    <iframe height='700' scrolling='no'\n            src='//codepen.io/team/AngularMaterial/embed/obgapg/?height=700&theme-id=21180&default-tab=result'\n            frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a\n        href='http://codepen.io/team/AngularMaterial/pen/obgapg/'>Card Layouts (corrected)</a> by AngularJS Material (<a\n        href='http://codepen.io/AngularMaterial'>@AngularMaterial</a>) on <a href='http://codepen.io'>CodePen</a>.\n    </iframe>\n  </div>\n\n    <p>\n      This is easily fixed simply by inverting the layout logic so that the default is <code>layout='row'</code>.\n      To see how the layout changes, shrink the browser window its width is <600px;\n    </p>\n\n\n  <br/>\n  <hr/>\n\n  <h3 id=\"layout-column-0px-ie11\">IE11 - Layout Column, 0px Height</h3>\n\n  <p>\n    In Internet Explorer 11, when you have a column layout with unspecified height and flex items\n    inside, the browser can get confused and incorrectly calculate the height of each item (and thus\n    the container) as <code>0px</code>, making the items overlap and not take up the proper amount\n    of space.\n  </p>\n\n  <p class=\"layout_note\">\n    <b>Note:</b> The flex items below actually do have some height. This is because our doc-specific\n    CSS provides a small bit of padding (<code>8px</code>). We felt that the extra padding made for\n    a better demo of the actual issue.\n  </p>\n\n  <docs-demo demo-title=\"IE11 - Layout Column, 0px Height\" class=\"colorNested\">\n    <demo-file name=\"index.html\">\n      <div flex layout=\"column\">\n        <div flex>\n          11111<br />11111<br />11111\n        </div>\n\n        <div flex>\n          22222<br />22222<br />22222\n        </div>\n\n        <div flex>\n          33333<br />33333<br />33333\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <p>\n    Unfortunately, there is no IE11 specific fix available, and the suggested workaround is to set\n    the <code>flex-basis</code> property to <code>auto</code> instead of <code>0px</code> (which is\n    the default setting).\n  </p>\n\n  <p>\n    You can easily achieve this using the <code>flex=\"auto\"</code> attribute that the Layout system\n    provides.\n  </p>\n\n  <docs-demo demo-title=\"IE11 - Layout Column, 0px Height (Fix 1)\" class=\"colorNested\">\n    <demo-file name=\"index.html\">\n      <div flex layout=\"column\">\n        <div flex=\"auto\">\n          11111<br />11111<br />11111\n        </div>\n\n        <div flex=\"auto\">\n          22222<br />22222<br />22222\n        </div>\n\n        <div flex=\"auto\">\n          33333<br />33333<br />33333\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n\n  <p>\n    Alternatively, you can manually set the height of the layout container (<code>400px</code>\n    in the demo below).\n  </p>\n\n  <docs-demo demo-title=\"IE11 - Layout Column, 0px Height (Fix 2)\" class=\"colorNested\">\n    <demo-file name=\"index.html\">\n      <div flex layout=\"column\" style=\"height: 400px;\">\n        <div flex>\n          11111<br />11111<br />11111\n        </div>\n\n        <div flex>\n          22222<br />22222<br />22222\n        </div>\n\n        <div flex>\n          33333<br />33333<br />33333\n        </div>\n      </div>\n    </demo-file>\n  </docs-demo>\n\n  <br/>\n  <hr/>\n\n  <h3>Flex Element Heights</h3>\n\n  <p>\n    Firefox currently has an issue calculating the proper height of flex containers whose children\n    are flex, but have more content than can properly fit within the container.\n  </p>\n\n  <p>\n    This is particularly problematic if the <code>flex</code> children are <code>md-content</code> components as\n    it will prevent the content from scrolling correctly, instead scrolling the entire body.\n  </p>\n\n  <div class=\"md-whiteframe-3dp\" style=\"height: 376px\">\n    <iframe height='376' scrolling='no'\n            src='//codepen.io/team/AngularMaterial/embed/NxKBwW/?height=376&theme-id=0&default-tab=result'\n            frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>\n      See the Pen <a href='http://codepen.io/team/AngularMaterial/pen/NxKBwW/'>AngularJS Material Basic App</a>\n      by AngularJS Material (<a href='http://codepen.io/AngularMaterial'>@AngularJSMaterial</a>)\n      on <a href='http://codepen.io'>CodePen</a>.\n    </iframe>\n  </div>\n\n  <p>\n    Notice in the above Codepen how we must set <code>overflow: auto</code> on the div with the\n    <code>change-my-css</code> class in order for Firefox to properly calculate the height and\n    shrink to the available space.\n  </p>\n\n</div>\n"
  },
  {
    "path": "docs/app/partials/license.tmpl.html",
    "content": "<div ng-controller=\"GuideCtrl\" class=\"doc-content\">\n  <md-content>\n    <p>The MIT License</p>\n\n    <p>\n      Copyright (c) 2020 Google LLC.\n      <a href=\"http://angularjs.org\">https://angularjs.org</a>\n    </p>\n\n    <p>\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    </p>\n\n    <p>\n      The above copyright notice and this permission notice shall be included in\n      all copies or substantial portions of the Software.\n    </p>\n\n    <p>\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    </p>\n  </md-content>\n</div>\n"
  },
  {
    "path": "docs/app/partials/menu-link.tmpl.html",
    "content": "<md-button\n    ng-class=\"{'active' : isSelected()}\"\n    ng-href=\"{{section.url}}\"\n    ng-click=\"focusSection()\">\n  {{section | humanizeDoc}}\n  <span class=\"md-visually-hidden\"\n    ng-if=\"isSelected()\">\n    current page\n  </span>\n</md-button>\n"
  },
  {
    "path": "docs/app/partials/menu-toggle.tmpl.html",
    "content": "<md-button class=\"md-button-toggle\"\n  ng-click=\"toggle()\"\n  aria-controls=\"docs-menu-{{section.name | nospace}}\"\n  aria-expanded=\"{{isOpen()}}\">\n  <div flex layout=\"row\">\n    {{section.name}}\n    <span flex></span>\n    <span aria-hidden=\"true\" class=\"md-toggle-icon\"\n    ng-class=\"{'toggled' : isOpen()}\">\n      <md-icon md-svg-icon=\"md-toggle-arrow\"></md-icon>\n    </span>\n  </div>\n  <span class=\"md-visually-hidden\">\n    Toggle {{isOpen()? 'expanded' : 'collapsed'}}\n  </span>\n</md-button>\n\n<ul id=\"docs-menu-{{section.name | nospace}}\"\n  class=\"menu-toggle-list\"\n  aria-hidden=\"{{!renderContent}}\"\n  ng-style=\"{ visibility: renderContent ? 'visible' : 'hidden' }\">\n\n  <li ng-repeat=\"page in section.pages\">\n    <menu-link section=\"page\"></menu-link>\n  </li>\n</ul>\n"
  },
  {
    "path": "docs/app/partials/view-source.tmpl.html",
    "content": "<md-dialog class=\"view-source-dialog\">\n\n  <md-tabs>\n    <md-tab ng-repeat=\"file in files\"\n                  active=\"file === data.selectedFile\"\n                  ng-click=\"data.selectedFile = file\" >\n        <span class=\"window_label\">{{file.viewType}}</span>\n    </md-tab>\n  </md-tabs>\n\n  <md-dialog-content md-scroll-y flex>\n    <div ng-repeat=\"file in files\">\n      <hljs code=\"file.content\"\n        lang=\"{{file.fileType}}\"\n        ng-show=\"file === data.selectedFile\" >\n      </hljs>\n    </div>\n  </md-dialog-content>\n\n  <md-dialog-actions layout=\"horizontal\">\n    <md-button class=\"md-primary\" ng-click=\"$hideDialog()\">\n      Done\n    </md-button>\n  </md-dialog-actions>\n</md-dialog>\n"
  },
  {
    "path": "docs/app/svg-assets-cache.js",
    "content": "(function() {\n  /**\n   * This 'svg-assets-cache.js' file should be loaded to a CDN or edge-server (currently S3).\n   * The CDN url (for this file) is then used in `doc/app/js/codepen.js#L59` to identify an\n   * external JS file that CodePen should load for 'launched' demos.\n   */\n  var assetMap = {\n    'img/icons/ic_card_giftcard_24px.svg' : '<svg fill=\"#000000\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z\"/> <path d=\"M0 0h24v24H0z\" fill=\"none\"/></svg>',\n    'img/icons/github-icon.svg' : '<svg height=\"1024\" width=\"1024\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\"> <path d=\"M512 0C229.252 0 0 229.25199999999995 0 512c0 226.251 146.688 418.126 350.155 485.813 25.593 4.686 34.937-11.125 34.937-24.626 0-12.188-0.469-52.562-0.718-95.314-128.708 23.46-161.707-31.541-172.469-60.373-5.525-14.809-30.407-60.249-52.398-72.263-17.988-9.828-43.26-33.237-0.917-33.735 40.434-0.476 69.348 37.308 78.471 52.75 45.938 77.749 119.876 55.627 148.999 42.5 4.654-32.999 17.902-55.627 32.501-68.373-113.657-12.939-233.22-56.875-233.22-253.063 0-55.94 19.968-101.561 52.658-137.404-5.22-12.999-22.844-65.095 5.063-135.563 0 0 42.937-13.749 140.811 52.501 40.811-11.406 84.594-17.031 128.124-17.22 43.499 0.188 87.314 5.874 128.188 17.28 97.689-66.311 140.686-52.501 140.686-52.501 28 70.532 10.375 122.564 5.124 135.499 32.811 35.844 52.626 81.468 52.626 137.404 0 196.686-119.751 240-233.813 252.686 18.439 15.876 34.748 47.001 34.748 94.748 0 68.437-0.686 123.627-0.686 140.501 0 13.625 9.312 29.561 35.25 24.562C877.436 929.998 1024 738.126 1024 512 1024 229.25199999999995 794.748 0 512 0z\" /></svg>',\n    'img/icons/tabs-arrow.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-1208\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><polygon points=\"15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 \"/><g id=\"Grid\" display=\"none\"></g></svg>',\n    'img/icons/ic_arrow_up_24px.svg' : '<svg height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z\"/> <path d=\"M0 0h24v24H0z\" fill=\"none\"/></svg>',\n    'img/icons/ic_build_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"none\" d=\"M0 0h24v24H0z\"/> <path d=\"M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z\"/></svg>',\n    'img/icons/android.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g id=\"android\"><path d=\"M6 18c0 .55.45 1 1 1h1v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h2v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h1c.55 0 1-.45 1-1V8H6v10zM3.5 8C2.67 8 2 8.67 2 9.5v7c0 .83.67 1.5 1.5 1.5S5 17.33 5 16.5v-7C5 8.67 4.33 8 3.5 8zm17 0c-.83 0-1.5.67-1.5 1.5v7c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-7c0-.83-.67-1.5-1.5-1.5zm-4.97-5.84l1.3-1.3c.2-.2.2-.51 0-.71-.2-.2-.51-.2-.71 0l-1.48 1.48C13.85 1.23 12.95 1 12 1c-.96 0-1.86.23-2.66.63L7.85.15c-.2-.2-.51-.2-.71 0-.2.2-.2.51 0 .71l1.31 1.31C6.97 3.26 6 5.01 6 7h12c0-1.99-.97-3.75-2.47-4.84zM10 5H9V4h1v1zm5 0h-1V4h1v1z\"/></g></svg>',\n    'img/icons/ic_people_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2616\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> </g> <path d=\"M16,11c1.7,0,3-1.3,3-3c0-1.7-1.3-3-3-3c-1.7,0-3,1.3-3,3C13,9.7,14.3,11,16,11z M8,11c1.7,0,3-1.3,3-3c0-1.7-1.3-3-3-3 C6.3,5,5,6.3,5,8C5,9.7,6.3,11,8,11z M8,13c-2.3,0-7,1.2-7,3.5V19h14v-2.5C15,14.2,10.3,13,8,13z M16,13c-0.3,0-0.6,0-1,0.1 c1.2,0.8,2,2,2,3.4V19h6v-2.5C23,14.2,18.3,13,16,13z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/hangout.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><path fill=\"#159F5C\" d=\"M23,4C13.6,4,6,11.6,6,21s7.6,17,17,17h1v7c9.7-4.7,16-15,16-24C40,11.6,32.4,4,23,4z M22,22l-2,4h-3l2-4h-3v-6h6V22zM30,22l-2,4h-3l2-4h-3v-6h6V22z\"/><rect x=\"0\" fill=\"none\" width=\"48\" height=\"48\"/></g></g></svg>',\n    'img/icons/ic_insert_drive_file_24px.svg' : '<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\"><g> <path d=\"M6,2C4.9,2,4,2.9,4,4l0,16c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8l-6-6H6z M13,9V3.5L18.5,9H13z\"/></g></svg>',\n    'img/icons/ic_school_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24H0z\" fill=\"none\"/> <path d=\"M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z\"/></svg>',\n    'img/icons/ic_play_arrow_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2232\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <polygon points=\"8,5 8,19 19,12 \" style=\"fill:#f3f3f3;\" /> <rect fill=\"none\" width=\"24\" height=\"24\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_chevron_right_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-1336\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <polygon points=\"10,6 8.6,7.4 13.2,12 8.6,16.6 10,18 16,12 \"/> <rect fill=\"none\" width=\"24\" height=\"24\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/bower-logo.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"512px\" height=\"512px\" viewBox=\"0 0 512 512\" enable-background=\"new 0 0 512 512\" xml:space=\"preserve\"><g> <g id=\"leaf\"> <path fill=\"#00ACEE\" d=\"M434.625,63.496c-67.822,0-118.399,71.68-95.018,123.167C435.596,186.664,396.518,98.058,434.625,63.496z\" /> </g> <path id=\"body\" fill=\"#FFCC2F\" d=\"M456.534,256.992c0-22.79-108.627-34.129-169.139-37.663 c-60.511-3.533-281.592,38.389-255.42,93.813c26.173,55.426,92.581,114.358,167.313,114.358c38.716,0,83.584-27.284,86.053-77.38 C330.121,335.163,456.534,334.371,456.534,256.992z\"/> <path id=\"wing_tip\" fill=\"#2BAF2B\" d=\"M400.981,272.143c7.02,7.104-15.222,26.295-34.606,17.262 c8.731,19.688-29.676,36.064-48.336,22.026c1.998,15.865-36.122,24.996-48.285,7.292c3.136,8.441,5.757,14.898,8.229,20.209 c-0.029-0.09-0.046-0.149-0.046-0.149c6.324,8.279,14.929,14.939,52.394,14.939c57.727,0,150.97-43.849,150.97-76.039 c0-26.643-9.992-29.14-27.196-27.198c-17.208,1.942-107.17,11.291-126.306,7.534C338.182,260.229,390.54,270.259,400.981,272.143z\" /> <path id=\"head\" fill=\"#EF5734\" d=\"M198.51,48.82c-110.382,0-221.179,109.721-168.451,261.056 c35.817,21.53,83.576,12.995,94.278,1.532c16.178,5.171,30.612,7.347,43.513,7.347c67.047,0,124.34-71.235,124.34-160.257 C292.189,67.196,231.93,48.82,198.51,48.82z\"/> <path id=\"eye_rim\" fill=\"#FFCC2F\" d=\"M153.308,146.522c0,24.632,19.969,44.603,44.603,44.603c24.633,0,44.603-19.971,44.603-44.603 c0-24.633-19.97-44.603-44.603-44.603C173.277,101.92,153.308,121.89,153.308,146.522z\"/> <path id=\"eye\" fill=\"#543729\" d=\"M171.207,146.522c0,14.747,11.956,26.704,26.704,26.704c14.748,0,26.703-11.957,26.703-26.704 c0-14.748-11.955-26.704-26.703-26.704C183.163,119.819,171.207,131.774,171.207,146.522z\"/> <ellipse id=\"pupil_highlight\" fill=\"#FFFFFF\" cx=\"197.91\" cy=\"134.674\" rx=\"15.56\" ry=\"9.675\"/> <path id=\"beak\" fill=\"#CECECE\" d=\"M289.401,123.675c-20.275,11.807-19.604,50.03-10.595,68.681 c17.445-6.466,41.752-19.291,45.527-21.585c3.773-2.293-2.088-10.989,12.559-10.989c20.315,0,38.684,6.348,43.956,8.634 C377.511,161.547,335.758,123.675,289.401,123.675z\"/> <path id=\"outline\" fill=\"#543729\" d=\"M502.214,250.797c-26.335-25.305-158.017-41.1-199.568-45.698 c2.014-4.754,3.726-9.669,5.142-14.731c5.665-2.481,11.776-4.789,18.101-6.716c0.77,2.272,4.397,10.98,6.465,15.112 c83.553,2.305,87.844-62.09,91.24-79.732c3.323-17.25,3.154-33.917,31.812-64.388C412.709,42.201,351.31,73.928,330.742,121.15 c-7.728-2.896-15.474-5.035-23.136-6.357c-5.488-22.146-34.077-83.845-109.097-83.845c-48.585,0-97.581,20.063-134.421,55.045 c-19.852,18.85-35.445,41.234-46.344,66.53C5.97,179.851,0,209.94,0,241.957C0,353.462,76.126,451.18,119.139,451.18 c18.784,0,34.943-14.067,38.736-26.675c3.181,8.645,12.938,35.522,16.142,42.364c4.737,10.117,26.642,18.872,36.229,8.373 c12.326,6.849,34.943,10.973,47.27-7.289c23.739,5.022,44.728-9.135,45.184-26.026c11.649-0.622,17.363-16.978,14.819-30.001 c-1.875-9.591-21.904-44-29.719-55.877c15.468,12.58,54.644,16.142,59.401,0.008c24.936,19.571,63.797,9.301,66.879-6.619 c30.301,7.874,65.054-9.417,59.348-30.359C522.102,315.711,515.872,263.921,502.214,250.797z M375.456,164.958 c-12.821-5.033-29.084-8.217-40.482-8.217c-16.164,0-26.009,9.16-41.218,9.16c-3.193,0-10.812,0.016-16.926-2.162 c4.021,4.217,9.025,6.505,18.725,6.505c5.793,0,17.263-2.958,26.553-5.752c0.129,1.956,0.334,3.898,0.61,5.826 c-17.402,4.161-35.664,15.231-40.949,18.105c-11.755-25.958-1.65-50.505,7.697-61.837 C331.331,126.686,365.144,155.433,375.456,164.958z M393.557,163.001l-6.406-5.979c-6.575-6.159-13.43-11.731-20.469-16.678 c10.483-20.801,23.658-43.514,40.298-57.565c-18.314,7.381-36.397,29.445-47.089,53.03c-5.448-3.464-10.98-6.554-16.561-9.255 c14.913-31.834,49.568-58.42,87.762-60.497C405.509,89.257,415.114,135.563,393.557,163.001z M341.006,184.7 c-2.821-6.114-5.677-16.27-5.328-22.239c4.753-0.112,13.868,1.67,15.335,2.016c-0.557,2.803-0.855,8.944-0.866,9.739 c0.903-1.556,3.41-6.922,4.43-9.029c9.127,1.744,21.126,4.659,28.161,7.938C374.478,178.473,360.439,184.293,341.006,184.7z M283.971,112.911c-33.381,33.832-20.199,76.63-8.046,95.976c-17.29,28.761-51.28,48.437-90.765,57.389 c44.328,0,70.397-11.409,85.563-22.586c9.677-7.131,14.928-14.17,17.608-18.088c65.72,4.251,169.783,25.423,179.935,32.281 c4.074,2.753,8.278,8.842,8.895,14.668c-49.387-6.914-138.407-14.188-161.719-15.424c16.549,2.347,137.241,25.202,158.163,30.552 c-6.368,10.384-20.872,17.715-42.733,12.621c11.812,16.093-11.125,35.399-43.071,24.766c7.032,15.799-21.413,30.021-53.741,13.555 c0.411,15.805-40.105,17.626-56.123,0.162c0.306,2.082,2.207,6.066,3.028,7.809c-5.162,46.15-42.961,74.783-81.677,74.783 c-94.794,0-177.375-76.989-177.375-179.417c0-108.292,80.03-189.096,176.597-189.096 C253.842,52.861,278.836,96.412,283.971,112.911z\"/></g></svg>',\n    'img/icons/mail.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><path fill=\"#7d7d7d\" d=\"M40,8H8c-2.2,0-4,1.8-4,4l0,24c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V12C44,9.8,42.2,8,40,8z M40,16L24,26L8,16v-4l16,10l16-10V16z\"/><rect fill=\"none\" width=\"48\" height=\"48\"/></g></g></svg>',\n    'img/icons/ic_play_circle_fill_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24H0z\" fill=\"none\"/> <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z\"/></svg>',\n    'img/icons/ic_comment_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-1464\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Labels\"></g><g id=\"Icon\"> <g> <path d=\"M22,4c0-1.1-0.9-2-2-2H4C2.9,2,2,2.9,2,4v12c0,1.1,0.9,2,2,2h14l4,4L22,4z M18,14H6v-2h12V14z M18,11H6V9h12V11z M18,8H6 V6h12V8z\"/> <rect x=\"0\" fill=\"none\" width=\"24\" height=\"24\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/copy2.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><rect fill=\"none\" width=\"48\" height=\"48\"/><path fill=\"#7d7d7d\" d=\"M32,2H8C5.8,2,4,3.8,4,6v28h4V6h24V2z M38,10H16c-2.2,0-4,1.8-4,4v28c0,2.2,1.8,4,4,4h22c2.2,0,4-1.8,4-4V14C42,11.8,40.2,10,38,10z M38,42H16V14h22V42z\"/></g></g></svg>',\n    'img/icons/baseline-share-24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24H0z\" fill=\"none\"/> <path d=\"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z\"/></svg>',\n    'img/icons/ic_launch_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-824\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M19,19H5V5h7V3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2v-7h-2V19z M14,3v2h3.6l-9.8,9.8l1.4,1.4L19,6.4 V10h2V3H14z\" /> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/cake.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g id=\"cake\"><path d=\"M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9z\"/></g></svg>',\n    'img/icons/ic_arrow_back_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-568\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M20,11H7.8l5.6-5.6L12,4l-8,8l8,8l1.4-1.4L7.8,13H20V11z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_access_time_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-440\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Labels\"></g><g id=\"Icon\"> <g> <g> <path fill-opacity=\"0.9\" d=\"M12,2C6.5,2,2,6.5,2,12s4.5,10,10,10c5.5,0,10-4.5,10-10S17.5,2,12,2z M12,20c-4.4,0-8-3.6-8-8 s3.6-8,8-8c4.4,0,8,3.6,8,8S16.4,20,12,20z\"/> </g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <polygon fill-opacity=\"0.9\" points=\"12.5,7 11,7 11,13 16.2,16.2 17,14.9 12.5,12.2 \"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_photo_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2616\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect x=\"0\" fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M21,19V5c0-1.1-0.9-2-2-2H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14C20.1,21,21,20.1,21,19z M8.5,13.5l2.5,3l3.5-4.5l4.5,6 H5L8.5,13.5z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_menu_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2232\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M3,18h18v-2H3V18z M3,13h18v-2H3V13z M3,6v2h18V6H3z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_email_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M20 4h-16c-1.1 0-1.99.9-1.99 2l-.01 12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-12c0-1.1-.9-2-2-2zm0 4l-8 5-8-5v-2l8 5 8-5v2z\"/> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/></svg>',\n    'img/icons/toggle-arrow.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 48 48\"> <path d=\"M24 16l-12 12 2.83 2.83 9.17-9.17 9.17 9.17 2.83-2.83z\"/> <path d=\"M0 0h48v48h-48z\" fill=\"none\"/></svg>',\n    'img/icons/copy.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g><g><rect fill=\"none\" width=\"24\" height=\"24\"/><path fill=\"#7d7d7d\" d=\"M16,1H4C2.9,1,2,1.9,2,3v14h2V3h12V1z M19,5H8C6.9,5,6,5.9,6,7v14c0,1.1,0.9,2,2,2h11c1.1,0,2-0.9,2-2V7C21,5.9,20.1,5,19,5z M19,21H8V7h11V21z\"/></g></g></svg>',\n    'img/icons/npm-logo.svg' : '<svg height=\"28\" width=\"28\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 27.23 27.23\"> <rect fill=\"#333333\" width=\"27.23\" height=\"27.23\" rx=\"2\"></rect> <polygon fill=\"#fff\" points=\"5.8 21.75 13.66 21.75 13.67 9.98 17.59 9.98 17.58 21.76 21.51 21.76 21.52 6.06 5.82 6.04 5.8 21.75\"> </polygon></svg>',\n    'img/icons/launch.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/> <path d=\"M19 19h-14v-14h7v-2h-7c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zm-5-16v2h3.59l-9.83 9.83 1.41 1.41 9.83-9.83v3.59h2v-7h-7z\"/></svg>',\n    'img/icons/ic_code_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/> <path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>',\n    'img/icons/favorite.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/> <path d=\"M12 21.35l-1.45-1.32c-5.15-4.67-8.55-7.75-8.55-11.53 0-3.08 2.42-5.5 5.5-5.5 1.74 0 3.41.81 4.5 2.09 1.09-1.28 2.76-2.09 4.5-2.09 3.08 0 5.5 2.42 5.5 5.5 0 3.78-3.4 6.86-8.55 11.54l-1.45 1.31z\"/></svg>',\n    'img/icons/ic_place_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M12 2c-3.87 0-7 3.13-7 7 0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\"/> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/></svg>',\n    'img/icons/ic_euro_24px.svg' : '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><svg width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\"> <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\"> <g id=\"Desktop-HD\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\"> <g id=\"euro\" sketch:type=\"MSLayerGroup\" transform=\"translate(4.928571, 3.000000)\"> <path d=\"M13.3295171,13.848956 C12.7717614,14.1408877 11.5268981,14.5372503 10.3117026,14.5372503 C8.98732947,14.5372503 7.74127945,14.1408877 6.89515215,13.1855827 C6.49641614,12.7381914 6.20567113,12.1258468 6.0205437,11.3319349 L12.6685173,11.3319349 L12.6685173,9.45217947 L5.65147555,9.45217947 L5.65147555,9.02852246 C5.65147555,8.73659074 5.65147555,8.47432688 5.67639655,8.20731616 L12.669704,8.20731616 L12.669704,6.32756069 L6.07513256,6.32756069 C6.26263342,5.63926639 6.52371057,5.03048195 6.92363329,4.60682495 C7.74246616,3.62541221 8.91019304,3.17564749 10.1550564,3.17564749 C11.3168497,3.17564749 12.4311744,3.52098135 13.1194687,3.81172636 L13.8587917,0.793911872 C12.9046734,0.371441579 11.4770561,0 9.88685892,0 C7.3722113,0 5.25273954,1.00514702 3.77172009,2.7282562 C2.92559278,3.68118779 2.2634062,4.89994338 1.94418005,6.32874741 L0.168855444,6.32874741 L0.168855444,8.20731616 L1.65343504,8.20731616 C1.65343504,8.47432688 1.62614062,8.73777745 1.62614062,9.00241475 L1.62614062,9.45217947 L0.168855444,9.45217947 L0.168855444,11.3331216 L1.89196462,11.3331216 C2.1304942,12.7393781 2.65858206,13.8750637 3.37417079,14.7745931 C4.85875039,16.7338585 7.21319158,17.7935943 9.83345677,17.7935943 C11.5292715,17.7935943 13.0660666,17.2904275 13.965596,16.789634 L13.3295171,13.848956 L13.3295171,13.848956 Z\" id=\"Shape\" sketch:type=\"MSShapeGroup\"></path> </g> </g> </g></svg>',\n    'img/icons/angular-logo.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-10 -10 120 120\"> <defs> <filter id=\"shadow\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"> <feOffset result=\"offOut\" in=\"SourceAlpha\" dx=\"0\" dy=\"0\"></feOffset> <feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"3\"></feGaussianBlur> <feComponentTransfer in=\"blurOut\" result=\"opacityOut\"> <feFuncA type=\"linear\" slope=\"0.5\"></feFuncA> </feComponentTransfer> <feBlend in=\"SourceGraphic\" in2=\"opacityOut\" mode=\"normal\"></feBlend> </filter> </defs> <path d=\" M 5 18.25 L 50 2.25 L 96 18 L 88.5 77 L 50 98.25 L 12 77.25 Z\" fill=\"black\" filter=\"url(#shadow)\" class=\"outline\"></path> <path d=\" M 5 18.25 L 50 2.25 L 50 98.25 L 12 77.25 Z\" fill=\"#de3641\" class=\"left\"></path> <path d=\" M 50 2.25 L 96 18 L 88.5 77 L 50 98.25 Z\" fill=\"#b13138\" class=\"right\"></path> <path d=\" M 50 13 L 79.25 75.5 L 69.25 75.5 L 63 61.25 L 50 61.25 L 50 52.75 L 59.5 52.75 L 50 33.1 L 42 52.75 L 50 52.75 L 50 61.25 L 38.1 61.25 L 32.5 75.5 L 21.75 75.5 Z\" fill=\"white\" class=\"letter\"></path></svg>',\n    'img/icons/message.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><path fill=\"#7d7d7d\" d=\"M40,4H8C5.8,4,4,5.8,4,8l0,36l8-8h28c2.2,0,4-1.8,4-4V8C44,5.8,42.2,4,40,4z M36,28H12v-4h24V28z M36,22H12v-4h24V22zM36,16H12v-4h24V16z\"/><rect x=\"0\" fill=\"none\" width=\"48\" height=\"48\"/></g></g></svg>',\n    'img/icons/ic_refresh_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2616\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <path d=\"M17.6,6.4C16.2,4.9,14.2,4,12,4c-4.4,0-8,3.6-8,8s3.6,8,8,8c3.7,0,6.8-2.6,7.7-6h-2.1c-0.8,2.3-3,4-5.6,4 c-3.3,0-6-2.7-6-6s2.7-6,6-6c1.7,0,3.1,0.7,4.2,1.8L13,11h7V4L17.6,6.4z\"/> <rect fill=\"none\" width=\"24\" height=\"24\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/facebook.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><g><path fill=\"#7d7d7d\" d=\"M40,4H8C5.8,4,4,5.8,4,8l0,32c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V8C44,5.8,42.2,4,40,4z M38,8v6h-4c-1.1,0-2,0.9-2,2v4h6v6h-6v14h-6V26h-4v-6h4v-5c0-3.9,3.1-7,7-7H38z\"/></g><g><rect fill=\"none\" width=\"48\" height=\"48\"/></g></g></g></svg>',\n    'img/icons/octicon-repo.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 48 48\"><path d=\"M21,12h-3v3h3V12z M21,6h-3v3h3V6z M39,0C37.5,0,10.5,0,9,0S6,1.5,6,3s0,34.5,0,36s1.5,3,3,3s6,0,6,0v6l4.5-4.5L24,48v-6 c0,0,13.5,0,15,0s3-1.5,3-3s0-34.5,0-36S40.5,0,39,0z M39,37.5c0,0.75-0.703,1.5-1.5,1.5S24,39,24,39v-3h-9v3c0,0-3.703,0-4.5,0 S9,38.203,9,37.5S9,33,9,33h30C39,33,39,36.75,39,37.5z M39,30H15V3h24.047L39,30z M21,24h-3v3h3V24z M21,18h-3v3h3V18z\"/></svg>',\n    'img/icons/separator.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 4 6\" enable-background=\"new 0 0 4 6\" xml:space=\"preserve\"><g> <polygon fill=\"#FFFFFF\" points=\"3.719,3 0.968,0.25 0.281,0.938 2.344,3 0.281,5.062 0.968,5.75 \"/></g></svg>',\n    'img/icons/sets/symbol-icons.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display: none;\"> <symbol id=\"spinner\" viewBox=\"0 0 24 24\"> <title>Animated Spinner</title> <path d=\"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z\"/> <animateTransform attributeName=\"transform\" type=\"rotate\" from=\"360\" to=\"0\" dur=\"3s\" repeatCount=\"indefinite\"/> </symbol> <symbol id=\"angular\" viewBox=\"-3.5 -3.5 165.908 175.75\"> <title>AngularJS Logo</title> <g transform=\"translate(-4.054,-4.375)\"> <polygon style=\"fill:#b3b3b3\" points=\"153.4 137.8 166.5 29.46 83.24 0.875 0.554 29.98 13.62 138.3 83.33 176.6\"/> <polygon style=\"fill:#a6120d\" points=\"158.2 35.72 83.05 10.09 83.05 167.5 146 132.6\"/> <polygon style=\"fill:#dd1b16\" points=\"9.833 36.18 21.03 133.1 83.05 167.5 83.05 10.09\"/> <path style=\"fill:#f2f2f2\" d=\"m103.7 93.87-20.69 9.675h-21.77l-10.25 25.7-19.07 0.3 51.13-113.7zm-2-4.87-18.51-36.73-15.22 36.1h15.08z\"/> <polygon style=\"fill:#b3b3b3\" points=\"83.05 103.5 107.1 103.5 118.3 129.5 136.5 129.9 83.05 15.8 83.19 52.27 100.5 88.4 83.09 88.4\"/> </g> </symbol></svg>',\n    'img/icons/sets/communication-icons.svg' : '<svg><defs><g id=\"business\"><path d=\"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z\"/></g><g id=\"call\"><path d=\"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"/></g><g id=\"call-end\"><path d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08c-.18-.17-.29-.42-.29-.7 0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28-.79-.74-1.69-1.36-2.67-1.85-.33-.16-.56-.5-.56-.9v-3.1C15.15 9.25 13.6 9 12 9z\"/></g><g id=\"call-made\"><path d=\"M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z\"/></g><g id=\"call-merge\"><path d=\"M17 20.41L18.41 19 15 15.59 13.59 17 17 20.41zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5 7.5 8z\"/></g><g id=\"call-missed\"><path d=\"M19.59 7L12 14.59 6.41 9H11V7H3v8h2v-4.59l7 7 9-9z\"/></g><g id=\"call-received\"><path d=\"M20 5.41L18.59 4 7 15.59V9H5v10h10v-2H8.41z\"/></g><g id=\"call-split\"><path d=\"M14 4l2.29 2.29-2.88 2.88 1.42 1.42 2.88-2.88L20 10V4zm-4 0H4v6l2.29-2.29 4.71 4.7V20h2v-8.41l-5.29-5.3z\"/></g><g id=\"chat\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z\"/></g><g id=\"clear-all\"><path d=\"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z\"/></g><g id=\"comment\"><path d=\"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM18 14H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"/></g><g id=\"contacts\"><path d=\"M20 0H4v2h16V0zM4 24h16v-2H4v2zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 2.75c1.24 0 2.25 1.01 2.25 2.25s-1.01 2.25-2.25 2.25S9.75 10.24 9.75 9 10.76 6.75 12 6.75zM17 17H7v-1.5c0-1.67 3.33-2.5 5-2.5s5 .83 5 2.5V17z\"/></g><g id=\"dialer-sip\"><path d=\"M17 3h-1v5h1V3zm-2 2h-2V4h2V3h-3v3h2v1h-2v1h3V5zm3-2v5h1V6h2V3h-3zm2 2h-1V4h1v1zm0 10.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.01.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.59l2.2-2.21c.27-.26.35-.65.24-1C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1z\"/></g><g id=\"dialpad\"><path d=\"M12 19c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\"/></g><g id=\"dnd-on\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z\"/></g><g id=\"email\"><path d=\"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z\"/></g><g id=\"forum\"><path d=\"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z\"/></g><g id=\"import-export\"><path d=\"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z\"/></g><g id=\"invert-colors-off\"><path d=\"M20.65 20.87l-2.35-2.35-6.3-6.29-3.56-3.57-1.42-1.41L4.27 4.5 3 5.77l2.78 2.78c-2.55 3.14-2.36 7.76.56 10.69C7.9 20.8 9.95 21.58 12 21.58c1.79 0 3.57-.59 5.03-1.78l2.7 2.7L21 21.23l-.35-.36zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59c0-1.32.43-2.57 1.21-3.6L12 14.77v4.82zM12 5.1v4.58l7.25 7.26c1.37-2.96.84-6.57-1.6-9.01L12 2.27l-3.7 3.7 1.41 1.41L12 5.1z\"/></g><g id=\"invert-colors-on\"><path d=\"M17.66 7.93L12 2.27 6.34 7.93c-3.12 3.12-3.12 8.19 0 11.31C7.9 20.8 9.95 21.58 12 21.58c2.05 0 4.1-.78 5.66-2.34 3.12-3.12 3.12-8.19 0-11.31zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59s.62-3.11 1.76-4.24L12 5.1v14.49z\"/></g><g id=\"live-help\"><path d=\"M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-6 16h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 11.9 13 12.5 13 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z\"/></g><g id=\"location-off\"><path d=\"M12 6.5c1.38 0 2.5 1.12 2.5 2.5 0 .74-.33 1.39-.83 1.85l3.63 3.63c.98-1.86 1.7-3.8 1.7-5.48 0-3.87-3.13-7-7-7-1.98 0-3.76.83-5.04 2.15l3.19 3.19c.46-.52 1.11-.84 1.85-.84zm4.37 9.6l-4.63-4.63-.11-.11L3.27 3 2 4.27l3.18 3.18C5.07 7.95 5 8.47 5 9c0 5.25 7 13 7 13s1.67-1.85 3.38-4.35L18.73 21 20 19.73l-3.63-3.63z\"/></g><g id=\"location-on\"><path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z\"/></g><g id=\"message\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"/></g><g id=\"messenger\"><path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z\"/></g><g id=\"no-sim\"><path d=\"M18.99 5c0-1.1-.89-2-1.99-2h-7L7.66 5.34 19 16.68 18.99 5zM3.65 3.88L2.38 5.15 5 7.77V19c0 1.1.9 2 2 2h10.01c.35 0 .67-.1.96-.26l1.88 1.88 1.27-1.27L3.65 3.88z\"/></g><g id=\"phone\"><path d=\"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"/></g><g id=\"portable-wifi-off\"><path d=\"M17.56 14.24c.28-.69.44-1.45.44-2.24 0-3.31-2.69-6-6-6-.79 0-1.55.16-2.24.44l1.62 1.62c.2-.03.41-.06.62-.06 2.21 0 4 1.79 4 4 0 .21-.02.42-.05.63l1.61 1.61zM12 4c4.42 0 8 3.58 8 8 0 1.35-.35 2.62-.95 3.74l1.47 1.47C21.46 15.69 22 13.91 22 12c0-5.52-4.48-10-10-10-1.91 0-3.69.55-5.21 1.47l1.46 1.46C9.37 4.34 10.65 4 12 4zM3.27 2.5L2 3.77l2.1 2.1C2.79 7.57 2 9.69 2 12c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 17.53 4 14.96 4 12c0-1.76.57-3.38 1.53-4.69l1.43 1.44C6.36 9.68 6 10.8 6 12c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-.65.17-1.25.44-1.79l1.58 1.58L10 12c0 1.1.9 2 2 2l.21-.02.01.01 7.51 7.51L21 20.23 4.27 3.5l-1-1z\"/></g><g id=\"quick-contacts-dialer\"><path d=\"M22 3H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm3.85-4h1.64L21 16l-1.99 1.99c-1.31-.98-2.28-2.38-2.73-3.99-.18-.64-.28-1.31-.28-2s.1-1.36.28-2c.45-1.62 1.42-3.01 2.73-3.99L21 8l-1.51 2h-1.64c-.22.63-.35 1.3-.35 2s.13 1.37.35 2z\"/></g><g id=\"quick-contacts-mail\"><path d=\"M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z\"/></g><g id=\"ring-volume\"><path d=\"M23.71 16.67C20.66 13.78 16.54 12 12 12 7.46 12 3.34 13.78.29 16.67c-.18.18-.29.43-.29.71 0 .28.11.53.29.71l2.48 2.48c.18.18.43.29.71.29.27 0 .52-.11.7-.28.79-.74 1.69-1.36 2.66-1.85.33-.16.56-.5.56-.9v-3.1c1.45-.48 3-.73 4.6-.73s3.15.25 4.6.72v3.1c0 .39.23.74.56.9.98.49 1.87 1.12 2.66 1.85.18.18.43.28.7.28.28 0 .53-.11.71-.29l2.48-2.48c.18-.18.29-.43.29-.71 0-.27-.11-.52-.29-.7zM21.16 6.26l-1.41-1.41-3.56 3.55 1.41 1.41s3.45-3.52 3.56-3.55zM13 2h-2v5h2V2zM6.4 9.81L7.81 8.4 4.26 4.84 2.84 6.26c.11.03 3.56 3.55 3.56 3.55z\"/></g><g id=\"stay-current-landscape\"><path d=\"M1.01 7L1 17c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2H3c-1.1 0-1.99.9-1.99 2zM19 7v10H5V7h14z\"/></g><g id=\"stay-current-portrait\"><path d=\"M17 1.01L7 1c-1.1 0-1.99.9-1.99 2v18c0 1.1.89 2 1.99 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z\"/></g><g id=\"stay-primary-landscape\"><path d=\"M1.01 7L1 17c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2H3c-1.1 0-1.99.9-1.99 2zM19 7v10H5V7h14z\"/></g><g id=\"stay-primary-portrait\"><path d=\"M17 1.01L7 1c-1.1 0-1.99.9-1.99 2v18c0 1.1.89 2 1.99 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z\"/></g><g id=\"swap-calls\"><path d=\"M18 4l-4 4h3v7c0 1.1-.9 2-2 2s-2-.9-2-2V8c0-2.21-1.79-4-4-4S5 5.79 5 8v7H2l4 4 4-4H7V8c0-1.1.9-2 2-2s2 .9 2 2v7c0 2.21 1.79 4 4 4s4-1.79 4-4V8h3l-4-4z\"/></g><g id=\"textsms\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z\"/></g><g id=\"voicemail\"><path d=\"M18.5 6C15.46 6 13 8.46 13 11.5c0 1.33.47 2.55 1.26 3.5H9.74c.79-.95 1.26-2.17 1.26-3.5C11 8.46 8.54 6 5.5 6S0 8.46 0 11.5 2.46 17 5.5 17h13c3.04 0 5.5-2.46 5.5-5.5S21.54 6 18.5 6zm-13 9C3.57 15 2 13.43 2 11.5S3.57 8 5.5 8 9 9.57 9 11.5 7.43 15 5.5 15zm13 0c-1.93 0-3.5-1.57-3.5-3.5S16.57 8 18.5 8 22 9.57 22 11.5 20.43 15 18.5 15z\"/></g><g id=\"vpn-key\"><path d=\"M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z\"/></g></defs></svg>',\n    'img/icons/sets/core-icons.svg' : '<svg><defs><g id=\"3d-rotation\"><path d=\"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81-1.33 1.32zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95.14.27.33.5.56.69.24.18.51.32.82.41.3.1.62.15.96.15.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72c.13-.29.2-.61.2-.97 0-.19-.02-.38-.07-.56-.05-.18-.12-.35-.23-.51-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33.15-.13.27-.27.37-.42.1-.15.17-.3.22-.46.05-.16.07-.32.07-.48 0-.36-.06-.68-.18-.96-.12-.28-.29-.51-.51-.69-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3c0-.17.03-.32.09-.45s.14-.25.25-.34c.11-.09.23-.17.38-.22.15-.05.3-.08.48-.08.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49-.05.15-.14.27-.25.37-.11.1-.25.18-.41.24-.16.06-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4.07.16.1.35.1.57 0 .41-.12.72-.35.93-.23.23-.55.33-.95.33zm8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27.45-.18.84-.43 1.16-.76.32-.33.57-.73.74-1.19.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57-.18-.47-.43-.87-.75-1.2zm-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85-.19.23-.43.41-.71.53-.29.12-.62.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99v.4zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0z\"/></g><g id=\"accessibility\"><path d=\"M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z\"/></g><g id=\"account-balance\"><path d=\"M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z\"/></g><g id=\"account-balance-wallet\"><path d=\"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z\"/></g><g id=\"account-box\"><path d=\"M3 5v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z\"/></g><g id=\"account-child\"><circle cx=\"12\" cy=\"13.49\" r=\"1.5\"/><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 2.5c1.24 0 2.25 1.01 2.25 2.25S13.24 9 12 9 9.75 7.99 9.75 6.75 10.76 4.5 12 4.5zm5 10.56v2.5c-.45.41-.96.77-1.5 1.05v-.68c0-.34-.17-.65-.46-.92-.65-.62-1.89-1.02-3.04-1.02-.96 0-1.96.28-2.65.73l-.17.12-.21.17c.78.47 1.63.72 2.54.82l1.33.15c.37.04.66.36.66.75 0 .29-.16.53-.4.66-.28.15-.64.09-.95.09-.35 0-.69-.01-1.03-.05-.5-.06-.99-.17-1.46-.33-.49-.16-.97-.38-1.42-.64-.22-.13-.44-.27-.65-.43l-.31-.24c-.04-.02-.28-.18-.28-.23v-4.28c0-1.58 2.63-2.78 5-2.78s5 1.2 5 2.78v1.78z\"/></g><g id=\"account-circle\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z\"/></g><g id=\"add\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/></g><g id=\"add-box\"><path d=\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4v2z\"/></g><g id=\"add-circle\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z\"/></g><g id=\"add-circle-outline\"><path d=\"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"/></g><g id=\"add-shopping-cart\"><path d=\"M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z\"/></g><g id=\"alarm\"><path d=\"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"/></g><g id=\"alarm-add\"><path d=\"M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm1-11h-2v3H8v2h3v3h2v-3h3v-2h-3V9z\"/></g><g id=\"alarm-off\"><path d=\"M12 6c3.87 0 7 3.13 7 7 0 .84-.16 1.65-.43 2.4l1.52 1.52c.58-1.19.91-2.51.91-3.92 0-4.97-4.03-9-9-9-1.41 0-2.73.33-3.92.91L9.6 6.43C10.35 6.16 11.16 6 12 6zm10-.28l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM2.92 2.29L1.65 3.57 2.98 4.9l-1.11.93 1.42 1.42 1.11-.94.8.8C3.83 8.69 3 10.75 3 13c0 4.97 4.02 9 9 9 2.25 0 4.31-.83 5.89-2.2l2.2 2.2 1.27-1.27L3.89 3.27l-.97-.98zm13.55 16.1C15.26 19.39 13.7 20 12 20c-3.87 0-7-3.13-7-7 0-1.7.61-3.26 1.61-4.47l9.86 9.86zM8.02 3.28L6.6 1.86l-.86.71 1.42 1.42.86-.71z\"/></g><g id=\"alarm-on\"><path d=\"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm-1.46-5.47L8.41 12.4l-1.06 1.06 3.18 3.18 6-6-1.06-1.06-4.93 4.95z\"/></g><g id=\"android\"><path d=\"M6 18c0 .55.45 1 1 1h1v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h2v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h1c.55 0 1-.45 1-1V8H6v10zM3.5 8C2.67 8 2 8.67 2 9.5v7c0 .83.67 1.5 1.5 1.5S5 17.33 5 16.5v-7C5 8.67 4.33 8 3.5 8zm17 0c-.83 0-1.5.67-1.5 1.5v7c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-7c0-.83-.67-1.5-1.5-1.5zm-4.97-5.84l1.3-1.3c.2-.2.2-.51 0-.71-.2-.2-.51-.2-.71 0l-1.48 1.48C13.85 1.23 12.95 1 12 1c-.96 0-1.86.23-2.66.63L7.85.15c-.2-.2-.51-.2-.71 0-.2.2-.2.51 0 .71l1.31 1.31C6.97 3.26 6 5.01 6 7h12c0-1.99-.97-3.75-2.47-4.84zM10 5H9V4h1v1zm5 0h-1V4h1v1z\"/></g><g id=\"announcement\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z\"/></g><g id=\"apps\"><path d=\"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z\"/></g><g id=\"archive\"><path d=\"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z\"/></g><g id=\"arrow-back\"><path d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"/></g><g id=\"arrow-drop-down\"><path d=\"M7 10l5 5 5-5z\"/></g><g id=\"arrow-drop-down-circle\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12l-4-4h8l-4 4z\"/></g><g id=\"arrow-drop-up\"><path d=\"M7 14l5-5 5 5z\"/></g><g id=\"cached\"><path d=\"M19 8l-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z\"/></g><g id=\"check\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></g><g id=\"undo\"><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></g><g id=\"redo\"><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></g><g id=\"content-copy\"><path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"/></g><g id=\"content-cut\"><path d=\"M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z\"/></g><g id=\"content-paste\"><path d=\"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z\"/></g></defs></svg>',\n    'img/icons/sets/device-icons.svg' : '<svg><defs><g id=\"access-alarm\"><path d=\"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"/></g><g id=\"access-alarms\"><path d=\"M22 5.7l-4.6-3.9-1.3 1.5 4.6 3.9L22 5.7zM7.9 3.4L6.6 1.9 2 5.7l1.3 1.5 4.6-3.8zM12.5 8H11v6l4.7 2.9.8-1.2-4-2.4V8zM12 4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z\"/></g><g id=\"access-time\"><path fill-opacity=\".9\" d=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zM12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z\"/></g><g id=\"add-alarm\"><path d=\"M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm1-11h-2v3H8v2h3v3h2v-3h3v-2h-3V9z\"/></g><g id=\"airplanemode-off\"><path d=\"M13 9V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v3.68l7.83 7.83L21 16v-2l-8-5zM3 5.27l4.99 4.99L2 14v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-3.73L18.73 21 20 19.73 4.27 4 3 5.27z\"/></g><g id=\"airplanemode-on\"><path d=\"M10.18 9\"/><path d=\"M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z\"/></g><g id=\"battery-20\"><path d=\"M7 17v3.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V17H7z\"/><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V17h10V5.33z\"/></g><g id=\"battery-30\"><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V15h10V5.33z\"/><path d=\"M7 15v5.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V15H7z\"/></g><g id=\"battery-50\"><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V13h10V5.33z\"/><path d=\"M7 13v7.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V13H7z\"/></g><g id=\"battery-60\"><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V11h10V5.33z\"/><path d=\"M7 11v9.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V11H7z\"/></g><g id=\"battery-80\"><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V9h10V5.33z\"/><path d=\"M7 9v11.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V9H7z\"/></g><g id=\"battery-90\"><path fill-opacity=\".3\" d=\"M17 5.33C17 4.6 16.4 4 15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V8h10V5.33z\"/><path d=\"M7 8v12.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V8H7z\"/></g><g id=\"battery-alert\"><path d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4zM13 18h-2v-2h2v2zm0-4h-2V9h2v5z\"/></g><g id=\"battery-charging-20\"><path d=\"M11 20v-3H7v3.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V17h-4.4L11 20z\"/><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V17h4v-2.5H9L13 7v5.5h2L12.6 17H17V5.33C17 4.6 16.4 4 15.67 4z\"/></g><g id=\"battery-charging-30\"><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v9.17h2L13 7v5.5h2l-1.07 2H17V5.33C17 4.6 16.4 4 15.67 4z\"/><path d=\"M11 20v-5.5H7v6.17C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V14.5h-3.07L11 20z\"/></g><g id=\"battery-charging-50\"><path d=\"M14.47 13.5L11 20v-5.5H9l.53-1H7v7.17C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V13.5h-2.53z\"/><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v8.17h2.53L13 7v5.5h2l-.53 1H17V5.33C17 4.6 16.4 4 15.67 4z\"/></g><g id=\"battery-charging-60\"><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V11h3.87L13 7v4h4V5.33C17 4.6 16.4 4 15.67 4z\"/><path d=\"M13 12.5h2L11 20v-5.5H9l1.87-3.5H7v9.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V11h-4v1.5z\"/></g><g id=\"battery-charging-80\"><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V9h4.93L13 7v2h4V5.33C17 4.6 16.4 4 15.67 4z\"/><path d=\"M13 12.5h2L11 20v-5.5H9L11.93 9H7v11.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V9h-4v3.5z\"/></g><g id=\"battery-charging-90\"><path fill-opacity=\".3\" d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33V8h5.47L13 7v1h4V5.33C17 4.6 16.4 4 15.67 4z\"/><path d=\"M13 12.5h2L11 20v-5.5H9L12.47 8H7v12.67C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V8h-4v4.5z\"/></g><g id=\"battery-charging-full\"><path d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4zM11 20v-5.5H9L13 7v5.5h2L11 20z\"/></g><g id=\"battery-full\"><path d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z\"/></g><g id=\"battery-std\"><path d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z\"/></g><g id=\"battery-unknown\"><path d=\"M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4zm-2.72 13.95h-1.9v-1.9h1.9v1.9zm1.35-5.26s-.38.42-.67.71c-.48.48-.83 1.15-.83 1.6h-1.6c0-.83.46-1.52.93-2l.93-.94c.27-.27.44-.65.44-1.06 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5H9c0-1.66 1.34-3 3-3s3 1.34 3 3c0 .66-.27 1.26-.7 1.69z\"/></g><g id=\"bluetooth\"><path d=\"M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z\"/></g><g id=\"bluetooth-connected\"><path d=\"M7 12l-2-2-2 2 2 2 2-2zm10.71-4.29L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88zM19 10l-2 2 2 2 2-2-2-2z\"/></g><g id=\"bluetooth-disabled\"><path d=\"M13 5.83l1.88 1.88-1.6 1.6 1.41 1.41 3.02-3.02L12 2h-1v5.03l2 2v-3.2zM5.41 4L4 5.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l4.29-4.29 2.3 2.29L20 18.59 5.41 4zM13 18.17v-3.76l1.88 1.88L13 18.17z\"/></g><g id=\"bluetooth-searching\"><path d=\"M14.24 12.01l2.32 2.32c.28-.72.44-1.51.44-2.33 0-.82-.16-1.59-.43-2.31l-2.33 2.32zm5.29-5.3l-1.26 1.26c.63 1.21.98 2.57.98 4.02s-.36 2.82-.98 4.02l1.2 1.2c.97-1.54 1.54-3.36 1.54-5.31-.01-1.89-.55-3.67-1.48-5.19zm-3.82 1L10 2H9v7.59L4.41 5 3 6.41 8.59 12 3 17.59 4.41 19 9 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM11 5.83l1.88 1.88L11 9.59V5.83zm1.88 10.46L11 18.17v-3.76l1.88 1.88z\"/></g><g id=\"brightness-auto\"><path d=\"M10.85 12.65h2.3L12 9l-1.15 3.65zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9h-1.9z\"/></g><g id=\"brightness-high\"><path d=\"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zm0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4z\"/></g><g id=\"brightness-low\"><path d=\"M20 15.31L23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6z\"/></g><g id=\"brightness-medium\"><path d=\"M20 15.31L23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69zM12 18V6c3.31 0 6 2.69 6 6s-2.69 6-6 6z\"/></g><g id=\"data-usage\"><path d=\"M13 2.05v3.03c3.39.49 6 3.39 6 6.92 0 .9-.18 1.75-.48 2.54l2.6 1.53c.56-1.24.88-2.62.88-4.07 0-5.18-3.95-9.45-9-9.95zM12 19c-3.87 0-7-3.13-7-7 0-3.53 2.61-6.43 6-6.92V2.05c-5.06.5-9 4.76-9 9.95 0 5.52 4.47 10 9.99 10 3.31 0 6.24-1.61 8.06-4.09l-2.6-1.53C16.17 17.98 14.21 19 12 19z\"/></g><g id=\"developer-mode\"><path d=\"M7 5h10v2h2V3c0-1.1-.9-1.99-2-1.99L7 1c-1.1 0-2 .9-2 2v4h2V5zm8.41 11.59L20 12l-4.59-4.59L14 8.83 17.17 12 14 15.17l1.41 1.42zM10 15.17L6.83 12 10 8.83 8.59 7.41 4 12l4.59 4.59L10 15.17zM17 19H7v-2H5v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4h-2v2z\"/></g><g id=\"devices\"><path d=\"M4 6h18V4H4c-1.1 0-2 .9-2 2v11H0v3h14v-3H4V6zm19 2h-6c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zm-1 9h-4v-7h4v7z\"/></g><g id=\"dvr\"><path d=\"M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2zm0 14H3V5h18v12zm-2-9H8v2h11V8zm0 4H8v2h11v-2zM7 8H5v2h2V8zm0 4H5v2h2v-2z\"/></g><g id=\"gps-fixed\"><path d=\"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"/></g><g id=\"gps-not-fixed\"><path d=\"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"/></g><g id=\"gps-off\"><path d=\"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06c-1.13.12-2.19.46-3.16.97l1.5 1.5C10.16 5.19 11.06 5 12 5c3.87 0 7 3.13 7 7 0 .94-.19 1.84-.52 2.65l1.5 1.5c.5-.96.84-2.02.97-3.15H23v-2h-2.06zM3 4.27l2.04 2.04C3.97 7.62 3.25 9.23 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c1.77-.2 3.38-.91 4.69-1.98L19.73 21 21 19.73 4.27 3 3 4.27zm13.27 13.27C15.09 18.45 13.61 19 12 19c-3.87 0-7-3.13-7-7 0-1.61.55-3.09 1.46-4.27l9.81 9.81z\"/></g><g id=\"location-disabled\"><path d=\"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06c-1.13.12-2.19.46-3.16.97l1.5 1.5C10.16 5.19 11.06 5 12 5c3.87 0 7 3.13 7 7 0 .94-.19 1.84-.52 2.65l1.5 1.5c.5-.96.84-2.02.97-3.15H23v-2h-2.06zM3 4.27l2.04 2.04C3.97 7.62 3.25 9.23 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c1.77-.2 3.38-.91 4.69-1.98L19.73 21 21 19.73 4.27 3 3 4.27zm13.27 13.27C15.09 18.45 13.61 19 12 19c-3.87 0-7-3.13-7-7 0-1.61.55-3.09 1.46-4.27l9.81 9.81z\"/></g><g id=\"location-searching\"><path d=\"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z\"/></g><g id=\"multitrack-audio\"><path d=\"M7 18h2V6H7v12zm4 4h2V2h-2v20zm-8-8h2v-4H3v4zm12 4h2V6h-2v12zm4-8v4h2v-4h-2z\"/></g><g id=\"network-cell\"><path fill-opacity=\".3\" d=\"M2 22h20V2z\"/><path d=\"M17 7L2 22h15z\"/></g><g id=\"network-wifi\"><path fill-opacity=\".3\" d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/><path d=\"M3.53 10.95l8.46 10.54.01.01.01-.01 8.46-10.54C20.04 10.62 16.81 8 12 8c-4.81 0-8.04 2.62-8.47 2.95z\"/></g><g id=\"nfc\"><path d=\"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H4V4h16v16zM18 6h-5c-1.1 0-2 .9-2 2v2.28c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V8h3v8H8V8h2V6H6v12h12V6z\"/></g><g id=\"now-wallpaper\"><path d=\"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z\"/></g><g id=\"now-widgets\"><path d=\"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z\"/></g><g id=\"screen-lock-landscape\"><path d=\"M21 5H3c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-2 12H5V7h14v10zm-9-1h4c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1v-1c0-1.11-.9-2-2-2-1.11 0-2 .9-2 2v1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1zm.8-6c0-.66.54-1.2 1.2-1.2.66 0 1.2.54 1.2 1.2v1h-2.4v-1z\"/></g><g id=\"screen-lock-portrait\"><path d=\"M10 16h4c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1v-1c0-1.11-.9-2-2-2-1.11 0-2 .9-2 2v1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1zm.8-6c0-.66.54-1.2 1.2-1.2.66 0 1.2.54 1.2 1.2v1h-2.4v-1zM17 1H7c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 18H7V5h10v14z\"/></g><g id=\"screen-lock-rotation\"><path d=\"M23.25 12.77l-2.57-2.57-1.41 1.41 2.22 2.22-5.66 5.66L4.51 8.17l5.66-5.66 2.1 2.1 1.41-1.41L11.23.75c-.59-.59-1.54-.59-2.12 0L2.75 7.11c-.59.59-.59 1.54 0 2.12l12.02 12.02c.59.59 1.54.59 2.12 0l6.36-6.36c.59-.59.59-1.54 0-2.12zM8.47 20.48C5.2 18.94 2.86 15.76 2.5 12H1c.51 6.16 5.66 11 11.95 11l.66-.03-3.81-3.82-1.33 1.33zM16 9h5c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1v-.5C21 1.12 19.88 0 18.5 0S16 1.12 16 2.5V3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm.8-6.5c0-.94.76-1.7 1.7-1.7s1.7.76 1.7 1.7V3h-3.4v-.5z\"/></g><g id=\"screen-rotation\"><path d=\"M16.48 2.52c3.27 1.55 5.61 4.72 5.97 8.48h1.5C23.44 4.84 18.29 0 12 0l-.66.03 3.81 3.81 1.33-1.32zm-6.25-.77c-.59-.59-1.54-.59-2.12 0L1.75 8.11c-.59.59-.59 1.54 0 2.12l12.02 12.02c.59.59 1.54.59 2.12 0l6.36-6.36c.59-.59.59-1.54 0-2.12L10.23 1.75zm4.6 19.44L2.81 9.17l6.36-6.36 12.02 12.02-6.36 6.36zm-7.31.29C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81-1.33 1.32z\"/></g><g id=\"sd-storage\"><path d=\"M18 2h-8L4.02 8 4 20c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-6 6h-2V4h2v4zm3 0h-2V4h2v4zm3 0h-2V4h2v4z\"/></g><g id=\"settings-system-daydream\"><path d=\"M9 16h6.5c1.38 0 2.5-1.12 2.5-2.5S16.88 11 15.5 11h-.05c-.24-1.69-1.69-3-3.45-3-1.4 0-2.6.83-3.16 2.02h-.16C7.17 10.18 6 11.45 6 13c0 1.66 1.34 3 3 3zM21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z\"/></g><g id=\"signal-cellular-0-bar\"><path fill-opacity=\".3\" d=\"M2 22h20V2z\"/></g><g id=\"signal-cellular-1-bar\"><path fill-opacity=\".3\" d=\"M2 22h20V2z\"/><path d=\"M12 12L2 22h10z\"/></g><g id=\"signal-cellular-2-bar\"><path fill-opacity=\".3\" d=\"M2 22h20V2z\"/><path d=\"M14 10L2 22h12z\"/></g><g id=\"signal-cellular-3-bar\"><path fill-opacity=\".3\" d=\"M2 22h20V2z\"/><path d=\"M17 7L2 22h15z\"/></g><g id=\"signal-cellular-4-bar\"><path d=\"M2 22h20V2z\"/></g><g id=\"signal-cellular-connected-no-internet-0-bar\"><path fill-opacity=\".3\" d=\"M22 8V2L2 22h16V8z\"/><path d=\"M20 22h2v-2h-2v2zm0-12v8h2v-8h-2z\"/></g><g id=\"signal-cellular-connected-no-internet-1-bar\"><path fill-opacity=\".3\" d=\"M22 8V2L2 22h16V8z\"/><path d=\"M20 10v8h2v-8h-2zm-8 12V12L2 22h10zm8 0h2v-2h-2v2z\"/></g><g id=\"signal-cellular-connected-no-internet-2-bar\"><path fill-opacity=\".3\" d=\"M22 8V2L2 22h16V8z\"/><path d=\"M14 22V10L2 22h12zm6-12v8h2v-8h-2zm0 12h2v-2h-2v2z\"/></g><g id=\"signal-cellular-connected-no-internet-3-bar\"><path fill-opacity=\".3\" d=\"M22 8V2L2 22h16V8z\"/><path d=\"M17 22V7L2 22h15zm3-12v8h2v-8h-2zm0 12h2v-2h-2v2z\"/></g><g id=\"signal-cellular-connected-no-internet-4-bar\"><path d=\"M20 18h2v-8h-2v8zm0 4h2v-2h-2v2zM2 22h16V8h4V2L2 22z\"/></g><g id=\"signal-cellular-no-sim\"><path d=\"M18.99 5c0-1.1-.89-2-1.99-2h-7L7.66 5.34 19 16.68 18.99 5zM3.65 3.88L2.38 5.15 5 7.77V19c0 1.1.9 2 2 2h10.01c.35 0 .67-.1.96-.26l1.88 1.88 1.27-1.27L3.65 3.88z\"/></g><g id=\"signal-cellular-null\"><path d=\"M20 6.83V20H6.83L20 6.83M22 2L2 22h20V2z\"/></g><g id=\"signal-cellular-off\"><path d=\"M21 1l-8.59 8.59L21 18.18V1zM4.77 4.5L3.5 5.77l6.36 6.36L1 21h17.73l2 2L22 21.73 4.77 4.5z\"/></g><g id=\"signal-wifi-0-bar\"><path fill-opacity=\".3\" d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/></g><g id=\"signal-wifi-1-bar\"><path fill-opacity=\".3\" d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/><path d=\"M6.67 14.86L12 21.49v.01l.01-.01 5.33-6.63C17.06 14.65 15.03 13 12 13s-5.06 1.65-5.33 1.86z\"/></g><g id=\"signal-wifi-2-bar\"><path fill-opacity=\".3\" d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/><path d=\"M4.79 12.52l7.2 8.98H12l.01-.01 7.2-8.98C18.85 12.24 16.1 10 12 10s-6.85 2.24-7.21 2.52z\"/></g><g id=\"signal-wifi-3-bar\"><path fill-opacity=\".3\" d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/><path d=\"M3.53 10.95l8.46 10.54.01.01.01-.01 8.46-10.54C20.04 10.62 16.81 8 12 8c-4.81 0-8.04 2.62-8.47 2.95z\"/></g><g id=\"signal-wifi-4-bar\"><path d=\"M12.01 21.49L23.64 7c-.45-.34-4.93-4-11.64-4C5.28 3 .81 6.66.36 7l11.63 14.49.01.01.01-.01z\"/></g><g id=\"signal-wifi-off\"><path d=\"M23.64 7c-.45-.34-4.93-4-11.64-4-1.5 0-2.89.19-4.15.48L18.18 13.8 23.64 7zm-6.6 8.22L3.27 1.44 2 2.72l2.05 2.06C1.91 5.76.59 6.82.36 7l11.63 14.49.01.01.01-.01 3.9-4.86 3.32 3.32 1.27-1.27-3.46-3.46z\"/></g><g id=\"storage\"><path d=\"M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z\"/></g><g id=\"usb\"><path d=\"M15 7v4h1v2h-3V5h2l-3-4-3 4h2v8H8v-2.07c.7-.37 1.2-1.08 1.2-1.93 0-1.21-.99-2.2-2.2-2.2-1.21 0-2.2.99-2.2 2.2 0 .85.5 1.56 1.2 1.93V13c0 1.11.89 2 2 2h3v3.05c-.71.37-1.2 1.1-1.2 1.95 0 1.22.99 2.2 2.2 2.2 1.21 0 2.2-.98 2.2-2.2 0-.85-.49-1.58-1.2-1.95V15h3c1.11 0 2-.89 2-2v-2h1V7h-4z\"/></g><g id=\"wifi-lock\"><path d=\"M20.5 9.5c.28 0 .55.04.81.08L24 6c-3.34-2.51-7.5-4-12-4S3.34 3.49 0 6l12 16 3.5-4.67V14.5c0-2.76 2.24-5 5-5zM23 16v-1.5c0-1.38-1.12-2.5-2.5-2.5S18 13.12 18 14.5V16c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h5c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1zm-1 0h-3v-1.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V16z\"/></g><g id=\"wifi-tethering\"><path d=\"M12 11c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 2c0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.48-.81 2.75-2 3.45l1 1.74c1.79-1.04 3-2.97 3-5.19zM12 3C6.48 3 2 7.48 2 13c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 18.53 4 15.96 4 13c0-4.42 3.58-8 8-8s8 3.58 8 8c0 2.96-1.61 5.53-4 6.92l1 1.73c2.99-1.73 5-4.95 5-8.65 0-5.52-4.48-10-10-10z\"/></g></defs></svg>',\n    'img/icons/sets/social-icons.svg' : '<svg><defs><g id=\"cake\"><path d=\"M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9z\"/></g><g id=\"domain\"><path d=\"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z\"/></g><g id=\"group\"><path d=\"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z\"/></g><g id=\"group-add\"><path d=\"M8 10H5V7H3v3H0v2h3v3h2v-3h3v-2zm10 1c1.66 0 2.99-1.34 2.99-3S19.66 5 18 5c-.32 0-.63.05-.91.14.57.81.9 1.79.9 2.86s-.34 2.04-.9 2.86c.28.09.59.14.91.14zm-5 0c1.66 0 2.99-1.34 2.99-3S14.66 5 13 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm6.62 2.16c.83.73 1.38 1.66 1.38 2.84v2h3v-2c0-1.54-2.37-2.49-4.38-2.84zM13 13c-2 0-6 1-6 3v2h12v-2c0-2-4-3-6-3z\"/></g><g id=\"location-city\"><path d=\"M15 11V5l-3-3-3 3v2H3v14h18V11h-6zm-8 8H5v-2h2v2zm0-4H5v-2h2v2zm0-4H5V9h2v2zm6 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V9h2v2zm0-4h-2V5h2v2zm6 12h-2v-2h2v2zm0-4h-2v-2h2v2z\"/></g><g id=\"mood\"><path d=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z\"/></g><g id=\"notifications\"><path d=\"M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2z\"/></g><g id=\"notifications-none\"><path d=\"M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2zm-2 1H7v-6.5C7 8.01 9.01 6 11.5 6S16 8.01 16 10.5V17z\"/></g><g id=\"notifications-off\"><path d=\"M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zM18 10.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-.51.12-.99.32-1.45.56L18 14.18V10.5zm-.27 8.5l2 2L21 19.73 4.27 3 3 4.27l2.92 2.92C5.34 8.16 5 9.29 5 10.5V16l-2 2v1h14.73z\"/></g><g id=\"notifications-on\"><path d=\"M6.58 3.58L5.15 2.15C2.76 3.97 1.18 6.8 1.03 10h2c.15-2.65 1.51-4.97 3.55-6.42zM19.97 10h2c-.15-3.2-1.73-6.03-4.13-7.85l-1.43 1.43c2.05 1.45 3.41 3.77 3.56 6.42zm-1.97.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2v-5.5zM11.5 22c.14 0 .27-.01.4-.04.65-.13 1.19-.58 1.44-1.18.1-.24.16-.5.16-.78h-4c0 1.1.9 2 2 2z\"/></g><g id=\"notifications-paused\"><path d=\"M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2zm-4-6.2l-2.8 3.4H14V15H9v-1.8l2.8-3.4H9V8h5v1.8z\"/></g><g id=\"pages\"><path d=\"M3 5v6h5L7 7l4 1V3H5c-1.1 0-2 .9-2 2zm5 8H3v6c0 1.1.9 2 2 2h6v-5l-4 1 1-4zm9 4l-4-1v5h6c1.1 0 2-.9 2-2v-6h-5l1 4zm2-14h-6v5l4-1-1 4h5V5c0-1.1-.9-2-2-2z\"/></g><g id=\"party-mode\"><path d=\"M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 3c1.63 0 3.06.79 3.98 2H12c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H7.1c-.06-.32-.1-.66-.1-1 0-2.76 2.24-5 5-5zm0 10c-1.63 0-3.06-.79-3.98-2H12c1.66 0 3-1.34 3-3 0-.35-.07-.69-.18-1h2.08c.07.32.1.66.1 1 0 2.76-2.24 5-5 5z\"/></g><g id=\"people\"><path d=\"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z\"/></g><g id=\"people-outline\"><path d=\"M16.5 13c-1.2 0-3.07.34-4.5 1-1.43-.67-3.3-1-4.5-1C5.33 13 1 14.08 1 16.25V19h22v-2.75c0-2.17-4.33-3.25-6.5-3.25zm-4 4.5h-10v-1.25c0-.54 2.56-1.75 5-1.75s5 1.21 5 1.75v1.25zm9 0H14v-1.25c0-.46-.2-.86-.52-1.22.88-.3 1.96-.53 3.02-.53 2.44 0 5 1.21 5 1.75v1.25zM7.5 12c1.93 0 3.5-1.57 3.5-3.5S9.43 5 7.5 5 4 6.57 4 8.5 5.57 12 7.5 12zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 5.5c1.93 0 3.5-1.57 3.5-3.5S18.43 5 16.5 5 13 6.57 13 8.5s1.57 3.5 3.5 3.5zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z\"/></g><g id=\"person\"><path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"/></g><g id=\"person-add\"><path d=\"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V7H4v3H1v2h3v3h2v-3h3v-2H6zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"/></g><g id=\"person-outline\"><path d=\"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z\"/></g><g id=\"plus-one\"><path d=\"M10 8H8v4H4v2h4v4h2v-4h4v-2h-4zm4.5-1.92V7.9l2.5-.5V18h2V5z\"/></g><g id=\"poll\"><path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/></g><g id=\"public\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z\"/></g><g id=\"school\"><path d=\"M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z\"/></g><g id=\"share\"><path d=\"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z\"/></g><g id=\"whatshot\"><path d=\"M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z\"/></g></defs></svg>',\n    'img/icons/ic_label_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-568\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M17.6,5.8C17.3,5.3,16.7,5,16,5L5,5C3.9,5,3,5.9,3,7v10c0,1.1,0.9,2,2,2l11,0c0.7,0,1.3-0.3,1.6-0.8L22,12L17.6,5.8z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_more_vert_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-2488\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M12,8c1.1,0,2-0.9,2-2s-0.9-2-2-2c-1.1,0-2,0.9-2,2S10.9,8,12,8z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2 S13.1,10,12,10z M12,16c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2S13.1,16,12,16z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/ic_ondemand_video_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path fill=\"none\" d=\"M0 0h24v24H0V0z\"/> <path d=\"M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2zm0 14H3V5h18v12zm-5-6l-7 4V7z\"/></svg>',\n    'img/icons/twitter.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"48px\" height=\"48px\" viewBox=\"0 0 48 48\" enable-background=\"new 0 0 48 48\" xml:space=\"preserve\"><g><g><g><path fill=\"#7d7d7d\" d=\"M40,4H8C5.8,4,4,5.8,4,8l0,32c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V8C44,5.8,42.2,4,40,4z M35.4,18.7c-0.1,9.2-6,15.6-14.8,16c-3.6,0.2-6.3-1-8.6-2.5c2.7,0.4,6-0.6,7.8-2.2c-2.6-0.3-4.2-1.6-4.9-3.8c0.8,0.1,1.6,0.1,2.3-0.1c-2.4-0.8-4.1-2.3-4.2-5.3c0.7,0.3,1.4,0.6,2.3,0.6c-1.8-1-3.1-4.7-1.6-7.2c2.6,2.9,5.8,5.3,11,5.6c-1.3-5.6,6.1-8.6,9.2-4.9c1.3-0.3,2.4-0.8,3.4-1.3c-0.4,1.3-1.2,2.2-2.2,2.9c1.1-0.1,2.1-0.4,2.9-0.8C37.5,16.9,36.4,17.9,35.4,18.7z\"/></g><g><rect fill=\"none\" width=\"48\" height=\"48\"/></g></g></g></svg>',\n    'img/icons/addShoppingCart.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g id=\"addShoppingCart\"><g id=\"add-shopping-cart\"><path d=\"M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z\"/></g></svg>',\n    'img/icons/ic_close_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>',\n    'img/icons/ic_visibility_24px.svg' : '<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"><svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g id=\"Header\"> <g> <rect x=\"-618\" y=\"-1592\" fill=\"none\" width=\"1400\" height=\"3600\"/> </g></g><g id=\"Label\"></g><g id=\"Icon\"> <g> <rect fill=\"none\" width=\"24\" height=\"24\"/> <path d=\"M12,4.5C7,4.5,2.7,7.6,1,12c1.7,4.4,6,7.5,11,7.5c5,0,9.3-3.1,11-7.5C21.3,7.6,17,4.5,12,4.5z M12,17c-2.8,0-5-2.2-5-5 s2.2-5,5-5c2.8,0,5,2.2,5,5S14.8,17,12,17z M12,9c-1.7,0-3,1.3-3,3s1.3,3,3,3c1.7,0,3-1.3,3-3S13.7,9,12,9z\"/> </g></g><g id=\"Grid\" display=\"none\"> <g display=\"inline\"> </g></g></svg>',\n    'img/icons/upload.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g><g><rect x=\"-618\" y=\"-2232\" fill=\"none\" width=\"1400\" height=\"3600\"/></g></g><g><g><rect fill=\"none\" width=\"24\" height=\"24\"/><path fill=\"#7d7d7d\" d=\"M19.4,10c-0.7-3.4-3.7-6-7.4-6C9.1,4,6.6,5.6,5.4,8C2.3,8.4,0,10.9,0,14c0,3.3,2.7,6,6,6h13c2.8,0,5-2.2,5-5C24,12.4,21.9,10.2,19.4,10z M14,13v4h-4v-4H7l5-5l5,5H14z\"/></g></g></svg>',\n    'img/icons/codepen-logo.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"500\" height=\"500\" viewBox=\"0 0 500 500\"><path d=\"M250 0C111.928 0 0 111.927 0 250c0 138.077 111.927 250 250 250 138.073 0 250-111.923 250-250C500 111.928 388.073 0 250 0zm0 458.943C134.79 458.943 41.06 365.21 41.06 250c0-115.207 93.73-208.94 208.94-208.94S458.94 134.793 458.94 250c0 115.21-93.73 208.943-208.94 208.943z\"/><path d=\"M404.462 201.172c-.028-.195-.076-.382-.11-.577-.064-.374-.134-.748-.23-1.114-.058-.22-.14-.43-.207-.64-.106-.327-.212-.652-.342-.97-.09-.22-.196-.438-.297-.65-.14-.3-.285-.593-.452-.877-.122-.212-.25-.416-.377-.618-.18-.277-.362-.546-.562-.806-.146-.195-.3-.39-.454-.578-.21-.243-.43-.487-.663-.716-.174-.178-.346-.357-.528-.52-.245-.22-.497-.432-.753-.634-.198-.155-.395-.31-.602-.456-.078-.05-.146-.114-.22-.163L257.37 97.656c-4.465-2.976-10.275-2.976-14.74 0l-141.294 94.196c-.073.05-.142.114-.22.163-.207.146-.402.3-.597.456-.26.204-.513.416-.753.634-.187.164-.357.342-.533.52-.23.23-.45.474-.658.717-.16.19-.313.384-.46.578-.194.26-.382.53-.556.806-.134.203-.26.406-.382.618-.163.284-.31.577-.45.877-.103.21-.21.43-.298.65-.13.317-.236.642-.34.968-.07.21-.147.422-.21.642-.096.366-.16.74-.23 1.114-.032.195-.08.382-.106.577-.077.57-.122 1.147-.122 1.733V297.1c0 .585.044 1.162.122 1.74.025.188.074.382.106.568.07.374.134.748.23 1.114.063.22.14.432.21.643.104.324.21.65.34.975.09.222.195.433.297.645.143.3.29.592.45.885.123.204.25.406.383.61.174.276.362.545.557.806.146.203.3.39.46.577.207.243.426.488.657.716.175.177.346.356.533.52.24.22.492.43.752.634.194.155.39.31.597.454.077.05.146.115.22.163L242.63 402.35c2.232 1.487 4.803 2.236 7.372 2.236 2.566 0 5.135-.75 7.368-2.236l141.295-94.197c.074-.047.142-.112.22-.162.207-.145.403-.3.602-.454.256-.203.508-.414.752-.635.182-.163.353-.343.527-.52.232-.23.452-.474.664-.717.155-.187.31-.374.455-.577.2-.26.383-.53.562-.806.126-.204.255-.406.377-.61.167-.293.312-.585.452-.885.1-.212.206-.423.297-.645.13-.324.235-.65.342-.975.068-.21.15-.423.206-.643.1-.366.168-.74.233-1.114.033-.187.08-.38.11-.568.072-.578.118-1.155.118-1.74v-94.197c0-.585-.045-1.162-.118-1.73zm-141.176-67.64l104.088 69.388-46.493 31.103-57.594-38.527v-61.963zm-26.57 0v61.964l-57.593 38.527-46.497-31.103 104.09-69.387zm-114.726 94.24L155.228 250l-33.238 22.233V227.77zm114.725 138.7l-104.088-69.39 46.497-31.093 57.592 38.52v61.96zM250 281.43L203.014 250 250 218.574l46.986 31.428L250 281.432zm13.286 85.04v-61.963l57.595-38.52 46.494 31.093-104.088 69.388zm114.724-94.238L344.777 250l33.233-22.23v44.464z\"/></svg>',\n    'img/icons/more_vert.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\"> <path d=\"M0 0h18v18h-18z\" fill=\"none\"/> <path d=\"M9 5.5c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5.67 1.5 1.5 1.5zm0 2c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0 5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z\"/></svg>',\n    'img/icons/ic_person_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"/> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/></svg>',\n    'img/icons/ic_phone_24px.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"> <path d=\"M0 0h24v24h-24z\" fill=\"none\"/> <path d=\"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1v3.49c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z\"/></svg>',\n    'img/icons/menu.svg' : '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\"> <path d=\"M0 0h18v18h-18z\" fill=\"none\"/> <path d=\"M2 13.5h14v-1.5h-14v1.5zm0-4h14v-1.5h-14v1.5zm0-5.5v1.5h14v-1.5h-14z\"/></svg>',\n    'img/icons/print.svg' : '<svg version=\"1.1\" x=\"0px\" y=\"0px\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" enable-background=\"new 0 0 24 24\" xml:space=\"preserve\"><g><g><g><path d=\"M19,8H5c-1.7,0-3,1.3-3,3v6h4v4h12v-4h4v-6C22,9.3,20.7,8,19,8z M16,19H8v-5h8V19z M19,12c-0.6,0-1-0.4-1-1s0.4-1,1-1c0.6,0,1,0.4,1,1S19.6,12,19,12z M18,3H6v4h12V3z\" fill=\"#7d7d7d\"/></g><rect fill=\"none\" width=\"24\" height=\"24\"/></g></g></svg>',\n    'icons/avatar-icons.svg' : '<svg><defs> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-1\" x=\"128\"> <path fill=\"#FF8A80\" d=\"M0 0h128v128H0z\"/> <path fill=\"#FFE0B2\" d=\"M36.3 94.8c6.4 7.3 16.2 12.1 27.3 12.4 10.7-.3 20.3-4.7 26.7-11.6l.2.1c-17-13.3-12.9-23.4-8.5-28.6 1.3-1.2 2.8-2.5 4.4-3.9l13.1-11c1.5-1.2 2.6-3 2.9-5.1.6-4.4-2.5-8.4-6.9-9.1-1.5-.2-3 0-4.3.6-.3-1.3-.4-2.7-1.6-3.5-1.4-.9-2.8-1.7-4.2-2.5-7.1-3.9-14.9-6.6-23-7.9-5.4-.9-11-1.2-16.1.7-3.3 1.2-6.1 3.2-8.7 5.6-1.3 1.2-2.5 2.4-3.7 3.7l-1.8 1.9c-.3.3-.5.6-.8.8-.1.1-.2 0-.4.2.1.2.1.5.1.6-1-.3-2.1-.4-3.2-.2-4.4.6-7.5 4.7-6.9 9.1.3 2.1 1.3 3.8 2.8 5.1l11 9.3c1.8 1.5 3.3 3.8 4.6 5.7 1.5 2.3 2.8 4.9 3.5 7.6 1.7 6.8-.8 13.4-5.4 18.4-.5.6-1.1 1-1.4 1.7-.2.6-.4 1.3-.6 2-.4 1.5-.5 3.1-.3 4.6.4 3.1 1.8 6.1 4.1 8.2 3.3 3 8 4 12.4 4.5 5.2.6 10.5.7 15.7.2 4.5-.4 9.1-1.2 13-3.4 5.6-3.1 9.6-8.9 10.5-15.2M76.4 46c.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6-.9 0-1.6-.7-1.6-1.6-.1-.9.7-1.6 1.6-1.6zm-25.7 0c.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6-.9 0-1.6-.7-1.6-1.6-.1-.9.7-1.6 1.6-1.6z\"/> <path fill=\"#E0F7FA\" d=\"M105.3 106.1c-.9-1.3-1.3-1.9-1.3-1.9l-.2-.3c-.6-.9-1.2-1.7-1.9-2.4-3.2-3.5-7.3-5.4-11.4-5.7 0 0 .1 0 .1.1l-.2-.1c-6.4 6.9-16 11.3-26.7 11.6-11.2-.3-21.1-5.1-27.5-12.6-.1.2-.2.4-.2.5-3.1.9-6 2.7-8.4 5.4l-.2.2s-.5.6-1.5 1.7c-.9 1.1-2.2 2.6-3.7 4.5-3.1 3.9-7.2 9.5-11.7 16.6-.9 1.4-1.7 2.8-2.6 4.3h109.6c-3.4-7.1-6.5-12.8-8.9-16.9-1.5-2.2-2.6-3.8-3.3-5z\"/> <circle fill=\"#444\" cx=\"76.3\" cy=\"47.5\" r=\"2\"/> <circle fill=\"#444\" cx=\"50.7\" cy=\"47.6\" r=\"2\"/> <path fill=\"#444\" d=\"M48.1 27.4c4.5 5.9 15.5 12.1 42.4 8.4-2.2-6.9-6.8-12.6-12.6-16.4C95.1 20.9 92 10 92 10c-1.4 5.5-11.1 4.4-11.1 4.4H62.1c-1.7-.1-3.4 0-5.2.3-12.8 1.8-22.6 11.1-25.7 22.9 10.6-1.9 15.3-7.6 16.9-10.2z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-10\" x=\"256\" y=\"256\"> <path fill=\"#FFCC80\" d=\"M41.6 123.8s0 .1-.1.1l.3-.4c-.1.2-.1.2-.2.3z\"/> <path fill=\"#8C9EFF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#C2C2C2\" d=\"M34.8 79.5c-2.5-3.4-5.9-6.4-6.9-10.3v-.1l-.6-.5c-.3-1.2.6-2 .5-3l-2.4-1h-6.9s0 17 17.4 17.3c-.9-.9-.7-1.8-1.1-2.4z\"/> <path fill=\"#CFD8DC\" d=\"M21.9 64.2l-.1-.3c0-.1 0-.2-.1-.4v-1l.1-.3c.1-.1.1-.2.1-.3.1-.1.1-.2.1-.2.2-.4.1-.8-.2-1.1-.4-.4-1-.4-1.3 0l-.2.2-.2.2c-.1.1-.2.2-.3.4l-.3.6-.3.6c-.1.2-.2.4-.2.7 0 .2-.1.5-.1.8v.5h3c.2-.2.1-.3 0-.4z\"/> <path fill=\"#eee\" d=\"M116.5 65.2c.1.1.2.1.2.2 0-.1-.1-.2-.2-.2zm8.2 6.1l.6.3c-.3-.1-.4-.2-.6-.3zm1.7 1l.6.3c-.2 0-.4-.1-.6-.3zm-3.4-2.1l.5.3c-.2 0-.4-.2-.5-.3zm-8-6.5zm-.1 64.1c-12-17.2-7.6-52-3.1-67.6v-.1c-3.5-4.2-7.8-11.7-10.2-18.7-1.7-5-4-8.8-6.4-11.8l-1.6-2-10.7 11.8c-1.5 2.1-3.3 1.8-4.1-.6l-7.1-17.3c-.3-.9-.3-1.9 0-2.7.3-1.1-.1-2.1.7-3l-2-.1c-1.3 0-2.5.1-3.7.3-1.7-.3-3.4-.5-5.1-.5-11.9 0-21.9 8.1-24.8 19.2-.5 1.8-.7 3.7-.8 5.6-1.2 3.6-4.2 7.7-11.5 8.4 1.3.4 2.2 1.9 2 3.6l-.5 2.8c-.3 2-1.2 2.4-2.2.9l1.6 8.6.2.9c.1 1.1.3 2.2.6 3.4 1 4 3.2 8.2 7.8 10.9.3.6 1 1.3 2 2.1 8.2 6.7 36 20.7 27.8 46.1h51.3c0-.1-.1-.1-.2-.2zM34.5 59.3c.5 0 1 .4 1 1 0 .5-.4 1-1 1-.5 0-1-.4-1-1s.4-1 1-1zm7.4 3.9c.5 0 1 .4 1 1 0 .5-.4 1-1 1-.5 0-1-.4-1-1 0-.5.5-1 1-1zm-1-8.5c-.5 0-1-.4-1-1 0-.5.4-1 1-1 .5 0 1 .4 1 1s-.5 1-1 1zm3.9-10.9c-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6zm73.3 22.7c.1.1.2.2.4.3-.2-.1-.3-.2-.4-.3zm3.2 2.6l.5.3-.5-.3zm-1.6-1.3l.4.3c-.1 0-.3-.1-.4-.3z\"/> <path fill=\"#C2C2C2\" d=\"M114.9 127.8l.2.2H128V73.2l-1-.6-.6-.3-1.2-.7-.6-.3-1.2-.7-.5-.3-1.2-.8-.5-.3-1.2-.9-.4-.3-1.2-1c-.1-.1-.2-.2-.4-.3l-1.3-1.2c-.1-.1-.2-.1-.2-.2l-1.5-1.5c-1.5-1.6-3-3.3-4.4-5.1-4.6 15.4-13 52.7 4.3 69.1z\"/> <path fill=\"#646464\" d=\"M26 55.1l.4-2.8c.2-1.8-.6-3.2-2-3.6-.3-.1-.7-.2-1.1-.1-2 .1-2.7 1.9-1.6 3.8l1.8 3.3c.1.2.2.3.3.4 1 1.3 1.9 1 2.2-1z\"/> <circle fill=\"#444\" cx=\"44.8\" cy=\"42.2\" r=\"2\"/> <circle fill=\"#CFD8DC\" cx=\"34.5\" cy=\"60.3\" r=\"1\"/> <circle fill=\"#CFD8DC\" cx=\"40.9\" cy=\"53.7\" r=\"1\"/> <circle fill=\"#CFD8DC\" cx=\"41.9\" cy=\"64.2\" r=\"1\"/> <path fill=\"#646464\" d=\"M70.7 18.8c-.3.8-.3 1.8 0 2.7l8.1 19.3c.8 2.5 2.6 2.7 4.1.6l12.3-11.8 1.4-1.3c.3-.4.5-.9.6-1.3.4-1.2.3-2.4-.1-3.6-1.1-4.3-5.6-8.9-11.2-10.3-5.6-1.4-10.9-.2-13.6 2.7-.8.8-1.3 1.8-1.6 3z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-11\" y=\"128\"> <path fill=\"#FFCC80\" d=\"M41.6 123.8s0 .1-.1.1l.3-.4c-.1.2-.1.2-.2.3z\"/> <path fill=\"#FFFF8D\" d=\"M0 0h128v128H0z\"/> <path fill=\"#F4B400\" d=\"M110.3 91.4l-.5-.5c.1.2.3.4.5.5zm-4.4-4.5l.4.5c-.1-.2-.3-.4-.4-.5zm9.8 9.5c.2.2.4.4.7.6-.3-.2-.5-.4-.7-.6zM104.3 85c.2.2.3.4.5.5-.2-.1-.4-.3-.5-.5zm3.7 4.1zm16.9 14l.9.6c-.3-.3-.6-.4-.9-.6zm-28.5-29l.1.2c-.1 0-.1-.1-.1-.2zm15.2 18.6c.2.2.4.4.7.6l-.7-.6zm10 8.2l.9.6-.9-.6zm-18.8-17.7l.4.5c-.1-.1-.3-.3-.4-.5zm-1.4-1.7c.1.1.1.2.2.2-.1 0-.1-.1-.2-.2zm12.2 13l.7.6c-.2-.1-.5-.4-.7-.6zm-15-16.8c.1.1.1.2.2.2l-.2-.2zm-1.2-1.8l.2.3c0-.1-.1-.2-.2-.3zm28.4 27.7l-.9-.6-2.4-1.5-.9-.6c-1-.7-2.1-1.4-3.1-2.2l-2.2-1.8c-.2-.2-.4-.4-.7-.6-.5-.4-1-.8-1.4-1.2l-.7-.6-1.3-1.2-.7-.6c-.5-.4-.9-.9-1.3-1.3l-.5-.5-1.8-1.8c-.6-.6-1.1-1.2-1.6-1.8l-.4-.5-1.2-1.3c-.2-.2-.3-.4-.5-.5l-1.1-1.3-.4-.5-1.2-1.5c-.1-.1-.1-.2-.2-.2-.9-1.2-1.8-2.4-2.6-3.6-.1-.1-.1-.2-.2-.2l-1-1.5-.2-.3c-.3-.5-.6-1-1-1.5l-.1-.2c-1.1-1.8-2-3.5-2.9-5.2-3.1-6-4.8-11.4-5.7-15.9-.2-.9-.3-1.7-.4-2.6L85 13l-8 10.2c-3.7-2.6-8.2-4.2-13.1-4.2s-9.4 1.5-13.1 4.1L42.7 13l-1.8 29-7.7 71.8h.2c-.1 1-.2 2-.2 3 0 4 .8 7.7 2.1 11.2H128v-23.1c-.7-.4-1.5-.8-2.2-1.3zM55 38.4c-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .8-.7 1.6-1.6 1.6zm17.9 0c-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .8-.7 1.6-1.6 1.6z\"/> <circle fill=\"#444\" cx=\"72.9\" cy=\"36.7\" r=\"2\"/> <circle fill=\"#444\" cx=\"55\" cy=\"36.7\" r=\"2\"/> <path fill=\"#444\" d=\"M61.6 39.5c-.5 1-.1 1.7 1 1.7h4.6c1.1 0 1.6-.8 1-1.7l-2.3-4c-.5-1-1.4-1-2 0l-2.3 4z\"/> <path fill=\"#FF5722\" d=\"M92.5 102.7c8.3 11.3 23.6 14.4 35.5 7.8v-5.6l-2.2-1.3-.9-.6-2.4-1.5-.9-.6c-1-.7-2.1-1.4-3.1-2.2l-2.2-1.8c-.2-.2-.4-.4-.7-.6-.5-.4-1-.8-1.4-1.2l-.7-.6-1.3-1.2-.7-.6c-.5-.4-.9-.9-1.3-1.3l-.5-.5-1.8-1.8c-.6-.6-1.1-1.2-1.6-1.8l-.4-.5-1.2-1.3c-.2-.2-.3-.4-.5-.5l-1.1-1.3-.4-.5-1.2-1.5c-.1-.1-.1-.2-.2-.2-.9-1.2-1.8-2.4-2.6-3.6-.1-.1-.1-.2-.2-.2l-1-1.5-.2-.3c-.3-.5-.6-1-1-1.5l-.1-.2c-1.1-1.8-2-3.5-2.9-5.2-7.7 9.4-8.4 23.4-.8 33.7z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-12\" x=\"128\" y=\"128\"> <path fill=\"#B9F6CA\" d=\"M0 0h128v128H0z\"/> <path fill=\"#444\" d=\"M50.4 75.7c-1.6-1.6-3.2-2.9-4.7-4-.9-.6-1-1.7-1.7-2.2-1.8-1-3.2-5.9-5.3-3.4l-.5.8-.4-.9c-1.3-1.2-1-.4-1.3-2.3-.5-4.2 1.2-7.2 5.1-7.8 1-.1 2-.1 2.9.2 9.5-1.8 13.7-7.4 15.2-10 4 5.7 14.3 11.4 38.3 7.8 2.8-4.7 4.5-10.2 4.5-16C102.4 20.8 88.6 7 71.6 7c-6.7 0-12.8 2.1-17.9 5.7L27.9 31C16.3 36.6 8.3 48.5 8.3 62.2c0 19.1 15.5 34.6 34.6 34.6 4.6 0 9-.9 13-2.5.2-8.4-1.4-14.5-5.5-18.6zm-5.9-21.6z\"/> <path fill=\"#8D6E63\" d=\"M73.7 122c6.1.5 13.4-.3 22-3.5-.1-.7-.3-1.4-.5-2.1-.3-1.3-3.8-21.4-4-28.1-.1-7.3.8-11.9 2-14.7h8.7l-2.5-10.1c-.2-2.4-.4-4.7-.7-6.6-.2-1.8-.3-2.3-.8-3.9-24 3.6-34.2-3.7-38.2-9.4-1.4 2.5-5.7 8.8-15.3 10.5-.9-.3-1.9-.3-2.9-.2-3.9.6-6.7 4.5-6.1 8.8.3 2 1.2 3.6 2.5 4.8.2.1 1.5.6 3.3 1.7.7.4 1.6.9 2.4 1.6 1.5 1.1 3.1 2.4 4.7 4 4 4.1 7.6 10.2 7.4 18.5-.1 4.9-1.6 10.6-5.1 17.2.1 0 7.3 10.2 23.1 11.5zM44.5 54.1z\"/> <path fill=\"#FFCC80\" d=\"M41.6 123.8s.1-.2.2-.3c-.1.2-.1.2-.2.3z\"/> <circle fill=\"#444\" cx=\"83.5\" cy=\"63.1\" r=\"2\"/> <path fill=\"#0097A7\" d=\"M73.7 122c-15.9-1.3-23-11.5-23-11.5-2.1 4-5.1 8.4-8.9 13.1l-.3.4c-.5.6-1.1 1.3-1.7 2-.5.6-1 1.3-1.6 2.1h59.7c-.7-3.2-1.5-6.4-2.1-9.5-8.7 3.1-16 3.9-22.1 3.4z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-13\" x=\"256\"> <path fill=\"#448AFF\" d=\"M0 0h128v128H0z\"/> <g fill=\"#00BFA5\"> <path d=\"M73 18.7c-4.8 0-9.7.8-14 2.3-.1.1-.2.2-.4.3l-7.3 4.6c-.6.4-1.4.4-2 .1-.3-.2-.6-.4-.8-.7l-.7-1.1c-.6-1-.3-2.2.6-2.8l7.3-4.6c.4-.2.8-.3 1.2-.3-5.5-3-23.7-10.7-33.7 10.7-11.8 25.4 11 50.2-14.4 62.6 0 0 26.2 13.7 40.9-24.8 3.7 3.2 8.8 5.8 16 7.4-.6-5.6.8-9.8-2.1-12.8-1.3-1.4-2.7-1.5-4-2.4-.7-.5-1.4-.9-2-1.3-1.5-.9-2.6-1.3-2.8-1.4-1.1-1-1.9-2.4-2.1-4.1-.5-3.6-2.2-6.9 1.1-7.4.8-.1 1.6-.1 2.4.2 8-1.5 11.6-6.7 12.8-8.9 3.4 4.8 11.7 9.8 31.9 6.8.3 1.1.6 1.2.8 2.4l.5-1.3c-.1-13-13.2-23.5-29.2-23.5zM56.1 43.2zm5.3 46.5s6 8.6 19.4 9.7c5.1.4 11.3-.3 18.6-2.9-.1-.6-.3-1.2-.4-1.7-.2-1.1-3.2-18-3.4-23.6-.2-6.2.6-10 1.6-12.4h7.3l-2.1-8.5c-.1-2-.4-3.9-.6-5.6 0-.3-.1-.7-.2-1-.2-1.1-.4-2.3-.8-3.4-20.2 3-28.5-2-31.9-6.8-1.2 2.1-4.8 7.4-12.8 8.9-.8-.2-1.6-.3-2.4-.2-3.3.5-5.6 3.8-5.1 7.4.2 1.7 1 3.1 2.1 4.1.2.1 1.3.5 2.8 1.4.6.4 1.3.8 2 1.3 1.3.9 2.6 2 4 3.4 2.9 3 5.6 7.2 6.1 12.8.5 4.5-.6 10.2-4.2 17.1zm27.5-41.2c.7 0 1.3.6 1.3 1.3s-.6 1.3-1.3 1.3-1.3-.6-1.3-1.3.6-1.3 1.3-1.3zm-32.8-5.3c.1-.1 0-.1 0 0zm-2.4 57.7l.2-.2-.2.2z\"/> <circle cx=\"88.9\" cy=\"49.8\" r=\"2\"/> <path d=\"M80.8 99.3c-13.3-1.1-19.4-9.7-19.4-9.7-1.8 3.4-4.3 7.1-7.5 11l-.3.3c-.4.5-.9 1.1-1.4 1.7-.7.9-1.6 2.1-2.8 3.7-2.3 3.2-5.4 7.8-8.8 13.5-1.4 2.4-2.9 5.1-4.4 8 0 0 0 .1-.1.1h71.3c-.6-1.6-1.3-3.2-1.7-4.8-2.2-8.6-4.6-17.9-6.5-26.8-7.2 2.8-13.3 3.5-18.4 3zM55.7 16.7l-7.3 4.6c-1 .6-1.3 1.9-.6 2.8l.7 1.1c.2.3.5.6.8.7.6.3 1.4.3 2-.1l7.3-4.6.4-.3c.7-.7.8-1.7.3-2.5l-.7-1.1c-.4-.6-1-.9-1.6-1-.5 0-1 .1-1.3.4z\"/> </g> <path fill=\"#444\" d=\"M73 18.7c-4.8 0-9.7.8-14 2.3-.1.1-.2.2-.4.3l-7.3 4.6c-.6.4-1.4.4-2 .1-.3-.2-.6-.4-.8-.7l-.7-1.1c-.6-1-.3-2.2.6-2.8l7.3-4.6c.4-.2.8-.3 1.2-.3-5.5-3-23.7-10.7-33.7 10.7-11.8 25.4 11 50.2-14.4 62.6 0 0 26.2 13.7 40.9-24.8 3.7 3.2 8.8 5.8 16 7.4-.6-5.6.8-9.8-2.1-12.8-1.3-1.4-2.7-1.5-4-2.4-.7-.5-1.4-.9-2-1.3-1.5-.9-2.6-1.3-2.8-1.4-1.1-1-1.9-2.4-2.1-4.1-.5-3.6-2.2-6.9 1.1-7.4.8-.1 1.6-.1 2.4.2 8-1.5 11.6-6.7 12.8-8.9 3.4 4.8 11.7 9.8 31.9 6.8.3 1.1.6 1.2.8 2.4l.5-1.3c-.1-13-13.2-23.5-29.2-23.5zM56.1 43.2z\"/> <path fill=\"#FFE0B2\" d=\"M61.4 89.7s6 8.6 19.4 9.7c5.1.4 11.3-.3 18.6-2.9-.1-.6-.3-1.2-.4-1.7-.2-1.1-3.2-18-3.4-23.6-.2-6.2.6-10 1.6-12.4h7.3l-2.1-8.5c-.1-2-.4-3.9-.6-5.6 0-.3-.1-.7-.2-1-.2-1.1-.4-2.3-.8-3.4-20.2 3-28.5-2-31.9-6.8-1.2 2.1-4.8 7.4-12.8 8.9-.8-.2-1.6-.3-2.4-.2-3.3.5-5.6 3.8-5.1 7.4.2 1.7 1 3.1 2.1 4.1.2.1 1.3.5 2.8 1.4.6.4 1.3.8 2 1.3 1.3.9 2.6 2 4 3.4 2.9 3 5.6 7.2 6.1 12.8.5 4.5-.6 10.2-4.2 17.1zm27.5-41.2c.7 0 1.3.6 1.3 1.3s-.6 1.3-1.3 1.3-1.3-.6-1.3-1.3.6-1.3 1.3-1.3zm-32.8-5.3c.1-.1 0-.1 0 0z\"/> <path fill=\"#FFCC80\" d=\"M53.7 100.9l.2-.2-.2.2z\"/> <circle fill=\"#444\" cx=\"88.9\" cy=\"49.8\" r=\"2\"/> <path fill=\"#FF5722\" d=\"M80.8 99.3c-13.3-1.1-19.4-9.7-19.4-9.7-1.8 3.4-4.3 7.1-7.5 11l-.3.3c-.4.5-.9 1.1-1.4 1.7-.7.9-1.6 2.1-2.8 3.7-2.3 3.2-5.4 7.8-8.8 13.5-1.4 2.4-2.9 5.1-4.4 8 0 0 0 .1-.1.1h71.3c-.6-1.6-1.3-3.2-1.7-4.8-2.2-8.6-4.6-17.9-6.5-26.8-7.2 2.8-13.3 3.5-18.4 3z\"/> <path fill=\"#00BFA5\" d=\"M55.7 16.7l-7.3 4.6c-1 .6-1.3 1.9-.6 2.8l.7 1.1c.2.3.5.6.8.7.6.3 1.4.3 2-.1l7.3-4.6.4-.3c.7-.7.8-1.7.3-2.5l-.7-1.1c-.4-.6-1-.9-1.6-1-.5 0-1 .1-1.3.4z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-14\" x=\"256\" y=\"128\"> <path fill=\"#B388FF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#1C3AA9\" d=\"M70.5 128h12.4c-5.1-15.8-6.6-23.9-7.2-28.4-1.9 8.8-4 19.3-5.2 28.4z\"/> <path d=\"M92.9 32.8l-.2.1c.1 0 .2 0 .2-.1zm-1.2.5l-.7.1.7-.1zm.6-.2l-.3.1.3-.1zm-52 .3c-.2 0-.5 0-.7-.1.3 0 .5.1.7.1zm-.9-.2l-.5-.1.5.1zm-.7-.2c-.2-.1-.4-.2-.5-.3.1.1.3.2.5.3z\" fill=\"none\"/> <path fill=\"#2A56C6\" d=\"M82.9 90.8v.2-.2z\"/> <path fill=\"#FFE0B2\" d=\"M31.2 47.2zM45.8 93c5.8 5.5 13.6 9.1 22.3 9.3 2.8-.1 5.4-.5 8-1.2l.8-3.8c4.3-19.3 9.7-37.4 15-52.9h6.9L94 36.2c-.2-1.2-.4-2.5-.7-3.6l-.4.3-.2.1-.4.2-.3.1-.3.1-.7.1H40.3c-.2 0-.5 0-.7-.1-.1 0-.1 0-.2-.1l-.5-.1-.2-.1c-.2-.1-.4-.2-.5-.3 0 0-.1 0-.1-.1-.1.2-.1.4-.1.7-1-.3-2-.4-3-.3-4.1.6-6.9 4.7-6.3 9.1.3 2 1.2 3.8 2.6 5 .3.1 1.6.7 3.4 1.7.8.4 1.6 1 2.5 1.6 1.5 1.1 3.2 2.5 4.9 4.1 0 0 16.3 12.3 3.4 38 .1.2.2.3.3.4zm34.1-51.9c.8 0 1.5.7 1.5 1.6 0 .9-.7 1.6-1.5 1.6s-1.5-.7-1.5-1.6.6-1.6 1.5-1.6z\"/> <path fill=\"#2A56C6\" d=\"M68.1 102.3c-8.7-.2-16.5-3.8-22.3-9.3-.1-.1-.2-.2-.4-.3-3-.2-7.6.2-10.8.6-4.6.6-9.6 1.3-15 2.4-3.6.7-8.1 1.9-19.7 5.3v27h71.4c1.3-9.1 2.9-18.1 4.7-26.9-2.5.7-5.1 1.1-7.9 1.2z\"/> <path fill=\"#6D4C41\" d=\"M61.8 9.8c-7.3 1.1-13.6 5.1-17.9 10.8h43.7C81.5 12.7 71.9 8.3 61.8 9.8z\"/> <path fill=\"#E65100\" d=\"M38.7 33l.2.1c.2.1.3.1.5.1.1 0 .1 0 .2.1l.7.1H91c.2 0 .5 0 .7-.1l.3-.1.3-.1c.1 0 .3-.1.4-.2l.2-.1.4-.3c1-.7 1.6-1.9 1.6-3.2v-4.8c0-2.2-1.8-4-4-4H40.4c-2.2 0-4 1.8-4 4v4.8c0 1.4.7 2.6 1.8 3.3 0 0 .1 0 .1.1s.2.2.4.3z\"/> <ellipse fill=\"#444\" cx=\"79.9\" cy=\"42.7\" rx=\"2\" ry=\"2.2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-15\" y=\"256\"> <path fill=\"#FF80AB\" d=\"M0 0h128v128H0z\"/> <path fill=\"#5D4037\" d=\"M87.3 11.7c-7.6 0-14.1 4.9-16.4 11.7-2.8-1.6-5.9-2.7-9.1-3.1-13.9-2.1-26.9 7.1-31.1 21.1 5 .8 9.5 3.1 13.4 3.1 1.4-.6 3-.9 4.6-.9 1.1 0 2.2.2 3.3.5 10-1.3 15.2-5.2 17.9-9 .3.5.6 1 1 1.6v.1c2.1 3.1 6.6 7.7 14.7 9.2.9-.3 1.9-.4 3-.2 1.5.2 2.8-1.1 3.8-.1 7-2.2 12.2-8.8 12.2-16.5 0-9.7-7.8-17.5-17.3-17.5z\"/> <path d=\"M70.9 36.6c-.4-.6-.8-1.2-1-1.6.2.5.5 1 1 1.6z\" fill=\"none\"/> <path fill=\"#5D4037\" d=\"M85.6 45.9z\"/> <path fill=\"#FFCC80\" d=\"M48.6 63.8c5.6 0 10.1-4.5 10.1-10.1s-4.5-10.1-10.1-10.1-10.1 4.5-10.1 10.1c.1 5.5 4.6 10.1 10.1 10.1zm-1.7-10.5c0 .9-.7 1.6-1.6 1.6-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9-.1 1.6.7 1.6 1.6zm38.7-7.4z\"/> <path fill=\"#F9A825\" d=\"M35.6 117.3c0 2.5 2.1 4.6 4.6 4.6s4.6-2.1 4.6-4.6c0-1.7-.9-3.2-2.3-4-.8-.2-1.8-.3-2.7-.6-2.3.3-4.2 2.2-4.2 4.6z\"/> <circle fill=\"#F9A825\" cx=\"64.3\" cy=\"117.1\" r=\"4.6\"/> <path fill=\"#F9A825\" d=\"M83.4 117.3c0 2.5 2.1 4.6 4.6 4.6 1.5 0 2.8-.7 3.7-1.8l-.7-.9-.6-.8c-.6-.7-1.3-1.5-1.8-2.1l-.3-.4c-.4-.5-.8-.9-1.2-1.5-.3-.4-.6-.8-.9-1.3-1.7.8-2.8 2.4-2.8 4.2z\"/> <path fill=\"#FFEE58\" d=\"M91.6 119.8c-.8 1-2.1 1.7-3.5 1.7-2.4 0-4.4-2-4.4-4.4 0-1.8 1-3.3 2.5-4-3-3.9-5.3-7.5-7.2-11 .2.1-7.3 10.6-23.7 12-3.8.3-8 .1-12.8-.8 1.3.8 2.2 2.2 2.2 3.8 0 2.4-2 4.4-4.4 4.4s-4.4-2-4.4-4.4c0-2.3 1.8-4.2 4-4.4-2.4-.6-4.8-1.3-7.4-2.2-1.2 5.7-2.6 11.6-4.1 17.5h69c-1.4-2-2.6-3.8-3.7-5.3m-29.4-1.2c-2.4 0-4.4-2-4.4-4.4s2-4.4 4.4-4.4 4.4 2 4.4 4.4c0 2.4-2 4.4-4.4 4.4z\"/> <path fill=\"#FFCC80\" d=\"M92.4 45.6c-1-1-2.4-1.7-3.8-1.9-1-.2-2-.1-3 .2-8.1-1.5-12.6-6.1-14.7-9.2-.5-.7-.8-1.2-1.1-1.7-2.7 3.8-7.9 7.7-17.9 9l.9.3-9.4.4.6-.3c-3.9 0-8.3-.4-13.4-1.1-.5 1.7-.9 3.5-1.2 5.3-.2 1.8-.5 3.8-.6 6l-.3 2-2.3 9.4h9c1.2 3 2.1 7.7 1.9 15.3-.2 6.9-3.9 27.7-4.2 29-.1.7-.3 1.4-.5 2.1 2.6.9 5 2 7.3 2.5l2.7.5c4.8.9 9.2 1.4 13 1.1 16.4-1.3 24-12 24-12-9.8-18.4-4.6-30.7 2.1-37.5 1.6-1.7 3.3-3 4.9-4.1.9-.6 1.7-1.2 2.5-1.6 1.8-1.1 3.2-1.6 3.4-1.7 1.3-1.2 2.3-3 2.6-5 .3-2.6-.7-5.3-2.5-7zm-32.9 2.7c.5 1 .8 2 1 3.1l-1-3.1z\"/> <path fill=\"#DB4437\" d=\"M36.6 54.7c.5 6.2 5.7 11.1 12 11.1 6.7 0 12.1-5.4 12.1-12.1 0-5.5-3.7-10.2-8.8-11.6-1-.3-2.1-.5-3.3-.5-1.6 0-3.2.3-4.6.9-4.1 1.7-7.1 5.6-7.4 10.2h-7.7l-.1.9-.3 1.1h8.1zm12-11.1c5.6 0 10.1 4.5 10.1 10.1s-4.5 10.1-10.1 10.1-10.1-4.5-10.1-10.1c.1-5.6 4.6-10.1 10.1-10.1z\"/> <circle fill=\"#444\" cx=\"45.3\" cy=\"53.3\" r=\"2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-16\" x=\"128\" y=\"256\"> <path fill=\"#B388FF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#444\" d=\"M58.4 24c4.2 5.9 23.9 10.2 38.9 4.6-4.2-14-17.1-23.2-31.1-21.1-11.7 1.8-20.8 11.2-23.7 22.9 7 3.2 14.5-3.8 15.9-6.4z\"/> <path fill=\"#689F38\" d=\"M72.7 101.3C56.3 100 48.8 89.4 48.8 89.4c-2.2 4.2-5.2 8.7-9.2 13.5l-.3.4-1.7 2c-.9 1.1-2 2.6-3.4 4.5-2.8 3.9-6.6 9.5-10.8 16.6l-.8 1.4h80.1c-2.5-9.8-5.1-20.3-7.3-30.2-8.9 3.4-16.5 4.3-22.7 3.7z\"/> <path fill=\"#FFCC80\" d=\"M101.8 51.3l-2.6-10.4c-.2-2.5-.5-4.9-.7-6.9-.2-1.9-.6-3.6-1.2-5.3-24.8 3.7-35-2.5-39.1-8.4-1.5 2.6-5.8 8.4-15.6 10.2-.1.2-.1.5-.1.7-.9-.3-1.9-.4-3-.2-4.1.6-6.9 4.7-6.3 9.1.3 2 1.2 3.8 2.6 5 .3.1 1.6.7 3.4 1.7.8.4 1.6 1 2.5 1.6 1.5 1.1 3.2 2.5 4.9 4.1 6.6 6.8 12.1 18.6 2.4 37 0 0 7.4 10.6 23.8 11.9 6.3.5 13.8-.3 22.8-3.6l-.5-2.1c-.3-1.4-4-22.1-4.2-29-.2-7.6.7-12.3 1.9-15.3h9zM81.1 40.5c0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6-.9.1-1.6-.7-1.6-1.6zm-41.7 62.8s0 .1-.1.1l.3-.4c0 .1-.1.2-.2.3z\"/> <circle fill=\"#444\" cx=\"82.7\" cy=\"40.5\" r=\"2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-2\"> <path fill=\"#B9F6CA\" d=\"M0 0h128v128H0z\"/> <path fill=\"#FFCC80\" d=\"M70.1 122.5l.6-.1c6.1-.8 12-2.4 17.7-4.8 1.2-.5 2.4-1.1 3.2-2.1 1.3-1.7-.1-5.6-.5-7.7-.7-3.8-1.3-7.7-1.9-11.5-.7-4.5-1.5-9.1-1.6-13.7-.2-7.6.7-12.3 1.9-15.3h9l-2.6-10.4c-.2-2.4-.4-4.8-.7-6.8-.2-1.9-.6-3.6-1.2-5.3-14.9 2.2-24.5.9-30.7-1.8l-23.1 4.5-.7.1h-.7c-.4-.1-.9-.2-1.2-.4-.4 0-.9 0-1.4.1-4.1.6-6.9 4.7-6.3 9.1.3 2 1.2 3.8 2.6 5 .3.1 1.6.7 3.4 1.7.8.4 1.6 1 2.5 1.6 1.5 1.1 3.2 2.5 4.9 4.1 5.8 5.9 8.4 13.8 7.4 22-.6 4.7-2.2 9.4-4.4 13.6-.5 1-1 1.6-1.1 2.8-.1 1.1-.1 2.3.1 3.4.4 2.3 1.5 4.4 3 6.2 2.6 3.1 6.4 5 10.4 5.8 3.8.4 7.6.3 11.4-.1zm9.5-67.6c.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6s-1.6-.7-1.6-1.6c-.1-.8.7-1.6 1.6-1.6zM128 97.7c-3.3 1.9-6.6 3.7-9.9 5.3-3.2 1.5-6.3 2.9-9.6 4.2-.9.4-2.1.5-2.9 1.1-1.1.8-1.9 2.5-2.3 3.7-.6 1.6-.6 3.4.3 4.8.8 1.2 2.1 2 3.5 2.6 5.9 2.9 12.2 5.1 18.6 6.5 1.4.3 2.3 1.8 2.4.1V97.9c-.1.1-.1-.1-.1-.2z\"/> <path d=\"M38.9 47.4zm.7 0z\" fill=\"none\"/> <path fill=\"#444\" d=\"M94.2 44.9c-.8-2.6-1.8-5-3.2-7.2l-7.2 1.4-20.4 4c6.3 2.7 15.9 4 30.8 1.8z\"/> <path fill=\"#E65100\" d=\"M38.9 48.4h.7c.2 0 .5 0 .7-.1l23.1-4.5 20.4-4 23.3-4.5c1.9-.4 3.2-2 2.9-3.6-.3-1.6-2.1-2.6-4.1-2.3l-19.6 3.8-1.3-6.8C83 15.5 70 8.7 55.9 11.5c-14 2.7-23.7 13.9-21.6 24.9h.1l1.7 9v.7c.2.8.7 1.4 1.4 1.9.5.1 1 .3 1.4.4z\"/> <circle fill=\"#444\" cx=\"79.6\" cy=\"56.5\" r=\"2\"/> <path fill=\"#689F38\" d=\"M128 128v-1.8L106.3 108l-.4.2-2.9 1.3c-3 1.3-6 2.6-9.2 3.8l-1.4.5c-9 3.3-16.5 4.1-22.8 3.6-16.4-1.3-23.8-11.9-23.8-11.9-2.2 4.2-5.2 8.7-9.2 13.5l-.3.4-1.7 2c-.9 1.1-2 2.6-3.4 4.5-.4.6-.9 1.3-1.4 2l98.2.1z\"/> <path fill=\"#FFCC80\" d=\"M36.3 119.3s.1-.2.2-.3c-.1.1-.2.2-.2.3z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-3\" x=\"384\"> <path fill=\"#80D8FF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#5D4037\" d=\"M53.7 68.3c.9-.1 1.7-.3 2-.9.1-.2.2-.4.2-.6.2-1-.2-2-.5-3-1.2-3.2-2-6.4-2.2-9.8-.3-3.9.4-7.8 1-11.6l12.7-8.1c.8-.5 1.8-1.5 2.7-1.7.9-.3 2.4.6 3.3.8 1.3.4 2.6.6 4 .9 5.4.9 10.9.7 16.2-.6 1.3-.3 2.7-1.1 4-1.3-.3-2.1-1.5-4.3-2.5-6.1-1-1.9-2.2-3.7-3.6-5.3-2.7-3.2-6-5.8-9.8-7.5-3.3-1.5-6.8-2.4-10.4-2.5 0 0-50.8-8.1-42.4 56.4l12.8.5 8.7.3c.9-.1 2.5.2 3.8.1z\"/> <path d=\"M59.5 25.7l-.3-.4c0 .2.1.3.3.4zm-1-1.2c-.2-.2-.3-.4-.4-.6.1.2.2.4.4.6zm.4.6l-.3-.4.3.4zm1.1 1.2l-.4-.4c.2.1.3.3.4.4zM46.3 56.2zm.5.4l.3.3-.3-.3zm-.2-.2l.2.2-.2-.2zm-.2-.2l.1.1-.1-.1zm14.3-29.3l-.4-.4c.1.1.2.3.4.4zm8.6 4.7l-1-.3c.3 0 .6.2 1 .3zm1.3.3c-.4-.1-.8-.2-1.1-.3.3.1.7.2 1.1.3zm-23.4 25l.4.4c-.2-.1-.3-.3-.4-.4zm27-24.2l-.9-.2c.3.1.6.2.9.2zm-12.8-5.2l-.5-.4c.1.1.3.2.5.4zm6.7 3.7c-.3-.1-.6-.2-.9-.4.2.1.6.2.9.4zm-5.9-3.1l-.6-.5.6.5zm3.7 2.2c-1.4-.6-2.6-1.3-3.6-2.1 1 .7 2.2 1.4 3.6 2.1zm1.1.4l-.9-.4c.2.2.5.3.9.4zm20.1 2.7h-.8.8zm-3.2 0h1.4-1.4zm-3.9 0l1.9.1c-.6 0-1.1 0-1.7-.1H80zm2 0h1.6H82zm6.1-.1c.3 0 .7 0 1-.1h-.2c-.2.1-.5.1-.8.1zm6.2-.6l-.7.1c1.2-.1 2.4-.3 3.6-.5l-2.2.3c-.2.1-.5.1-.7.1zm-3.4.4c-.3 0-.6 0-.8.1.9-.1 1.9-.2 2.9-.3l-.8.1c-.5 0-.9 0-1.3.1zM51.1 61.9c.2.3.4.6.5 1-.2-.4-.3-.7-.5-1zm-3.5-4.6c.8.8 1.8 1.9 2.8 3.5-1-1.5-2-2.7-2.8-3.5zm2.9 3.6l.6.9c-.3-.3-.5-.6-.6-.9zm1.2 2.1l.6 1.1c-.3-.4-.4-.8-.6-1.1zm26.5-29.8l-.9-.1c-.2 0-.3 0-.5-.1l-.9-.1h-.2c1.3.2 2.6.3 4 .4-.3 0-.6 0-.9-.1-.2.1-.4.1-.6 0zm-3.8-.4l1.1.2-.9-.1c-.1-.1-.2-.1-.2-.1zm-3.7-.8c.7.2 1.5.4 2.3.5l-.9-.2-1.4-.3zM52.2 64.1c.6 1.2 1.1 2.6 1.5 4.1-.4-1.5-.9-2.9-1.5-4.1z\" fill=\"none\"/> <path fill=\"#E65100\" d=\"M101.3 128h.3c-2.4-9.5-4.8-19.4-6.8-28.7-7.6 2.7-39.3.6-45.1-5.1-2.5 4.9-6 10.3-10.8 16.2H97l4.3 17.6z\"/> <path fill=\"#2A56C6\" d=\"M97.2 92.5v-.2.2z\"/> <path fill=\"#00838F\" d=\"M39.2 107.1l.3-.4-.3.3v.1z\"/> <path fill=\"#EE8100\" d=\"M101.6 128c-1.5-5.8-3-11.8-4.3-17.7H38.9c-.9 1.1-2.1 2.2-3.1 3.3-.2.2-.3.4-.5.5-4 4.6-7.5 9.2-10.4 13.8h76.7z\"/> <path fill=\"#FFE0B2\" d=\"M72.4 103.8c5.9-.2 14.8-1.8 22.4-4.5-.3-1.4-.6-2.7-.8-4.1-1.9-9.4-3.2-18.1-3.4-25-.5-19.6 6.6-20.2 6.6-20.2h2.1c0-4.2-.5-8.8-.9-12.3-.2-1.9-.6-3.6-1.2-5.3l-3.6.5-.6.1-2.9.3c-.3 0-.6 0-.9.1-.3 0-.7 0-1 .1-.3 0-.7 0-1 .1h-5.1c-.7 0-1.3 0-1.9-.1h-.3c-1.4-.1-2.8-.2-4-.4h-.2l-1.1-.2h-.2l-.9-.2c-.1 0-.2 0-.3-.1l-2.3-.5h-.1c-.4-.1-.8-.2-1.1-.3-.1 0-.1 0-.2-.1l-1-.3c-.1 0-.1 0-.2-.1-.3-.1-.6-.2-.9-.4-.1 0-.1 0-.2-.1l-.9-.4s-.1 0-.1-.1c-1.4-.6-2.6-1.3-3.6-2.1l-.1-.1-.6-.5-.2-.2-.5-.4-.2-.2-.4-.4-.2-.2-.4-.4-.2-.2-.3-.4-.2-.2-.3-.4-.1-.2c-.2-.2-.3-.4-.4-.6l-8 24.9-11.2-14.1c-4.1.6-6.9 4.7-6.3 9.1.3 2 1.2 3.8 2.6 5 .3.1 1.6.7 3.4 1.7.8.4 1.6 1 2.5 1.6 1.5 1.1 3.2 2.5 4.9 4.1h.1l.1.1.2.2.1.1.3.3.1.1.4.4c.8.8 1.8 1.9 2.8 3.5v.1l.6.9s0 .1.1.1c.2.3.4.6.5 1 0 0 0 .1.1.1l.6 1.1c.6 1.2 1.1 2.6 1.5 4.1 1.7 6.2 1.6 14.8-4 25.9 5.6 5.8 13.6 9.4 22.5 9.7z\"/> <circle fill=\"#444\" cx=\"84.2\" cy=\"44.1\" r=\"2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-4\" x=\"384\" y=\"128\"> <path fill=\"#84FFFF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#444\" d=\"M28 54.2c1-.2 1.5.5 2.8.8 1.3.3 2.7.2 4-.2 2.2-.7 4.1-2.1 6.1-3.4 12.6-8.2 28.9-10.4 43.2-5.8 3 1 6 2.3 8 4.7.9 1.1 1.6 2.4 2.5 3.6s2.1 2.2 3.5 2.4c5.2.8 4.9-8.6 4.9-11.8 0-21.3-17.3-38.6-38.6-38.6S25.8 23.2 25.8 44.5c0 3.2.2 7 1.4 10 .3-.1.6-.2.8-.3z\"/> <path fill=\"#8D6E63\" d=\"M44.3 103.5c0 .2-.1.4-.1.5-.5 3.9.3 7.9 2.3 11.3 2.1 3.7 5.4 6.6 9.2 8.3 3.1 1.4 6.5 2.1 10 2.1 5.3-.1 10.6-2 14.2-5.9 1.9-2.1 3.2-4.6 4.5-7.1.9-1.7 1.8-3.4 2.5-5.2.6-1.7.6-2.3-.5-3.6-2.2-2.6-4.1-5.7-4.9-9.1-.9-4.1.3-9.7 3.5-12.6 1.3-1.2 2.8-2.5 4.4-3.9l13.1-11c1.5-1.2 2.6-3 2.9-5.1.4-3.2-1.1-6.3-3.7-7.9-.5-.3-.9-.5-1.5-.7h-.1c-.2-.1-.5-.2-.7-.2h-.1c-.3-.1-.6-.1-.8-.2-1.4-.2-2.8 0-4 .5-.8-14-13.9-11-29.9-11-14.6 0-26.8-2.5-29.4 7.8-.2.9-.5 2-.8 3.1-1.2-.4-2.4-.6-3.8-.4-.3 0-.6.1-.9.2l-.3.1-.6.2-.3.1-.6.3-.2.1-.8.5c-2.3 1.7-3.6 4.5-3.2 7.6.3 2.1 1.3 3.8 2.8 5.1 0 0 10.9 9.3 11 9.3 4.6 3.9 8.2 10.7 8.6 16.7.1 1.8 0 3.7-.5 5.5-.1 1.5-1 3-1.3 4.6z\"/> <path d=\"M100.4 53.6zm-.8-.3h-.1.1zm-70.5.3l-.3.1c.1 0 .2 0 .3-.1zm-.9.4l-.2.1s.1 0 .2-.1zm1.7-.7l-.3.1c.2 0 .3-.1.3-.1z\" fill=\"none\"/> <path fill=\"#8D6E63\" d=\"M39.3 109.5c-.1.1-.1.2-.1.2l.5-.6c-.1.1-.2.3-.4.4z\"/> <path fill=\"#FFEB3B\" d=\"M62.8 128h6.8l-3.4-5zm-23.6-18.3c-.1.2-.2.4-.2.5-3.1.9-6 2.7-8.4 5.4l-.2.2s-.5.6-1.5 1.7c-.9 1.1-2.2 2.6-3.7 4.5-1.3 1.6-2.8 3.6-4.4 5.8h28.6l-10.2-18.1zm72.3 16.6c-1.3-2.2-2.3-3.9-3.1-5.1-.9-1.3-1.3-2-1.3-2l-.2-.3c-.6-.9-1.2-1.7-1.9-2.4-3.1-3.4-7-5.2-10.9-5.7l-.3.4L83.6 128h28.9c-.3-.6-.7-1.2-1-1.7z\"/> <circle fill=\"#444\" cx=\"79.5\" cy=\"62.7\" r=\"2\"/> <circle fill=\"#444\" cx=\"53.8\" cy=\"62.8\" r=\"2\"/> <path fill=\"#F57F17\" d=\"M65.7 122.3l.5-.4L44 103.5l-4.3 5.6-.5.6L49.4 128h13.4l3.4-5zm0 0l.5.7 3.4 5h14l10.1-16.8.3-.4-6.4-6.2-.4.3-21 17z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-5\" x=\"384\" y=\"256\"> <path fill=\"#FFFF8D\" d=\"M0 0h128v128H0z\"/> <path fill=\"#C2C2C2\" d=\"M51.7 31.4v-22s-19.6 2.5-15.8 29.9c11 0 14.8-4.3 15.8-7.9z\"/> <path fill=\"#848484\" d=\"M94.1 39.8c.1-1 0-2-.1-3 0-1-.1-1.9-.2-2.9-.2-1.8-.4-3.5-.8-5.2-.6-2.9-1.5-5.8-2.9-8.4-1.1-2.2-2.6-4.2-4.3-6-1.6-1.6-3.3-2.9-5.3-3.9-1.8-1-3.8-1.7-5.8-2.2-2-.5-4-.8-6-.9-1.9-.1-3.8-.1-5.7 0-1.7.1-3.3.3-5 .6-1.3.2-2.5.5-3.8.8l-2.2.6-.4.1v20.8c0 1-.1 1.8.4 2.7.2.3.5.6.6.9.3.9.7 1.8 1.2 2.7 1.1 1.8 2.7 3.4 4.7 4.3 2.4 1.1 5.1 1.4 7.8 1.6 4.8.3 9.6.4 14.3.3 2.2 0 4.3-.3 6.4-.9 1.2-.3 2.4-.6 3.6-1 .6-.2 1.2-.4 1.8-.5.6-.2 1.2-.5 1.7-.5z\"/> <path fill=\"#FFE0B2\" d=\"M66.8 116.8l17.9-8.7 3.1-8.2c-15.1-17 1.2-31.6 2.3-32.5h.1l13.2-11.1c1.5-1.2 2.5-3 2.8-5 .6-4.4-2.5-8.4-6.9-9.1-1.5-.2-3 0-4.3.6-.2-1-.5-1.9-.8-2.9-26.9 3.7-37.9-2.5-42.4-8.4-1.6 2.6-5.1 6.1-15.8 7.9-.2.9-.5 2-.8 3.1-1.2-.4-2.4-.6-3.8-.4-4.4.6-7.5 4.7-6.9 9.1.3 2 1.3 3.8 2.8 5l7.5 6.4c4.2 4.5 18.4 21.7 9 37l.7 3.7 4.7 4.6 17.6 8.9z\"/> <path fill=\"#055524\" d=\"M39.8 104.7zm54.3-.4l-.8 1.5-6.8 12.1V128H128v-2.3z\"/> <path fill=\"#FFE0B2\" d=\"M40.4 103.9c-.2.2-.3.4-.5.5 0 0-.1.1-.1.2v.1l.6-.8z\"/> <circle fill=\"#444\" cx=\"80\" cy=\"51.7\" r=\"2\"/> <circle fill=\"#444\" cx=\"54.3\" cy=\"51.7\" r=\"2\"/> <path fill=\"#055524\" d=\"M39.8 104.7c-3.2.9-6.1 2.7-8.6 5.5l-.2.2s-.5.6-1.5 1.7c-.9 1.1-2.2 2.6-3.7 4.5-2.3 2.9-5.1 6.7-8.3 11.4h31v-7.8l-8.7-15.5z\"/> <path fill=\"#848484\" d=\"M65.3 67.3s2.7 9.8 14.5 9.8c0 0 3.9-18.5-14.5-18.5v8.7z\"/> <path fill=\"#C2C2C2\" d=\"M65.3 67.3v-8.7C46.9 58.6 50.8 77 50.8 77c11.8 0 14.5-9.7 14.5-9.7z\"/> <path fill=\"#A7FFEB\" d=\"M80.9 128h5.6v-10.1zm-21 0h13.8l-6.9-10zm-11.5 0h4.3l-4.3-7.8z\"/> <path fill=\"#1DE9B6\" d=\"M66.8 118l-.5-.8.5-.4-22.9-17.3h-.1l-3.4 4.4-.6.8 8.6 15.5 4.3 7.8h7.2zm26.5-12.2l.8-1.5-6.4-4.4-20.9 16.9-.5.4.5.8 6.9 10h7.2l5.6-10.1z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-6\" y=\"384\"> <path fill=\"#FF8A80\" d=\"M0 0h128v128H0z\"/> <path fill=\"#F2A600\" d=\"M30.3 43.7c3.1-.4 6.1 1 7.7 3.4 10.3-2 11-11.5 12.6-14.1 4.5 5.8 13.3 17.8 39.5 14.5 1.6-2.7 4.7-4.3 8-3.8.4 0 .7-1.9 1-1.8-.1-2.2-.3-4.4-.8-6.4v-.1C94.9 19.6 80.8 7.8 64 7.8c-15 0-27.8 9.4-32.8 22.6C29.8 34 29 38 28.9 42.1l.7 1.8.7-.2z\"/> <path d=\"M89.1 102.8l.4-.3c-.1 0-.3.1-.4.3zm2.2-1.9l-.5.4c.2-.2.3-.3.5-.4zm-18 9.2c-.1 0-.2 0-.3.1.1-.1.2-.1.3-.1zm-2.4.4h-.2.2zm16.1-6.2l.3-.2-.3.2zm-9 4.5l.5-.2-.5.2zm4.9-2.1l.2-.1c-.1.1-.1.1-.2.1zm2-1.1l.5-.3-.5.3zm-4.6 2.3l.4-.2c-.1.1-.2.2-.4.2zm12.6-8.6zM30.3 41.7c-.3 0-.5.1-.7.1.2 0 .5 0 .7-.1zm35.9 69.2c-.6 0-1.2 0-1.9-.1.6 0 1.2.1 1.9.1z\" fill=\"none\"/> <path fill=\"#F2A600\" d=\"M41.5 101.3l.8.7c-.3-.3-.5-.5-.8-.7zm1.4 1.1c.2.2.5.4.8.6-.3-.2-.6-.4-.8-.6zm1.3 1.1c.2.2.5.4.8.5-.2-.1-.5-.3-.8-.5zm54.1-68.1zM38.7 98.3c.4.4.8.8 1.1 1.3-.4-.4-.8-.8-1.1-1.3zm-7.6-67.9zm15.4 74.7l.5.3-.5-.3zm4.6 2.4l.3.1c-.1 0-.2 0-.3-.1zm-3.1-1.6l.5.3c-.2-.1-.4-.2-.5-.3zm13.6 4.6l-.9-.1.9.1zM88.9 67c-1.6 1.4-3.1 2.7-4.4 3.9-3.3 3.8-6.3 10.3-1 18.7 5.7-8.1 10.6-17.7 13.2-29.1L88.9 67zM41 100.8l-.8-.8.8.8zm8.5 6l.4.2c-.1-.1-.2-.2-.4-.2zm9.5 3.3h.1-.1zm-46.1 17.3c4.5-7.1 8.6-12.7 11.7-16.6 1.5-2 2.8-3.5 3.7-4.5 1-1.1 1.5-1.7 1.5-1.7l.2-.2c2.4-2.7 5.3-4.5 8.4-5.4.1-.2.2-.4.2-.5 0-.1 0-.2.1-.2 13.6-13.3 4.7-26.5-1.5-32.9l-4.4-3.8c-2.6 8.7-8.5 18.2-20.1 26.9-6.4 4.1-10.6 11.4-10.6 19.7 0 8.2 4.1 15.4 10.4 19.8l.4-.6z\"/> <path fill=\"#FFE0B2\" d=\"M67.1 110.9h-2 2zM38.8 98.1c-.4.3 2.1 5.6 2.5 5.9 1.8 1.8 4.1 2.2 6.3 3.5 4.8 2.7 10.2 3.6 15.6 4.2 5.7.6 11.5-.5 16.8-2.6 2.5-1 4.8-2.3 7-3.8 1.2-.8 2.2-1.6 3.3-2.6.4-.3 2.4-3.6 2.7-3.3-4-3.3-8-6.9-10.4-11.6-2.2-4.2-2.6-9.1-.5-13.4 1.7-3.3 4.5-5.6 7.3-7.9 2.2-1.8 4.3-3.6 6.5-5.5l4.7-3.9c1-.8 2.1-1.6 2.8-2.7 1.5-2 1.9-4.6 1.2-7-1.4-4.8-7.1-7.2-11.5-4.9-1 .5-1.9 1.3-2.6 2.2l-.5.7-1.1.1c-.8.1-1.6.2-2.4.2-2.6.2-5.3.3-7.9.1-6.8-.3-13.5-2.1-19.1-6-3.6-2.4-6.3-5.6-8.9-9-.5.9-.8 1.9-1.1 2.8-.5 1.4-1 2.7-1.6 4-1.7 3.3-4.5 5.8-8.2 6.9-.5.2-1.1.3-1.7.4-.3-.5-.7-.9-1.1-1.3-.9-.6-2.1-1.3-3.3-1.6-2.5-.7-5.2-.2-7.2 1.4-3.9 3.1-4 9.2-.1 12.5l10.5 8.9c2.4 2 4.3 4.8 5.9 7.4 2.1 3.5 3.4 7.6 3.2 11.7-.3 5.6-3.3 10.4-7.1 14.2-.1.1 13.6-13.3 0 0z\"/> <path fill=\"#80DEEA\" d=\"M93 99.4l-.2-.1-1.5 1.5-.5.4c-.4.4-.9.8-1.3 1.1l-.4.3c-.6.5-1.2.9-1.8 1.3l-.3.2c-.5.4-1.1.7-1.6 1l-.5.3-1.8 1-.2.1c-.7.4-1.4.7-2.1 1l-.4.2-1.8.7-.5.2c-.8.3-1.5.5-2.3.7l-2.4.6c-.1 0-.2 0-.3.1l-2.1.4h-.2c-1.5.2-3 .3-4.5.4h2-1.9c-.6 0-1.2 0-1.9-.1l-2.7-.3-.9-.1-1.6-.3h-.1c-2.7-.6-5.2-1.4-7.6-2.4l-.3-.1c-.4-.2-.8-.4-1.2-.5l-.4-.2c-.4-.2-.7-.4-1-.5l-.5-.3-1-.6-.5-.3c-.5-.3-1-.6-1.5-1-.3-.2-.5-.4-.8-.5l-.6-.5-.8-.6-.6-.5c-.3-.2-.5-.4-.8-.7l-.5-.5-.8-.8-.4-.4c-.4-.4-.8-.8-1.1-1.3-.1.2-.2.4-.2.5-3.1.9-6 2.7-8.4 5.4l-.2.2s-.5.6-1.5 1.7c-.9 1.1-2.2 2.6-3.7 4.5-3.1 3.9-7.2 9.5-11.7 16.6-.1.2-.2.4-.4.6H118c-2.7-5.4-5.1-9.8-7.1-13.1-1.3-2.2-2.3-3.9-3.1-5.1-.9-1.3-1.3-2-1.3-2l-.2-.3c-.6-.9-1.2-1.7-1.9-2.4-3.3-3.3-7.4-5.2-11.4-5.5z\"/> <circle fill=\"#444\" cx=\"78.9\" cy=\"51.3\" r=\"2\"/> <circle fill=\"#444\" cx=\"53.2\" cy=\"51.3\" r=\"2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-7\" x=\"128\" y=\"384\"> <path fill=\"#FFCC80\" d=\"M41.6 123.8s0 .1-.1.1l.3-.4c-.1.2-.1.2-.2.3z\"/> <path fill=\"#80D8FF\" d=\"M0 0h128v128H0z\"/> <path fill=\"#5D4037\" d=\"M29.3 123.1c4.1-6.9 7.8-12.4 10.5-16.2 1.4-1.9 2.5-3.4 3.3-4.4l1.7-2s0-.1.1-.1l.3-.3C49 95.4 51.9 91 54.1 87c9.5-17.8 6.1-29.3-.3-35.9-1.6-1.6-3.2-2.9-4.7-4-.9-.6-1.7-1.1-2.4-1.6-1.8-1-3.1-1.6-3.3-1.7-1.3-1.2-2.2-2.9-2.5-4.9-.5-4.3 2.2-6.2 6.1-6.8 1-.1 2-.1 2.9.2 9.6-1.8 11.9-8 13.3-10.6 4 5.7 13.9 9.8 38 6.1C97.1 14.3 84.5 5.4 71 7.4c-4.4.7-8.3 2.4-11.8 4.9l-.1.1c-1.1.8-2.1 1.6-3 2.6l-35 30C12.9 49.8 7.3 58.8 7.3 69.1c0 2.7.4 5.3 1.1 7.8.3 4.9-.1 11.7-2.9 18.6-.2.5-.5 1-.7 1.6-1.2 3.2-1.9 6.6-1.9 10.2 0 8.2 3.5 15.6 9.1 20.7h14.5c1-1.7 1.9-3.4 2.8-4.9zm20.5-90.8z\"/> <path fill=\"#FFCC80\" d=\"M63.1 19.8c-1.4 2.6-5.7 8.8-15.3 10.6-.9-.3-1.9-.3-2.9-.2-3.9.6-6.7 4.5-6.1 8.8.3 2 1.2 3.7 2.5 4.9.2.1 1.5.6 3.3 1.7.7.4 1.6 1 2.4 1.6 1.5 1.1 3.1 2.4 4.7 4 6.4 6.6 11.8 18.1 2.3 35.9 0 0 7.3 15.5 23.2 16.9 6.1.5 13.3-5.6 22.1-8.8-.1-.7-.3-1.4-.5-2.1-.3-1.3-3.9-21.5-4.1-28.2-.2-7.4.7-11.9 1.9-14.8h8.8L103 39.7c-.2-2.4-.4-4.7-.7-6.7-.2-1.8-.6-3.5-1.1-5.2-24.2 3.7-34-2.3-38.1-8zm22.3 19.6c0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6-.9 0-1.6-.7-1.6-1.6zm-35.6-7.1zm-4.9 68.1s0 .1-.1.1l.3-.4-.2.3z\"/> <circle fill=\"#444\" cx=\"86.9\" cy=\"39.4\" r=\"2\"/> <path fill=\"#00BFA5\" d=\"M77.2 98.5C61.3 97.2 54.1 87 54.1 87c-2.2 4-5.1 8.4-8.9 13.1l-.3.4c-.5.7-1.1 1.3-1.7 2-.8 1-2 2.5-3.3 4.4-2.8 3.8-6.5 9.2-10.5 16.2-.9 1.6-1.8 3.2-2.8 4.9h80.8l-.3-1c-2.6-10.3-5.4-21.4-7.7-31.9-8.8 3.1-16.1 3.9-22.2 3.4z\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-8\" x=\"256\" y=\"384\"> <path fill=\"#FFCC80\" d=\"M41.6 123.8s.1-.2.2-.3c-.1.2-.1.2-.2.3z\"/> <path fill=\"#B388FF\" d=\"M0 0h128v128H0z\"/> <path d=\"M64.1 34.5c-.1.1-.2.2-.3.2.1-.1.2-.2.3-.2zm.9-.7c-.1.1-.2.1-.2.2l.2-.2zm-1.9 1.3c-.1.1-.2.2-.4.2.2 0 .3-.1.4-.2zm-5.4 2.6l-.5.2c.2-.1.4-.2.5-.2zm2.8-1.1l-.2.1s.1-.1.2-.1zm-1.3.5l-.4.2c.1 0 .2-.1.4-.2zm8.8-6.3l-.2.3c.1-.1.2-.2.2-.3zm-1.9 2.1l-.3.2.3-.2zm1.4-1.4l-.3.3c.1-.2.2-.3.3-.3zm-.7.6l-.3.3c.2-.1.3-.2.3-.3zM62 35.8l-.3.2.3-.2zm5 47l-.3 1.6.3-1.6zM56.2 38.1l-.5.1c.1 0 .3 0 .5-.1zm10.4 46.5c-.1.5-.2 1.1-.4 1.6.2-.5.3-1 .4-1.6zm.6-3.6l-.2 1.6c.1-.5.1-1 .2-1.6zm-5.6-20.8c.1.1.2.3.4.4l-.4-.4zm7.5-30.9l-.6.9c.5-.7.9-1.3 1.2-1.8-.1.2-.3.5-.5.7 0 .1 0 .2-.1.2zM67.2 81c1-10.6-2.4-17.3-5.2-20.4 2.7 3.1 6.2 9.8 5.2 20.4zm-1 5.5c-.1.6-.3 1.1-.5 1.7.2-.6.4-1.2.5-1.7zm-5.6-27.4l.2.2c-.1 0-.2-.1-.2-.2zm-.3-.2s.1.1.2.1c-.1 0-.1 0-.2-.1zm-.2-.1zm-.1-.1zm1.7 38.2c-.1-.1-.2-.2-.4-.3l.1.1.3.2zm-.5-37.1l.3.3-.3-.3zm-.3-.4l.3.3c-.2-.1-.2-.2-.3-.3z\" fill=\"none\"/> <path fill=\"#2A56C6\" d=\"M98.8 94.8v.2-.2z\"/> <path fill=\"#FFE0B2\" d=\"M2.8 109.6L0 110.8V128h15.5L2.8 109.6z\"/> <path fill=\"#DD2C00\" d=\"M91.9 128h5.6c-3.8-12-4.4-16-4.9-20.1-.1-.5-.5-2.4-.5-2.9-2.6.7-5.2 1.1-8 1.2-8.7-.2-16.5-3.8-22.3-9.3l-.2-.2-.1-.1c-2.9.2-7.6.2-10.8.6-4.6.6-9.6 1.3-15 2.4-4.7.9-11.2 2.7-33.3 9.3l.5.7L15.5 128h70.2\"/> <path fill=\"#FFEB3B\" d=\"M66.2 86.5c0-.1 0-.1.1-.2.1-.6.3-1.1.4-1.6v-.2l.3-1.6v-.1l.2-1.6c1-10.6-2.4-17.3-5.2-20.4-.1-.1-.2-.3-.4-.4l-.1-.1-.3-.3-.1-.1-.3-.3-.1-.1-.2-.2-.1-.1c-.1-.1-.1-.1-.2-.1 0 0-.1 0-.1-.1l-.1-.1s-.1 0-.1-.1c-1.6-1.7-3.3-3-4.9-4.1-.9-.6-1.7-1.2-2.5-1.6-1.8-1.1-3.2-1.6-3.4-1.7-1.3-1.2-2.3-3-2.6-5-.6-4.4.3-6.4 4.3-7.1 1-.2 2-.1 3 .2l.1-.7c.6-.1 1.1-.2 1.6-.4l.5-.1 1.1-.3.5-.2 1-.3.4-.2c.4-.1.7-.3 1.1-.5l.2-.1 1.2-.6.3-.2c.3-.1.5-.3.8-.5.1-.1.3-.2.4-.2.2-.1.4-.3.7-.4.1-.1.2-.2.3-.2l.7-.5c.1-.1.2-.1.2-.2.3-.2.5-.4.8-.7.1-.1.2-.1.2-.2l.5-.5.3-.3.4-.4.3-.3.3-.4c.1-.1.2-.2.2-.3.2-.2.3-.4.4-.6l.6-.9.1-.2c.2-.3.3-.5.5-.7 4.2 5.9 14.5 10.4 39.3 6.7-4.2-14-17.3-23.5-31.3-21.4-5.3.8-10.1 3.2-14 6.6l-.2.2c-.5.4-1 .9-1.4 1.4-5.3 4.8-23.3 19.8-52.2 26.5-3.9 0-7.4 1.6-9.9 4.2v19.3c.3.3.6.6.9.8l-.3.9S30.9 96.4 64 90.3l1.6-1.8c0-.1 0-.1.1-.2.2-.7.4-1.3.5-1.8z\"/> <path fill=\"#FFE0B2\" d=\"M84 106.2c2.8-.1 5.4-.5 8-1.2l.8-3.8c4.3-19.3 9.7-37.4 15-52.9h6.9l-4.8-8.2c-.2-1.9-.6-3.6-1.2-5.3-24.8 3.7-35-2.5-39.1-8.4-.3.5-.7 1.1-1.2 1.8l-.4.6-.2.3-.3.4-.3.3-.4.4-.3.3-.5.5s-.1 0-.2.1c-.3.2-.5.4-.8.7-.1.1-.2.1-.2.2-.2.2-.4.3-.7.5-.1.1-.2.2-.3.2-.2.1-.4.3-.7.4-.1.1-.2.2-.4.2l-.8.5-.3.2-1.2.6-.2.1-1.1.5-.4.2c-.3.1-.6.2-1 .3l-.5.2c-.3.1-.7.2-1.1.3l-.5.1-1.6.4c-.1.2-.1.5-.1.7-.9-.3-1.9-.4-3-.2-4.1.6-6.9 4.7-6.3 9.1.3 2 1.2 3.8 2.6 5 .3.1 1.6.7 3.4 1.7.8.4 1.6 1 2.5 1.6 1.5 1.1 3.2 2.5 4.9 4.1l.1.1.1.1.1.1s.1.1.2.1c0 0 .1 0 .1.1l.2.2.1.1.3.3.1.1.3.3.1.1s.2.3.4.4c2.7 3.1 7.2 9.8 6.2 20.4l-.2 1.6v.1l-.3 1.6v.2c-.1.5-.2 1.1-.4 1.6 0 .1 0 .1-.1.2-.1.6-.3 1.1-.5 1.7 0 .1 0 .1-.1.2-.8 2.6-1.8 5.3-3.3 8.3.1.1.2.2.4.3 5.7 5.6 13.5 9.1 22.2 9.3z\"/> <path fill=\"#DD2C00\" d=\"M85.6 128h5.1\"/> <circle fill=\"#444\" cx=\"95.8\" cy=\"46.5\" r=\"2\"/> </svg> <svg viewBox=\"0 0 128 128\" height=\"128\" width=\"128\" id=\"svg-9\" x=\"384\" y=\"384\"> <path fill=\"#FFCC80\" d=\"M41.6 123.8s0 .1-.1.1l.3-.4c-.1.2-.1.2-.2.3z\"/> <path fill=\"#FFFF8D\" d=\"M0 0h128v128H0z\"/> <path fill=\"#C2C2C2\" d=\"M83.2 26.6c.1-.9.2-1.8.2-2.7C83.4 13.5 75 5 64.6 5s-18.8 8.4-18.8 18.8c0 1.4.2 2.7.4 4 5.4-4 12.2-6.4 19.4-6.4 6.5.1 12.5 2 17.6 5.2z\"/> <path fill=\"#848484\" d=\"M41.4 58.4c9.6-1.9 10.3-10.7 11.7-13.2 4.2 5.4 12.4 16.6 36.8 13.5 1.5-2.5 4.4-6 7.4-5.6.3 0 .6.1 1 .2C98 42 92 32.1 83.1 26.5 78 23.3 72 21.4 65.6 21.4c-7.3 0-14 2.4-19.4 6.4-7.9 5.9-13.1 15.2-13.3 25.7.4-.1.9 1.7 1.4 1.7 2.8-.4 5.6 1 7.1 3.2z\"/> <path fill=\"#FF5722\" d=\"M109.6 121.5c-1.2-2-2.2-3.6-2.9-4.8l-1.2-1.8-.2-.3c-.5-.8-1.1-1.6-1.8-2.3-3.1-3.3-6.9-5.1-10.8-5.3 0 0 .1 0 .1.1l-.2-.1c-3.4 3.7-7.8 6.6-12.7 8.5V128h33.4c-1.4-2.5-2.6-4.7-3.7-6.5zM42 106l-.2.5c-2.9.8-5.6 2.5-7.8 5.1l-.2.2s-.5.6-1.4 1.6c-.9 1-2 2.4-3.5 4.2-2.1 2.6-4.7 6.1-7.5 10.4h28v-15.7c-2.8-1.7-5.3-3.8-7.4-6.3z\"/> <path fill=\"#E0F7FA\" d=\"M67.7 117.7c-6.8-.2-13.1-2.1-18.3-5.4V128h30.5v-12.6c-3.8 1.4-7.9 2.2-12.2 2.3z\"/> <path fill=\"#FFE0B2\" d=\"M42 106c2.1 2.4 4.6 4.5 7.4 6.3 5.2 3.3 11.5 5.3 18.3 5.4 4.3-.1 8.4-.9 12.1-2.3 5-1.9 9.3-4.8 12.7-8.5l.2.1s-.1 0-.1-.1c-15.7-12.3-12-21.7-7.8-26.6 1.3-1.1 2.6-2.3 4.1-3.6l12.2-10.3c1.4-1.2 2.4-2.8 2.7-4.8.5-3.8-1.9-7.3-5.4-8.2-.3-.1-.6-.2-1-.2-3.1-.4-5.9 1.1-7.4 3.6-24.4 3.1-32.7-8.1-36.8-13.5-1.5 2.4-2.1 11.3-11.7 13.2-1.6-2.3-4.3-3.6-7.2-3.2l-1.4.3c-3.4 1.1-5.5 4.5-5 8.1.3 1.9 1.3 3.6 2.6 4.7l10.2 8.7c5.8 6 14.1 18.3 1.4 30.7-.1.1-.1.2-.1.2zm37.6-45.3c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5c-.1-.9.6-1.5 1.5-1.5zm-24 0c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5c-.1-.9.6-1.5 1.5-1.5z\"/> <circle fill=\"#444\" cx=\"79.6\" cy=\"62.2\" r=\"2\"/> <circle fill=\"#444\" cx=\"55.6\" cy=\"62.2\" r=\"2\"/> </svg> </defs></svg>',\n  };\n\n  // Note: 'material.svgAssetsCache' is used with AngularJS Material docs\n  // when launching code pen demos; @see codepen.js\n\n  angular.module('material.svgAssetsCache',[])\n    .run(function($templateCache) {\n      angular.forEach(assetMap, function(value, key) {\n        $templateCache.put(key, value);\n      });\n    });\n})();\n"
  },
  {
    "path": "docs/config/index.js",
    "content": "const path = require('canonical-path');\nconst Package = require('dgeni').Package;\n\nconst projectPath = path.resolve(__dirname, '../..');\nconst packagePath = __dirname;\n\nmodule.exports = new Package('angular-md', [\n  require('dgeni-packages/ngdoc'),\n  require('dgeni-packages/nunjucks')\n])\n\n.processor(require('./processors/componentsData'))\n.processor(require('./processors/indexPage'))\n.processor(require('./processors/buildConfig'))\n.processor(require('./processors/content'))\n\n.config(function(log, templateEngine, templateFinder) {\n\n  templateFinder.templateFolders = [\n    path.resolve(packagePath, 'template'),\n    path.resolve(packagePath, 'template/ngdoc'),\n    path.resolve(packagePath, '../app-template')\n  ];\n})\n\n.config(function(readFilesProcessor, writeFilesProcessor) {\n  readFilesProcessor.basePath = projectPath;\n  readFilesProcessor.sourceFiles = [\n    { include: 'src/components/**/*.js', basePath: '.' },\n    { include: 'src/core/**/*.js', basePath: '.' },\n    { include: 'docs/content/**/*.md', basePath: 'docs/content', fileReader: 'ngdocFileReader' }\n  ];\n\n  writeFilesProcessor.outputFolder = 'dist/docs';\n})\n\n\n.config(function(computeIdsProcessor, computePathsProcessor) {\n\n  computeIdsProcessor.idTemplates.push({\n    docTypes: ['content'],\n    idTemplate: { getId: ({ fileInfo }) => `content-${fileInfo.relativePath.replace(\"/\",\"-\")}` },\n    getAliases: function(doc) { return [doc.id]; }\n  });\n\n  // Build custom paths and outputPaths for \"content\" pages (theming and CSS).\n  computePathsProcessor.pathTemplates.push({\n    docTypes: ['content'],\n    getPath: function(doc) {\n      let docPath = path.dirname(doc.fileInfo.relativePath);\n      if (doc.fileInfo.baseName !== 'index') {\n        docPath = path.join(docPath, doc.fileInfo.baseName);\n      }\n      return docPath;\n    },\n    getOutputPath: function(doc) {\n      return path.join(\n        'partials',\n        path.dirname(doc.fileInfo.relativePath),\n        doc.fileInfo.baseName) + '.html';\n    }\n  });\n\n  // The default dgeni path for directives and services is something like\n  // \"api/material.components.autocomplete/directive/mdAutocomplete\".\n  // The module name is rather unnecessary, so we override with the shorter\n  // \"api/directive/mdAutocomplete\".\n  computePathsProcessor.pathTemplates.push({\n    docTypes: ['directive', 'service', 'type'],\n    getPath: function(doc) {\n      return path.join(doc.area, doc.docType, doc.name);\n    }\n  });\n})\n\n.config(function(generateComponentGroupsProcessor) {\n  generateComponentGroupsProcessor.$enabled = false;\n});\n"
  },
  {
    "path": "docs/config/processors/buildConfig.js",
    "content": "const buildConfig = require('../../../config/build.config');\nconst q = require('q');\nconst exec = require('child_process').exec;\n\nmodule.exports = function buildConfigProcessor() {\n  return {\n    $runBefore: ['rendering-docs'],\n    $runAfter: ['indexPageProcessor'],\n    $process: process\n  };\n\n  function process(docs) {\n\n    docs.push({\n      template: 'build-config.js',\n      outputPath: 'js/build-config.js',\n      buildConfig: buildConfig\n    });\n\n    return q.all([getSHA(), getCommitDate()])\n            .then(function() {\n              return docs;\n          });\n  }\n\n  /**\n   * Git the SHA associated with the most recent commit on origin/master\n   * @returns {*}\n   */\n  function getSHA() {\n    const deferred = q.defer();\n\n    exec('git rev-parse HEAD', function(error, stdout) {\n      buildConfig.commit = stdout && stdout.toString().trim();\n      deferred.resolve(buildConfig.commit);\n    });\n\n    return deferred.promise;\n  }\n\n  /**\n   * Get the commit date for the most recent commit on origin/master\n   * @returns {*}\n   */\n  function getCommitDate() {\n    const deferred = q.defer();\n\n    exec('git show -s --format=%ci HEAD', function(error, stdout) {\n      buildConfig.date = stdout && stdout.toString().trim();\n      deferred.resolve(buildConfig.date);\n    });\n\n    return deferred.promise;\n  }\n\n\n};\n"
  },
  {
    "path": "docs/config/processors/componentsData.js",
    "content": "const _ = require('lodash');\nconst buildConfig = require('../../../config/build.config.js');\n\n// We don't need to publish all of a doc's data to the app, that will\n// add many kilobytes of loading overhead.\nfunction publicDocData(doc, extraData) {\n  const options = _.assign(extraData || {}, { hasDemo: (doc.docType === 'directive') });\n\n  // This RegEx always retrieves the last source descriptor.\n  // For example it retrieves from `/opt/material/src/core/services/ripple/ripple.js` the following\n  // source descriptor: `src/core/`.\n  // This is needed because components are not only located in `src/components`.\n  let descriptor = doc.fileInfo.filePath.toString().match(/src\\/.*?\\//g).pop();\n  if (descriptor) {\n    descriptor = descriptor.substring(descriptor.indexOf('/') + 1, descriptor.lastIndexOf('/'));\n  }\n\n  return buildDocData(doc, options, descriptor || 'components');\n}\n\nfunction coreServiceData(doc, extraData) {\n  const options = _.assign(extraData || {}, { hasDemo: false });\n  return buildDocData(doc, options, 'core');\n}\n\nfunction buildDocData(doc, extraData, descriptor) {\n\n  const module = 'material.' + descriptor;\n  const githubBaseUrl = buildConfig.repository + '/blob/master/src/' + descriptor + '/';\n\n  const basePathFromProjectRoot = 'src/' + descriptor + '/';\n  const filePath = doc.fileInfo.filePath;\n  const indexOfBasePath = filePath.indexOf(basePathFromProjectRoot);\n  const path = filePath.substr(indexOfBasePath + basePathFromProjectRoot.length, filePath.length);\n\n  return _.assign({\n    name: doc.name,\n    type: doc.docType,\n    restrict: doc.restrict,\n    outputPath: doc.outputPath,\n    url: doc.path,\n    label: doc.label || doc.name,\n    module: module,\n    githubUrl: githubBaseUrl + path\n  }, extraData);\n}\n\nmodule.exports = function componentsGenerateProcessor() {\n  return {\n    $runAfter: ['paths-computed'],\n    $runBefore: ['rendering-docs'],\n    $process: process\n  };\n\n  function process(docs) {\n\n    const components = _(docs)\n      .filter(function(doc) {\n        // We are not interested in docs that are not in a module\n        // We are only interested in pages that are not landing pages\n        return doc.docType !== 'componentGroup' && doc.module;\n      })\n      .filter('module')\n      .groupBy('module')\n      .map(function(moduleDocs, moduleName) {\n\n        const moduleDoc = _.find(docs, {\n          docType: 'module',\n          name: moduleName\n        });\n        if (!moduleDoc) return undefined;\n\n        return publicDocData(moduleDoc, {\n          docs: moduleDocs\n            .filter(function(doc) {\n              // Private isn't set to true, just to an empty string if @private is supplied\n              return doc.docType !== 'module';\n            })\n            .map(publicDocData)\n        });\n\n      })\n      .filter() // remove null items\n      .value();\n\n    const EXPOSED_CORE_SERVICES = '$mdMedia';\n\n    const services = _(docs).filter(function(doc) {\n      return doc.docType === 'service' &&\n        doc.module === 'material.core' &&\n        EXPOSED_CORE_SERVICES.indexOf(doc.name) !== -1;\n    }).map(coreServiceData).value();\n\n    docs.push({\n      name: 'SERVICES',\n      template: 'constant-data.template.js',\n      outputPath: 'js/services-data.js',\n      items: services\n    });\n\n    docs.push({\n      name: 'COMPONENTS',\n      template: 'constant-data.template.js',\n      outputPath: 'js/components-data.js',\n      items: components\n    });\n  }\n};\n"
  },
  {
    "path": "docs/config/processors/content.js",
    "content": "const _ = require('lodash');\n\nmodule.exports = function contentProcessor() {\n  return {\n    $runAfter: ['paths-computed'],\n    $runBefore: ['rendering-docs'],\n    $process: function(docs) {\n      const contentDocs = _(docs)\n      .filter(function(doc) {\n        return doc.docType === 'content';\n      })\n      .groupBy('area')\n      .mapValues(function(areaDocs) {\n        return _.map(areaDocs, function(areaDoc) {\n          return {\n            name: areaDoc.name,\n            outputPath: areaDoc.outputPath,\n            url: '/' + areaDoc.path,\n            label: areaDoc.label || areaDoc.name\n          };\n        });\n      }).\n      value();\n\n      docs.push({\n        name: 'PAGES',\n        template: 'constant-data.template.js',\n        outputPath: 'js/content-data.js',\n        items: contentDocs\n      });\n    }\n  };\n};\n"
  },
  {
    "path": "docs/config/processors/indexPage.js",
    "content": "const buildConfig = require('../../../config/build.config');\n\nmodule.exports = function indexPageProcessor() {\n  return {\n    $runAfter: ['componentsGenerateProcessor'],\n    $runBefore: ['rendering-docs'],\n    $process: process\n  };\n\n  function process(docs) {\n    docs.push({\n      template: 'index.template.html',\n      outputPath: 'index.html',\n      path: 'index.html',\n      buildConfig: buildConfig\n    });\n  }\n};\n"
  },
  {
    "path": "docs/config/template/build-config.js",
    "content": "angular.module('docsApp').constant('BUILDCONFIG', {$ doc.buildConfig | json $});\n"
  },
  {
    "path": "docs/config/template/constant-data.template.js",
    "content": "angular.module('docsApp').constant('{$ doc.name $}', {$ doc.items | json $});\n"
  },
  {
    "path": "docs/config/template/demo-index.template.html",
    "content": "<!doctype html>\n<html ng-app=\"<%= ngModule && ngModule.module || 'ngMaterial' %>\">\n<head>\n    <title><%= name %></title>\n    <meta name=\"viewport\" content=\"initial-scale=1, maximum-scale=1\" />\n\n    <script src=\"/node_modules/angular/angular.js\"></script>\n    <script src=\"/node_modules/angular-animate/angular-animate.js\"></script>\n    <script src=\"/node_modules/angular-aria/angular-aria.js\"></script>\n    <script src=\"/node_modules/angular-messages/angular-messages.js\"></script>\n    <script src=\"/dist/angular-material.js\"></script>\n\n    <link rel=\"stylesheet\" href=\"/dist/angular-material.css\">\n\n    <% js.forEach(function(file) { %>\n    <script src=\"<%= file.name %>\"></script>\n    <% }); %>\n    <% css.forEach(function(file) { %>\n    <link rel=\"stylesheet\" href=\"<%= file.name %>\">\n    <% }); %>\n</head>\n\n<body>\n<%= index.contents %>\n</body>\n</html>\n"
  },
  {
    "path": "docs/config/template/index.template.html",
    "content": "<!doctype html>\n<html ng-app=\"docsApp\" ng-controller=\"DocsCtrl\" lang=\"en\" ng-strict-di>\n<head>\n<meta charset=\"utf-8\">\n<base href=\"/\">\n<title ng-bind=\"'AngularJS Material - ' + menu.currentSection.name +\n    (menu.currentSection === menu.currentPage ? '' : ' > ' + menu.currentPage.name)\">\n  AngularJS Material\n</title>\n<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic\">\n<link rel=\"stylesheet\" href=\"angular-material.min.css\">\n<link rel=\"stylesheet\" href=\"docs.css\">\n</head>\n<body class=\"docs-body\" layout=\"row\" ng-cloak aria-label=\"AngularJS Material Docs\">\n\n  <md-sidenav class=\"site-sidenav md-sidenav-left md-whiteframe-z2\"\n              md-component-id=\"left\" hide-print\n              md-is-locked-open=\"$mdMedia('gt-sm')\">\n\n    <header class=\"nav-header\">\n      <a ng-href=\"/\" class=\"docs-logo\">\n        <img src=\"img/logo.svg\" alt=\"AngularJS Logo\" />\n        <h1 class=\"docs-logotype md-heading\">AngularJS Material</h1>\n      </a>\n    </header>\n\n    <ul class=\"skip-links\">\n      <li>\n        <md-button class=\"md-icon-button\" ng-click=\"focusMainContent($event)\" href=\"#\"\n                   aria-label=\"Skip to main content\">\n          <md-tooltip>Focus main content header</md-tooltip>\n          <md-icon md-svg-src=\"img/icons/ic_chevron_right_24px.svg\"></md-icon>\n        </md-button>\n      </li>\n    </ul>\n\n    <md-content flex role=\"navigation\">\n      <ul class=\"docs-menu\">\n        <li ng-repeat=\"section in menu.sections\" class=\"parent-list-item {{section.className || ''}}\">\n          <h2 class=\"menu-heading md-subhead\" ng-if=\"section.type === 'heading'\" id=\"heading_{{ section.name | nospace }}\">\n            {{section.name}}\n          </h2>\n          <menu-link section=\"section\" ng-if=\"section.type === 'link' && !section.hidden\"></menu-link>\n\n          <menu-toggle section=\"section\" ng-if=\"section.type === 'toggle' && !section.hidden\"></menu-toggle>\n\n          <ul ng-if=\"section.children\" class=\"menu-nested-list\">\n            <li ng-repeat=\"child in section.children\">\n              <menu-link section=\"child\" ng-if=\"child.type === 'link'\"></menu-link>\n\n              <menu-toggle section=\"child\" ng-if=\"child.type === 'toggle'\"></menu-toggle>\n            </li>\n          </ul>\n        </li>\n      </ul>\n    </md-content>\n  </md-sidenav>\n\n  <main layout=\"column\" flex>\n    <md-toolbar class=\"md-whiteframe-glow-z1 site-content-toolbar\" md-theme=\"site-toolbar\">\n\n      <div class=\"md-toolbar-tools docs-toolbar-tools\" tabIndex=\"-1\">\n        <md-button class=\"md-icon-button\" ng-click=\"openMenu()\" hide-gt-sm aria-label=\"Toggle Menu\">\n          <md-icon md-svg-src=\"img/icons/ic_menu_24px.svg\"></md-icon>\n        </md-button>\n        <div layout=\"row\" flex class=\"fill-height\">\n          <h2 class=\"md-toolbar-item md-breadcrumb md-headline\" tabindex=\"-1\">\n            <span ng-if=\"menu.currentPage.name !== menu.currentSection.name\">\n              <span hide-sm hide-md>{{menu.currentSection.name}}</span>\n              <span class=\"docs-menu-separator-icon\" hide-sm hide-md style=\"transform: translate3d(0, 1px, 0)\">\n                <span class=\"md-visually-hidden\">-</span>\n                <md-icon\n                    aria-hidden=\"true\"\n                    md-svg-src=\"img/icons/ic_chevron_right_24px.svg\"\n                    style=\"margin-top: -2px\"></md-icon>\n              </span>\n            </span>\n            <span class=\"md-breadcrumb-page\">{{menu.currentPage | humanizeDoc}}</span>\n          </h2>\n\n          <span flex></span> <!-- use up the empty space -->\n\n          <div class=\"md-toolbar-item docs-tools\" layout=\"row\">\n            <md-button class=\"md-icon-button\"\n                       aria-label=\"Install with NPM\"\n                       ng-if=\"!currentComponent.docs.length && !currentComponent.isService\"\n                       target=\"_blank\"\n                       ng-href=\"https://www.npmjs.com/package/angular-material\">\n              <md-tooltip md-autohide>Install with NPM</md-tooltip>\n              <md-icon md-svg-src=\"img/icons/npm-logo.svg\"></md-icon>\n            </md-button>\n            <md-button class=\"md-icon-button\"\n                       aria-label=\"View Source on Github\"\n                       ng-if=\"!currentComponent.docs.length && !currentComponent.isService\"\n                       target=\"_blank\"\n                       ng-href=\"{{BUILDCONFIG.repository}}/{{menu.version.current.github}}\">\n              <md-tooltip md-autohide>View Source on Github</md-tooltip>\n              <md-icon md-svg-src=\"img/icons/github-icon.svg\" style=\"color: black;\"></md-icon>\n            </md-button>\n\n            <md-select\n                ng-if=\"currentComponent.docs.length\"\n                ng-class=\"{ hide: path().indexOf('demo') == -1 }\"\n                ng-model=\"relatedPage\"\n                placeholder=\"API Reference\"\n                class=\"md-body-1\">\n              <md-optgroup label=\"Directives\" ng-if=\"(currentComponent.docs | filter: { type: 'directive' }).length\">\n                <md-option\n                    ng-repeat=\"doc in currentComponent.docs | filter: { type: 'directive' }\"\n                    ng-value=\"doc.url\"\n                    ng-click=\"redirectToUrl(doc.url)\"\n                    aria-label=\"{{ doc | humanizeDoc }}\">\n                  {{doc | humanizeDoc | directiveBrackets:doc.restrict}}\n                </md-option>\n              </md-optgroup>\n              <md-optgroup label=\"Services\" ng-if=\"(currentComponent.docs | filter: { type: 'service' }).length\">\n                <md-option\n                    ng-repeat=\"doc in currentComponent.docs | filter: { type: 'service' }\"\n                    ng-value=\"doc.url\"\n                    ng-click=\"redirectToUrl(doc.url)\"\n                    aria-label=\"{{ doc | humanizeDoc }}\">\n                  {{doc | humanizeDoc | directiveBrackets}}\n                </md-option>\n              </md-optgroup>\n            </md-select>\n\n            <md-button\n              class=\"md-icon-button\"\n              aria-label=\"View Demo\"\n              ng-class=\"{hide: !currentDoc || !currentDoc.hasDemo || !currentComponent.demoUrl}\"\n              ng-href=\"{{currentComponent.demoUrl}}\">\n              <md-icon md-svg-src=\"img/icons/ic_play_circle_fill_24px.svg\" style=\"fill: #666666\">\n              </md-icon>\n              <md-tooltip>View Demo</md-tooltip>\n            </md-button>\n\n            <md-button\n              aria-label=\"View Source on Github\"\n              class=\"md-icon-button\"\n              ng-class=\"{hide: !currentDoc}\"\n              ng-href=\"{{currentDoc.githubUrl}}\"\n              hide-sm hide-md>\n              <md-icon md-svg-src=\"img/icons/github-icon.svg\"></md-icon>\n              <md-tooltip>View Source on Github</md-tooltip>\n            </md-button>\n          </div>\n        </div>\n      </div>\n\n      <div class=\"eol-notice\">\n        <div>\n          AngularJS Material <a ng-href=\"https://docs.angularjs.org/misc/version-support-status\">Long Term Support</a>\n          has officially ended as of January 2022. Read the\n          <a href=\"https://goo.gle/angularjs-end-of-life\">End-Of-Life announcement</a>.\n        </div>\n      </div>\n\n    </md-toolbar>\n\n    <md-content md-scroll-y flex>\n      <div ng-view layout-padding flex=\"noshrink\" class=\"docs-ng-view\" cache-scroll-position></div>\n\n      <div layout=\"row\" flex=\"noshrink\" layout-align=\"center center\">\n        <div id=\"license-footer\" flex>\n          Powered by Google &copy;2014&#8211;{{thisYear}}.\n          Code licensed under the <a ng-href=\"./license\">MIT License</a>.\n          Documentation licensed under\n          <a href=\"http://creativecommons.org/licenses/by/4.0/\" target=\"_blank\">CC BY 4.0</a>.\n        </div>\n      </div>\n\n      <md-button class=\"md-fab md-fab-bottom-right docs-scroll-fab\"\n                 docs-scroll-class=\"scrolling\"\n                 ng-click=\"scrollTop()\"\n                 aria-label=\"Back to Top\">\n        <md-tooltip md-direction=\"top\">Back to Top</md-tooltip>\n        <md-icon md-svg-src=\"img/icons/ic_arrow_up_24px.svg\"></md-icon>\n      </md-button>\n\n    </md-content>\n\n  </main>\n\n\n  <!-- Preload is (currently) only used for testing jQuery -->\n  <script src=\"preload.js\"></script>\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/{$ doc.buildConfig.ngVersion $}/angular.min.js\"></script>\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/{$ doc.buildConfig.ngVersion $}/angular-animate.min.js\"></script>\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/{$ doc.buildConfig.ngVersion $}/angular-route.min.js\"></script>\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/{$ doc.buildConfig.ngVersion $}/angular-aria.min.js\"></script>\n  <script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/{$ doc.buildConfig.ngVersion $}/angular-messages.min.js\"></script>\n  <script src=\"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.js\"></script>\n\n  <script src=\"angular-material.min.js\"></script>\n  <script src=\"docs.js\"></script>\n  <script src=\"docs-demo-scripts.js\"></script>\n\n  <script>\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n              m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n      ga('create', 'UA-8594346-14', 'auto');\n      ga('send', 'pageview');\n  </script>\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/api.template.html",
    "content": "{% extends \"base.template.html\" %}\n\n{% block content %}\n\n{% block header %}\n<header class=\"api-profile-header\" >\n  <h2 class=\"md-display-1\" >{{currentDoc.name}} API Documentation</h2>\n  {% block related_components %}{% endblock %}\n</header>\n\n{% endblock %}\n\n<div layout=\"row\" class=\"api-options-bar with-icon\"></div>\n\n{% block description %}\n<div class=\"api-profile-description\">\n  {$ doc.description | marked $}\n</div>\n{% endblock %}\n\n<div>\n  {% block dependencies %}\n  {%- if doc.requires %}\n  <section class=\"api-section\">\n    <h2 id=\"dependencies\">Dependencies</h2>\n    <ul>{% for require in doc.requires %}<li>{$ require | link $}</li>{% endfor %}</ul>\n  </section>\n  {% endif -%}\n  {% endblock %}\n\n  {% block additional %}\n  {% endblock %}\n\n  {% block examples %}\n  {%- if doc.examples %}\n  <section class=\"api-section\">\n    <h2 id=\"example\">Example</h2>\n    {%- for example in doc.examples -%}\n    {$ example | marked $}\n    {%- endfor -%}\n  </section>\n  {% endif -%}\n  {% endblock %}\n</div>\n\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/componentGroup.template.html",
    "content": "{% block content %}\n<h1>\n  {%- if doc.title -%}\n    {$ doc.title $}\n  {%- elif doc.module -%}\n    {$ doc.groupType | title $} components in {$ doc.module | code $}\n  {%- else -%}\n    Pages\n  {%- endif -%}\n</h1>\n\n{$ doc.description | marked $}\n\n<div class=\"component-breakdown\">\n  <div>\n    <table class=\"definition-table md-api-table\">\n      <tr>\n        <th>Name</th>\n        <th>Description</th>\n      </tr>\n      {% for page in doc.components %}\n      <tr>\n        <td>{$ page.id | link(page.name, page) $}</td>\n        <td>{$ page.description | firstParagraph | marked $}</td>\n      </tr>\n      {% endfor %}\n    </table>\n  </div>\n</div>\n\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/directive.template.html",
    "content": "{% include \"lib/macros.html\" -%}\n{% extends \"api/api.template.html\" %}\n\n{% block additional %}\n\n  {% block usage %}\n  <section class=\"api-section\">\n    <h2 id=\"Usage\">Usage</h2>\n  {% if doc.usage %}\n    {$ doc.usage | marked $}\n  {% else %}\n    <ul>\n    {% if doc.restrict.element %}\n      <li>as element:\n      {% code %}\n      <{$ doc.name | dashCase $}\n        {%- for param in doc.params %}\n        {$ directiveParam(param.alias or param.name, param.type, '=\"', '\"') $}\n        {%- endfor %}>\n      ...\n      </{$ doc.name | dashCase $}>\n      {% endcode %}\n      </li>\n    {% endif -%}\n\n    {%- if doc.restrict.attribute -%}\n      <li>as attribute:\n        {% code %}\n        <{$ doc.element $}\n          {%- for param in doc.params %}\n          {$ directiveParam(param.name, param.type, '=\"', '\"') $}\n          {%- endfor %}>\n        ...\n        </{$ doc.element $}>\n        {% endcode %}\n      </li>\n    {% endif -%}\n\n    {%- if doc.restrict.cssClass -%}\n      <li>as CSS class:\n        {% code %}\n        {% set sep = joiner(' ') %}\n        <{$ doc.element $} class=\"\n        {%- for param in doc.params -%}\n          {$ sep() $}{$ directiveParam(param.name, param.type, ': ', ';') $}\n        {%- endfor %}\"> ... </{$ doc.element $}>\n        {% endcode %}\n      </li>\n    {% endif -%}\n\n  {%- endif %}\n  </section>\n  {% endblock -%}\n\n  {%- if doc.animations %}\n  <h2>Animations</h2>\n  {$ doc.animations | marked $}\n  {$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.\n  {%- endif -%}\n\n  {% include \"lib/params.template.html\" %}\n  {% include \"lib/events.template.html\" %}\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/filter.template.html",
    "content": "{% include \"lib/macros.html\" -%}\n{% extends \"api/api.template.html\" %}\n\n{% block additional %}\n  <h3>In HTML Template Binding</h3>\n  {% if doc.usage %}\n    {$ doc.usage | code $}\n  {% else %}\n    {% code -%}\n    {{ {$ doc.name $}_expression | {$ doc.name $}\n      {%- for param in doc.params %}{% if not loop.first %} : {$ param.name $}{% endif %}{% endfor -%}\n    }}\n    {%- endcode %}\n  {% endif %}\n\n  <h3>In JavaScript</h3>\n  {% code -%}\n    {%- set sep = joiner(', ') -%}\n    $filter('{$ doc.name $}')({% for param in doc.params %}{$ sep() $}{$ param.name $}{% endfor -%})\n  {%- endcode %}\n\n  {% include \"lib/params.template.html\" %}\n  {% include \"lib/this.template.html\" %}\n  {% include \"lib/returns.template.html\" %}\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/function.template.html",
    "content": "{% extends \"api/object.template.html\" %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/input.template.html",
    "content": "{% include \"lib/macros.html\" -%}\n{% extends \"api/directive.template.html\" %}\n\n{% block usage %}\n  {% code %}\n  <input type=\"{$ doc.inputType $}\"\n    {%- for param in doc.params %}\n         {$ directiveParam(param.alias or param.name, param.type, '=\"', '\"') $}\n    {%- endfor %}>\n  {% endcode %}\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/module.template.html",
    "content": "{% extends \"base.template.html\" %}\n\n{% block content %}\n<h1>\n  {% if doc.title %}{$ doc.title | marked $}{% else %}{$ doc.name | code $}{% endif %}\n</h1>\n\n{$ doc.description | marked $}\n\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/object.template.html",
    "content": "{% include \"lib/macros.html\" %}\n{% extends \"api/api.template.html\" %}\n\n{% block additional %}\n\n{% if doc.usage %}\n  <section class=\"api-section\">\n    <h2 id=\"Usage\">Usage</h2>\n      {$ doc.usage | marked $}\n  </section>\n{% endif %}\n\n  {% if doc.params or doc.returns or doc.this or doc.kind == 'function' -%}\n    <section class=\"api-section\">\n      {% include \"lib/params.template.html\" %}\n      {% include \"lib/this.template.html\" %}\n      {% include \"lib/returns.template.html\" %}\n    </section>\n  {%- endif %}\n\n  {% include \"lib/methods.template.html\" %}\n  {% include \"lib/events.template.html\" %}\n  {% include \"lib/properties.template.html\" %}\n\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/provider.template.html",
    "content": "{% extends \"api/object.template.html\" %}\n\n{% block related_components %}\n  {% if doc.serviceDoc -%}\n  <li>\n    <a href=\"{$ doc.serviceDoc.path $}\">- {$ doc.serviceDoc.name $}</a>\n  </li>\n  {%- endif %}\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/service.template.html",
    "content": "{% extends \"api/object.template.html\" %}\n\n{% block related_components %}\n  {% if doc.providerDoc -%}\n  <li>\n    <a href=\"{$ doc.providerDoc.path $}\">- {$ doc.providerDoc.name $}</a>\n  </li>\n  {%- endif %}\n{% endblock %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/api/type.template.html",
    "content": "{% extends \"api/object.template.html\" %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/base.template.html",
    "content": "<div class=\"doc-content\">\n{% block content %}\n{% endblock %}\n</div>\n"
  },
  {
    "path": "docs/config/template/ngdoc/content.template.html",
    "content": "<div class=\"doc-content theming\">\n    {% block content %}\n    {$ doc.description | marked $}\n    {% endblock %}\n</div>\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/events.template.html",
    "content": "{%- if doc.events %}\n<section class=\"api-section\">\n  <h2>Events</h2>\n  <ul class=\"events\">\n    {%- for event in doc.events %}\n    <li id=\"{$ event.name $}\">\n      <h3>{$ event.name $}</h3>\n      <div>{$ event.description | marked $}</div>\n      {%- if event.eventType == 'listen' %}\n      <div class=\"inline\">\n        <h4>Listen on: {$ event.eventTarget $}</h4>\n      </div>\n      {%- else %}\n      <div class=\"inline\">\n        <h4>Type:</h4>\n        <div class=\"type\">{$ event.eventType $}</div>\n      </div>\n      <div class=\"inline\">\n        <h4>Target:</h4>\n        <div class=\"target\">{$ event.eventTarget $}</div>\n      </div>\n      {% endif -%}\n    </li>\n    {% endfor -%}\n  </ul>\n</section>\n{% endif -%}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/macros.html",
    "content": "{% macro typeList(types) -%}\n{%- set sep = joiner('|') %}\n{% for typeName in types %}<code class=\"api-type {$ typeName | typeClass $}\">{$ typeName | escape $}</code>{% endfor %}\n{%- endmacro -%}\n\n{%- macro paramList(params) %}\n  {% for param in params %}\n    {%if not param.type.optional %}\n      <tr class=\"api-params-item\">\n        <td style=\"white-space: nowrap;\">\n          <b>* {$ param.name $}</b>\n          {% if param.alias %}| {$ param.alias $}{% endif %}\n          <span hide show-sm>{$ typeList(param.typeList) $}</span>\n        </td>\n        <td style=\"white-space: nowrap;\">{$ typeList(param.typeList) $}</td>\n        <td class=\"description\">\n          {$ param.description | marked $}\n          {% if param.default %}<p><em>(default: {$ param.default $})</em></p>{% endif %}\n        </td>\n      </tr>\n    {% endif %}\n  {% endfor %}\n  {% for param in params %}\n    {%if param.type.optional %}\n      <tr class=\"api-params-item\">\n        <td style=\"white-space: nowrap;\">\n          {$ param.name $}\n          {% if param.alias %}| {$ param.alias $}{% endif %}\n          <span hide show-sm>{$ typeList(param.typeList) $}</span>\n        </td>\n        <td style=\"white-space: nowrap;\">{$ typeList(param.typeList) $}</td>\n        <td class=\"description\">\n          {$ param.description | marked $}\n          {% if param.default %}<p><em>(default: {$ param.default $})</em></p>{% endif %}\n        </td>\n      </tr>\n    {% endif %}\n  {% endfor %}\n{% endmacro -%}\n\n{%- macro paramTable(params) %}\n<table class=\"md-api-table\">\n  <thead>\n    <tr>\n      <th>Parameter</th>\n      <th>Type</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n  {$ paramList(params) $}\n  </tbody>\n</table>\n{% endmacro -%}\n\n{%- macro propertyTable(params) %}\n<table class=\"md-api-table\">\n  <thead>\n    <tr>\n      <th>Property</th>\n      <th>Type</th>\n      <th>Description</th>\n    </tr>\n  </thead>\n  <tbody>\n  {$ paramList(params) $}\n  </tbody>\n</table>\n{% endmacro -%}\n\n\n\n{%- macro directiveParam(name, type, join, sep) %}\n  {%- if type.optional %}[{% endif -%}\n  {$ name | dashCase $}{$ join $}{$ type.description $}{$ sep $}\n  {%- if type.optional %}]{% endif -%}\n{% endmacro -%}\n\n{%- macro functionOptionSyntax(fn) %}\n  {%- set sep = joiner(', ') -%}\n  <code>{$ fn.name $}({</code>\n    {%- for param in fn.params %}\n    <br/>&nbsp;&nbsp;<code>{%- if param.type.optional %}[{% endif -%}\n    {$ param.name $}: {$ param.type.name $}\n    {%- if param.type.optional %}]{% endif -%},</code>\n    {% endfor %}\n  <br/><code>});</code>\n{% endmacro -%}\n\n{%- macro functionSyntax(fn) %}\n  {%- set sep = joiner(', ') -%}\n  {$ fn.name $}({%- for param in fn.params %}{$ sep() $}\n    {%- if param.type.optional %}[{% endif -%}\n    {$ param.name $}\n    {%- if param.type.optional %}]{% endif -%}\n    {% endfor %});\n{% endmacro -%}\n\n{%- macro returnTable(fn) -%}\n<table class=\"md-api-table\">\n  <thead>\n  <tr>\n    <th>Returns</th>\n    <th>Description</th>\n  </tr>\n  </thead>\n  <tbody>\n  <tr>\n    <td>{$ typeList(fn.typeList) $}</td>\n    <td class=\"description\">{$ fn.description | marked $}</td>\n  </tr>\n  </tbody>\n</table>\n{%- endmacro -%}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/methods.template.html",
    "content": "{% import \"./macros.html\" as macros %}\n\n{%- if doc.methods %}\n<section class=\"api-section\">\n  <h2>Methods</h2>\n  <br/>\n  <ul class=\"methods\">\n    {%- for method in doc.methods %}\n    <li id=\"{$ method.name $}\">\n      <h3 class=\"method-function-syntax\">\n        <code class=\"method-function-syntax\">{$ doc.name $}.{$ macros.functionSyntax(method) $}</code>\n      </h3>\n      <div class=\"service-desc\">{$ method.description | marked $}</div>\n\n      <div class=\"method-param-table\">\n\n      {% if method.params %}\n      {$ macros.paramTable(method.params) $}\n      {% endif %}\n\n      {% if method.this %}\n      <h4>Method's {% code %}this{% endcode %}</h4>\n      {$ method.this | marked $}\n      {% endif %}\n\n      {% if method.returns %}\n      {$ macros.returnTable(method.returns) $}\n      {% endif %}\n\n      </div>\n\n    </li>\n    {% endfor -%}\n  </ul>\n</section>\n{%- endif -%}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/params.template.html",
    "content": "{% import \"./macros.html\" as macros %}\n\n{%- if doc.params %}\n  <div class=\"api-param-section\">\n    <h2>\n      {% if doc.paramType %}\n        {$ doc.paramType $}\n      {% elif doc.docType == 'directive' %}\n        Attributes\n      {% else %}\n        Arguments\n      {% endif %}\n    </h2>\n    <div class=\"api-param-table\">\n      {$ macros.paramTable(doc.params) $}\n    </div>\n  </div>\n{%- endif -%}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/properties.template.html",
    "content": "{% import \"./macros.html\" as macros %}\n\n{%- if doc.properties %}\n<section class=\"api-section\">\n  <h2>Properties</h2>\n  <br/>\n  <ul class=\"methods\">\n    {%- for property in doc.properties %}\n    <li id=\"{$ property.name $}\">\n      <h3 class=\"method-function-syntax\">\n        <code class=\"method-function-syntax\">{$ doc.name $}.{$ property.name $}</code>\n      </h3>\n      <div class=\"service-desc\">{$ property.description | marked $}</div>\n\n      <div class=\"method-param-table\">\n\n        {% if property.params %}\n        {$ macros.paramTable(property.params) $}\n        {% endif %}\n\n        {% if method.this %}\n        <h4>Property's {% code %}this{% endcode %}</h4>\n        {$ property.this | marked $}\n        {% endif %}\n\n        {% if property.returns %}\n        {$ macros.returnTable(property.returns) $}\n        {% endif %}\n\n      </div>\n\n    </li>\n    {% endfor -%}\n  </ul>\n</section>\n{%- endif -%}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/returns.template.html",
    "content": "{% import \"./macros.html\" as macros %}\n\n{% if doc.returns -%}\n<div class=\"api-param-table\">\n  {$ macros.returnTable(doc.returns) $}\n</div>\n{%- endif %}\n"
  },
  {
    "path": "docs/config/template/ngdoc/lib/this.template.html",
    "content": "<section class=\"api-section\">\n  {% if doc.this %}\n  <h3>Method's {% code %}this{% endcode %}</h3>\n  {$ doc.this | marked $}\n  {% endif %}\n</section>\n\n"
  },
  {
    "path": "docs/config/template/readme.template.html",
    "content": "<div class=\"doc-content\">\n  <div>\n    {$ doc.content | marked $}\n  </div>\n  <div flex layout=\"column\">\n\n    <section ng-repeat=\"demo in currentComponent.demos\" \n      class=\"demo-container {{currentComponent.componentId}}-{{demo.id}}\"\n      ng-class=\"{'show-source': demo.$showSource}\">\n\n      <md-toolbar class=\"demo-toolbar\"> \n        <div class=\"md-toolbar-tools\">\n          <span>{{demo.name}}</span>\n          <span flex></span>\n          <md-button\n            style=\"min-width: 72px;\"\n            ng-click=\"demo.$showSource = !demo.$showSource\">\n            Source\n          </md-button>\n        </div>\n      </md-toolbar>\n\n      <md-tabs style=\"border-top: solid 1px #00ADC3;\"\n        class=\"demo-source-tabs\">\n        <md-tab ng-repeat=\"file in demo.$files\"\n                      active=\"file === demo.$selectedFile\"\n                      ng-click=\"demo.$selectedFile = file\"\n                      label=\"{{file.basePath}}\">\n            <md-content md-scroll-y class=\"demo-source-container\">\n                    <hljs code=\"file.content\"\n                          lang=\"{{file.fileType}}\" >\n                    </hljs>\n            </md-content>\n        </md-tab>\n      </md-tabs>\n\n\n      <div demo-include=\"demo\" class=\"md-whiteframe-z1\">\n      </div>\n    </section>\n\n  </div>\n</div>\n"
  },
  {
    "path": "docs/config/template/template.json",
    "content": "{$ doc.content | json $}\n"
  },
  {
    "path": "docs/content/CSS/button.md",
    "content": "@ngdoc content\n@name button\n@description\n\n# &lt;md-button&gt;\n\nBelow is a snapshot of the AngularJS Material **button** component demos with the default themes and standard options:\n\n![buttonsdemo](https://cloud.githubusercontent.com/assets/210413/7947020/fafde934-093f-11e5-9584-27eb2deedd0f.png)\n\n<br/>\n### CSS Styles\n\nThe base CSS class for all `<md-button>` components is `.md-button`: \n\n<hljs lang=\"css\">\n.md-button {\n  padding: 0 6px 0 6px;\n  margin: 6px 8px 6px 8px;\n  min-width: 88px;\n  border-radius: 3px;\n  font-size: 14px;\n  text-align: center;\n  text-transform: uppercase;\n  text-decoration:none;\n  border: none;\n  outline: none;\n}\n</hljs>\n\nWhen defining custom CSS overrides, developers should create their own CSS class. For example, to define a `.btn1` override to **md-button** use:\n\n<hljs lang=\"css\">\n.btn1 {\n // your custom overrides here\n}\n</hljs>\n\n<hljs lang=\"html\">\n  <md-button class=\"btn1\" ng-click=\"acceptOffer();\"> Accept </md-button>\n</hljs>\n\n<br/>\n### Theme Requirements\n\nAll AngularJS Material components have specific CSS rules constructed using the theme name and theme-class overrides. For the **Default** theme, however, these rules are added to the components styles using the `.md-default-theme` class. If, however, you have configured a custom theme called `companyX` that is **NOT** the default theme, then any CSS overrides **must** use fully-specified classname. For `<md-button>` the **fully-specified classname** will be `.md-button.md-companyX-theme.btn1`.\n\n<hljs lang=\"css\">\n.md-button.md-companyX-theme.btn1            {  }\n.md-button.md-companyX-theme.md-primary.btn1 {  }\n.md-button.md-companyX-theme.md-accent.btn1  {  }\n.md-button.md-companyX-theme.md-warn.btn1    {  }\n</hljs>\n\n\n<br/>\n## Flat Buttons\n\n![mdbuttonflatdefault3](https://cloud.githubusercontent.com/assets/210413/7945984/bda14884-0939-11e5-9196-131ded20ca77.png)\n\n<hljs lang=\"html\">\n<md-button> Button </md-button>\n</hljs>\n\n<hljs lang=\"css\">\n.md-button {\n  color : currentColor;\n}\n\n.md-button:not([disabled]):hover {\n  background-color: rgba(158, 158, 158, 0.2);\n}\n\n.md-button[disabled] {\n  color : rgba(0, 0, 0, 0.26);\n  background-color: transparent;\n}\n</hljs>\n\n<br/>\n\n#### Custom CSS Overrides \n\n![mdbuttonflatdefault_overrides2](https://cloud.githubusercontent.com/assets/210413/7945987/c1b1c700-0939-11e5-879c-ba804ca03267.png)\n\n\n<hljs lang=\"html\"> \n<md-button class=\"btn1\"> Button </md-button> \n</hljs>\n<hljs lang=\"css\">\n.btn1 { \n  color : rgb(49, 46, 46);\n  background-color: rgba(255, 222, 121, 0.96);\n  border-radius: 10px 0 0 10px;\n  font-size: 16px;\n}\n\n.btn1:not([disabled]):hover { \n  background-color: rgba(107, 103, 91, 0.96);\n  color: white;\n}\n\n.btn1[disabled] { \n  color : rgb(187, 187, 187);\n  background-color: rgba(230, 230, 229, 0.96);\n}\n</hljs>\n\n<br/>\n## Raised Buttons\n\n![raisedbutton](https://cloud.githubusercontent.com/assets/1292882/7254163/fe898728-e849-11e4-943b-a9cd88ec9573.PNG)\n\nAdd the `.md-raised` class to create a raised button:\n\n<hljs lang=\"html\">\n<md-button class=\"md-raised\">Button</md-button>\n</hljs>\n\n<hljs lang=\"css\">\n.md-button.md-raised:not([disabled]) {\n    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);\n}\n</hljs>\n\n<br/>\n## Cornered buttons\n\n![corneredbutton](https://cloud.githubusercontent.com/assets/1292882/7254379/682592ac-e84b-11e4-8d33-78314cea8bda.PNG)\n\nAdd the `.md-cornered` class to create a button with corners:\n\n<hljs lang=\"html\">\n<md-button class=\"md-raised md-cornered\">Button</md-button>\n</hljs>\n\n<hljs lang=\"css\">\n.md-button.md-cornered {\n    border-radius: 0; \n}\n</hljs>\n\n<br/>\n## Default FAB Button\n\n![floatingbutton](https://cloud.githubusercontent.com/assets/1292882/7254736/8fec7ee8-e84d-11e4-9cf9-58ea9221c3c2.PNG)\n\nAdd the `.md-fab` class in order to create a floating action button (aka FAB):\n\n<hljs lang=\"html\">\n<md-button class=\"md-fab\" aria-label=\"Eat cake\">\n  <md-icon md-svg-src=\"img/icons/cake.svg\"></md-icon>\n</md-button>\n</hljs>\n<hljs lang=\"css\">\n.md-button.md-fab {\n  line-height: 5.6rem;\n  min-width: 0;\n  width: 5.6rem;\n  height: 5.6rem;\n  border-radius: 50%;\n}\n</hljs>\n\n<br/>\n## Mini FAB Button\n\n![minibutton](https://cloud.githubusercontent.com/assets/1292882/7273617/1fcca280-e8fe-11e4-9588-231a9e860be1.PNG)\n\nAdd the `.md-mini` class in order to create small, mini-FAB buttons: \n\n<hljs lang=\"html\">\n<md-button class=\"md-fab md-mini\" aria-label=\"Eat cake\">\n  <md-icon md-svg-src=\"img/icons/cake.svg\"></md-icon>\n</md-button>\n</hljs>\n\n<hljs lang=\"css\">\n.md-button.md-fab.md-mini {\n      line-height: 4rem;\n      width: 4rem;\n      height: 4rem;\n}\n</hljs>\n\n<br/>\n## Icon button using SVGs\n\n![iconbutton](https://cloud.githubusercontent.com/assets/1292882/7273908/d701bd8a-e900-11e4-84c7-44c580c7372d.PNG)\n\nCreate icon buttons by adding the `.md-icon-button` class and the `<md-icon ...>` component:\n\n<hljs lang=\"html\">\n<md-button class=\"md-icon-button md-primary\" aria-label=\"Settings\">\n        <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n</md-button>\n</hljs>\n<hljs lang=\"css\">\n.md-button.md-icon-button {\n    margin: 0 0.6rem;\n    height: 4.8rem;\n    min-width: 0;\n    line-height: 4.8rem;\n    padding-left: 0;\n    padding-right: 0;\n    width: 4.8rem; \n}\n</hljs>\n\n<br/>\n## Icon button using Font-icons\n\n\n![fonticonbutton](https://cloud.githubusercontent.com/assets/1292882/7670414/f57721ba-fcab-11e4-9a22-67970063797c.PNG)\n\nHere is another example of a button with font icons:\n\n<hljs lang=\"html\">\n<md-button>\n <md-icon md-font-icon=\"icon-home\" \n          ng-style=\"{color: 'green', 'font-size':'36px', height:'36px'}\" >\n </md-icon>\n</md-button>\n</hljs>\n\n\n<br/>\n## Grouping with CSS Overrides\n\n![mdbuttongroup](https://cloud.githubusercontent.com/assets/210413/7961138/1b48bb16-09cb-11e5-9283-bdda28b8bb66.png)\n\nUsing the customization approaches documented above, we can easily create a mdButtonGroup:\n\n<hljs lang=\"html\">\n<section layout=\"row\"\n         layout-align=\"center center\">\n  <md-button class=\"groupX left\">Apple</md-button>\n  <md-button class=\"groupX middle\">Samsung</md-button>\n  <md-button class=\"groupX middle\">Sony</md-button>\n  <md-button class=\"groupX right\">B&O</md-button>\n</section>\n</hljs>\n\n<hljs lang=\"css\">\n.groupX {\n\tfont-size: 16px;\n\tmargin: 20px 0;\n\tpadding: 3px 15px 3px 15px;\n\tcolor: rgb(49, 46, 46);\n\tbackground-color: rgba(224, 224, 224, 0.96);\n\ttext-transform: none;\n    font-weight: 400;\n    min-width:100px;\n}\n\n.md-button.left {\n    border-radius: 10px 0 0 10px;\n}\n\n.md-button.middle {\n    border-radius: 0;\n    border-left: 1px solid rgba(230, 230, 230, 0.96);\n    border-right: 1px solid rgba(230, 230, 230, 0.96);\n}\n\n.md-button.right {\n    border-radius: 0 10px 10px 0;\n}\n\n.md-button:not([disabled]):hover {\n    background-color: rgba(193, 193, 193, 0.96);\n    color: rgba(44, 65, 164, 0.96);\n    transition: 0.3s;\n}\n</hljs>\n"
  },
  {
    "path": "docs/content/CSS/checkbox.md",
    "content": "@ngdoc content\n@name checkbox\n@description\n\n<h2>  CSS Styles</h2>\n\nThe css decalaration of the `<md-checkbox>` component is:\n\n<hljs lang=\"css\">\n md-checkbox {\n   margin: 8px;\n   cursor: pointer;\n   padding-left: 18px;\n   padding-right: 0;\n   line-height: 26px;\n   min-width: 18px;\n   min-height: 18px;\n }\n</hljs>\n\n<br/>\n<h3> Ink color</h3>\n\n<p>In order to change the color when the checkbox is checked:</p>\n\n![greencheckbox](https://cloud.githubusercontent.com/assets/1292882/8035909/b2130da0-0dfc-11e5-932f-4424d3b46d5b.PNG)\n\n<hljs lang=\"html\">\n<md-checkbox class=\"green\">\n   Green Checkbox\n</md-checkbox>\n</hljs>\n\n <hljs lang=\"css\">\n md-checkbox.md-checked.green .md-icon {\n  background-color: rgba(0, 255, 0, 0.87);\n }\n </hljs>\n\n\n<br/>\n<h3> Disabled</h3>\n\n<p>In order to change the color when a disabled checkbox is checked:</p>\n\n![checkboxdisabledred](https://cloud.githubusercontent.com/assets/1292882/8036177/dc941a86-0dfe-11e5-8892-ac19ec6926fe.PNG)\n<br/>\n\n<hljs lang=\"html\">\n<md-checkbox ng-disabled=\"true\" class=\"red\" ng-model=\"data.cb4\" ng-init=\"data.cb4=true\">\n  Checkbox: Disabled, Checked\n</md-checkbox>\n</hljs>\n\n <hljs lang=\"css\">\nmd-checkbox.md-checked[disabled].red .md-icon {\n  background-color: rgba(255, 0, 0, 0.26);\n}\n </hljs>\n\n<br/>\n<h3>  Borders</h3>\n<p>In order to add a custom border do the following:</p>\n\n![checkboxcustomborder](https://cloud.githubusercontent.com/assets/1292882/8037214/388dd40c-0e05-11e5-82a7-4bfa2541e968.PNG)\n\n<br/><br/>\n<hljs lang=\"html\">\n <div>\n  <md-checkbox ng-model=\"data.cb2\" aria-label=\"Checkbox 2\" ng-true-value=\"'yup'\" ng-false-value=\"'nope'\">\n   Default Border\n  </md-checkbox>\n </div>\n <div>\n  <md-checkbox ng-model=\"data.cb2\" aria-label=\"Checkbox 2\" ng-true-value=\"'yup'\" class=\"dotted\" ng-false-value=\"'nope'\">\n     Custom Border\n  </md-checkbox>\n </div>\n</hljs>\n<hljs lang=\"css\">\nmd-checkbox.dotted .md-icon {\n border-width: 1px;\n border-style: dashed;\n}\n</hljs>\n\n\n\n<br/>\n<h3> Bi-Di </h3>\n\nThe mdCheckbox directive supports bi-directional specifiers in the `<html dir=\"rtl\">` tag:\n\n![checkboxrtl](https://cloud.githubusercontent.com/assets/1292882/8036091/fb40bcf6-0dfd-11e5-8319-25e68939d1a3.PNG)\n\n\n"
  },
  {
    "path": "docs/content/CSS/typography.md",
    "content": "@ngdoc content\n@name Typography\n@description\n\n<h2 class=\"md-display-1\">CSS classes are provided for typography</h2>\n<h3 class=\"md-headline\">You can use them to create visual consistency across your application.</h3>\n<p class=\"md-subhead\">You can find additional guidance in the \n[Material Design Typography Specification](https://material.io/archive/guidelines/style/typography.html).\n</p>\n\n<section class=\"demo-container\">\n  <md-toolbar class=\"demo-toolbar\">\n    <div class=\"md-toolbar-tools\">\n      <h3>General Typography</h3>\n    </div>\n  </md-toolbar>\n  <div class=\"md-whiteframe-z1 docs-list\">\n    <p>\n      AngularJS Material uses the [Roboto](https://fonts.google.com/specimen/Roboto)\n      font for all of its components.\n    </p>\n\n    <p>\n      The `Roboto` font will be <b>not</b> automatically loaded by AngularJS Material itself. The\n      developer is responsible for loading all fonts used in their application. Shown below is a\n      sample <i>link</i> markup used to load the `Roboto` font from a CDN.\n    </p>\n\n    <hljs lang=\"html\">\n      <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic\">\n    </hljs>\n\n    <h4 class=\"md-title\">Notes</h4>\n    <p>\n      When `Roboto` isn't loaded, the typography will fall back to the following fonts: \n    </p>\n\n    <ul>\n      <li>- `Helvetica Neue`</li>\n      <li>- `sans-serif`</li>\n    </ul>\n  </div>\n</section>\n\n<section class=\"demo-container\">\n  <md-toolbar class=\"demo-toolbar\">\n    <div class=\"md-toolbar-tools\">\n      <h3>Heading Styles</h3>\n    </div>\n  </md-toolbar>\n  <div class=\"md-whiteframe-z1 docs-list\">\n    <p style=\"margin-top: 0;\">\n      To preserve <a href=\"http://webaim.org/techniques/semanticstructure/\">semantic structures</a>, \n      you should style the `<h1>` - `<h6>` heading tags with the styling classes shown below:\n    </p>\n\n\t<div layout=\"row\" class=\"docs-descriptions\">\n      <h4 class=\"md-body-1\" flex=\"25\" id=\"headings-selectors\">Selectors</h4>\n      <h4 class=\"md-body-1\" id=\"headings-output\">Output</h4>\n    </div>\n    <md-divider></md-divider>\n    <ul>\n      <li layout=\"row\" layout-sm=\"column\" layout-xs=\"column\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-display-4</code>\n        </span>\n        <h5 flex aria-describedby=\"headings-output\" class=\"md-display-4 docs-output\">Light 112px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-display-3</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-display-3 docs-output\">Regular 56px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-display-2</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-display-2 docs-output\">Regular 45px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-display-1</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-display-1 docs-output\">Regular 34px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-headline</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-headline docs-output\">Regular 24px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-title</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-title docs-output\">Medium 20px</h5>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"headings-selectors\">\n          <code>.md-subhead</code>\n        </span>\n        <h5 aria-describedby=\"headings-output\" class=\"md-subhead docs-output\">Regular 16px</h5>\n      </li>\n    </ul>\n    <h4 class=\"md-title\">Example</h4>\n    <hljs lang=\"html\">\n      <h1 class=\"md-display-3\">Headline</h1>\n      <h2 class=\"md-display-1\">Headline</h2>\n      <h3 class=\"md-headline\">Headline</h3>\n    </hljs>\n\n\t  <br/>\n  <span class=\"md-body-1\">\n  \tNote: Base font size is `10px` for easy rem units (1.2rem = 12px). Body font size is `14px`. sp = scalable pixels.\n\t</span>\n\n  </div>\n\n</section>\n\n<section class=\"demo-container\">\n  <md-toolbar class=\"demo-toolbar\">\n    <div class=\"md-toolbar-tools\">\n      <h3>Body Copy</h3>\n    </div>\n  </md-toolbar>\n  <div class=\"md-whiteframe-z1 docs-list\">\n    <div layout=\"row\" class=\"docs-descriptions\">\n      <h4 class=\"md-body-1\" flex=\"25\" id=\"body-selectors\">Selectors</h4>\n      <h4 class=\"md-body-1\" id=\"body-output\">Output</h4>\n    </div>\n    <md-divider></md-divider>\n    <ul>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"body-selectors\">\n          <code>.md-body-1</code><br>\n        </span>\n        <p class=\"docs-output md-body-1\" aria-describedby=\"body-output\">Regular 14px</p>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"body-selectors\"><code>\n          .md-body-2</code>\n        </span>\n        <p class=\"md-body-2 docs-output\" aria-describedby=\"body-output\">Medium 14px</p>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"body-selectors\">\n          <code>.md-button</code>\n        </span>\n        <div class=\"docs-output\" aria-describedby=\"body-output\">\n    \t\t  <md-button class=\"md-raised\" style=\"margin-left:0; margin-right:0;\">Medium 14px</md-button>\n        </div>\n      </li>\n      <li layout=\"row\" layout-align=\"start center\">\n        <span flex=\"25\" class=\"docs-definition\" aria-describedby=\"body-selectors\">\n          <code>.md-caption</code><br>\n        </span>\n        <div class=\"docs-output\" aria-describedby=\"body-output\">\n          <small class=\"md-caption\">Regular 12px</small>\n        </div>\n      </li>\n    </ul>\n    <h4 class=\"md-title\">Examples</h4>\n    <hljs lang=\"html\">\n      <p class=\"md-body-2\">Body copy with medium weight.</p>\n      <md-button>Button</md-button>\n      <p class=\"md-body-1\">Regular body copy <small class=\"md-caption\">with small text</small>.</p>\n      <span class=\"md-caption\">Caption</span>\n    </hljs>\n  </div>\n</section>\n"
  },
  {
    "path": "docs/content/Theming/01_introduction.md",
    "content": "@ngdoc content\n@name Introduction and Terms\n@description\n\nMaterial Design is a visual language with specifications for innovative user experiences (UX) and user interface (UI) elements. Themes convey meaning through color, tones, and contrasts, similar to how Layouts convey meaning through keylines and alignments.\n\nTheme [**color palettes**](https://material.io/archive/guidelines/style/color.html#color-color-palette), alphas, and shadows deliver a consistent tone to your application and a unified feel for all AngularJS Material UI components.\n\nTheming allows changing the color of your AngularJS Material application. If you\nneed more custom styling (such as layout changes including padding, margins,\netc) you will need to either write CSS rules with custom selectors, or build a\ncustom version of the `angular-material.css` file using Sass and custom\nvariables.\n\n> <b>Note:</b> The Material Theming system provides the\n> <a ng-href=\"api/service/$mdThemingProvider#mdthemingprovider-setnonce-noncevalue\">\n  `$mdThemingProvider.setNonce()`</a> method to meet the requirements of a CSP-policy enabled application.\n\n<img src=\"https://cloud.githubusercontent.com/assets/210413/4816236/bf7783dc-5edd-11e4-88ef-1f8b6e87e1d7.png\" alt=\"color palette\" style=\"max-width: 100%;\">\n\n## Theming Approach\n\nAngularJS Material makes it easy to design an app which follows the Material style\nguide's suggested design patterns:\n\n> Limit your selection of colors by choosing three color hues from the primary palette and one accent color\n> from the secondary palette. The accent color may or may not need fallback options.\n\nThis concept is central to how AngularJS Material approaches theming.\n\n## Important Terms\n\n### Hues / Shades\n\nA hue/shade is a single color within a palette.\n\n### Palettes\n\nA palette is a collection of hues. By default, AngularJS Material ships with all\npalettes from the material design spec built in. Valid palettes include:\n\n- red\n- pink\n- purple\n- deep-purple\n- indigo\n- blue\n- light-blue\n- cyan\n- teal\n- green\n- light-green\n- lime\n- yellow\n- amber\n- orange\n- deep-orange\n- brown\n- grey\n- blue-grey\n\n### Color Intentions\n\nA color intention is a mapping of a palette for a given intention within your\napplication.\n\nValid color intentions in AngularJS Material include:\n\n- *primary* - used to represent primary interface elements for a user\n- *accent* - used to represent secondary interface elements for a user\n- *warn* - used to represent interface elements that the user should be careful of\n\n### Themes\n\nA theme is a configuration of palettes used for specific color intentions. A\ntheme also specifies a background color palette to be used for the application.\n"
  },
  {
    "path": "docs/content/Theming/02_declarative_syntax.md",
    "content": "@ngdoc content\n@name Declarative Syntax\n@description\n\nTheming in AngularJS Material uses classes to apply an intention group to a given\ncomponent. Most components in AngularJS Material support intention classes \nas expected, including:\n\n- md-button\n- md-checkbox\n- md-progress-circular\n- md-progress-linear\n- md-radio-button\n- md-slider\n- md-switch\n- md-tabs\n- md-input-container\n- md-toolbar\n\n\n### Specifying intention group\n\nThe classes to apply the color intention for a given component are as follows:\n`md-primary`, `md-accent`, `md-warn`.\n\n<hljs lang=\"html\">\n<md-button class=\"md-primary\">Click me</md-button>\n<md-button class=\"md-accent\">or maybe me</md-button>\n<md-button class=\"md-warn\">Careful</md-button>\n</hljs>\n\n### Differentiating within an intention group.\n\nIf you need to slightly differentiate an element, you can specify an additional\nclass of `md-hue-1`, `md-hue-2`, or `md-hue-3`. Use these classes sparingly\nin your application to avoid overwhelming users.\n\n<hljs lang=\"html\">\n<md-button class=\"md-primary\">Click me</md-button>\n<md-button class=\"md-primary md-hue-1\">Click me</md-button>\n<md-button class=\"md-primary md-hue-2\">Click me</md-button>\n</hljs>\n"
  },
  {
    "path": "docs/content/Theming/03_configuring_a_theme.md",
    "content": "@ngdoc content\n@name Configuring a Theme\n@description\n\n## Configuring a theme\n\nBy default, your AngularJS Material application will use the default theme, a theme\nthat is pre-configured with the following palettes for intention groups:\n\n- *primary* - indigo\n- *accent* - pink\n- *warn* - red\n- *background* - grey\n\nConfiguring of the default theme is done by using the `$mdThemingProvider`\nduring application configuration.\n\n### Configuring Color Intentions\n\nYou can specify a color palette for a given color intention by calling the\nappropriate configuration method (`theme.primaryPalette`, `theme.accentPalette`,\n`theme.warnPalette`, `theme.backgroundPalette`).\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.theme('default')\n    .primaryPalette('pink')\n    .accentPalette('orange');\n});\n</hljs>\n\n### Specifying Dark Themes\n\nYou can mark a theme as dark by calling `theme.dark()`. \n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.theme('default')\n    .dark();\n});\n</hljs>\n\n### Specifying Custom Hues For Color Intentions\n\nYou can specify the hues from a palette that will be used by an intention group\nby default and for the `md-hue-1`, `md-hue-2`, `md-hue-3` classes. \n\nBy default, shades `500`, `300` `800` and `A100` are used for `primary` and\n`warn` intentions, while `A200`, `A100`, `A400` and `A700` are used for `accent`.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n\n  $mdThemingProvider.theme('default')\n    .primaryPalette('pink', {\n      'default': '400', // by default use shade 400 from the pink palette for primary intentions\n      'hue-1': '100', // use shade 100 for the `md-hue-1` class\n      'hue-2': '600', // use shade 600 for the `md-hue-2` class\n      'hue-3': 'A100' // use shade A100 for the `md-hue-3` class\n    })\n    // If you specify less than all of the keys, it will inherit from the\n    // default shades\n    .accentPalette('purple', {\n      'default': '200' // use shade 200 for default, and keep all other shades the same\n    });\n\n});\n</hljs>\n\n### Defining Custom Palettes\n\nAs mentioned before, AngularJS Material ships with the Material Design Spec's color palettes built\nin. In the event that you need to define a custom color palette, you can use `$mdThemingProvider`\nto define it. This makes the palette available to your theme for use in its intention groups.\nNote that you must specify all hues in the definition map. If you only want to override a few hues,\nplease extend a palette (above).\n\nFor a dark colored, custom palette, you should specify the default contrast color as  `light`.\nFor lighter hues in the palette, you may need to add them to the list of `contrastDarkColors` to\nmeet contrast guidelines. Similarly, you may need to add darker hues to `contrastStrongLightColors`,\nwhich has been updated to the latest Material Design guidelines for\n[Color Usability](https://material.io/archive/guidelines/style/color.html#color-usability).\nThe update to the guidelines changed primary text on dark backgrounds from 87% to 100% opacity.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n\n  $mdThemingProvider.definePalette('amazingDarkPaletteName', {\n    '50': 'ffebee',\n    '100': 'ffcdd2',\n    '200': 'ef9a9a',\n    '300': 'e57373',\n    '400': 'ef5350',\n    '500': 'f44336',\n    '600': 'e53935',\n    '700': 'd32f2f',\n    '800': 'c62828',\n    '900': 'b71c1c',\n    'A100': 'ff8a80',\n    'A200': 'ff5252',\n    'A400': 'ff1744',\n    'A700': 'd50000',\n    // By default, text (contrast) on this palette should be white with 87% opacity.\n    'contrastDefaultColor': 'light',\n    // By default, for these lighter hues, text (contrast) should be 'dark'.\n    'contrastDarkColors': '50 100 200 300 400 500 600 A100 A200 A400',\n    // By default, for these darker hues, text (contrast) should be white with 100% opacity.\n    'contrastStrongLightColors': '700 800 900 A700'\n  });\n\n  $mdThemingProvider.theme('default')\n    .primaryPalette('amazingDarkPaletteName')\n});\n</hljs>\n\nFor a light colored, custom palette, you should specify the default contrast color as `dark`.\nThen `contrastStrongLightColors` can be used if any hues are too dark for dark text.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n\n  $mdThemingProvider.definePalette('amazingLightPaletteName', {\n    '50': '#f1f8e9',\n    '100': '#dcedc8',\n    '200': '#c5e1a5',\n    '300': '#aed581',\n    '400': '#9ccc65',\n    '500': '#8bc34a',\n    '600': '#7cb342',\n    '700': '#689f38',\n    '800': '#558b2f',\n    '900': '#33691e',\n    'A100': '#ccff90',\n    'A200': '#b2ff59',\n    'A400': '#76ff03',\n    'A700': '#64dd17',\n    // By default, text (contrast) on this palette should be dark with 87% opacity.\n    'contrastDefaultColor': 'dark',\n    // By default, for these darker hues, text (contrast) should be white with 100% opacity.\n    'contrastStrongLightColors': '800 900'\n  });\n\n  $mdThemingProvider.theme('default')\n    .accentPalette('amazingLightPaletteName')\n});\n</hljs>\n\n### Extending Existing Palettes\n\nSometimes it is easier to extend an existing color palette to change a few properties\nthan to define a whole new palette. You can use `$mdThemingProvider.extendPalette` \nto quickly extend an existing color palette.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n\n  // Extend the red theme with a different color and make the contrast color black instead of white.\n  // For example: raised button text will be black instead of white.\n  var neonRedMap = $mdThemingProvider.extendPalette('red', {\n    '500': '#ff0000',\n    'contrastDefaultColor': 'dark'\n  });\n\n  // Register the new color palette map with the name `neonRed`\n  $mdThemingProvider.definePalette('neonRed', neonRedMap);\n\n  // Use that theme for the primary intentions\n  $mdThemingProvider.theme('default')\n    .primaryPalette('neonRed');\n\n});\n</hljs>\n\n### Disable Theming\n\nYou can disable theming by calling `disableTheming()`.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.disableTheming();\n});\n</hljs>\n\n"
  },
  {
    "path": "docs/content/Theming/04_multiple_themes.md",
    "content": "@ngdoc content\n@name Multiple Themes\n@description\n\nIn most applications, declaring multiple themes is **not** necessary. Instead,\nyou should configure the `default` theme for your needs. If you need multiple\nthemes in a single application, AngularJS Material does provide tools\nto make this possible.\n\n### Registering another theme\n\nUse the `$mdThemingProvider` to register a second theme within your application.\nBy default all themes will inherit from the `default` theme. Once you have\nregistered the second theme, you can configure it with the same chainable\ninterface used on the default theme.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.theme('altTheme')\n    .primaryPalette('purple') // specify primary color, all\n                            // other color intentions will be inherited\n                            // from default\n});\n</hljs>\n\n### Using another theme\n\n#### Via the Provider\n\nYou can change the default theme to be used across your entire application using\nthe provider:\n\n<hljs lang=\"js\">\n$mdThemingProvider.setDefaultTheme('altTheme');\n</hljs>\n\n#### Via a Directive\n\nAngularJS Material also exposes the `md-theme` directive which will set the theme\non an element and all child elements.\n\nIn the following example, the application will use the `default` theme, while\nthe second child `div` will use the `altTheme`. This allows you to theme\ndifferent parts of your application differently.\n\n<hljs lang=\"html\">\n<div>\n  <md-button class=\"md-primary\">I will be blue (by default)</md-button>\n  <div md-theme=\"altTheme\">\n    <md-button class=\"md-primary\">I will be purple (altTheme)</md-button>\n  </div>\n</div>\n</hljs>\n\n#### Dynamic Themes\n\nBy default, to save on performance, theming directives will **not** watch\n`md-theme` for changes. If you need themes to be dynamically modified, you will\nneed to use the `md-theme-watch` directive.\n\n<hljs lang=\"html\">\n<div>\n  <md-button ng-click=\"dynamicTheme = 'default'\">Default</md-button>\n  <md-button ng-click=\"dynamicTheme = 'altTheme'\">altTheme</md-button>\n  <div md-theme=\"{{ dynamicTheme }}\" md-theme-watch>\n    <md-button class=\"md-primary\">I'm dynamic</md-button>\n  </div>\n</div>\n</hljs>\n\nIf you need this behavior in your entire application (ie. on all `md-theme`\ndirectives) you can use the `$mdThemingProvider` to enable it.\n\n<hljs lang=\"js\">\n$mdThemingProvider.alwaysWatchTheme(true);\n</hljs>\n\n#### Lazy Generate Themes\n\nBy default, every theme is generated when defined. You can disable this in the\nconfiguration section using the `$mdThemingProvider`.\n\n<hljs lang=\"js\">\nangular.module('myApp', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  //disable theme generation\n  $mdThemingProvider.generateThemesOnDemand(true);\n\n  //themes are still defined in config, but the css is not generated\n  $mdThemingProvider.theme('altTheme')\n    .primaryPalette('purple')\n    .accentPalette('green');\n});\n</hljs>\n\nIf you do this, you must generate the theme before using it using `$mdTheming`.\n\n<hljs lang=\"js\">\n//generate the predefined theme named altTheme\n$mdTheming.generateTheme('altTheme');\n</hljs>\n\nThe theme name that is passed in must match the name of the theme that was\ndefined as part of the configuration block.\n"
  },
  {
    "path": "docs/content/Theming/05_under_the_hood.md",
    "content": "@ngdoc content\n@name Theming under the hood\n@description\n\n### Under the Hood\n\nAngularJS Material dynamically generates CSS for registered themes by injecting several\n`<script>` tags into the `<head>` section of the application at runtime. Here is how\nthat process currently works:\n\n1. During the AngularJS Material build process, a function in `gulp/util.js` called\n[themeBuildStream()](https://github.com/angular/material/blob/master/gulp/util.js#L223)\ncompiles all `*-theme.scss` files from components into a single CSS string that is\ninjected into the `material.core` module as a constant called `$MD_THEME_CSS`.\n\n1. At runtime, a function in `src/core/services/theming/theming.js` called\n[generateAllThemes()](https://github.com/angular/material/blob/master/src/core/services/theming/theming.js#L917)\nparses `$MD_THEME_CSS` to generate the `<style>` tags that are added to the `<head>`\nsection of the application. A closure variable called `GENERATED` is used to keep track\nof the themes that have had their CSS generated.\n\n1. For each of the four (4) palettes (e.g. `primary`, `accent`, `warn` and `background`)\n*in each registered theme* (including the default theme), there are four (4) `<style>`\ntags added to the `<head>` section (e.g. `.md-primary`, `.md-primary.md-hue-1`,\n`.md-primary.md-hue-2`, `.md-primary.md-hue-3`). Each registered theme\nresults in 16 `<style>` tags being generated. \n"
  },
  {
    "path": "docs/content/Theming/06_browser_color.md",
    "content": "@ngdoc content\n@name Browser Colors\n@description\n\n<div class=\"layout_note\">\n  <span>This feature is for **mobile** devices only.</span>\n</div>\n\n![browser color](https://cloud.githubusercontent.com/assets/6004537/18006666/50519c7e-6ba9-11e6-905b-c3751c20549c.png)\n\nThis feature enables browser header theming using\n[Material Design Colors](https://material.io/archive/guidelines/style/color.html#)\nand the AngularJS Material theming system. For API details, please visit the\n<a ng-href=\"api/service/$mdThemingProvider#enableBrowserColor\">$mdThemingProvider</a> documentation.\n\nFor more information about this feature of mobile browsers, please visit\n[Web Fundamentals](https://developers.google.com/web/fundamentals/design-and-ux/browser-customization/#color_browser_elements).\n\nBelow are usage examples for both the AngularJS configuration phase and during runtime.\n\n### Config Phase\n<hljs lang=\"js\">\n  myAppModule\n    .config(function($mdThemingProvider) {\n      // Enable browser color\n      $mdThemingProvider.enableBrowserColor({\n        theme: 'myTheme', // Default is 'default'\n        palette: 'accent', // Default is 'primary', any basic material palette and extended palettes are available\n        hue: '200' // Default is '800'\n      });\n    });\n</hljs>\n\n### Runtime\n<hljs lang=\"js\">\n  myAppModule\n    .controller('myCtrl', function($scope, $mdTheming) {\n      var removeFunction = $mdTheming.setBrowserColor({\n        theme: 'myTheme', // Default is 'default'\n        palette: 'accent', // Default is 'primary', any basic material palette and extended palettes are available\n        hue: '200' // Default is '800'\n      });\n      \n      $scope.$on('$destroy', function () {\n        removeFunction(); // COMPLETELY removes the browser color\n      })\n    })\n</hljs>\n\n"
  },
  {
    "path": "docs/content/migration.md",
    "content": "@ngdoc content\n@name Migration to Angular Material\n@description\n\n<style>\n  table {\n    margin: 24px 2px;\n    box-shadow: 0 1px 2px rgba(10, 16, 20, 0.24), 0 0 2px rgba(10, 16, 20, 0.12);\n    border-radius: 2px;\n    background-color: white;\n    color: rgba(0,0,0,0.87);\n    border-spacing: 0;\n  }\n  table thead > {\n    vertical-align: middle;\n    border-color: inherit;\n  }\n  table thead > tr {\n    vertical-align: inherit;\n    border-color: inherit;\n  }\n  table thead > tr > th {\n    background-color: white;\n    border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n    color: #333;\n    font-size: 12px;\n    font-weight: 500;\n    padding: 8px 24px;\n    text-align: left;\n    line-height: 31px;\n    min-width: 64px;\n  }\n  table tbody > tr > th,\n  table tbody > tr > td {\n    border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n    padding: 16px;\n    text-align: left;\n    line-height: 15px;\n    vertical-align: top;\n  }\n  h1>a, h2>a, h3>a, h4>a {\n    font-weight: 500;\n  }\n</style>\n\n# Migration to Angular Material and the Angular CDK\n\nWhile AngularJS Material has not yet entered Long Term Support (LTS) mode like [AngularJS has][172],\nthe Angular Components team's resources are focused on [Angular Material][171] and the Angular\n[Component Dev Kit (CDK)][cdk]. \n\nFor applications with long-term development and support plans, consideration should be made for\nmigration to the latest version of [Angular][aio], Angular Material, and the CDK.\n\nThe official [ngUpgrade guide][ngUpgrade] covers general practices around AngularJS to Angular\nmigration. This document provides additional guidance specific to AngularJS Material (`v1.1.9+`).\n\n## Table of Contents\n\n- [AngularJS Material features that have moved to the Angular CDK](#cdk)\n- [Changes to the theming system](#theming)\n- [The extraction of the AngularJS Material layout system into a separate library](#flex-layout)\n- [Alternative, light-weight layout options available in the Angular CDK](#cdk-layout)\n- [Typography](#typography)\n- [A comparison of AngularJS Material to Angular Material features](#comparison)\n- [New components in Angular Material](#new-components)\n<br><br>\n\n## Key Concepts\n\nThe [ngUpgrade Preparation Guide][173] covers a number of important steps for preparing your\napplication for the migration. In addition to this preparation work, you should use the content of\nthis document in order to make migration plans based on how features and components have changed\nbetween AngularJS Material and Angular Material.\n\n### <a name=\"cdk\"></a> Angular CDK\n\nSome of the features of AngularJS Material have been made more generic and moved into the [Angular\nCDK][cdk]. \n\nThese include:\n\n| AngularJS Material                   | CDK                                                       |\n|--------------------------------------|-----------------------------------------------------------|\n| [`$mdPanel`][109]                    | [`Overlay`][110]                                          |\n| [`md-virtual-repeat`][68]            | [`*cdkVirtualFor`][40]                                    |\n| [`md-virtual-repeat-container`][179] | [`cdk-virtual-scroll-viewport`][40]                       |\n| [`$mdLiveAnnouncer`][111]            | [`LiveAnnouncer`][112]                                    |\n| `$mdUtil`'s [`bidi()`][113] function | [`Directionality` service][114] and [`Dir` directive][180]|\n| [`md-input`][52]'s `md-no-autogrow` and `max-rows` | [`CdkTextareaAutosize`][115]                |\n| [layout][108] system                 | Covered in [separate section](#cdk-layout) of this guide  |\n\n### <a name=\"theming\"></a> Theming\n\nAngularJS Material performs most theming at _run-time_. While this allows developers to configure\nthemes dynamically in JavaScript, it also incurs substantial performance cost to generate\nCSS during application load.\n\nAngular Material performs theming at _compile-time_ with [Sass][170]. While this approach\nrequires more up-front set-up, it completely removes all JavaScript execution cost associated\nwith theming. The use of Sass also moves the theming system to a more well-supported and\nbroadly-understood toolchain.\n\n#### Defining palettes\n\nAngularJS Material supports defining [custom palettes][151] or [extending existing palettes][158].\n\nIn Angular Material, custom palette creation, including definition of hues and contrast colors, can\nbe accomplished by copying one of the [provided palettes][167], modifying it, and then using it in\nyour [custom theme creation][164].\n\n#### Defining themes\n\nAngularJS Material uses a provider, [`$mdThemingProvider`][144], to define the theme configuration\nused to generate styles during application loading. This provider also includes a default theme for\ncases when no custom palettes are provided.\n\nAngular Material has no default theme; a theme CSS file must _always_ be included. You can either\nuse one of the [pre-built theme files][163], or define a [custom theme][164] with Sass mixins,\nincluding the output in your application just like any other CSS asset.\n\n##### Defining themes at run-time\n\nAngularJS Material uses a service, [`$mdTheming`][143], to define themes and generate CSS styles at\nrun-time.\n\nDefining and generating theme CSS at run-time is not supported by Angular Material. However,\nloading additional theme CSS into your application (or modifying an existing theme's `link` node\nto [swap theme CSS files][181]) at run-time is supported.\n\nYour application can choose to generate additional themes at compile-time or build an API to\ndynamically generate theme CSS on-demand. In either case, it is possible to [lazy load][165] the\ntheme CSS at run-time.\n\n#### Applying themes to your application\n\nAngularJS Material has a custom directive, [`md-theme`][155], to apply a theme to a specific\ncomponent and its children.\n\nRather than providing a special directive API, Angular Material's Sass-based theming system relies\non standard Sass mixins and vanilla CSS selectors. For example, you can customize an individual\nbutton (or set of buttons) by defining a class and applying it to a parent element:\n\n\n<hljs lang=\"scss\">\n// Create a CSS class to use an alternate button theme, $alternate-theme, which you have\n// already defined.\n.alternate-button  {\n  @include mat-button-theme($alternate-theme);\n}\n</hljs>\n<hljs lang=\"html\">\n<!-- You can use normal Angular class bindings to toggle the alternate styles. -->\n<div [class.alternate-button]=\"isAlternateMode\">\n  <button mat-button>Save changes</button>\n</div>\n</hljs>\n\nJust like any other CSS, these classes can be applied to any element in your application and can\nbe added/removed/toggled to swap colors at run-time.\n\n[See the full documentation](https://material.angular.io/guide/theming) for details on themes,\nincluding examples of multiple themes.\n\n##### Dynamically applying themes\n\nAngularJS Material's [`md-theme`][155] and [`md-theme-watch`][156] directives support data binding\nlike `md-theme=\"{{ dynamicTheme }}\" md-theme-watch`.\n\nWith Angular Material, you can make use of Angular's [ngClass][159] API to dynamically apply classes\nassociated with specific theming configurations like `[ngClass]=\"dynamicThemeClass\"`. You can also\nuse normal Angular class bindings to toggle classes like\n`[class.my-dark-theme]=\"isDarkMode\"`.\n\n#### Applying theming to custom components\n\nAngularJS Material's [`md-colors`][73] directive and [`$mdColors`][125] service support looking up\nand [dynamically applying `theme-palette-hue-opacity` color combinations][73] as CSS properties to\nyour application's custom components.\n\nAngular Material uses the [`mat-color`][74] Sass function to lookup theme colors and \nSass mixins with CSS selectors (see `alternate-button ` example of a class above) to\n[style application or library components][168].\n\n##### Accessing Hues\n\nAngularJS Material's [Hue classes][169] (`md-hue-1`, `md-hue-2`, `md-hue-3`) are used to modify a\ncomponent's hues.\n\nThese classes are not supported out of the box with Angular Material, but you can use the\n[`mat-color`][74] Sass function to lookup the desired Hues and assign them to all of the appropriate\nCSS selectors and CSS properties, for a specific component, in a theme mixin. \n\n#### Browser header and system status bar coloring on mobile\n\nAngularJS Material's theme system supports modifying the\n[browser header and system status bar colors][149].\n\nAngular's [Meta service][147] can be used to dynamically modify `<meta>` tags that affect browser\nheader and status bar colors. The [AngularJS Material docs][149] for this feature have links to\nlearn more about the specific `<meta>` tags.\n\n##### Note about CSS variables\nOnce the team begins phasing out support for IE11, the theming system will be revisited with\n[CSS Variables][160] (also known as CSS Custom Properties) in mind.\n\n### <a name=\"layout\"></a> Changes to Layout Features\n\nThe AngularJS Material [layout][108] system includes includes attributes and classes like `layout`,\n`flex`, `show`, `hide`, etc.\n\nSince AngularJS Material's inception, browser support for [CSS Flexbox][flexbox] has [broadly\nimproved][177] and [CSS Grid][65] has become [widely available][178]. Application developers should\ncarefully consider the the costs of additional JavaScript run-time dependencies versus native\nalternatives when choosing an approach to layout.\n\nMany of the AngularJS Material layout APIs map to straightforward, vanilla CSS using Flexbox and\n[media queries][183]. We recommend checking out the following documentation and tutorials:\n- MDN [Flexbox][flexbox] and [Grid][65] documentation\n- [A Visual Guide to CSS3 Flexbox Properties](https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties)\n- [Flexbox Zombies](https://mastery.games/p/flexbox-zombies)\n- [Flexbox Froggy](https://flexboxfroggy.com)\n- [Grid by Example](https://gridbyexample.com/)\n- [A Complete Guide to Grid](https://css-tricks.com/snippets/css/complete-guide-grid/)\n- [Learn CSS Grid](https://learncssgrid.com/)\n\n#### <a name=\"flex-layout\"></a> Flex Layout\n\nThis comprehensive layout system was moved into its [own project][120] (beta).\n\nThe package contains the following:\n- A [Declarative API][116] that includes attributes like `fxLayout`, `fxFlex`, `fxHide`, `fxShow`,\n  and more.\n- A [Responsive API][117] that includes attributes like `fxLayout.lt-md`, `fxFlex.gt-sm`,\n  `fxHide.gt-xs`, `[ngClass.sm]`, `[ngStyle.xs]`, and more.\n- Both APIs include [CSS Grid][65] features in addition to the [CSS Flexbox][flexbox] features from\n  AngularJS Material.\n- The ability to define [Custom Breakpoints][118]\n- A [MediaObserver service][119] that allows subscribing to `MediaQuery` activation changes\n\nThis library adds a nontrivial payload cost as reported by `source-map-explorer` in\n`v7.0.0-beta.24`\n - When using Flexbox only: up to `~46 KB`\n - When using Flexbox and Grid: up to `~60 KB`\n   - Core: `~23 KB`, Flex: `~17 KB`, Grid: `~14 KB`, Extended: `~6 KB`\n\n#### <a name=\"cdk-layout\"></a> Angular CDK Layout\nThe CDK's layout capabilities offer a lightweight alternative (or complement) to larger,\nfull-blown layout systems. This capability adds `3.06 KB` as reported by `source-map-explorer`\nwith Angular CDK `v7.3.7`.\n\nThe CDK's [Layout][121] capability offers:\n- A `MediaMatcher` service that provides access to the low level, native [`MediaQueryList`][123]\n- A set of `Breakpoints` that match the [Material Design][122] responsive layout grid breakpoints\n- A `BreakpointObserver` service that offers APIs for responding to changes in viewport size based\n  on predefined breakpoints.\n\n### <a name=\"typography\"></a> Typography\n\nAngularJS Material [typography classes][107] align with the Angular Material\n[typography classes][27].\n\nAngular Material also adds the following typography features:\n- [Customization via Sass mixins][174] that are similar to the theme configuration mixins\n- Utility Sass mixins and functions for use in [styling your custom components][175]\n  \n## <a name=\"comparison\"></a> Comparison of Features and Migration Tips\n\nAngular Material introduces a number of [new components](#new-components) and features that do not\nexist in AngularJS Material. Angular Material also makes greater use of semantic HTML and native\nelements to improve accessibility.\n\n### Directives\nMost components use the same name between the two libraries, changing the `md-` prefix to `mat-`.\nFor example, `<md-card>` becomes `<mat-card>`. Some element directives changed to attribute\ndirectives, for instance `<md-subheader>` changed to `matSubheader`.\n\n#### Component and Directive comparison reference\n\n| Directive          | Old (`md-`)  | New (`mat-`) | Special Notes                                          |\n|--------------------|--------------|--------------|--------------------------------------------------------|\n| autocomplete       |   [Docs][41] |   [Docs][24] |                                                        |\n| autofocus          |   [Docs][69] |   [Docs][182]| `cdkFocusInitial`                                      |\n| button             |   [Docs][43] |   [Docs][1]  |                                                        |\n| calendar           |   [Docs][70] |   -          | The [datepicker][25] has a `mat-calendar` component, but it cannot be used in stand-alone mode.|\n| card               |   [Docs][44] |   [Docs][2]  |                                                        |\n| checkbox           |   [Docs][45] |   [Docs][3]  |                                                        |\n| chip               |   [Docs][71] |   [Docs][26] |                                                        |\n| chip-remove        |   [Docs][72] |   [Docs][26] | `matChipRemove`                                        |\n| chips              |   [Docs][46] |   [Docs][26] |                                                        |\n| colors             |   [Docs][73] |   -          | [`mat-color` mixin][74] supports static theme color lookups.|\n| contact-chips      |   [Docs][75] |   -          | Not implemented                                        |\n| content            |   [Docs][76] |   [Docs][77] | `cdkScrollable`                                        |\n| datepicker         |   [Docs][47] |   [Docs][25] |                                                        |\n| divider            |   [Docs][49] |   [Docs][35] |                                                        |\n| fab-speed-dial     |   [Docs][78] |   -          | Not implemented                                        |\n| fab-toolbar        |   [Docs][79] |   -          | Not implemented                                        |\n| grid-list          |   [Docs][50] |   [Docs][9]  |                                                        |\n| highlight-text     |   [Docs][80] |   -          | Not implemented                                        |\n| icon               |   [Docs][51] |   [Docs][10] |                                                        |\n| ink-ripple         |   [Docs][81] |   [Docs][19] | `matRipple`                                            |\n| input              |   [Docs][52] |   [Docs][5]  | `matInput`                                             |\n| input-container    |   [Docs][82] |   [Docs][83] | `mat-form-field`                                       |\n| list               |   [Docs][53] |   [Docs][8]  |                                                        |\n| menu               |   [Docs][54] |   [Docs][17] |                                                        |\n| menu-bar           |   [Docs][84] |   -          | Not implemented                                        |\n| nav-bar            |   [Docs][85] |   [Docs][86] | `mat-tab-nav-bar`                                      |\n| nav-item           |   [Docs][87] |   [Docs][88] | `mat-tab-link`                                         |\n| optgroup           |   [Docs][89] |   [Docs][90] |                                                        |\n| option             |   [Docs][91] |   [Docs][23] |                                                        |\n| progress-linear    |   [Docs][55] |   [Docs][12] | `mat-progress-bar`                                     |\n| progress-circular  |   [Docs][56] |   [Docs][11] | `mat-progress-spinner`                                 |\n| radio-button       |   [Docs][57] |   [Docs][4]  |                                                        |\n| radio-group        |   [Docs][92] |   [Docs][93] |                                                        |\n| select             |   [Docs][59] |   [Docs][23] |                                                        |\n| select-on-focus    |   [Docs][94] |   -          | Not implemented                                        |\n| sidenav            |   [Docs][60] |   [Docs][6]  |                                                        |\n| sidenav-focus      |   [Docs][95] |   -          | [autofocus][96] only supports focusing the first focusable element.|\n| switch             |   [Docs][61] |   [Docs][14] | `mat-slide-toggle`                                     |\n| slider             |   [Docs][62] |   [Docs][16] |                                                        |\n| slider-container   |   [Docs][97] |   -          | See Migration Notes below                              |\n| subheader          |   [Docs][98] |   [Docs][99] | `matSubheader`                                         |\n| swipe              |   [Docs][100]|   -          | See [HammerJS setup][101] and [Hammer.Swipe][102]      |\n| tabs               |   [Docs][64] |   [Docs][13] |                                                        |\n| textarea           |   [Docs][52] |   [Docs][5]  |                                                        |\n| toolbar            |   [Docs][66] |   [Docs][7]  |                                                        |\n| tooltip            |   [Docs][67] |   [Docs][18] |                                                        |\n| truncate           |   [Docs][103]|   -          | Not implemented                                        |\n| virtual-repeat     |   [Docs][68] |   [Docs][40] | `cdk-virtual-scroll-viewport` and `*cdkVirtualFor`     |\n| whiteframe         |   [Docs][104]|  [Guide][105]| Based on classes and mixins                            |\n\n#### Component and Directive Migration Notes\n\n1. `md-slider-container` helped style and position a `span` and `input` along with the `md-slider`.\n  You can add elements or components next to your `mat-slider`, then position and style them as\n  desired.\n\n### Service comparison reference \n\n| Service          | Old          | New          | Special Notes                                          |\n|------------------|--------------|--------------|--------------------------------------------------------|\n| $mdAriaProvider  |   [Docs][124]|   -          | See Migration Notes below                              |\n| $mdBottomSheet   |   [Docs][42] |   [Docs][38] | `MatBottomSheet`                                       |\n| $mdColors        |   [Docs][125]|   -          | [`mat-color` mixin][74] supports static theme color lookups.|\n| $mdCompiler      |   [Docs][126]|   -          | See Migration Notes below                              |\n| $mdCompilerProvider| [Docs][127]|   -          | See Migration Notes below                              |\n| $mdDateLocaleProvider|[Docs][128]|  [Docs][129]| `MomentDateAdapter`                                    |\n| $mdDialog        |   [Docs][48] |   [Docs][22] | `MatDialog`                                            |\n| $mdGestureProvider|  [Docs][130]|   -          | See Migration Notes below                              |\n| $mdIcon          |   [Docs][131]|   [Docs][132]| `svgIcon`                                              |\n| $mdIconProvider  |   [Docs][133]|   [Docs][134]| `MatIconRegistry`                                      |\n| $mdInkRipple     |   [Docs][58] |   [Docs][19] |                                                        |\n| $mdInkRippleProvider|[Docs][135]|   [Docs][136]| `MAT_RIPPLE_GLOBAL_OPTIONS`                            |\n| $mdInteraction   |   [Docs][137]|   -          | Not implemented                                        |\n| $mdLiveAnnouncer |   [Docs][111]|   [Docs][112]| CDK `LiveAnnouncer`                                    |\n| $mdMedia         |   [Docs][137]|   [Docs][138]| CDK `BreakpointObserver.isMatched()` or Flex Layout's [MediaObserver service][119]|\n| $mdPanel         |   [Docs][109]|   [Docs][110]| CDK `Overlay`                                          |\n| $mdPanelProvider |   [Docs][139]|   -          | Not implemented                                        |\n| $mdProgressCircularProvider|[Docs][140]|-      | Not implemented                                        |\n| $mdSidenav       |   [Docs][141]|   -          | See Migration Notes below                              |\n| $mdSticky        |   [Docs][142]|   -          | See Migration Notes below                              |\n| $mdTheming       |   [Docs][143]|   -          | [Sass mixins][145] support custom component theming.|\n| $mdThemingProvider|  [Docs][144]|   -          | [Sass mixins][146] support static, custom theme creation. Use Angular's [Meta service][147] for browser coloring features.|\n| $mdToast         |   [Docs][63] |   [Docs][21] | `MatSnackBar`                                          |\n\n#### Service Migration Notes\n\n1. [This article](https://medium.com/myplanet-musings/comparing-3-top-automated-accessibility-testing-tools-wave-tenon-io-and-google-lighthouse-d3897d7bb311)\n  covers [Chrome DevTools' Lighthouse](https://developers.google.com/web/tools/lighthouse/)\n  Accessibility Auditing Tool. It provides guidance and two additional options for accessibility\n  testing. Also note that the documentation for every Angular Material component includes a section\n  with accessibility recommendations.\n1. `$mdCompiler` and the related `$mdCompilerProvider` are AngularJS-specific solutions.\n  Similar tools and APIs are not needed when working with Angular.\n1. Angular Material uses [HammerJS][101]. To disable gesture detection, do not import HammerJS\n  in your project. Angular Material does not do click hijacking, so the APIs related to\n  that feature aren't needed.\n1. `$mdSidenav` is a convenience to allow calling `$mdSidenav('right').toggle()` or\n  `$mdSidenav('left').close()` from components, without the need to have an actual reference to each\n  `md-sidenav` instance. If you need functionality like this with Angular Material, you can use\n  Angular's [@ViewChild Decorator](https://angular.io/api/core/ViewChild) to get a reference to the\n  `MatDrawer` or `MatSidenav` instance. Then you can store that reference in a service for use from\n  multiple components.\n1. `$mdSticky` uses the browser's native [position: sticky](https://developer.mozilla.org/en-US/docs/Web/CSS/position#Sticky_positioning)\n  when supported and only supplies a workaround for browsers like IE11 that do not support native\n  sticky positioning. For Angular Material, you should use the native `position: sticky` and\n  provide your own solution for IE11.\n\n### <a name=\"new-components\"></a> New Components\nThese are new components found in Angular Material and the Angular CDK that do not exist in\nAngularJS Material.\n\nThe `mat-` and `cdk-` prefixes have been omitted to make this table more readable.\n\n| Directive        | New          | Special Notes                                          |\n|------------------|--------------|--------------------------------------------------------|\n| badge            |   [Docs][37] |                                                        |\n| button-toggle    |   [Docs][15] |                                                        |\n| drag-drop        |   [Docs][39] | CDK                                                    |\n| expansion-panel  |   [Docs][32] |                                                        |\n| paginator        |   [Docs][29] |                                                        |\n| sort-header      |   [Docs][30] |                                                        |\n| stepper          |   [Docs][33] | Unstyled CDK and Material versions available.          |\n| table            |   [Docs][28] | Unstyled CDK and Material versions available.          |\n| tree             |   [Docs][36] | Unstyled CDK and Material versions available.          |\n\n [0]: https://github.com/angular/flex-layout/wiki\n [1]: https://material.angular.io/components/button/overview\n [2]: https://material.angular.io/components/card/overview\n [3]: https://material.angular.io/components/checkbox/overview\n [4]: https://material.angular.io/components/radio/overview\n [5]: https://material.angular.io/components/input/overview\n [6]: https://material.angular.io/components/sidenav/overview\n [7]: https://material.angular.io/components/toolbar/overview\n [8]: https://material.angular.io/components/list/overview\n [9]: https://material.angular.io/components/grid-list/overview\n[10]: https://material.angular.io/components/icon/overview\n[11]: https://material.angular.io/components/progress-spinner/overview\n[12]: https://material.angular.io/components/progress-bar/overview\n[13]: https://material.angular.io/components/tabs/overview\n[14]: https://material.angular.io/components/slide-toggle/overview\n[15]: https://material.angular.io/components/button-toggle/overview\n[16]: https://material.angular.io/components/slider/overview\n[17]: https://material.angular.io/components/menu/overview\n[18]: https://material.angular.io/components/tooltip/overview\n[19]: https://material.angular.io/components/ripple/overview\n[20]: https://material.angular.io/guide/theming\n[21]: https://material.angular.io/components/snack-bar/overview\n[22]: https://material.angular.io/components/dialog/overview\n[23]: https://material.angular.io/components/select/overview\n[24]: https://material.angular.io/components/autocomplete/overview\n[25]: https://material.angular.io/components/datepicker/overview\n[26]: https://material.angular.io/components/chips/overview\n[27]: https://material.angular.io/guide/typography\n[28]: https://material.angular.io/components/table/overview\n[29]: https://material.angular.io/components/paginator/overview\n[30]: https://material.angular.io/components/sort/overview\n[31]: https://tina-material-tree.firebaseapp.com/simple-tree\n[32]: https://material.angular.io/components/expansion/overview\n[33]: https://material.angular.io/components/stepper/overview\n[34]: https://material.angular.io/cdk/categories\n[35]: https://material.angular.io/components/divider/overview\n[36]: https://material.angular.io/components/tree/overview\n[37]: https://material.angular.io/components/badge/overview\n[38]: https://material.angular.io/components/bottom-sheet/overview\n[39]: https://material.angular.io/cdk/drag-drop/overview\n[40]: https://material.angular.io/cdk/scrolling/overview#virtual-scrolling\n[41]: https://material.angularjs.org/latest/api/directive/mdAutocomplete\n[42]: https://material.angularjs.org/latest/api/service/$mdBottomSheet\n[43]: https://material.angularjs.org/latest/api/directive/mdButton\n[44]: https://material.angularjs.org/latest/api/directive/mdCard\n[45]: https://material.angularjs.org/latest/api/directive/mdCheckbox\n[46]: https://material.angularjs.org/latest/api/directive/mdChips\n[47]: https://material.angularjs.org/latest/api/directive/mdDatepicker\n[48]: https://material.angularjs.org/latest/api/service/$mdDialog\n[49]: https://material.angularjs.org/latest/api/directive/mdDivider\n[50]: https://material.angularjs.org/latest/api/directive/mdGridList\n[51]: https://material.angularjs.org/latest/api/directive/mdIcon\n[52]: https://material.angularjs.org/latest/api/directive/mdInput\n[53]: https://material.angularjs.org/latest/api/directive/mdList\n[54]: https://material.angularjs.org/latest/api/directive/mdMenu\n[55]: https://material.angularjs.org/latest/api/directive/mdProgressLinear\n[56]: https://material.angularjs.org/latest/api/directive/mdProgressCircular\n[57]: https://material.angularjs.org/latest/api/directive/mdRadioButton\n[58]: https://material.angularjs.org/latest/api/service/$mdInkRipple\n[59]: https://material.angularjs.org/latest/api/directive/mdSelect\n[60]: https://material.angularjs.org/latest/api/directive/mdSidenav\n[61]: https://material.angularjs.org/latest/api/directive/mdSwitch\n[62]: https://material.angularjs.org/latest/api/directive/mdSlider\n[63]: https://material.angularjs.org/latest/api/service/$mdToast\n[64]: https://material.angularjs.org/latest/api/directive/mdTabs\n[65]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout\n[66]: https://material.angularjs.org/latest/api/directive/mdToolbar\n[67]: https://material.angularjs.org/latest/api/directive/mdTooltip\n[68]: https://material.angularjs.org/latest/api/directive/mdVirtualRepeat\n[69]: https://material.angularjs.org/latest/api/directive/mdAutofocus\n[70]: https://material.angularjs.org/latest/api/directive/mdCalendar\n[71]: https://material.angularjs.org/latest/api/directive/mdChip\n[72]: https://material.angularjs.org/latest/api/directive/mdChipRemove\n[73]: https://material.angularjs.org/latest/api/directive/mdColors\n[74]: https://material.angular.io/guide/theming-your-components#note-using-the-code-mat-color-code-function-to-extract-colors-from-a-palette\n[75]: https://material.angularjs.org/latest/api/directive/mdContactChips\n[76]: https://material.angularjs.org/latest/api/directive/mdContent\n[77]: https://material.angular.io/cdk/scrolling/overview#cdkscrollable-and-scrolldispatcher\n[78]: https://material.angularjs.org/latest/api/directive/mdFabSpeedDial\n[79]: https://material.angularjs.org/latest/api/directive/mdFabToolbar\n[80]: https://material.angularjs.org/latest/api/directive/mdHighlightText\n[81]: https://material.angularjs.org/latest/api/directive/mdInkRipple\n[82]: https://material.angularjs.org/latest/api/directive/mdInputContainer\n[83]: https://material.angular.io/components/form-field/overview\n[84]: https://material.angularjs.org/latest/api/directive/mdMenuBar\n[85]: https://material.angularjs.org/latest/api/directive/mdNavBar\n[86]: https://material.angular.io/components/tabs/overview#tabs-and-navigation\n[87]: https://material.angularjs.org/latest/api/directive/mdNavItem\n[88]: https://material.angular.io/components/tabs/api#MatTabLink\n[89]: https://material.angularjs.org/latest/api/directive/mdOptgroup\n[90]: https://material.angular.io/components/select/overview#creating-groups-of-options\n[91]: https://material.angularjs.org/latest/api/directive/mdOption\n[92]: https://material.angularjs.org/latest/api/directive/mdRadioGroup\n[93]: https://material.angular.io/components/radio/overview#radio-groups\n[94]: https://material.angularjs.org/latest/api/directive/mdSelectOnFocus\n[95]: https://material.angularjs.org/latest/api/directive/mdSidenavFocus\n[96]: https://material.angular.io/components/sidenav/api#MatSidenav\n[97]: https://material.angularjs.org/latest/api/directive/mdSliderContainer\n[98]: https://material.angularjs.org/latest/api/directive/mdSubheader\n[99]: https://material.angular.io/components/list/overview#lists-with-multiple-sections\n[100]: https://material.angularjs.org/latest/api/directive/mdSwipeDown\n[101]: https://material.angular.io/guide/getting-started#step-5-gesture-support\n[102]: http://hammerjs.github.io/recognizer-swipe/\n[103]: https://material.angularjs.org/latest/api/directive/mdTruncate\n[104]: https://material.angularjs.org/latest/api/directive/mdWhiteframe\n[105]: https://material.angular.io/guide/elevation\n[106]: https://material.angularjs.org/latest/Theming/01_introduction\n[107]: https://material.angularjs.org/latest/CSS/typography\n[108]: https://material.angularjs.org/latest/layout/introduction\n[109]: https://material.angularjs.org/latest/api/service/$mdPanel\n[110]: https://material.angular.io/cdk/overlay/overview\n[111]: https://github.com/angular/material/blob/v1.1.17/src/core/services/liveAnnouncer/live-announcer.js\n[112]: https://material.angular.io/cdk/a11y/api#LiveAnnouncer\n[113]: https://github.com/angular/material/blob/v1.1.17/src/core/util/util.js#L86-L105\n[114]: https://material.angular.io/cdk/bidi/api#Directionality\n[115]: https://material.angular.io/cdk/text-field/api#CdkTextareaAutosize\n[116]: https://github.com/angular/flex-layout/wiki/Declarative-API-Overview\n[117]: https://github.com/angular/flex-layout/wiki/Responsive-API\n[118]: https://github.com/angular/flex-layout/wiki/Breakpoints\n[119]: https://github.com/angular/flex-layout/wiki/API-Documentation#javascript-api-imperative\n[120]: https://github.com/angular/flex-layout\n[121]: https://material.angular.io/cdk/layout/overview\n[122]: https://material.io/design/layout/responsive-layout-grid.html#breakpoints\n[123]: https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList\n[124]: https://material.angularjs.org/latest/api/service/$mdAriaProvider\n[125]: https://material.angularjs.org/latest/api/service/$mdColors\n[126]: https://material.angularjs.org/latest/api/service/$mdCompiler\n[127]: https://material.angularjs.org/latest/api/service/$mdCompilerProvider\n[128]: https://material.angularjs.org/latest/api/service/$mdDateLocaleProvider\n[129]: https://material.angular.io/components/datepicker/overview#internationalization\n[130]: https://material.angularjs.org/latest/api/service/$mdGestureProvider\n[131]: https://material.angularjs.org/latest/api/service/$mdIcon\n[132]: https://material.angular.io/components/icon/api#MatIcon\n[133]: https://material.angularjs.org/latest/api/service/$mdIconProvider\n[134]: https://material.angular.io/components/icon/api#MatIconRegistry\n[135]: https://material.angularjs.org/latest/api/service/$mdInkRippleProvider\n[136]: https://material.angular.io/components/ripple/overview#global-options\n[137]: https://material.angularjs.org/latest/api/service/$mdMedia\n[138]: https://material.angular.io/cdk/layout/overview#breakpointobserver\n[139]: https://material.angularjs.org/latest/api/service/$mdPanelProvider\n[140]: https://material.angularjs.org/latest/api/service/$mdProgressCircular\n[141]: https://material.angularjs.org/latest/api/service/$mdSidenav\n[142]: https://material.angularjs.org/latest/api/service/$mdSticky\n[143]: https://material.angularjs.org/latest/api/service/$mdTheming\n[144]: https://material.angularjs.org/latest/api/service/$mdThemingProvider\n[145]: https://material.angular.io/guide/theming-your-components\n[146]: https://material.angular.io/guide/theming#defining-a-custom-theme\n[147]: https://angular.io/api/platform-browser/Meta\n[148]: https://material.io/archive/guidelines/style/color.html#color-color-palette\n[149]: https://material.angularjs.org/latest/Theming/06_browser_color\n[150]: https://material.angularjs.org/latest/Theming/01_introduction#palettes\n[151]: https://material.angularjs.org/latest/Theming/03_configuring_a_theme#defining-custom-palettes\n[152]: https://material.angularjs.org/latest/Theming/03_configuring_a_theme\n[153]: https://material.angularjs.org/latest/Theming/04_multiple_themes\n[154]: https://material.angularjs.org/latest/Theming/04_multiple_themes#using-another-theme\n[155]: https://material.angularjs.org/latest/Theming/04_multiple_themes#via-a-directive\n[156]: https://material.angularjs.org/latest/Theming/04_multiple_themes#dynamic-themes\n[157]: https://material.angularjs.org/latest/Theming/05_under_the_hood\n[158]: https://material.angularjs.org/latest/Theming/03_configuring_a_theme#extending-existing-palettes\n[159]: https://angular.io/api/common/NgClass\n[160]: https://caniuse.com/#feat=css-variables\n[161]: https://github.com/angular/components/releases/tag/7.3.3\n[162]: https://github.com/angular/components/issues/4352\n[163]: https://material.angular.io/guide/theming#using-a-pre-built-theme\n[164]: https://material.angular.io/guide/theming#defining-a-custom-theme\n[165]: https://material.angular.io/guide/theming#multiple-themes\n[166]: https://material.angular.io/guide/theming#theming-only-certain-components\n[167]: https://github.com/angular/components/blob/7.3.6/src/lib/core/theming/_palette.scss#L72-L103\n[168]: https://material.angular.io/guide/theming-your-components\n[169]: https://material.angularjs.org/latest/Theming/03_configuring_a_theme#specifying-custom-hues-for-color-intentions\n[170]: https://sass-lang.com/\n[171]: https://material.angular.io/\n[172]: https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c\n[173]: https://angular.io/guide/upgrade#preparation\n[174]: https://material.angular.io/guide/typography#customization\n[175]: https://material.angular.io/guide/typography#material-typography-in-your-custom-css\n[176]: https://github.com/angular/material-tools\n[177]: https://caniuse.com/#feat=flexbox\n[178]: https://caniuse.com/#feat=css-grid\n[179]: https://material.angularjs.org/latest/api/directive/mdVirtualRepeatContainer\n[180]: https://material.angular.io/cdk/bidi/api#Dir\n[181]: https://material.angular.io/guide/theming#swapping-css-files\n[182]: https://material.angular.io/cdk/a11y/overview#regions\n[183]: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries\n\n[aio]: https://angular.io/\n[cdk]: https://material.angular.io/cdk\n[ngUpgrade]: https://angular.io/guide/upgrade-performance\n[style-guide]: https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md\n[webpack]: http://webpack.github.io/\n[flexbox]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox\n"
  },
  {
    "path": "docs/content/performance/internet-explorer.md",
    "content": "@ngdoc content\n@name Internet Explorer\n@description\n\n# Introduction\n\nAngularJS Material is a cutting edge framework which uses advanced CSS features.\nInternet Explorer is known to have performance issues with some of these features. \nSome of the notable issues are related to layout calculations, animations, and border rendering. \nIn this document, we will provide optimizations which can improve performance in \nInternet Explorer.\n\nThis document should be consulted after the AngularJS code in an application is optimized: \n1. Reduce the number of watchers\n1. Enable production mode, etc.\n\n# Theming\n\nAngularJS Material theming works by injecting inline styles into the `<head>`. The benefit\nis that the theme can be switched or modified at runtime. Unfortunately these inline styles can \npresent a performance burden for Internet Explorer. When switching or modifying themes at runtime\nis not a requirement, the theming CSS can be exported to an external file which can be loaded statically.\nThe following steps should be performed:\n\n* Configure your theme as explained <a ng-href=\"Theming/03_configuring_a_theme\">here</a>\n  - If you are using a custom theme, don't forget this step \n* Run the application in Chrome \n* Open the Chrome DevTools\n* Execute the following javascript - <i>This copies the theming CSS to the clipboard</i>\n\n<hljs lang=\"js\">\ncopy([].slice.call(document.styleSheets)\n  .map(e => e.ownerNode)\n  .filter(e => e.hasAttribute('md-theme-style'))\n  .map(e => e.textContent)\n  .join('\\n');\n);\n</hljs>\n\n* Paste the content to a static, external CSS file and link it to the app's `index.html`.\n* In the top level AngularJS modules of the application, add the following code to disable\n  the injection of styles:\n\n<hljs lang=\"js\">\nangular\n  .module('myApp', ['ngMaterial'])\n  .config(function($mdThemingProvider) {\n    $mdThemingProvider.disableTheming();\n});\n</hljs>\n\n<br>\n\n# Directives that can help\n\n## Virtual Repeat\n\nOne of the greatest issues with Internet Explorer, is the slow layout calculation. \nThe more elements are in the dom, the slower the calculations are. \nThis is especially important with ng-repeat.\nLet's take the following [Example](https://codepen.io/team/AngularMaterial/pen/GdjVvP):\n\n<hljs lang=\"html\">\n<md-list>\n  <md-list-item ng-repeat=\"person in people\"\n                ng-click=\"goToPerson(person.name, $event)\">\n    <img alt=\"{{::person.name }}\" ng-src=\"{{::person.img }}\" class=\"md-avatar\">\n    <p>{{::person.name }}</p>\n    <md-checkbox class=\"md-secondary\" ng-model=\"person.selected\"></md-checkbox>\n    <md-icon md-svg-icon=\"communication:email\" ng-click=\"doSecondaryAction($event)\"\n             aria-label=\"Send Email\" class=\"md-secondary md-hue-3\"></md-icon>\n    <md-icon class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\" aria-label=\"Chat\"\n             md-svg-icon=\"communication:message\"></md-icon>\n  </md-list-item>\n</md-list>\n</hljs>\n\nIn this example, a list of people is shown. When a person is clicked, a `md-dialog` is opened. \nThe opening of the dialog inserts a md-backdrop and a layout calculation of the whole DOM is triggered. \nThe bigger the list gets, the opening of the dialog is slowed down.\n\nThe best solution is to keep the DOM small. The list elements which should be in the DOM are just the\nelements which fit in the viewport at any one time.\nThis can be achieved by using [Virtual Repeat](https://material.angularjs.org/latest/demo/virtualRepeat).\n\nThe [solution](https://codepen.io/team/AngularMaterial/pen/yjamqa) is easy and elegant:\n\n<hljs lang=\"html\">\n<md-content layout=\"column\" ng-controller=\"ListCtrl\">\n  <md-virtual-repeat-container id=\"vertical-container\">\n    <md-list>\n      <md-list-item md-virtual-repeat=\"person in people\"\n                    ng-click=\"goToPerson(person.name, $event)\">\n        <img alt=\"{{ person.name }}\" ng-src=\"{{ person.img }}\" class=\"md-avatar\">\n        <p>{{ person.name }}</p>\n        <md-checkbox class=\"md-secondary\" ng-model=\"person.selected\"></md-checkbox>\n        <md-icon md-svg-icon=\"communication:email\" ng-click=\"doSecondaryAction($event)\"\n                 aria-label=\"Send Email\" class=\"md-secondary md-hue-3\"></md-icon>\n        <md-icon class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\" aria-label=\"Chat\"\n                 md-svg-icon=\"communication:message\"></md-icon>\n      </md-list-item>\n    </md-list>\n  </md-virtual-repeat-container>\n</md-content>\n</hljs>\n\nThe virtual repeat directive only adds, to the dom, the elements visible in the viewport. \nWhen the view is scrolled the existing elements are reused.\nUsing this solution, the virtual repeat directive supports real-time scrolling through millions of \nrecords (assuming all in-memory). \n\n**Caveat**: Virtual Repeat requires the height of all list items to be equal and static.\nThis restriction is key to the performance that it provides.\n<br>\n\n# Directives to use with Caution\n\n## Tabs\n\nThe [Tabs](https://material.angularjs.org/latest/demo/tabs) directive is capable of some very nice\nanimations. This comes at a cost of layout calculations which increase in cost as DOM items are added\nto the content of the tabs. Internet Explorer's layout calculations are slower than other browsers\nwhen Flexbox is involved. This means that tabs that work fine on Chrome and Firefox, may lag for\nyour IE users. The primary alternative to the Tabs directive is the \n[NavBar](https://material.angularjs.org/latest/demo/navBar) directive.\n\nAnother alternative is to:\n\n* use a single external content to represent the currently selected tab content area\n* use Tabs selectedIndex to route or switch the content in the external content area\n\nThe [Material Adaptive Shrine](https://github.com/angular/material-adaptive/blob/61417580a8c8cfd454364b7f6d16d0a9b22896f4/shrine/app/src/dashboard/tmpl/dashboard.html#L11-L16)\napp has an example of this.\n\n* Previously each tab had a child featuredItem and a productGrid component... this caused perf issues.\n* It was refactored to move to using a single external productGrid outside the tabs (aka navBar)\n* It now uses `md-on-select` or data binding to update the productGrid content.\n\n<br>\n\n# Bells and whistles\n\nAngularJS Material comes with all of the bells and whistles turned on by default. \nThese can be switched off selectively for Internet Explorer.\n\n## Gestures\n\nDisabling support for touch gestures across the app can improve performance in IE.\n\n<hljs lang=\"js\">\nvar isIE = window.document.documentMode;\n\nangular\n  .module('myApp', ['ngMaterial'])\n  .config( function($mdGestureProvider) {\n    if (isIE) {\n      $mdGestureProvider.disableAll();\n    }\n  });\n</hljs>\n\n## Ink ripples\n\nThe material ink ripple animation effects can be turned off using the `$mdInkRippleProvider`.\n\n### Example\n\n<hljs lang=\"js\">\nvar isIE = window.document.documentMode;\n\nangular\n  .module('myApp', ['ngMaterial'])\n  .config( function($mdInkRippleProvider) {\n    if (isIE) {\n      $mdInkRippleProvider.disableInkRipple();\n    }\n  });\n</hljs>\n"
  },
  {
    "path": "docs/guides/BUILD.md",
    "content": "## Build Instructions\n\n* [Introduction](#intro)<br/><br/>\n* [Build Commands](#commands)\n* [Building the Documentation](#livedocs)\n* [Building the Library](#builds)\n<br/><br/>\n* [Component Modules](#comp)\n* [Building Individual Components](#comp_builds)\n* [Component Debugging](#comp_debug)\n\n## <a name=\"intro\"></a> Introduction\n\nAngularJS Material has a collection of build processes and commands available to deploy distribution\nfiles, test components, and more.\n\nThese commands are defined within the `package.json` and two (2) **gulp** files:\n\n* [package.json](../../package.json)\n* [Project Gulp](../../gulpfile.js)\n* [Documentation Gulp](../gulpfile.js)\n\nFrom the project root, install the NPM packages by running\n- `npm install` or `npm i`\n\n### <a name=\"commands\"></a> Build Commands\n\nThe following command line tasks are available:\n\n- `npm run build` to build\n- `npm run build:prod` to uglify, strip `console.log`, and autoprefix CSS\n- `npm run docs:build` to build the docs into `dist/docs`\n- `npm run docs:watch` to build the library and docs, and rebuild on file changes\n\n<a separator></a>\n\n- `npm run lint` to run ESLint\n- `npm run test:fast` to run smoke tests\n- `npm run test:full` to run all of the unit tests\n\n### <a name=\"livedocs\"></a> Building the Documentation\n\nThe AngularJS Material Docs are generated from the source code. The documentation itself uses the\nAngularJS Material layout, components, and themes.\n\n> Our build process uses **[dgeni](https://github.com/angular/dgeni)**, the wonderful documentation\ngenerator built by [Pete Bacon Darwin](https://github.com/petebacondarwin).\n\nTo view the Docs (locally):\n\n1. Build the docs and serve with 'live reload' using `npm run docs:watch`\n1. Open Browser to [http://localhost:8080](http://localhost:8080)\n\n### <a name=\"builds\"></a> Building the Library\n\nDevelopers can build the entire AngularJS Material library or individual component modules. The\nlibrary comprises:\n\n* `angular-material.js` - components, services, and theming\n* `angular-material.css|scss` - styles\n* `layouts/**.css|scss` - default layout stylesheets\n\nTo build from the source, simply use:\n```bash\n# Build the library to\n#\n# - `dist/angular-material.js`\n# - `dist/angular-material.css|scss`\n# - `dist/layouts`\n\nnpm run build\n\n# Build minified assets\n#\n# - `dist/angular-material.min.js`\n# - `dist/angular-material.min.css|scss`\n# - `dist/layouts`\n\nnpm run build:prod\n```\n\n##<a name=\"comp\"></a> Component Modules\n\nAngularJS Material supports the construction and deployment of individual component builds.\nEach component is contained within its own module and specifies its own dependencies.\n\n> At a minimum, all components have a dependency upon the `core` module.\n\nFor example, the **slider** component is registered as the **material.components.slider** module.\n\n### <a name=\"comp_builds\"></a> Building Individual Components\n\nTo build and deploy assets for each component individually, run:\n```bash\nnpm run build:modules\n```\n\nAll component modules are compiled and distributed to:\n```text\n -- dist\n    -- modules\n       -- js\n          -- core\n          -- <component folder>\n```\n\nLet's consider the Slider component with its module definition:\n```js\n/**\n * @ngdoc module\n * @name material.components.slider\n */\nangular.module('material.components.slider', [\n  'material.core'\n]);\n```\n\nFirst build all the component modules.\n\nTo use - for example - the Slider component within your own application, simply load the stylesheets\nand JS from both the **slider** and the **core** modules:\n```text\n -- dist\n    -- modules\n       -- js\n          -- core\n             -- core.js\n             -- core.css\n          -- slider\n             -- slider.js\n             -- slider.css\n             -- slider-default-theme.css\n```\n\n### <a name=\"comp_debug\"></a> Component Debugging\n\nDebugging a demo in the Docs is complicated due the multiple demos loading and initializing. A\nmore practical approach is to open and debug a specific, standalone Component demo.\n\nTo open a Component demo outside of the Docs application, just build, deploy and debug that\ncomponent's demo(s).\n\nFor example, to debug the **textfield** component:\n\n```bash\n# Watch and build the 'textfield' demos\n#\n# NOTE: watch-demo will rebuild your component source\n#       and demos upon each `save`.\n# Note: server will livereload demos on port 8080 after updates are\n#       built (by watch-demo) to the dist/demos/ dir.\n#\ngulp watch-demo -c textfield server\n```\n\nThe demo build process will deploy a *self-contained* AngularJS application that runs the specified\ncomponent's demo(s). E.g.:\n\n* `dist/demos/textfield/**/*.*`\n* `dist/demos/tabs/**/*.*`\n*  etc.\n\nAfter running the appropriate `watch-demo` and `server` tasks:\n\n* Open browser to [http://localhost:8080/dist/demos](http://localhost:8080/dist/demos)\n* Navigate to `<component>/<demo>`\n* Open Dev Tools and debug...\n"
  },
  {
    "path": "docs/guides/CODEPEN.md",
    "content": "# Editable Demos in CodePen\n\n## Description\n\nUsers can click a button on each demo to open it in CodePen\nfor editing. From there the user can edit, save, or make other\nmodifications to the example.\n\n## Why CodePen?\n\nCodePen appears to be one the most stable and active online sandboxes.\nIt offers a more accessible experience compared to other tools.\n\n## How does it work?\n\nClicking **'Edit on CodePen'** creates a new CodePen instance that includes all HTML, CSS, and\nJavaScript assets via the [CodePen API](http://blog.codepen.io/documentation/api/prefill).\nWe append an additional script to the new CodePen to initialize the\n[cache](#asset_cache), which is responsible for serving assets.\n\n## As a contributor, what do I need to know?\n\n* [SVG images are served from a cache](#asset_cache)\n* [Adding a new SVG requires a change to the asset cache](#build_cache)\n* Anytime adding a new dependency to an example, the [svg-assets-cache.js](../app/svg-assets-cache.js)\n  will need to be updated with the new dependency and [uploaded to the CDN](#update_cdn)\n* Images used in demos must use full paths\n* Code examples are modified prior to sending to CodePen with the same\n  module defined in the [svg-assets-cache.js](../app/svg-assets-cache.js)\n* Additional HTML template files located in the demo directory are appended to your index file\n  using `ng-template`. [See docs](https://docs.angularjs.org/api/ng/directive/script)\n\n## <a name=\"asset_cache\"></a> Asset Cache\n\nWe store SVG images in an asset cache using `$templateCache`. We send a script to CodePen that\ninitializes the cache within the demo module.\n\n### Why is an asset cache needed for CodePen?\n\nComponents within AngularJS Material, at times, use icons or SVG images. Images\nfetched over HTTP, without having a server that will allow cross\nsite scripting (`Access-Control-Allow-Origin: *`), will fail with a\n[CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) error.\n\nWe use the asset cache to bypass HTTP requests for images by instead serving the cached content.\n\n### <a name=\"build_cache\"></a> How do I populate the cache?\n\n* Make all changes necessary to add or update any SVG images\n* Run `./scripts/build-asset-cache.sh | pbcopy` to add an object literal to your paste buffer.\n* Paste object literal as `var assetMap = { ... }` in the [svg-assets-cache.js](../app/svg-assets-cache.js)\n* [Update](#update_cdn) the CDN with the new script\n* Commit [svg-assets-cache.js](../app/svg-assets-cache.js)\n\n### <a name=\"update_cdn\"></a> Update CodePen Asset Cache\n\nCDN is located on the CodePen PRO account.\n\n* Refer to the [instructions](https://blog.codepen.io/documentation/asset-hosting/#asset-manager)\n  on how to edit the `svg-assets-cache.js` file.\n* \"Edit\" and \"Save\" the `svg-assets-cache.js` file.\n  * This has been verified to work even though we no longer have a Pro account.\n* The URL should remain the same.\n* You will not be able to upload a new script since we no longer have a Pro account.\n\n## Deployment Considerations\n\nThe step to generate and deploy the `svg-assets-cache.js` is currently a\nmanual process. Keep in mind, you need to follow the steps for [building](#build_cache) and\n[updating](#update_cdn) the asset cache on the CDN when making any changes to a SVG image used by\na demo or, the docs site.\n"
  },
  {
    "path": "docs/guides/CODING.md",
    "content": "# Coding Conventions and Guidelines\n\n - [Project Structure](#structure)\n - [Coding Rules](#rules)\n\n\n## <a name=\"structure\"></a> Project Structure\n\nAll component modules are defined in:\n\n```text\n -- /src\n    -- /components\n       -- /<component folder>\n\n          -- <component>.js\n          -- <component>.spec.js\n          -- <component>.scss\n          -- <component>-theme.scss\n\n          -- /demo<name>\n\n             -- index.html\n             -- style.css\n             -- script.js\n```\n\nAll component modules are compiled and distributed individually to:\n\n```text\n -- /dist\n    -- /modules\n       -- /js\n          -- /core\n          -- /<component folder>\n```\n\nAdditionally, all component modules are compiled and deployed as a library to:\n\n```text\n -- /dist\n    -- angular.material.js\n    -- angular.material.css\n```\n\n> NOTE: the `dist` directory is **not** version controlled.\n\n<br/>\n\n## <a name=\"rules\"></a> Coding Rules\n\n#### Coding conventions:\n\nThe best guidance is a coding approach that implements both code and comments in a clear,\nunderstandable, concise, and DRY fashion.\n\nBelow is a sample code that demonstrates some of our rules and conventions:\n\n```js\n/**\n * @ngdoc module\n * @name material.components.slider\n */\nangular.module('material.components.slider', [\n  'material.core'\n])\n  .directive('mdSlider', SliderDirective);\n\n/**\n * @ngdoc directive\n * @name mdSlider\n * @module material.components.slider\n * @restrict E\n * @description\n * The `<md-slider>` component allows the user to choose from a range of values.\n *\n * It has two modes: 'normal' mode, where the user slides between a wide range of values, and\n * 'discrete' mode, where the user slides between only a few select values.\n *\n * To enable discrete mode, add the `md-discrete` attribute to a slider, and use the `step`\n * attribute to change the distance between values the user is allowed to pick.\n *\n * @usage\n * <h4>Normal Mode</h4>\n * <hljs lang=\"html\">\n *   <md-slider ng-model=\"myValue\"\n *              min=\"5\"\n *              max=\"500\">\n *   </md-slider>\n * </hljs>\n *\n * <h4>Discrete Mode</h4>\n * <hljs lang=\"html\">\n *   <md-slider md-discrete\n *              ng-model=\"myDiscreteValue\"\n *              step=\"10\"\n *              min=\"10\"\n *              max=\"130\">\n *   </md-slider>\n * </hljs>\n *\n * @param {boolean=} mdDiscrete Whether to enable discrete mode.\n * @param {number=} step The distance between values the user is allowed to pick. Default 1.\n * @param {number=} min The minimum value the user is allowed to pick. Default 0.\n * @param {number=} max The maximum value the user is allowed to pick. Default 100.\n */\nfunction SliderDirective($mdTheming) {\n  //...\n}\n\n```\n\n*  With the exceptions listed in this document, follow the rules contained in\n   [Google's JavaScript Style Guide](https://google.github.io/styleguide/javascriptguide.xml).\n*  All components must have unique, understandable module names; prefixed with\n   'material.components.'.\n*  All components must depend upon the 'material.core' module.\n*  Do not use `$inject` to annotate arguments.<br/>\n   ngAnnotate is used as part of the build process to automatically create the annotations.\n*  All public API methods **must** be documented with ngdoc, an extended version of jsdoc (we added\n   support for markdown and templating via @ngdoc tag). To see how we document our APIs, please\n   check out the existing ngdocs and see\n   [this wiki page](https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation).\n*  All directives must use the `md-` prefix for both the directive name and any directive\n   attributes.<br/>\n   Directive **templates** should be defined inline.\n\n\n#### Testing\n\n* All components must have valid, **passing** unit tests.\n* All features or bug fixes **must be tested** by one or more\n  [specs](https://docs.angularjs.org/guide/unit-testing).\n\n#### Coding\n\n* Wrap all code at **100 characters**.\n* Do not use tabs. Use two (2) spaces to represent a tab or indent.\n* Constructors are PascalCase, closures and variables are lowerCamelCase.\n* When enhancing or fixing existing code\n  * Do not reformat the author's code\n  * Conform to standards and practices used within that code; unless overridden by best practices or patterns.\n  * Provide jsDocs for functions and single-line comments for code blocks\n  * Be careful of regression errors introduce by your changes\n  * **Always** test your changes with unit tests and manual user testing.\n\n#### Patterns\n\n* All source files will be automatically wrapped inside an anonymous closure using the Module Pattern.\n* Use the **Revealing Pattern** as a coding style.\n* Do **not** use the global variable namespace, export our API explicitly via AngularJS DI.\n* Instead of complex inheritance hierarchies, use **simple** objects.\n* Avoid prototypal inheritance unless warranted by performance or other considerations.\n* We **love** functions and closures and, whenever possible, prefer them over objects.<br/>\n\n    > Do not use anonymous functions. All closures should be named.\n\n#### Documentation\n\n* All non-trivial functions should have a jsdoc description.\n* To write concise code that can be better minified, we **use aliases internally** that map to the\n  external API.\n* Use of argument **type annotations** for private internal APIs is not encouraged, unless it's an\n  internal API that is used throughout AngularJS Material.\n"
  },
  {
    "path": "docs/guides/COMMIT_LEVELS.md",
    "content": "## Understanding the Team Commit Process\nThe AngularJS Material team has a very specific process for change commits.\n\nOur commit process is intentionally restrictive to \n1. Support the evolution of AngularJS Material while avoiding unexpected breaking changes\n1. Manage change complexity and coding standards within the library\n\nAngularJS Material uses a \"Pull Request\" process to allow team leads opportunities to maintain\ncode reviews, ensure sanity checks, encourage coding standards, and provide feedback to help\ncontributors learn and improve.\n\n#### General Rules\n\n* Please **do not** commit directly to master; unless explicitly authorized by a Team Lead\n* Contributors should fork the repository and work on fixes or enhancements on their own fork.\n  * Use the Pull Request feature to submit your changes to the 'origin' AngularJS Material repository\n* When a developer has changes ready for merging into master, those fixes or updates must be submitted via a Pull Request\n* All PRs should be rebased (with master) and commits squashed prior to the final merge process\n* Please include unit tests with all your source (component or core) changes\n* All unit tests must be 100% passing before the PR will be approved/merged.\n\n#### Commit Authorization Rules\n\nThe development team has defined three (3) Github levels of **commit authorization** within \n[AngularJS Material](https://github.com/angular/material/):\n\n* **Contributors**: \n  * Developers in this group includes any team members not listed under Team Leads or Caretakers below\n  * For any and all changes, developers must use a feature branch from a fork of the AngularJS Material repository \n    * Please do not make or submit any changes from the master branch of your fork\n  * Are not authorized to merge PRs\n  * Should not reassign issues or change milestones\n  * Should ensure their issue labels are correct\n  * Should test their issues with the latest HEAD versions of AngularJS Material\n  * Should test their issues with the latest releases of AngularJS (1.7.x, 1.8.x)\n  * Should communicate with the Team Lead when their PRs are submitted or code review updates\n     are complete\n    * Should direct all questions about the status of presubmit testing to the Team Leads\n  * Should review PRs\n* **Team Leads**: \n  * Includes: [Michael Prentice](https://github.com/splaktar)\n  * Are not authorized to merge PRs\n  * Should assign issues and manage milestones\n  * Should ensure issue labels are correct\n  * Should review PRs\n    * Michael Prentice is the primary PR reviewer and approver\n    * Should confirm all CI tasks and CLA check passes\n  * Should process approved PRs\n    * Should verify that `merge safe` labels are accurate, then request Caretaker to merge\n    * Should request that a Caretaker starts Google presubmit tests when PRs are labeled\n      `merge ready` and do not have the `merge safe` label\n  * Should decide when to package and deploy new releases\n    * Should provider Caretaker with a reviewed and approved CHANGELOG\n* **Google Caretakers**:\n  * Includes: [Jeremy Elbourn](https://github.com/jelbourn), [Andrew Seguin](https://github.com/andrewseguin), [Miles Malerba](https://github.com/mmalerba)\n  * Rotate responsibilities by the week. Each week has a primary and backup Caretaker.\n  * Should review PRs\n    * Should confirm all CI tasks and CLA check passes\n  * Should start Google presubmit tests for `merge ready` PRs when requested by Team Leads\n    * Should report the status of the presubmit tests to the Team Leads and/or in the PR within 2 days\n  * Should merge PRs\n    * Should merge `merge ready` and `merge safe` PRs without running presubmit tests\n    * Should merge `merge ready` PRs after successful presubmit\n    * Should squash and merge PRs with multiple commits\n  * Should create new releases\n    * Should confirm new release CHANGELOGs with Team Leads\n    * Should create CLs to add release assets to the Google CDN\n    * Should notify Team Leads when CDN CLs are completed\n"
  },
  {
    "path": "docs/guides/MERGE_REQUESTS.md",
    "content": "## Merging a Pull Request\n\n* [Copy the PR into a local branch](#curl)\n* [Squashing everything into one commit](#squash)\n* [Dealing with Conflicts](#conflicts)\n* [Merging With Master](#merging)\n\n<hr/>\n\n### <a name=\"curl\"></a> Bringing a pull request into your local git\n\nTo bring in a pull request, first create a new branch for that pull request:\n\n```sh\ngit checkout -b wip-pr-143\n```\n\nThen run the following to bring all of the commits from that pull request\nin on top of your branch's local history:\n\n```sh\ncurl -L https://github.com/angular/material/pull/143.patch | git am -3\n```\n\nIf there are any conflicts, go to the [Dealing with conflicts](#conflicts) section below.\n\nIf the merge succeeds, use `git diff origin/master` to see all the new changes that will happen\npost-merge.\n\n### <a name=\"squash\"></a> Squashing everything into one commit\n\nBefore merging a pull request into master, make sure there is only one commit\nrepresenting the changes in the pull request, so the git log stays lean.\n\nWe will use git's interactive rebase to let us manipulate, merge, and rename\ncommits in our local history.\n\nTo interactively rebase all of your commits that occur after the latest in master, run:\n\n```sh\ngit rebase --interactive origin/master\n```\n\nThis will bring up an interactive dialog in your text editor. Follow the instructions\nto squash all of your commits into the top one, then rename the top one.\n\nOnce this is done, run `git log` and you will see only one commit after master, representing\neverything from the pull request.\n\nFinally, we'll pull from master with rebase to put all of our local commits on top of\nthe latest remote.\n\n```sh\ngit pull --rebase origin master\n```\n\nThis may cause conflicts, see below for how to deal with these.\n\n### <a name=\"conflicts\"></a> Dealing with conflicts\n\nRun the following to see which files are conflicted:\n\n```sh\ngit status\n```\n\nYou can open the conflicted files and fix them manually, or if the conflict isn't relevant, run:\n\n```sh\ngit checkout --theirs <file>\n```\n\nTo checkout *your local* version of the file.\n\n```sh\ngit checkout --ours <file>\n```\n\nTo checkout *their remote* version of the file. (yes, it's backwards).\n\nAfter all the conflicted files are fixed, run:\n\n```sh\ngit add -A\ngit rebase --continue\n```\n\nOr if you're pulling from `git am` and fixing conflicts, run:\n\n```sh\ngit add -A\ngit am --continue\n```\n\n### <a name=\"merging\"></a> Merging with master\n\nFinally, after you've squashed the whole pull request into one commit and made sure\nit has no conflicts with the latest master and tests are run, you're ready to merge it in.\n\nSimply go back to the master branch:\n\n```sh\ngit checkout master\n```\n\nMake sure you're up to date in the master branch too:\n\n```sh\ngit pull --rebase origin master\n```\n\nAnd finally, rebase your pull request in from your WIP pull request branch:\n\n```sh\ngit rebase wip-pr-143\n```\n\nThis will rebase the commits from wip-pr-143 into master.\n\nFinally, verify that tests pass and the docs look fine, and make sure\nthe commit message for the pull request closes the proper issues and lists\nbreaking changes.\n\nYou can amend the commit to change the message:\n\n```sh\ngit commit --amend\n```\n\nThis will open the latest commit in your text editor and allow you to add\ntext. Do **not** forget to add `Close #xxx` to also close the PR; in this case you will add\n`Close #143`.\n\nFor example:\n\n> fix(constant): rename $mdConstant.SOMETHING_ELSE to $mdConstant.SOMETHING\n\n> Close #143. Close #156.\n\n> BREAKING CHANGE: $mdConstant.SOMETHING_ELSE has been renamed to $mdConstant.SOMETHING.\n\n> Change your code from this:\n\n> ```js\n  $mdConstant.SOMETHING_ELSE\n> ```\n\n> To this:\n\n> ```js\n  $mdConstant.SOMETHING\n> ```\n\nFor more examples of how to format commit messages, see\n[the guidelines in CONTRIBUTING.md](../../.github/CONTRIBUTING.md#-git-commit-guidelines).\n\n```sh\ngit push origin master\n```\n\nLastly, be sure to cleanup any branches that you were using for this pull request.\n\n```sh\ngit branch -D wip-pr-143\n```\n"
  },
  {
    "path": "docs/guides/PULL_REQUESTS.md",
    "content": "### Submitting a Pull Request\nBefore you submit your pull request consider the following guidelines:\n\n* Search [GitHub](https://github.com/angular/material/pulls) for an open or closed Pull Request\n  that relates to your submission. You don't want to duplicate effort.\n\n* Please sign our [Contributor License Agreement (CLA)](../../.github/CONTRIBUTING.md#cla) before sending pull\n  requests. We cannot accept code without this.\n\n* Make your changes in a new git branch:\n\n     ```shell\n     git checkout -b wip/my-fix-branch master\n     ```\n\n* Follow our [Coding Rules](CODING.md#rules).\n\n* **Include appropriate test cases.**\n\n* Create your patch.\n\n* Run the full AngularJS Material test suite, as described in the [developer documentation](BUILD.md),\n  and ensure that all tests pass.\n\n* Commit your changes using a descriptive commit message that follows our\n  [commit message conventions](../../.github/CONTRIBUTING.md#commit-message-format). Adherence to the [commit message conventions](../../.github/CONTRIBUTING.md#commit-message-format) is required\n  because release notes are automatically generated from these messages.\n\n     ```shell\n     git commit -a\n     ```\n  Note: the optional commit `-a` command line option will automatically \"add\" and \"rm\" edited files.\n\n* Build your changes locally to ensure all the tests pass:\n\n    ```shell\n    npm run test:full\n    ```\n\n* Push your branch to GitHub:\n\n    ```shell\n    git push origin wip/my-fix-branch\n    ```\n\n* In GitHub, send a pull request to `angular:master`.\n\n* If we suggest changes then:\n  * Make the required updates.\n\n  * Re-run the AngularJS Material test suite to ensure tests are still passing.\n\n  * Commit your new changes by [ammending your original commit](https://help.github.com/articles/changing-a-commit-message/#amending-older-or-multiple-commit-messages) to **squash your commits**, then **force push** to your GitHub repository\n    (this will update your Pull Request):\n\n    ```shell\n    git commit -a --amend\n    git push --force origin wip/my-fix-branch\n    ```\n\n<br/>\n<hr/>\n\nThat's it... thank you for your contribution!\n\n<hr/>\n\n#### After your pull request is merged\n\nAfter your pull request is merged, you can safely delete your branch and pull the changes\nfrom the main (upstream) repository:\n\n* Delete the remote branch on GitHub either through a Git UI/IDE or your local shell as follows:\n\n    ```shell\n    git push origin --delete wip/my-fix-branch\n    ```\n\n* Check out the master branch:\n\n    ```shell\n    git checkout master -f\n    ```\n\n* Delete the local branch:\n\n    ```shell\n    git branch -D wip/my-fix-branch\n    ```\n\n* Update your master with the latest upstream version:\n\n    ```shell\n    git pull --ff upstream master\n    ```\n"
  },
  {
    "path": "docs/guides/THEMES_IMPL_NOTES.md",
    "content": "# Notes on AngularJS Material's theme implementation\n\n#### TL;DR\nYou configure themes with `$mdThemingProvider`. The CSS is then generated at run-time by\nthe `$mdTheming` service and appended to the document's `<head>`.\n\n## Explanation\n\n### At build time\n* All the styles associated with **color** are defined in a separate SCSS file of the form\n`xxx-theme.scss`.\n* Instead of using a hard-coded color or a SCSS variable, you define the colors with a mini-DSL\n  (described below).\n* The build process takes all of those `-theme.scss` files and globs them up into one enormous\nstring.\n* The build process wraps that string with code to set it as an AngularJS module constant:\n  ```\n    angular.module('material.core').constant('$MD_THEME_CSS', 'HUGE_THEME_STRING');\n  ```\n* That code gets dumped at the end of `angular-material.js`.\n\n### At run time\n* The user defines some themes with `$mdThemingProvider` during the module config phase.\n* At module run time, the theming service takes `$MD_THEME_CSS` and, for each theme, evaluates the\nmini-DSL, applies the colors for the theme, and appends the resulting CSS into the document head.\n\n### The mini-DSL\n* You write each color in the form `'{{palette-hue-contrast-opacity}}'`, where `hue`, `contrast`,\nand opacity are optional.\n* For example, `'{{primary-500}}'`.\n* Palettes are `primary`, `accent`, `warn`, `background`.\n* The hues for each type use the Material Design hues. When not specified, each palette defaults\n`hue` to `500` except for `background`.\n* The `opacity` value can be a decimal between 0 and 1 or one of the following values based on the\nhue's contrast type (dark, light, or strongLight):\n  * `icon`: icon (0.54 / 0.87 / 1.0)\n  * `secondary`: secondary text (0.54 / 0.87)\n  * `disabled`: disabled text or icon (0.38 / 0.54)\n  * `hint`: hint text (0.38 / 0.50)\n  * `divider`: divider (0.12)\n* `contrast` will give a contrast color (for text) and can be mixed with `opacity`.\nFor example, `accent-contrast` will be a contrast color for the accent color, for use as a text\ncolor on an accent-colored background. Adding an `opacity` value as in `accent-contrast-icon` will\napply the Material Design icon opacity. Using a decimal opacity value as in `accent-contrast-0.25`\nwill apply the contrast color for the accent color at 25% opacity.\n"
  },
  {
    "path": "docs/gulpfile.js",
    "content": "const gulp = require('gulp');\nconst Dgeni = require('dgeni');\nconst _ = require('lodash');\nconst concat = require('gulp-concat');\nconst fs = require('fs');\nconst gulpif = require('gulp-if');\nconst lazypipe = require('lazypipe');\nconst mkdirp = require('mkdirp');\nconst ngHtml2js = require('gulp-ng-html2js');\nconst path = require('path');\nconst sass = require('gulp-sass')(require('sass'));\nconst through2 = require('through2');\nconst uglify = require('gulp-uglify');\nconst utils = require('../scripts/gulp-utils.js');\nconst karma = require('karma').server;\nconst argv = require('minimist')(process.argv.slice(2));\nconst gutil = require('gulp-util');\nconst series = require('stream-series');\n\ngulp.task('demos', function() {\n  const demos = [];\n  return generateDemos()\n    .pipe(through2.obj(function(demo, enc, next) {\n      // Don't include file contents into the docs app,\n      // it saves space\n      demo.css.concat(demo.js).concat(demo.html).concat(demo.index)\n        .forEach(function(file) {\n          delete file.contents;\n        });\n      demos.push(demo);\n      next();\n    }, function(done) {\n      const demoIndex = _(demos)\n        .groupBy('moduleName')\n        .map(function(moduleDemos, moduleName) {\n          const componentName = moduleName.split('.').pop();\n          return {\n            name: componentName,\n            moduleName: moduleName,\n            label: utils.humanizeCamelCase(componentName),\n            demos: moduleDemos,\n            url: 'demo/' + componentName\n          };\n        })\n        .value();\n\n      const dest = path.resolve(__dirname, '../dist/docs/js');\n      const file = \"angular.module('docsApp').constant('DEMOS', \" +\n        JSON.stringify(demoIndex, null, 2) + \");\";\n      mkdirp.sync(dest);\n      fs.writeFileSync(dest + '/demo-data.js', file);\n\n      done();\n    }));\n});\n\nfunction generateDemos() {\n  return gulp.src('src/{components,services}/*/')\n    .pipe(through2.obj(function(folder, enc, next) {\n      const self = this;\n      const split = folder.path.split(path.sep);\n      const name = split.pop();\n      const moduleName = 'material.' + split.pop() + '.' + name;\n\n      utils.copyDemoAssets(name, 'src/components/', 'dist/docs/demo-partials/');\n\n      utils.readModuleDemos(moduleName, function(demoId) {\n        return lazypipe()\n          .pipe(gulpif, /^(?!.+global\\.).*css/, transformCss(demoId))\n          .pipe(gulp.dest, 'dist/docs/demo-partials/' + name)\n        ();\n      })\n        .on('data', function(demo) {\n          self.push(demo);\n        })\n        .on('end', next);\n\n      function transformCss(demoId) {\n        return lazypipe()\n          .pipe(through2.obj, function(file, enc, next) {\n            file.contents = Buffer.from(\n              '.' + demoId + ' {\\n' + file.contents.toString() + '\\n}'\n            );\n            next(null, file);\n          })\n          .pipe(sass)\n        ();\n      }\n    }));\n}\n\ngulp.task('docs-generate', ['build'], function() {\n  const dgeni = new Dgeni([\n    require('./config')\n  ]);\n  return dgeni.generate();\n});\n\ngulp.task('docs-app', ['docs-generate'], function() {\n  return gulp.src(['docs/app/**/*', '!docs/app/partials/**/*.html'])\n    .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-demo-scripts', ['demos'], function() {\n  return gulp.src('dist/docs/demo-partials/**/*.js')\n    .pipe(concat('docs-demo-scripts.js'))\n    .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-js-dependencies', ['build'], function() {\n  return gulp.src(['dist/angular-material.js', 'dist/angular-material.min.js', 'docs/app/contributors.json'])\n    .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-js', ['docs-app', 'docs-html2js', 'demos', 'build', 'docs-js-dependencies'], function() {\n  const preLoadJs = ['docs/app/js/preload.js'];\n  if (process.argv.indexOf('--jquery') !== -1) {\n    preLoadJs.push('node_modules/jquery/dist/jquery.js');\n  }\n\n  return series(\n    gulp.src([\n      'node_modules/angularytics/dist/angularytics.js',\n      'dist/docs/js/app.js', // Load the AngularJS module initialization at first.\n      'dist/docs/js/**/*.js'\n    ])\n      .pipe(concat('docs.js'))\n      .pipe(gulpif(!argv.dev, uglify())),\n    gulp.src(preLoadJs)\n      .pipe(concat('preload.js'))\n      .pipe(gulpif(!argv.dev, uglify()))\n  )\n  .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-css-dependencies', ['build'], function() {\n  return gulp.src([\n    'dist/angular-material.css',\n    'dist/angular-material.min.css'\n  ])\n  .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-css', ['docs-app', 'build', 'docs-css-dependencies'], function() {\n  return gulp.src([\n    'dist/themes/*.css',\n    'docs/app/css/highlightjs-material.css',\n    'docs/app/css/layout-demo.css',\n    'docs/app/css/style.css'\n  ])\n  .pipe(concat('docs.css'))\n  .pipe(utils.autoprefix())\n  .pipe(gulp.dest('dist/docs'));\n});\n\ngulp.task('docs-html2js', function() {\n  return gulp.src('docs/app/**/*.tmpl.html')\n    .pipe(ngHtml2js({\n      moduleName: 'docsApp',\n      declareModule: false\n    }))\n    .pipe(concat('docs-templates.js'))\n    .pipe(gulp.dest('dist/docs/js'));\n});\n\ngulp.task('docs-karma', ['docs-js'], function(done) {\n  const karmaConfig = {\n    singleRun: true,\n    autoWatch: false,\n    browsers: argv.browsers ? argv.browsers.trim().split(',') : ['Chrome'],\n    configFile: path.join(__dirname, '/../config/karma-docs.conf.js')\n  };\n\n  karma.start(karmaConfig, function(exitCode) {\n    if (exitCode !== 0) {\n      gutil.log(gutil.colors.red(\"Karma exited with the following exit code: \" + exitCode));\n      // eslint-disable-next-line no-process-exit\n      process.exit(exitCode);\n    }\n    done();\n  });\n});\n"
  },
  {
    "path": "docs/spec/codepen.spec.js",
    "content": "describe('CodepenDataAdapter', function() {\n\n  let codepenDataAdapter, demo, data, externalScripts;\n  beforeEach(module('docsApp'));\n\n  beforeEach(inject(function(_codepenDataAdapter_) {\n    codepenDataAdapter = _codepenDataAdapter_;\n  }));\n\n  beforeEach(function() {\n    externalScripts = [\n      'http://some-url-to-external-js-files-required-for-codepen'\n    ];\n\n    demo = {\n      id: 'spec-demo',\n      title: 'demo-title',\n      module: 'demo-module',\n      files: {\n        index: {\n          contents: '<div></div>'\n        },\n        html: [],\n        css: [\n          { contents: '.fake-class { color: red }' }\n        ],\n        js: [\n          { contents: 'angular.module(\"SomeOtherModule\", [\"Dependency1\"]);' }\n        ]\n      }\n    }\n  });\n\n  describe('#translate', function() {\n\n    describe('the most common usage', function() {\n      beforeEach(function() {\n        data = codepenDataAdapter.translate(demo, externalScripts);\n      });\n\n      it('provides the title of the codepen', function() {\n        expect(data.title).toBe(demo.title);\n      });\n\n      it('includes the core angular css', function() {\n\n        // NOTE: the release script replaces this localhost reference with\n        // 'https://gitcdn.link/repo/angular/bower-material/master/angular-material.css'\n\n        expect(data.css_external).toBe('http://localhost:8080/angular-material.css');\n      });\n\n      it('includes the external js files, including the asset cache required to serve svgs to codepen', function() {\n\n        const expected = [\n          'http://some-url-to-external-js-files-required-for-codepen',\n          'http://localhost:8080/angular-material.js',\n          'https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/assets-cache.js'\n        ].join(';');\n        expect(data.js_external).toBe(expected)\n      });\n\n      it('adds ng-app attribute to the index', function() {\n        expect(angular.element(data.html).attr('ng-app')).toBe('MyApp');\n      });\n\n      it('adds the demo id as a class attribute to the parent element on the index.html', function() {\n        expect(angular.element(data.html).hasClass(demo.id)).toBe(true);\n      });\n\n      it('replaces the demo module with the codepen module', function() {\n        expect(data.js).toBe(\"angular.module('MyApp');\");\n      });\n\n      it('includes the demo css', function() {\n        expect(data.css).toBe('.fake-class { color: red }');\n      });\n    });\n\n    describe('when html templates are included in the demo', function() {\n\n      let template, script;\n      beforeEach(function() {\n        template = {\n          name: 'template-name',\n          contents: \"<div class='foo'>{{bar}}</div>\"\n        };\n\n        demo.files.html.push(template);\n\n        data = codepenDataAdapter.translate(demo, externalScripts);\n\n        script = angular.element(data.html).find('script');\n      });\n\n      it('appends the template to the index', function() {\n        expect(script.html()).toBe(template.contents);\n      });\n\n      it('adds the ngTemplate to the script tag', function() {\n        expect(script.attr('type')).toBe('text/ng-template');\n      });\n\n      it('adds the template name as the id', function() {\n        expect(script.attr('id')).toBe(template.name);\n      });\n    });\n\n    describe('when the demo html includes a <code> block', function() {\n\n      it('escapes the ampersand, so that codepen does not unescape the angle brackets', function() {\n        demo.files.index.contents = '<div><code>&gt;md-autocomplete&lt;</code></div>';\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(angular.element(data.html).html()).toBe('<code>&amp;gt;md-autocomplete&amp;lt;</code>');\n      });\n\n      it('handles multiple code blocks', function() {\n        demo.files.index.contents = '<div><code>&gt;md-autocomplete&lt;</code><code>&gt;md-input&lt;</code></div>';\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(angular.element(data.html).html()).toBe('<code>&amp;gt;md-autocomplete&amp;lt;</code><code>&amp;gt;md-input&amp;lt;</code>');\n      });\n\n    });\n\n    describe('when the html example includes &nbsp;', function() {\n\n      it('escapes the ampersand, so that the codepen does not translate to an invalid character', function() {\n        demo.files.index.contents = '<div>&nbsp;&nbsp;</div>';\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(angular.element(data.html).html()).toBe('&amp;nbsp;&amp;nbsp;');\n      });\n    });\n\n    describe('when the module definition in the js file is formatted in different ways', function() {\n\n      it('handles second argument on a new line', function() {\n        const script = \"angular.module('test',\\n \\\n[]);\";\n        demo.files.js = [{ contents: script }];\n\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(data.js).toBe(\"angular.module('MyApp');\");\n      });\n\n      it('handles dependencies on new lines', function() {\n        const script = \"angular.module('test', [\\n \\\n'Dep1',\\n \\\n'Dep2',\\n \\\n]);\";\n        demo.files.js = [{ contents: script }];\n\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(data.js).toBe(\"angular.module('MyApp');\");\n      });\n\n      it('handles module on a new line', function() {\n        const script = \"angular\\n\\\n.module('test', [\\n \\\n'Dep1',\\n \\\n'Dep2',\\n \\\n]);\";\n        demo.files.js = [{ contents: script }];\n\n        data = codepenDataAdapter.translate(demo, externalScripts);\n        expect(data.js).toBe(\"angular\\n\\\n.module('MyApp');\");\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "docs/spec/demo.spec.js",
    "content": "describe('docsDemo', function() {\n\n  beforeEach(module('docsApp', 'ngMaterial'));\n\n  var codepen, element, $httpBackend, demoModel;\n\n  beforeEach(inject(function($rootScope, $compile, $q, _codepen_, _$httpBackend_) {\n    codepen = _codepen_;\n    $httpBackend = _$httpBackend_;\n\n    spyOn(codepen, 'editOnCodepen');\n\n    stubHttpRequestsForImages();\n\n    var filePromise = $q.defer();\n\n    filePromise.resolve('<div class=\"my-amazing-demo\"></div>');\n\n    $rootScope.demo = demoModel = {\n      id: 'id',\n      name: 'name',\n      moduleName: 'moduleName',\n      $files: [\n        { name: 'index.html', httpPromise: filePromise.promise }\n      ]\n    };\n\n    element = $compile(\"<docs-demo demo-id='1234' demo-title='basic-usage' demo-module='foo-module'><demo-file ng-repeat='file in demo.$files' name='index.html' contents='file.httpPromise'></demo-file></docs-demo>\")($rootScope);\n\n    $rootScope.$digest();\n  }));\n\n  describe('clicking the edit on codepen button', function() {\n\n    beforeEach(function() {\n      var codepenButton = element.find('button').eq(1);\n      codepenButton.triggerHandler({type: 'click'});\n    });\n\n    it('sends codepen the demo information', function() {\n      expect(codepen.editOnCodepen).toHaveBeenCalled();\n    });\n\n    describe('demo information supplied to codepen', function() {\n\n      var demo;\n      beforeEach(function() {\n        demo = codepen.editOnCodepen.calls.mostRecent().args[0];\n      });\n\n      it('includes the title of the demo', function() {\n        expect(demo.title).toBe('basic-usage');\n      });\n\n      it('includes the demo id', function() {\n        expect(demo.id).toBe('1234');\n      });\n\n      it('includes the module name', function() {\n        expect(demo.module).toBe('foo-module');\n      });\n\n      it('includes the files for the demo', function() {\n        var index = demo.files.index;\n        expect(index.name).toBe('HTML');\n        expect(index.fileType).toBe('html');\n        expect(index.contents).toBe('<div class=\"my-amazing-demo\"></div>');\n      });\n    });\n  });\n\n  function stubHttpRequestsForImages() {\n    $httpBackend.whenGET('img/icons/ic_visibility_24px.svg').respond('');\n    $httpBackend.expectGET('img/icons/ic_visibility_24px.svg');\n    $httpBackend.whenGET('img/icons/codepen-logo.svg').respond('');\n    $httpBackend.expectGET('img/icons/codepen-logo.svg');\n  }\n});\n"
  },
  {
    "path": "gulp/.jshintrc",
    "content": "{\n  \"sub\": true,\n  \"multistr\": true,\n  \"-W018\": true,\n  \"expr\": true,\n  \"boss\": true,\n  \"laxbreak\": true,\n  \"esversion\": 9,\n  \"predef\": [\"angular\"]\n}\n"
  },
  {
    "path": "gulp/config.js",
    "content": "const argsVersion = require('minimist')(process.argv.slice(2)).version;\nconst currentVersion = require('../package.json').version;\nconst VERSION = argsVersion || currentVersion;\n\nmodule.exports = {\n  banner:\n  '/*!\\n' +\n  ' * AngularJS Material Design\\n' +\n  ' * https://github.com/angular/material\\n' +\n  ' * @license MIT\\n' +\n  ' * v' + VERSION + '\\n' +\n  ' */\\n',\n  jsCoreFiles: [\n    'src/core/*.js',\n    'src/core/util/autofocus.js',\n    'src/core/util/color.js',\n    'src/core/util/constant.js',\n    'src/core/util/iterator.js',\n    'src/core/util/media.js',\n    'src/core/util/prefixer.js',\n    'src/core/util/util.js',\n    'src/core/util/animation/animate.js',\n    'src/core/util/animation/animateCss.js',\n    'src/core/services/aria/*.js',\n    'src/core/services/compiler/*.js',\n    'src/core/services/gesture/*.js',\n    'src/core/services/interaction/*.js',\n    'src/core/services/interimElement/*.js',\n    'src/core/services/layout/*.js',\n    'src/core/services/liveAnnouncer/*.js',\n    'src/core/services/meta/*.js',\n    'src/core/services/registry/*.js',\n    'src/core/services/ripple/button_ripple.js',\n    'src/core/services/ripple/checkbox_ripple.js',\n    'src/core/services/ripple/list_ripple.js',\n    'src/core/services/ripple/ripple.js',\n    'src/core/services/ripple/tab_ripple.js',\n    'src/core/services/theming/theme.palette.js',\n    'src/core/services/theming/theming.js'\n  ],\n  jsHintFiles: [\n    'src/**/*.js',\n    '!src/**/*.spec.js'\n  ],\n  componentPaths: [\n    'src/components/autocomplete',\n    'src/components/backdrop',\n    'src/components/bottomSheet',\n    'src/components/button',\n    'src/components/card',\n    'src/components/checkbox',\n    'src/components/chips',\n    'src/components/colors',\n    'src/components/content',\n    'src/components/datepicker',\n    'src/components/dialog',\n    'src/components/divider',\n    'src/components/fabActions',\n    'src/components/fabSpeedDial',\n    'src/components/fabToolbar',\n    'src/components/gridList',\n    'src/components/icon',\n    'src/components/input',\n    'src/components/list',\n    'src/components/menu',\n    'src/components/menuBar',\n    'src/components/navBar',\n    'src/components/panel',\n    'src/components/progressCircular',\n    'src/components/progressLinear',\n    'src/components/radioButton',\n    'src/components/select',\n    'src/components/showHide',\n    'src/components/sidenav',\n    'src/components/slider',\n    'src/components/sticky',\n    'src/components/subheader',\n    'src/components/swipe',\n    'src/components/switch',\n    'src/components/tabs',\n    'src/components/toast',\n    'src/components/toolbar',\n    'src/components/tooltip',\n    'src/components/truncate',\n    'src/components/virtualRepeat',\n    'src/components/whiteframe'\n  ],\n  inputVariables: 'src/components/input/_input-variables.scss',\n  mockFiles: [\n    'test/angular-material-mocks.js'\n  ],\n  themeBaseFiles: [\n    'src/core/style/_variables.scss',\n    'src/core/style/_mixins.scss'\n  ],\n  themeCore: 'src/core/style/core-theme.scss',\n  scssModules: 'src/core/style/_modules.scss',\n  scssBaseFiles: [\n    'src/core/style/_modules.scss',\n    'src/core/style/_variables.scss',\n    'src/components/input/_input-variables.scss',\n    'src/core/style/_mixins.scss',\n    'src/core/style/structure.scss',\n    'src/core/style/typography.scss',\n    'src/core/style/layout.scss',\n    'src/components/panel/*.scss'\n  ],\n  scssServicesLayout: 'src/core/services/layout/layout.scss',\n  scssLayoutFiles: [\n    'src/core/style/_modules.scss',\n    'src/core/style/_variables.scss',\n    'src/core/style/_mixins.scss',\n    'src/core/style/layout.scss',\n    'src/core/services/layout/layout.scss'\n  ],\n  scssLayoutAttributeFiles: [\n    'src/core/style/_modules.scss',\n    'src/core/style/_variables.scss',\n    'src/core/style/_mixins.scss',\n    'src/core/services/layout/layout-attributes.scss'\n  ],\n  scssComponentPaths: [\n    'src/components/autocomplete',\n    'src/components/backdrop',\n    'src/components/bottomSheet',\n    'src/components/button',\n    'src/components/card',\n    'src/components/checkbox',\n    'src/components/chips',\n    'src/components/content',\n    'src/components/datepicker',\n    'src/components/dialog',\n    'src/components/divider',\n    'src/components/fabSpeedDial',\n    'src/components/fabToolbar',\n    'src/components/gridList',\n    'src/components/icon',\n    'src/components/input',\n    'src/components/list',\n    'src/components/menu',\n    'src/components/menuBar',\n    'src/components/navBar',\n    // panel is included in scssBaseFiles above\n    'src/components/progressCircular',\n    'src/components/progressLinear',\n    'src/components/radioButton',\n    'src/components/select',\n    'src/components/sidenav',\n    'src/components/slider',\n    'src/components/sticky',\n    'src/components/subheader',\n    'src/components/swipe',\n    'src/components/switch',\n    'src/components/tabs',\n    'src/components/toast',\n    'src/components/toolbar',\n    'src/components/tooltip',\n    'src/components/truncate',\n    'src/components/virtualRepeat',\n    'src/components/whiteframe'\n  ],\n  cssIEPaths: ['src/**/ie_fixes.css'],\n  outputDir: 'dist/'\n};\n"
  },
  {
    "path": "gulp/const.js",
    "content": "const config = require('./config');\nconst path = require('path');\nconst args = require('minimist')(process.argv.slice(2));\nconst utils = require('../scripts/gulp-utils.js');\nconst version = require('../package.json').version;\n\nexports.ROOT       = path.normalize(path.join(__dirname, '/..'));\nexports.VERSION    = args.version || version;\nexports.LR_PORT    = args.port || args.p || 8080;\nexports.IS_DEV     = args.dev;\nexports.SHA        = args.sha;\nexports.BUILD_MODE = getBuildMode();\n\nfunction getBuildMode () {\n  const mode = (args.module || args.m || args.c) ? 'demos' : args.mode;\n  switch (mode) {\n    case 'closure': return {\n      name: 'closure',\n      transform: utils.addClosurePrefixes,\n      outputDir: path.join(config.outputDir, 'modules/closure') + path.sep,\n      useBower: false\n    };\n    case 'demos': return {\n      name: 'demos',\n      transform: utils.addJsWrapper,\n      outputDir: path.join(config.outputDir, 'demos') + path.sep,\n      useBower: false\n    };\n    default: return {\n      name: 'default',\n      transform: utils.addJsWrapper,\n      outputDir: path.join(config.outputDir, 'modules/js') + path.sep,\n      useBower: true\n    };\n  }\n}\n"
  },
  {
    "path": "gulp/tasks/build-all-modules.js",
    "content": "const BUILD_MODE = require('../const').BUILD_MODE;\n\nconst gulp = require('gulp');\nconst path = require('path');\nconst through2 = require('through2');\nconst series = require('stream-series');\nconst util = require('../util');\n\nexports.task = function() {\n  const isRelease = process.argv.indexOf('--release') !== -1;\n  return gulp.src(['src/core/', 'src/components/*'])\n      .pipe(through2.obj(function(folder, enc, next) {\n        const moduleId = folder.path.indexOf('components') > -1\n            ? 'material.components.' + path.basename(folder.path)\n            : 'material.' + path.basename(folder.path);\n        const stream = isRelease ?\n            series(\n              util.buildModule(moduleId, { minify: true, useBower: BUILD_MODE.useBower }),\n              util.buildModule(moduleId, {})\n            ) : util.buildModule(moduleId, {});\n        stream.on('end', function() { next(); });\n      }))\n      .pipe(BUILD_MODE.transform());\n};\n"
  },
  {
    "path": "gulp/tasks/build-contributors.js",
    "content": "const child_process = require('child_process');\nconst os = require('os');\nconst path = require('path');\n\n(function () {\n  'use strict';\n\n  /**\n   * Note 'githubcontrib' may require an application-scoped access token defined as\n   * GITHUB_API_TOKEN in your ENV.\n   */\n  exports.task = function () {\n    const appPath = 'dist/docs';\n\n    if (os.platform() === 'win32') {\n      const contributorsPath = path.join(process.cwd(), appPath, 'contributors.json');\n      child_process.execSync('del /f /q ' + contributorsPath);\n      process.chdir('./node_modules/.bin');\n      child_process.execSync('githubcontrib.cmd --owner angular --repo material --cols 6' +\n        ' --format json --showlogin true --sha master --sortOrder desc > '\n        + contributorsPath);\n      process.chdir('../..');\n    } else {\n      child_process.execSync('rm -f ' + appPath + '/contributors.json');\n      exec([\n        './node_modules/.bin/githubcontrib --owner angular --repo material --cols 6 --format json' +\n        ' --showlogin true --sha master --sortOrder desc > ' + appPath + '/contributors.json'\n      ]);\n    }\n  };\n  exports.dependencies = ['docs-js'];\n\n  /** utility method for executing terminal commands */\n  function exec (cmd, userOptions) {\n    if (cmd instanceof Array) {\n      return cmd.map(function (cmd) { return exec(cmd, userOptions); });\n    }\n    try {\n      const options = { } ;\n      for (const key in userOptions) options[ key ] = userOptions[ key ];\n      return child_process.execSync(cmd + ' 2> /dev/null', options).toString().trim();\n    } catch (err) {\n      return err;\n    }\n  }\n})();\n"
  },
  {
    "path": "gulp/tasks/build-demo.js",
    "content": "const util = require('../util');\n\nexports.dependencies = ['build', 'build-module-demo'];\n\nexports.task = function() {\n  return util.buildModule(util.readModuleArg());\n};\n"
  },
  {
    "path": "gulp/tasks/build-js.js",
    "content": "const util = require('../util');\n\nexports.task = function() {\n  return util.buildJs();\n};\n"
  },
  {
    "path": "gulp/tasks/build-module-demo.js",
    "content": "const BUILD_MODE = require('../const').BUILD_MODE;\nconst ROOT = require('../const').ROOT;\n\nconst gulp = require('gulp');\nconst gutil = require('gulp-util');\nconst fs = require('fs');\nconst path = require('path');\nconst through2 = require('through2');\nconst lazypipe = require('lazypipe');\nconst sass = require('gulp-sass')(require('sass'));\nconst gulpif = require('gulp-if');\nconst _ = require('lodash');\n\nconst util = require('../util');\nconst utils = require('../../scripts/gulp-utils.js');\n\nexports.task = function() {\n  const mod = util.readModuleArg();\n  const name = mod.split('.').pop();\n  const demoIndexTemplate = fs.readFileSync(\n    ROOT + '/docs/config/template/demo-index.template.html', 'utf8'\n  ).toString();\n\n  gutil.log('Building demos for', mod, '...');\n\n  return utils.readModuleDemos(mod, function() {\n    return lazypipe()\n    .pipe(gulpif, /.css$/, sass())\n    .pipe(gulpif, /.css$/, util.autoprefix())\n    .pipe(gulp.dest, BUILD_MODE.outputDir + name)\n    ();\n  })\n  .pipe(through2.obj(function(demo, enc, next) {\n    fs.writeFileSync(\n      path.resolve(BUILD_MODE.outputDir, name, demo.name, 'index.html'),\n      _.template(demoIndexTemplate)(demo)\n    );\n    next();\n  }));\n};\n"
  },
  {
    "path": "gulp/tasks/build-scss.js",
    "content": "const config = require('../config');\nconst gulp = require('gulp');\nconst gutil = require('gulp-util');\nconst rename = require('gulp-rename');\nconst filter = require('gulp-filter');\nconst concat = require('gulp-concat');\nconst series = require('stream-series');\nconst util = require('../util');\nconst sassUtils = require('../../scripts/gulp-utils');\nconst sass = require('gulp-sass')(require('sass'));\nconst insert = require('gulp-insert');\nconst gulpif = require('gulp-if');\nconst minifyCss = util.minifyCss;\nconst args = util.args;\nconst IS_DEV = require('../const').IS_DEV;\nconst path = require('path');\n\nexports.task = function() {\n  const streams = [];\n  const modules = args.modules,\n    overrides = args.override,\n    dest = args['output-dir'] || config.outputDir,\n    layoutDest = dest + 'layouts/';\n\n  gutil.log(\"Building css files...\");\n\n  // create SCSS file for distribution\n  streams.push(\n    gulp.src(getPaths())\n    .pipe(util.filterNonCodeFiles())\n    .pipe(filter(['**', '!**/*.css']))\n    .pipe(filter(['**', '!**/*-theme.scss']))\n    .pipe(filter(['**', '!**/*-attributes.scss']))\n    .pipe(concat('angular-material.scss'))\n    .pipe(insert.prepend(config.banner))\n    .pipe(gulp.dest(dest))                        // raw uncompiled SCSS\n    .pipe(sass())\n    .pipe(util.dedupeCss())\n    .pipe(util.autoprefix())\n    .pipe(gulp.dest(dest))                        // unminified\n    .pipe(gulpif(!IS_DEV, minifyCss()))\n    .pipe(gulpif(!IS_DEV, util.dedupeCss()))\n    .pipe(rename({extname: '.min.css'}))\n    .pipe(gulp.dest(dest))                        // minified\n  );\n\n  streams.push(\n    gulp.src(config.cssIEPaths.slice())         // append raw CSS for IE Fixes\n    .pipe(concat('angular-material.layouts.ie_fixes.css'))\n    .pipe(gulp.dest(layoutDest))\n  );\n\n  // Generate standalone SCSS (and CSS) file for Layouts API\n  // The use of these classnames is automated but requires\n  // the Javascript module `material.core.layout`\n  //  > (see src/core/services/layout.js)\n  // NOTE: this generated css is ALSO appended to the published\n  //       angular-material.css file\n\n  streams.push(\n    gulp.src(config.scssLayoutFiles)\n    .pipe(concat('angular-material.layouts.scss'))\n    .pipe(sassUtils.hoistScssVariables())\n    .pipe(insert.prepend(config.banner))\n    .pipe(gulp.dest(layoutDest))      // raw uncompiled SCSS\n    .pipe(sass())\n    .pipe(util.dedupeCss())\n    .pipe(util.autoprefix())\n    .pipe(rename({extname: '.css'}))\n    .pipe(gulp.dest(layoutDest))\n    .pipe(gulpif(!IS_DEV, minifyCss()))\n    .pipe(gulpif(!IS_DEV, util.dedupeCss()))\n    .pipe(rename({extname: '.min.css'}))\n    .pipe(gulp.dest(layoutDest))\n  );\n\n  // Generate the Layout-Attributes SCSS and CSS files\n  // These are intended to allow usages of the Layout styles\n  // without:\n  //  * use of the Layout directives and classnames, and\n  //  * Layout module `material.core.layout`\n\n  streams.push(\n    gulp.src(config.scssLayoutAttributeFiles)\n    .pipe(concat('angular-material.layout-attributes.scss'))\n    .pipe(sassUtils.hoistScssVariables())\n    .pipe(gulp.dest(layoutDest))     // raw uncompiled SCSS\n    .pipe(sass())\n    .pipe(util.dedupeCss())\n    .pipe(util.autoprefix())\n    .pipe(rename({extname: '.css'}))\n    .pipe(insert.prepend(config.banner))\n    .pipe(gulp.dest(layoutDest))\n    .pipe(gulpif(!IS_DEV, minifyCss()))\n    .pipe(gulpif(!IS_DEV, util.dedupeCss()))\n    .pipe(rename({extname: '.min.css'}))\n    .pipe(gulp.dest(layoutDest))\n  );\n\n  return series(streams);\n\n  /**\n   * @returns {string[]} array of SCSS file paths used in the build\n   */\n  function getPaths() {\n    const paths = config.scssBaseFiles.slice(0);\n    if (modules) {\n      paths.push.apply(paths, modules.split(',').map(function(module) {\n        return 'src/components/' + module + '/*.scss';\n      }));\n    } else {\n      config.scssComponentPaths.forEach(component => paths.push(path.join(component, '*.scss')));\n      paths.push(config.scssServicesLayout);\n    }\n    overrides && paths.unshift(overrides);\n    return paths;\n  }\n};\n"
  },
  {
    "path": "gulp/tasks/build.js",
    "content": "exports.dependencies = ['build-scss', 'build-js'];\n"
  },
  {
    "path": "gulp/tasks/changelog.js",
    "content": "const fs = require('fs');\nconst changelog = require('conventional-changelog');\nconst ROOT = require('../const').ROOT;\nconst SHA = require('../const').SHA;\nconst VERSION = require('../const').VERSION;\nconst addStream = require('add-stream');\nconst path = require('path');\nconst spawnSync = require('child_process').spawnSync;\nconst chalk = require('gulp-util').colors;\nconst log = require('gulp-util').log;\n\nexports.task = function () {\n\n  const changelogPath = path.join(ROOT, 'CHANGELOG.md');\n  const inputStream = fs.createReadStream(changelogPath);\n  const previousTag = getLatestTag();\n  const currentTag = 'v' + VERSION;\n\n  /* Validate different fork points for the changelog generation */\n  if (previousTag.name === currentTag && !SHA) {\n    log(chalk.yellow('Warning: You are generating a changelog by comparing the same versions.'));\n  } else if (SHA) {\n    log('Generating changelog from commit ' + getShortSha(SHA) + '...');\n  } else {\n    const shortSha = getShortSha(previousTag.sha);\n    log('Generating changelog from tag ' + previousTag.name + ' (' + shortSha + ')');\n  }\n\n  const contextOptions = {\n    version: VERSION,\n    previousTag: previousTag.name,\n    currentTag: currentTag\n  };\n\n  /* Create our changelog and append the current changelog stream. */\n  const changelogStream = changelog({ preset: 'angular' }, contextOptions, {\n    from: SHA || previousTag.sha\n  }).pipe(addStream(inputStream));\n\n\n  /* Wait for the changelog to be ready and overwrite it. */\n  inputStream.on('end', function() {\n    changelogStream.pipe(fs.createWriteStream(changelogPath));\n  });\n\n};\n\n/**\n * Resolves the latest tag over all branches from the repository metadata.\n * @returns {{sha: string, name: string}}\n */\nfunction getLatestTag() {\n  const tagSha = spawnSync('git', ['rev-list', '--tags', '--max-count=1']).stdout.toString().trim();\n  const tagName =  spawnSync('git', ['describe', '--tags', tagSha]).stdout.toString().trim();\n\n  return {\n    sha: tagSha,\n    name: tagName\n  };\n}\n\n/**\n * Transforms a normal SHA-1 into a 7-digit SHA.\n * @returns {string} shortened SHA\n */\nfunction getShortSha(sha) {\n  return sha.substring(0, 7);\n}\n"
  },
  {
    "path": "gulp/tasks/ddescribe-iit.js",
    "content": "const gulp = require('gulp');\nconst PluginError = require('gulp-util').PluginError;\nconst path = require('path');\nconst through2 = require('through2');\n\nconst kDisallowedFunctions = [\n  // Allow xit/xdescribe --- disabling tests is okay\n  'fit',\n  'iit',\n  'fdescribe',\n  'ddescribe',\n  'describe.only',\n  'it.only'\n];\n\nfunction disallowedIndex(largeString, disallowedString) {\n  const notFunctionName = '[^A-Za-z0-9$_]';\n  const regex = new RegExp('(^|' + notFunctionName + ')(' + disallowedString + ')' + notFunctionName + '*\\\\(', 'gm');\n  const match = regex.exec(largeString);\n  // Return the match accounting for the first submatch length.\n  return match != null ? match.index + match[1].length : -1;\n}\n\nfunction checkFile(fileContents, disallowed) {\n  let res = void 0;\n  if (Array.isArray(disallowed)) {\n    disallowed.forEach(function(str) {\n      const index = disallowedIndex(fileContents, str);\n      if (index !== -1) {\n        res = res || [];\n        res.push({\n          str: str,\n          line: fileContents.substr(0, index).split('\\n').length,\n          index: index\n        });\n      }\n    });\n  }\n  return res;\n}\n\nexports.task = function() {\n  let failures = void 0;\n  return gulp.src(['src/**/*.spec.js', 'test/**/*-spec.js'])\n      .pipe(through2.obj(function(file, enc, next) {\n        const errors = checkFile(file.contents.toString(), kDisallowedFunctions);\n        if (errors) {\n          failures = failures || [];\n          failures.push({\n            file: file,\n            contents: file.contents.toString(),\n            errors: errors\n          });\n        }\n        next();\n      }, function(callback) {\n        if (failures) {\n          this.emit('error', new PluginError('ddescribe-iit', {\n            message: '\\n' + failures.map(function(failure) {\n              const filename = path.relative(process.cwd(), failure.file.path);\n              const lines = failure.contents.split('\\n');\n              let start = 0;\n              const starts = lines.map(function(line) { const s = start; start += line.length + 1; return s; });\n              return failure.errors.map(function(error) {\n                const line = lines[error.line - 1];\n                const start = starts[error.line - 1];\n                const col = (error.index - start);\n                return '  `' + error.str + '` found at ' +filename + ':' + error.line + ':' + (col+1) + '\\n' +\n                       '      ' + line + '\\n' +\n                       '      ' + repeat(' ', col) + repeat('^', error.str.length);\n                function repeat(c, len) {\n                  let s = '';\n                  if (len > 0) {\n                    for (let i = 0; i < len; ++i) {\n                      s += c;\n                    }\n                  }\n                  return s;\n                }\n              }).join('\\n\\n');\n            }).join('\\n\\n'),\n            showStack: false\n          }));\n        }\n        callback();\n      }));\n};\n"
  },
  {
    "path": "gulp/tasks/default.js",
    "content": "exports.dependencies = ['build'];\n"
  },
  {
    "path": "gulp/tasks/docs.js",
    "content": "const gulp = require('gulp');\nconst connect = require('gulp-connect');\nconst constants = require('../const');\nconst IS_DEV = constants.IS_DEV;\n\nif (IS_DEV) {\n  exports.dependencies = ['docs-js', 'docs-css', 'docs-demo-scripts'];\n} else {\n  exports.dependencies = ['docs-js', 'docs-css', 'docs-demo-scripts', 'build-contributors'];\n}\n\nexports.task = function () { gulp.src('.').pipe(connect.reload()); };\n"
  },
  {
    "path": "gulp/tasks/jshint.js",
    "content": "const config = require('../config');\nconst gulp = require('gulp');\nconst jshint = require('gulp-jshint');\n\nexports.task = function() {\n  return gulp.src(config.jsHintFiles)\n      .pipe(jshint('.jshintrc'))\n      .pipe(jshint.reporter('jshint-summary', {\n        fileColCol: ',bold',\n        positionCol: ',bold',\n        codeCol: 'green,bold',\n        reasonCol: 'cyan'\n      }))\n      .pipe(jshint.reporter('fail'));\n};\n"
  },
  {
    "path": "gulp/tasks/karma-fast.js",
    "content": "const gutil = require('gulp-util');\nconst util = require('../util');\nconst ROOT = require('../const').ROOT;\nconst karma = require('karma');\nconst parseConfig = karma.config.parseConfig;\nconst Server = karma.Server;\nconst karmaOptions = {\n  logLevel: 'warn',\n  singleRun: true,\n  autoWatch: false\n};\n\nconst args = util.args;\n\n/**\n * NOTE: `karma-fast` does NOT pre-make a full build of JS and CSS\n */\nexports.task = function(done) {\n  // NOTE: `karma-fast` does NOT test Firefox by default.\n  if (args.browsers) {\n    karmaOptions.browsers = args.browsers.trim().split(',');\n  }\n\n  if (args.reporters) {\n    karmaOptions.reporters = args.reporters.trim().split(',');\n  }\n\n  gutil.log('Running unit tests on unminified source.');\n\n  parseConfig(ROOT + '/config/karma.conf.js', karmaOptions, {\n    promiseConfig: true,\n    throwErrors: true\n  }).then(parsedKarmaConfig => {\n    const server = new Server(parsedKarmaConfig, function(exitCode) {\n      if (exitCode !== 0) {\n        gutil.log(gutil.colors.red('Karma exited with the following exit code: ' + exitCode));\n      }\n      process.env.KARMA_TEST_COMPRESSED = undefined;\n      process.env.KARMA_TEST_JQUERY = undefined;\n      // eslint-disable-next-line no-process-exit\n      process.exit(exitCode);\n    });\n    gutil.log('Starting Karma Server...');\n    server.start();\n  });\n};\n"
  },
  {
    "path": "gulp/tasks/karma-sauce.js",
    "content": "const ROOT = require('../const').ROOT;\nconst karma = require('karma');\nconst parseConfig = karma.config.parseConfig;\nconst Server = karma.Server;\nconst karmaOptions = {\n  logLevel: 'warn'\n};\n\nexports.task = function(done) {\n  parseConfig(ROOT + '/config/karma-sauce.conf.js', karmaOptions, {\n    promiseConfig: true,\n    throwErrors: true\n  }).then(parsedKarmaConfig => {\n    const server = new Server(parsedKarmaConfig, function(exitCode) {\n      // Immediately exit the process if Karma reported errors, because due to\n      // potential still running tunnel-browsers gulp won't exit properly.\n      // eslint-disable-next-line no-process-exit\n      exitCode === 0 ? done() : process.exit(exitCode);\n    });\n    server.start();\n  });\n};\n"
  },
  {
    "path": "gulp/tasks/karma-watch.js",
    "content": "const ROOT = require('../const').ROOT;\nconst args = require('../util').args;\nconst karma = require('karma');\nconst parseConfig = karma.config.parseConfig;\nconst Server = karma.Server;\nconst karmaOptions = {\n  singleRun: false,\n  autoWatch: true,\n  browsers: args.browsers ? args.browsers.trim().split(',') : ['Chrome']\n};\n\n// Make full build of JS and CSS\nexports.dependencies = ['build'];\n\nexports.task = function(done) {\n  let karmaConfigPath = ROOT + '/config/karma.conf.js';\n  if (args.config)\n    karmaConfigPath = ROOT + '/' + args.config.trim();\n  parseConfig(karmaConfigPath, karmaOptions, {promiseConfig: true, throwErrors: true})\n      .then(parsedKarmaConfig => {\n        const server = new Server(parsedKarmaConfig, function(exitCode) {\n          // Immediately exit the process if Karma reported errors, because due to\n          // potential still running tunnel-browsers gulp won't exit properly.\n          // eslint-disable-next-line no-process-exit\n          exitCode === 0 ? done() : process.exit(exitCode);\n        });\n        server.start();\n      });\n};\n"
  },
  {
    "path": "gulp/tasks/karma.js",
    "content": "const gutil = require('gulp-util');\nconst util = require('../util');\nconst ROOT = require('../const').ROOT;\nconst args = util.args;\nconst karma = require('karma');\nconst parseConfig = karma.config.parseConfig;\nconst Server = karma.Server;\n\nconst karmaOptions = {\n  logLevel: 'warn'\n};\n\n// Make full build of JS and CSS\nexports.dependencies = ['build'];\n\nexports.task = function(done) {\n  let karmaConfigPath = ROOT + '/config/karma.conf.js';\n  if (args.browsers)\n    karmaOptions.browsers = args.browsers.trim().split(',');\n  if (args.reporters)\n    karmaOptions.reporters = args.reporters.trim().split(',');\n  if (args.config)\n    karmaConfigPath = ROOT + '/' + args.config.trim();\n\n  gutil.log(gutil.colors.blue('Running unit tests on unminified source.'));\n\n  parseConfig(karmaConfigPath, karmaOptions, {promiseConfig: true, throwErrors: true})\n      .then(parsedKarmaConfig => {\n        const server = new Server(parsedKarmaConfig, function(exitCode) {\n          // Immediately exit the process if Karma reported errors, because due to\n          // potential still running tunnel-browsers gulp won't exit properly.\n          // eslint-disable-next-line no-process-exit\n          exitCode === 0 ? done() : process.exit(exitCode);\n        });\n        server.start();\n      });\n};\n"
  },
  {
    "path": "gulp/tasks/server.js",
    "content": "const connect = require('gulp-connect');\nconst LR_PORT = require('../const').LR_PORT;\n\nexports.task = function () {\n  connect.server({\n    root: './',\n    livereload: true,\n    port: LR_PORT\n  });\n};\n"
  },
  {
    "path": "gulp/tasks/site.js",
    "content": "const connect = require('gulp-connect');\nconst LR_PORT = require('../const').LR_PORT;\n\nexports.task = function () {\n  connect.server({\n    root: './dist/docs',\n    livereload: true,\n    port: LR_PORT,\n\n    // For any 404, respond with index.html. This enables html5Mode routing.\n    // In a production environment, this would be done with much more\n    // fine-grained URL rewriting rules.\n    fallback: './dist/docs/index.html'\n  });\n};\n"
  },
  {
    "path": "gulp/tasks/validate.js",
    "content": "exports.dependencies = ['jshint', 'ddescribe-iit', 'karma'];\n"
  },
  {
    "path": "gulp/tasks/watch-demo.js",
    "content": "const gulp = require('gulp');\nconst gutil = require('gulp-util');\nconst util = require('../util');\n\nexports.dependencies = ['build-demo'];\n\nexports.task = function () {\n  const module = util.readModuleArg();\n  const name = module.split('.').pop();\n  const dir = \"/dist/demos/\" + name.trim();\n  gutil.log('\\n',\n    '-- Rebuilding', dir, 'when source files change...\\n',\n    '-- Navigate to', gutil.colors.green('\"dist/demos/' + name + '/\"'),\n    'in your browser to develop.'\n  );\n\n  return gulp.watch('src/**/!(*.spec)', ['build-demo']);\n};\n"
  },
  {
    "path": "gulp/tasks/watch.js",
    "content": "const gulp = require('gulp');\n\nexports.dependencies = ['docs'];\n\nexports.task = function() {\n  gulp.watch(['docs/**/*', 'src/**/!(*.spec)'], ['docs']);\n};\n"
  },
  {
    "path": "gulp/util.js",
    "content": "const config = require('./config');\nconst gulp = require('gulp');\nconst gutil = require('gulp-util');\nconst frep = require('gulp-frep');\nconst fs = require('fs');\nconst args = require('minimist')(process.argv.slice(2));\nconst path = require('path');\nconst rename = require('gulp-rename');\nconst filter = require('gulp-filter');\nconst concat = require('gulp-concat');\nconst series = require('stream-series');\nconst lazypipe = require('lazypipe');\nconst glob = require('glob').sync;\nconst uglify = require('gulp-uglify');\nconst sass = require('gulp-sass')(require('sass'));\nconst plumber = require('gulp-plumber');\nconst ngAnnotate = require('gulp-ng-annotate');\nconst insert = require('gulp-insert');\nconst gulpif = require('gulp-if');\nconst cssnano = require('cssnano');\nconst gulpPostcss = require('gulp-postcss');\nconst postcss = require('postcss');\nconst _ = require('lodash');\nconst constants = require('./const');\nconst VERSION = constants.VERSION;\nconst BUILD_MODE = constants.BUILD_MODE;\nconst IS_DEV = constants.IS_DEV;\nconst ROOT = constants.ROOT;\nconst utils = require('../scripts/gulp-utils.js');\n\nexports.buildJs = buildJs;\nexports.autoprefix = utils.autoprefix;\nexports.buildModule = buildModule;\nexports.filterNonCodeFiles = filterNonCodeFiles;\nexports.readModuleArg = readModuleArg;\nexports.themeBuildStream = themeBuildStream;\nexports.minifyCss = minifyCss;\nexports.dedupeCss = dedupeCss;\nexports.args = args;\n\n/**\n * Builds the entire component library javascript.\n */\nfunction buildJs() {\n  const jsFiles = config.jsCoreFiles;\n  config.componentPaths.forEach(component => {\n    jsFiles.push(path.join(component, '*.js'));\n    jsFiles.push(path.join(component, '**/*.js'));\n  });\n\n  gutil.log(\"building js files...\");\n\n  const jsBuildStream = gulp.src(jsFiles)\n  .pipe(filterNonCodeFiles())\n  .pipe(utils.buildNgMaterialDefinition())\n  .pipe(plumber())\n  .pipe(ngAnnotate())\n  .pipe(utils.addJsWrapper(true));\n\n  const jsProcess = series(jsBuildStream, themeBuildStream())\n  .pipe(concat('angular-material.js'))\n  .pipe(BUILD_MODE.transform())\n  .pipe(insert.prepend(config.banner))\n  .pipe(insert.append(';window.ngMaterial={version:{full: \"' + VERSION + '\"}};'))\n  .pipe(gulp.dest(config.outputDir))\n  .pipe(gulpif(!IS_DEV, uglify({output: {comments: 'some'}})))\n  .pipe(rename({extname: '.min.js'}))\n  .pipe(gulp.dest(config.outputDir));\n\n  return series(jsProcess, deployMaterialMocks());\n\n  // Deploy the `angular-material-mocks.js` file to the `dist` directory\n  function deployMaterialMocks() {\n    return gulp.src(config.mockFiles)\n    .pipe(gulp.dest(config.outputDir));\n  }\n}\n\nfunction minifyCss(extraOptions) {\n  const options = {\n    reduceTransforms: false,\n    svgo: false\n  };\n  const preset = {\n    preset: [\n      'default',\n      _.assign(options, extraOptions)\n    ]\n  };\n\n  return gulpPostcss([cssnano(preset)]);\n}\n\n/**\n * @param {string} module\n * @param {{isRelease, minify, useBower}=} opts\n */\nfunction buildModule(module, opts) {\n  opts = opts || {};\n  if (module.indexOf(\".\") < 0) {\n    module = \"material.components.\" + module;\n  }\n  gutil.log('Building ' + module + (opts.isRelease && ' minified' || '') + ' ...');\n\n  const name = module.split('.').pop();\n  utils.copyDemoAssets(name, 'src/components/', 'dist/demos/');\n\n  let stream = utils.filesForModule(module)\n  .pipe(filterNonCodeFiles())\n  .pipe(filterLayoutAttrFiles())\n  .pipe(gulpif('*.scss', buildModuleStyles(name)))\n  .pipe(gulpif('*.js', buildModuleJs(name)));\n\n  if (module === 'material.core') {\n    stream = splitStream(stream);\n  }\n\n  return stream\n  .pipe(BUILD_MODE.transform())\n  .pipe(insert.prepend(config.banner))\n  .pipe(gulpif(opts.minify, buildMin()))\n  .pipe(gulpif(opts.useBower, buildBower()))\n  .pipe(gulp.dest(BUILD_MODE.outputDir + name));\n\n  function splitStream(stream) {\n    const js = series(stream, themeBuildStream())\n    .pipe(filter('**/*.js'))\n    .pipe(concat('core.js'));\n\n    const css = stream\n    .pipe(filter(['**/*.css', '!**/ie_fixes.css']));\n\n    return series(js, css);\n  }\n\n  function buildMin() {\n    return lazypipe()\n    .pipe(gulpif, /.css$/, minifyCss(),\n      uglify({output: {comments: 'some'}})\n      .on('error', function(e) {\n          console.log('\\x07', e.message);\n          return this.end();\n        }\n      )\n    )\n    .pipe(rename, function(path) {\n      path.extname = path.extname\n      .replace(/.js$/, '.min.js')\n      .replace(/.css$/, '.min.css');\n    })\n    ();\n  }\n\n  function buildBower() {\n    return lazypipe()\n    .pipe(utils.buildModuleBower, name, VERSION)();\n  }\n\n  function buildModuleJs(name) {\n    const patterns = [\n      {\n        pattern: /@ngInject/g,\n        replacement: 'ngInject'\n      },\n      {\n        // Turns `thing.$inject` into `thing['$inject']` in order to prevent\n        // Closure from stripping it from objects with an @constructor\n        // annotation.\n        pattern: /\\.\\$inject\\b/g,\n        replacement: \"['$inject']\"\n      }\n    ];\n    return lazypipe()\n    .pipe(plumber)\n    .pipe(ngAnnotate)\n    .pipe(frep, patterns)\n    .pipe(concat, name + '.js')\n    ();\n  }\n\n  /**\n   * @param {string} name module name. I.e. 'select', 'dialog', etc.\n   * @returns {*}\n   */\n  function buildModuleStyles(name) {\n    let files = [];\n    const inputVariableConsumers = [\n      'input', 'select', 'checkbox', 'datepicker', 'radioButton', 'switch'\n    ];\n    config.themeBaseFiles.forEach(function(fileGlob) {\n      files = files.concat(glob(fileGlob, {cwd: ROOT}));\n    });\n\n    // Handle md-input and md-input-container variables that need to be shared with md-select\n    // in order to orchestrate identical layouts and alignments. In the future, it may be necessary\n    // to also use these variables with md-datepicker and md-autocomplete.\n    if (inputVariableConsumers.includes(name)) {\n      files = files.concat(glob(config.inputVariables, {cwd: ROOT}));\n    }\n\n    const baseStyles = files.map(function(fileName) {\n      return fs.readFileSync(fileName, 'utf8').toString();\n    }).join('\\n');\n\n    let sassModules;\n    // Don't add the Sass modules to core since they get automatically included already.\n    if (name === 'core') {\n      sassModules = '';\n    } else {\n      sassModules = fs.readFileSync(config.scssModules, 'utf8').toString();\n    }\n\n    return lazypipe()\n    .pipe(insert.prepend, baseStyles)\n    .pipe(gulpif, /theme.scss/, rename(name + '-default-theme.scss'), concat(name + '.scss'))\n    // Theme files are suffixed with the `default-theme.scss` string.\n    // In some cases there are multiple theme SCSS files, which should be concatenated together.\n    .pipe(gulpif, /default-theme.scss/, concat(name + '-default-theme.scss'))\n    // We can't prepend these earlier, or they get duplicated in a way that hoistScssAtUseStatements\n    // can't deduplicate them.\n    .pipe(insert.prepend, sassModules)\n    .pipe(utils.hoistScssAtUseStatements)\n    .pipe(sass)\n    .pipe(dedupeCss)\n    .pipe(utils.autoprefix)\n    (); // Invoke the returning lazypipe function to create our new pipe.\n  }\n}\n\n/**\n * @returns {string} module name. i.e. material.components.icon\n */\nfunction readModuleArg() {\n  const module = args.c ? 'material.components.' + args.c : (args.module || args.m);\n  if (!module) {\n    gutil.log('\\nProvide a component argument via `-c`:',\n      '\\nExample: -c toast');\n    gutil.log('\\nOr provide a module argument via `--module` or `-m`.',\n      '\\nExample: --module=material.components.toast or -m material.components.dialog');\n    throw new Error(\"Unable to read module arguments.\");\n  }\n  return module;\n}\n\n/**\n * We are not injecting the layout-attributes selectors into the core module css,\n * otherwise we would have the layout-classes and layout-attributes in there.\n */\nfunction filterLayoutAttrFiles() {\n  return filter(function(file) {\n    return !/.*layout-attributes\\.scss/g.test(file.path);\n  });\n}\n\nfunction filterNonCodeFiles() {\n  return filter(function(file) {\n    return !/demo|module\\.json|script\\.js|\\.spec.js|README/.test(file.path);\n  });\n}\n\n// builds the theming related css and provides it as a JS const for AngularJS\nfunction themeBuildStream() {\n  // Make a copy so that we don't modify the actual config that is used by other functions\n  const paths = config.themeBaseFiles.slice(0);\n  config.componentPaths.forEach(component => paths.push(path.join(component, '*-theme.scss')));\n  paths.push(config.themeCore);\n\n  return gulp.src(paths)\n  .pipe(concat('default-theme.scss'))\n  .pipe(utils.hoistScssVariables())\n  .pipe(sass())\n  .pipe(dedupeCss())\n  // The PostCSS orderedValues plugin modifies the theme color expressions.\n  .pipe(minifyCss({orderedValues: false}))\n  .pipe(utils.cssToNgConstant('material.core', '$MD_THEME_CSS'));\n}\n\n// Removes duplicated CSS properties.\nfunction dedupeCss() {\n  const prefixRegex = /-(webkit|moz|ms|o)-.+/;\n\n  return insert.transform(function(contents) {\n    // Parse the CSS into an AST.\n    const parsed = postcss.parse(contents);\n\n    // Walk through all the rules, skipping comments, media queries etc.\n    parsed.walk(function(rule) {\n      // Skip over any comments, media queries and rules that have less than 2 properties.\n      if (rule.type !== 'rule' || !rule.nodes || rule.nodes.length < 2) return;\n\n      // Walk all of the properties within a rule.\n      rule.walk(function(prop) {\n        // Check if there's a similar property that comes after the current one.\n        const hasDuplicate = validateProp(prop) && _.find(rule.nodes, function(otherProp) {\n          return prop !== otherProp && prop.prop === otherProp.prop && validateProp(otherProp);\n        });\n\n        // Remove the declaration if it's duplicated.\n        if (hasDuplicate) {\n          prop.remove();\n\n          gutil.log(gutil.colors.yellow(\n            'Removed duplicate property: \"' +\n            prop.prop + ': ' + prop.value + '\" from \"' + rule.selector + '\"...'\n          ));\n        }\n      });\n    });\n\n    // Turn the AST back into CSS.\n    return parsed.toResult().css;\n  });\n\n  // Checks if a property is a style declaration and that it\n  // doesn't contain any vendor prefixes.\n  function validateProp(prop) {\n    return prop && prop.type === 'decl' && ![prop.prop, prop.value].some(function(value) {\n      return value.indexOf('-') > -1 && prefixRegex.test(value);\n    });\n  }\n}\n"
  },
  {
    "path": "gulpfile.js",
    "content": "const gulp = require('gulp');\nconst fs = require('fs');\n\n// include docs gulpfile (should eventually be factored out)\nrequire('./docs/gulpfile');\n\n// read in all files from gulp/tasks and create tasks for them\nfs.readdirSync('./gulp/tasks')\n    .filter(function (filename) {\n      return filename.match(/\\.js$/i);\n    })\n    .map(function (filename) {\n      return {\n        name: filename.substr(0, filename.length - 3),\n        contents: require('./gulp/tasks/' + filename)\n      };\n    })\n    .forEach(function (file) {\n      gulp.task(file.name, file.contents.dependencies, file.contents.task);\n    });\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"angular-material-source\",\n  \"version\": \"1.2.5\",\n  \"description\": \"The AngularJS Material project is an implementation of Material Design in AngularJS. This project provides a set of reusable, well-tested, and accessible Material Design UI components. AngularJS Material is supported internally at Google by the AngularJS, Angular Components, and other product teams.\",\n  \"keywords\": [\n    \"client-side\",\n    \"browser\",\n    \"material\",\n    \"material-design\",\n    \"design\",\n    \"angularjs\",\n    \"angular.js\",\n    \"css\",\n    \"components\",\n    \"google\"\n  ],\n  \"homepage\": \"https://material.angularjs.org\",\n  \"bugs\": \"https://github.com/angular/material/issues\",\n  \"license\": \"MIT\",\n  \"licenses\": [\n    {\n      \"type\": \"MIT\",\n      \"url\": \"https://github.com/angular/material/blob/master/LICENSE\"\n    }\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/angular/material.git\"\n  },\n  \"private\": true,\n  \"style\": \"./dist/angular-material.css\",\n  \"scss\": \"./dist/angular-material.scss\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"@octokit/rest\": \"^18.5.2\",\n    \"@types/angular\": \"^1.8.1\",\n    \"@types/q\": \"^1.5.4\",\n    \"acorn\": \"^7.4.1\",\n    \"add-stream\": \"^1.0.0\",\n    \"ajv\": \"^6.12.6\",\n    \"angular\": \"^1.8.2\",\n    \"angular-animate\": \"^1.8.2\",\n    \"angular-aria\": \"^1.8.2\",\n    \"angular-messages\": \"^1.8.2\",\n    \"angular-mocks\": \"^1.8.2\",\n    \"angular-route\": \"^1.8.2\",\n    \"angular-sanitize\": \"^1.8.2\",\n    \"angular-touch\": \"^1.8.2\",\n    \"angularytics\": \"^0.4.0\",\n    \"autoprefixer\": \"^10.2.6\",\n    \"canonical-path\": \"^1.0.0\",\n    \"cli-color\": \"^2.0.0\",\n    \"cliui\": \"^7.0.4\",\n    \"colors\": \"^1.4.0\",\n    \"conventional-changelog\": \"^3.1.24\",\n    \"cssnano\": \"^5.0.5\",\n    \"dgeni\": \"^0.4.14\",\n    \"dgeni-packages\": \"^0.29.2\",\n    \"eslint\": \"^7.23.0\",\n    \"github-contributors-list\": \"^1.2.5\",\n    \"glob\": \"^7.1.6\",\n    \"gulp\": \"^3.9.1\",\n    \"gulp-add-src\": \"^1.0.0\",\n    \"gulp-concat\": \"^2.6.1\",\n    \"gulp-connect\": \"^5.7.0\",\n    \"gulp-filter\": \"^6.0.0\",\n    \"gulp-frep\": \"^0.1.3\",\n    \"gulp-if\": \"^3.0.0\",\n    \"gulp-insert\": \"^0.5.0\",\n    \"gulp-jshint\": \"^2.1.0\",\n    \"gulp-ng-annotate\": \"^2.1.0\",\n    \"gulp-ng-html2js\": \"^0.2.3\",\n    \"gulp-plumber\": \"^1.2.1\",\n    \"gulp-postcss\": \"^9.0.0\",\n    \"gulp-rename\": \"^2.0.0\",\n    \"gulp-sass\": \"^5.0.0\",\n    \"gulp-uglify\": \"^3.0.2\",\n    \"gulp-util\": \"^3.0.8\",\n    \"jasmine-core\": \"2.8.0\",\n    \"jquery\": \"^3.6.0\",\n    \"jshint\": \"^2.12.0\",\n    \"jshint-summary\": \"^0.4.0\",\n    \"karma\": \"^6.3.17\",\n    \"karma-browserstack-launcher\": \"^1.6.0\",\n    \"karma-chrome-launcher\": \"^3.1.0\",\n    \"karma-firefox-launcher\": \"^2.1.1\",\n    \"karma-jasmine\": \"1.1.2\",\n    \"karma-junit-reporter\": \"^2.0.1\",\n    \"karma-sauce-launcher\": \"^4.3.6\",\n    \"lazypipe\": \"^1.0.2\",\n    \"lodash\": \"^4.17.21\",\n    \"minimist\": \"^1.2.5\",\n    \"mkdirp\": \"0.5.1\",\n    \"moment\": \"^2.29.1\",\n    \"path-type\": \"^5.0.0\",\n    \"postcss\": \"^8.3.0\",\n    \"prompt-sync\": \"^4.2.0\",\n    \"q\": \"^1.5.1\",\n    \"sass\": \"^1.43.4\",\n    \"stream-series\": \"^0.1.1\",\n    \"through2\": \"^4.0.2\"\n  },\n  \"resolutions\": {\n    \"graceful-fs\": \"4.2.9\",\n    \"marked\": \"0.3.6\",\n    \"websocket-extensions\": \"0.1.4\"\n  },\n  \"scripts\": {\n    \"build\": \"gulp build\",\n    \"build:prod\": \"gulp build --release\",\n    \"build:modules\": \"gulp build-all-modules --release --mode=default\",\n    \"build:closure\": \"gulp build-all-modules --release --mode=closure\",\n    \"build:docs:prod\": \"gulp docs --release\",\n    \"contributors:release\": \"githubcontrib --owner angular --repo material --cols 6 --format md --showlogin true --sha master --sortOrder desc --fromDate \",\n    \"ddescribe-iit\": \"gulp ddescribe-iit\",\n    \"docs:build\": \"gulp docs\",\n    \"docs:watch\": \"gulp watch site --dev\",\n    \"gulp\": \"gulp\",\n    \"preinstall\": \"npx npm-force-resolutions\",\n    \"test:ci\": \"gulp karma --config=config/karma-circleci.conf.js --reporters='dots,junit'\",\n    \"test:fast\": \"gulp karma-fast\",\n    \"test:full\": \"gulp karma\",\n    \"test:watch\": \"gulp karma-watch\",\n    \"test:sauce\": \"gulp karma-sauce\",\n    \"lint\": \"eslint .\",\n    \"lint:jshint\": \"gulp jshint\"\n  },\n  \"browserslist\": [\n    \"> 0.5%\",\n    \"last 2 versions\",\n    \"Firefox ESR\",\n    \"not ie <= 10\",\n    \"not ie_mob <= 10\",\n    \"not bb <= 10\",\n    \"not op_mob <= 12.1\"\n  ],\n  \"engines\": {\n    \"node\": \">=12\",\n    \"npm\": \">=6\"\n  }\n}"
  },
  {
    "path": "release",
    "content": "node --harmony release.js\n"
  },
  {
    "path": "release.js",
    "content": "/* eslint-disable no-fallthrough */\n(function () {\n  'use strict';\n\n  const colors         = require('colors');\n  const strip          = require('cli-color/strip');\n  const fs             = require('fs');\n  const path           = require('path');\n  const prompt         = require('prompt-sync')({sigint: true});\n  const child_process  = require('child_process');\n  const pkg            = require('./package.json');\n  const pkgLock        = require('./package-lock.json');\n  let oldVersion       = pkg.version;\n  const abortCmds      = ['git reset --hard', 'git checkout staging', 'rm abort push'];\n  const pushCmds       = ['rm abort push'];\n  const cleanupCmds    = [];\n  const defaultOptions = { encoding: 'utf-8' };\n  const origin         = 'git@github.com:angular/material.git';\n  const lineWidth      = 80;\n  const lastMajorVer   = JSON.parse(exec('curl https://material.angularjs.org/docs.json')).latest;\n  let newVersion;\n  let npmTag = 'latest';\n\n  try {\n    child_process.execSync('gulp --version', defaultOptions);\n  } catch (error) {\n    throw new Error('Please install gulp globally via \"npm i -g gulp@^3.9.1\".');\n  }\n  header();\n  const dryRun = prompt(`Is this a dry-run? [${\"yes\".cyan}/no] `, 'yes') !== 'no';\n  npmTag = prompt(`What would you like the NPM tag to be? [${npmTag.cyan}/next] `, npmTag);\n\n  if (dryRun) {\n    oldVersion = prompt(`What would you like the old version to be? (default: ${oldVersion.cyan}) `, oldVersion);\n    build();\n  } else if (validate()) {\n    build();\n  }\n\n  function build () {\n    newVersion = getNewVersion();\n\n    line();\n\n    checkoutVersionBranch();\n    updateVersion();\n    createChangelog();\n    commitChanges();\n    tagRelease();\n    cloneRepo('bower-material');\n    updateBowerVersion();\n    cloneRepo('code.material.angularjs.org');\n    updateSite();\n    updateMaster();\n    writeScript('abort', abortCmds.concat(cleanupCmds));\n    if (!dryRun) writeScript('push', pushCmds.concat(cleanupCmds));\n\n    line();\n    log('Your repo is ready to be pushed.');\n    log(`Please look over ${\"CHANGELOG.md\".cyan} and make any changes.`);\n    log(`When you are ready, please run \"${\"./push\".green}\" to finish the process.`);\n    log(`If you would like to cancel this release, please run \"${\"./abort\".red}\"`);\n  }\n\n  // utility methods\n\n  /** confirms that you will be able to perform the release before attempting */\n  function validate () {\n    if (exec('npm whoami') !== 'angular') {\n      err('You must be authenticated with npm as \"angular\" to perform a release.');\n    } else if (exec('git rev-parse --abbrev-ref HEAD') !== 'staging') {\n      err('Releases can only performed from \"staging\" at this time.');\n    } else {\n      return true;\n    }\n    function err (msg) {\n      const str = 'Error: ' + msg;\n      log(str.red);\n    }\n  }\n\n  /** creates the version branch and adds abort steps */\n  function checkoutVersionBranch () {\n    exec(`git branch -q -D release/${newVersion}`);\n    exec(`git checkout -q -b release/${newVersion}`);\n    abortCmds.push('git checkout master');\n    abortCmds.push(`git branch -D release/${newVersion}`);\n  }\n\n  /** writes the new version to package.json and package-lock.json */\n  function updateVersion () {\n    start(`Updating ${\"package.json\".cyan} version from ${oldVersion.cyan} to ${newVersion.cyan}...`);\n    pkg.version = newVersion;\n    fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));\n    done();\n    start(`Updating ${\"package-lock.json\".cyan} version from ${oldVersion.cyan} to ${newVersion.cyan}...`);\n    pkgLock.version = newVersion;\n    fs.writeFileSync('./package-lock.json', JSON.stringify(pkgLock, null, 2));\n    done();\n    abortCmds.push('git checkout package.json');\n    abortCmds.push('git checkout package-lock.json');\n    pushCmds.push('git add package.json');\n    pushCmds.push('git add package-lock.json');\n  }\n\n  /** generates the changelog from the commits since the last release */\n  function createChangelog () {\n    start(`Generating changelog from ${oldVersion.cyan} to ${newVersion.cyan}...`);\n\n    exec(`git fetch --tags ${origin}`);\n    exec(`git checkout CHANGELOG.md`);\n    exec(`gulp changelog --sha=$(git merge-base v${lastMajorVer} HEAD)`);\n\n    done();\n\n    abortCmds.push('git checkout CHANGELOG.md');\n    pushCmds.push('git add CHANGELOG.md');\n  }\n\n  /** utility method for clearing the terminal */\n  function clear () {\n    write(\"\\u001b[2J\\u001b[0;0H\");\n  }\n\n  /** prompts the user for the new version */\n  function getNewVersion () {\n    header();\n    const options = getVersionOptions(oldVersion);\n    let key, version;\n    log(`The current version is ${oldVersion.cyan}.`);\n    log('');\n    log('What should the next version be?');\n    for (key in options) { log((+key + 1) + ') ' + options[ key ].cyan); }\n    log('');\n    const type = prompt('Please select a new version: ');\n\n    if (options[ type - 1 ]) version = options[ type - 1 ];\n    else if (type.match(/^\\d+\\.\\d+\\.\\d+(-rc\\.?\\d+)?$/)) version = type;\n    else throw new Error('Your entry was invalid.');\n\n    log('');\n    log('The new version will be ' + version.cyan + '.');\n    return prompt(`Is this correct? [${\"yes\".cyan}/no] `, 'yes') === 'yes' ? version : getNewVersion();\n\n    function getVersionOptions (version) {\n      return version.match(/-rc\\.?\\d+$/)\n        ? [increment(version, 'rc'), increment(version, 'minor')]\n        : [increment(version, 'patch'), addRC(increment(version, 'minor'))];\n\n      function increment (versionString, type) {\n        const version = parseVersion(versionString);\n        if (version.rc) {\n          switch (type) {\n            case 'minor': version.rc = 0; break;\n            case 'rc': version.rc++; break;\n          }\n        } else {\n          version[ type ]++;\n          // reset any version numbers lower than the one changed\n          switch (type) {\n            case 'minor': version.patch = 0;\n            case 'patch': version.rc = 0;\n          }\n        }\n        return getVersionString(version);\n\n        function parseVersion (version) {\n          const parts = version.split(/-rc\\.|\\./g);\n          return {\n            string: version,\n            major:  parts[ 0 ],\n            minor:  parts[ 1 ],\n            patch:  parts[ 2 ],\n            rc:     parts[ 3 ] || 0\n          };\n        }\n\n        function getVersionString (version) {\n          let str = version.major + '.' + version.minor + '.' + version.patch;\n          if (version.rc) str += '-rc.' + version.rc;\n          return str;\n        }\n      }\n\n      function addRC (str) {\n        return str + '-rc.1';\n      }\n    }\n  }\n\n  /** adds git tag for release and pushes to GitHub */\n  function tagRelease () {\n    pushCmds.push(\n      `git tag v${newVersion} -f`,\n      `git push ${origin} HEAD`,\n      `git push --tags ${origin}`\n    );\n  }\n\n  /** amends the commit to include local changes (ie. changelog) */\n  function commitChanges () {\n    start('Committing changes...');\n    exec(`git commit -am \"release: v${newVersion}\"`);\n    done();\n    pushCmds.push('git commit --amend --no-edit');\n  }\n\n  /** utility method for cloning GitHub repos */\n  function cloneRepo (repo) {\n    start(`Cloning ${repo.cyan} from GitHub...`);\n    exec(`rm -rf ${repo}`);\n    exec(`git clone git@github.com:angular/${repo}.git --depth=1`);\n    done();\n    cleanupCmds.push(`rm -rf ${repo}`);\n  }\n\n  /** writes an array of commands to a bash script */\n  function writeScript (name, cmds) {\n    fs.writeFileSync(name, '#!/usr/bin/env bash\\n\\n' + cmds.join('\\n'));\n    exec('chmod +x ' + name);\n  }\n\n  /** updates the version for bower-material in package.json and bower.json */\n  function updateBowerVersion () {\n    start(`Updating ${\"bower-material\".cyan} version...`);\n    const options = { cwd: './bower-material' };\n    const bower   = require(options.cwd + '/bower.json'),\n          pkg     = require(options.cwd + '/package.json');\n    // update versions in config files\n    bower.version = pkg.version = newVersion;\n    fs.writeFileSync(options.cwd + '/package.json', JSON.stringify(pkg, null, 2));\n    fs.writeFileSync(options.cwd + '/bower.json', JSON.stringify(bower, null, 2));\n    done();\n    start(`Building ${\"bower-material\".cyan} files...`);\n    // build files for bower\n    exec([\n      'rm -rf dist',\n      'gulp build',\n      'gulp build-all-modules --mode=default',\n      'gulp build-all-modules --mode=closure',\n      'rm -rf dist/demos'\n    ]);\n    done();\n    start(`Copying files into ${\"bower-material\".cyan} repo...`);\n    // copy files over to bower repo\n    exec([\n      'cp -Rf ../dist/* ./',\n      'git add -A',\n      `git commit -am \"release: v${newVersion}\"`,\n      'rm -rf ../dist'\n    ], options);\n    done();\n    // add steps to push script\n    pushCmds.push(\n      comment(`push to bower-material (master and tag) and publish to npm as '${npmTag}'`),\n      'cd ' + options.cwd,\n      'cp ../CHANGELOG.md .',\n      'git add CHANGELOG.md',\n      'git commit --amend --no-edit',\n      `git tag -f v${newVersion}`,\n      'git pull --rebase --strategy=ours',\n      'git push',\n      'git push --tags',\n      'rm -rf .git/',\n      `npm publish --tag ${npmTag}`,\n      'cd ..'\n    );\n  }\n\n  /** builds the website for the new version */\n  function updateSite () {\n    start('Adding new version of the docs site...');\n    const options = { cwd: './code.material.angularjs.org' };\n    writeDocsJson();\n\n    // build files for bower\n    exec([\n      'rm -rf dist',\n      'gulp docs'\n    ]);\n    replaceFilePaths();\n\n    // copy files over to site repo\n    exec([\n      `cp -Rf ../dist/docs ${newVersion}`,\n      'rm -rf latest && cp -Rf ../dist/docs latest',\n      'git add -A',\n      `git commit -am \"release: v${newVersion}\"`,\n      `git tag -f v${newVersion}`,\n      'rm -rf ../dist'\n    ], options);\n    replaceBaseHref(newVersion);\n    replaceBaseHref('latest');\n\n    // update firebase.json file\n    updateFirebaseJson();\n    exec(['git commit --amend --no-edit -a'], options);\n    done();\n\n    // add steps to push script\n    pushCmds.push(\n      comment('push the site'),\n      'cd ' + options.cwd,\n      'git pull --rebase --strategy=ours',\n      'git push',\n      'git push --tags',\n      'cd ..'\n    );\n\n    function updateFirebaseJson () {\n      fs.writeFileSync(options.cwd + '/firebase.json', getFirebaseJson());\n      function getFirebaseJson () {\n        const json = require(options.cwd + '/firebase.json');\n        json.hosting.rewrites = json.hosting.rewrites || [];\n        const rewrites = json.hosting.rewrites;\n\n        switch (rewrites.length) {\n          case 0:\n            rewrites.push(getRewrite('HEAD'));\n          case 1:\n            rewrites.push(getRewrite('latest'));\n          default:\n            rewrites.push(getRewrite(newVersion));\n        }\n        return JSON.stringify(json, null, 2);\n        function getRewrite (str) {\n          return {\n            source:      '/' + str + '/**/!(*.@(js|html|css|json|svg|png|jpg|jpeg))',\n            destination: '/' + str + '/index.html'\n          };\n        }\n      }\n    }\n\n    function writeDocsJson () {\n      const config = require(options.cwd + '/docs.json');\n      config.versions.unshift(newVersion);\n\n      // only set to default if not a release candidate\n      config.latest = newVersion;\n      fs.writeFileSync(options.cwd + '/docs.json', JSON.stringify(config, null, 2));\n    }\n  }\n\n  /** replaces localhost file paths with public URLs */\n  function replaceFilePaths () {\n    // handle docs.js\n    const filePath = path.join(__dirname, '/dist/docs/docs.js');\n    const file = fs.readFileSync(filePath);\n    const contents = file.toString()\n        .replace(/http:\\/\\/localhost:8080\\/angular-material/g, 'https://gitcdn.xyz/cdn/angular/bower-material/v' + newVersion + '/angular-material')\n        .replace(/http:\\/\\/localhost:8080\\/docs.css/g, 'https://material.angularjs.org/' + newVersion + '/docs.css');\n    fs.writeFileSync(filePath, contents);\n  }\n\n  /** replaces base href in index.html for new version as well as latest */\n  function replaceBaseHref (folder) {\n    // handle index.html\n    const filePath = path.join(__dirname, '/code.material.angularjs.org/', folder, '/index.html');\n    const file = fs.readFileSync(filePath);\n    const contents = file.toString().replace(/base href=\"\\//g, 'base href=\"/' + folder + '/');\n    fs.writeFileSync(filePath, contents);\n  }\n\n  /** copies the changelog back over to master branch */\n  function updateMaster () {\n    pushCmds.push(\n      comment('update package.json in master'),\n      'git checkout master',\n      `git pull --rebase ${origin} master --strategy=recursive --strategy-option==theirs`,\n      `git checkout release/${newVersion} -- CHANGELOG.md`,\n      `node -e \"const newVersion = '${newVersion}'; ${stringifyFunction(buildCommand)}\"`,\n      'git add CHANGELOG.md',\n      'git add package.json',\n      `git commit -m \"update version number in package.json to ${newVersion}\"`,\n      `git push ${origin} master`\n    );\n\n    function buildCommand () {\n      require('fs').writeFileSync('package.json', JSON.stringify(getUpdatedJson(), null, 2));\n      function getUpdatedJson () {\n        const json = require('./package.json');\n        json.version = newVersion;\n        return json;\n      }\n    }\n\n    function stringifyFunction (method) {\n      return method\n          .toString()\n          .split('\\n')\n          .slice(1, -1)\n          .map(function (line) { return line.trim(); })\n          .join(' ')\n          .replace(/\"/g, '\\\\\"');\n    }\n  }\n\n  /** utility method to output header */\n  function header () {\n    clear();\n    line();\n    log(center('AngularJS Material Release'));\n    line();\n  }\n\n  /** outputs a centered message in the terminal */\n  function center (msg) {\n    msg        = ' ' + msg.trim() + ' ';\n    const length = msg.length;\n    const spaces = Math.floor((lineWidth - length) / 2);\n    return Array(spaces + 1).join('-') + msg.green + Array(lineWidth - msg.length - spaces + 1).join('-');\n  }\n\n  /** outputs done text when a task is completed */\n  function done () {\n    log('done'.green);\n  }\n\n  /**\n   * utility method for executing terminal commands while ignoring stderr\n   * @param {string|Array} cmd\n   * @param {Object=} userOptions\n   * @return\n   */\n  function exec (cmd, userOptions) {\n    if (cmd instanceof Array) {\n      return cmd.map(function (cmd) { return exec(cmd, userOptions); });\n    }\n    try {\n      const options = Object.create(defaultOptions);\n      for (const key in userOptions) options[ key ] = userOptions[ key ];\n      return child_process.execSync(cmd + ' 2> /dev/null', options).toString().trim();\n    } catch (err) {\n      return err;\n    }\n  }\n\n  /** returns a commented message for use in bash scripts */\n  function comment (msg) {\n    return '\\n# ' + msg + '\\n';\n  }\n\n  /**\n   * prints the left side of a task while it is being performed\n   */\n  function start (msg) {\n    const msgLength = strip(msg).length,\n          diff      = lineWidth - 4 - msgLength;\n    write(msg + Array(diff + 1).join(' '));\n  }\n\n  /** outputs to the terminal with string variable replacement */\n  function log (msg) {\n    msg = msg || '';\n    console.log(msg);\n  }\n\n  /** writes a message without a newline */\n  function write (msg) {\n    process.stdout.write(msg);\n  }\n\n  /** prints a horizontal line to the terminal */\n  function line () {\n    log(Array(lineWidth + 1).join('-'));\n  }\n})();\n"
  },
  {
    "path": "scripts/bower-material-release.sh",
    "content": "#!/bin/bash\n\nARG_DEFS=(\n  \"--version=(.*)\"\n)\n\nfunction run {\n  cd ../\n\n  echo \"-- Building release...\"\n  rm -rf dist\n  gulp build --release --version=$VERSION\n  gulp build-all-modules --release --mode=default --version=$VERSION\n  gulp build-all-modules --release --mode=closure --version=$VERSION\n  rm -rf dist/demos\n\n  echo \"-- Cloning bower-material...\"\n  rm -rf bower-material\n  git clone https://github.com/angular/bower-material \\\n    bower-material --depth=2\n\n  echo \"-- Copying in build files...\"\n\n  rm -rf bower-material/core\n  rm -rf bower-material/modules/css\n  rm -rf bower-material/modules/scss\n  rm -rf bower-material/layouts\n\n  # From the project root\n  cp -Rf dist/* bower-material/\n  commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)\n  commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)\n\n  cd bower-material/\n\n  git config user.name \"${commitAuthorName}\"\n  git config user.email \"${commitAuthorEmail}\"\n  # GitHub personal access token with push permission specified as environment variable\n  git config credential.helper \"store --file=.git/credentials\"\n  echo \"https://${ANGULARJS_MATERIAL_BOWER_TOKEN}:@github.com\" > .git/credentials\n\n  # Remove stale files from older builds\n  rm -f ./angular-material.layouts.css\n  rm -f ./angular-material.layouts.min.css\n  rm -rf ./demos\n  rm -rf ./core\n\n  # Restructure release files\n  mkdir -p ./modules/layouts ./modules/scss\n\n  # Repackage the raw SCSS & Clone the layout CSS\n  cp ./angular-material.scss ./modules/scss/\n  cp ./layouts/*.scss ./modules/scss/\n\n  cp ./layouts/*.css ./modules/layouts/\n\n  # Cleanup\n  rm -f ./angular-material.scss\n  rm -rf ./layouts/\n\n\n  echo \"-- Committing and tagging...\"\n  replaceJsonProp \"bower.json\" \"version\" \"$VERSION\"\n  replaceJsonProp \"package.json\" \"version\" \"$VERSION\"\n\n  git add -A\n  git commit -am \"release: v$VERSION\"\n  git tag -f v$VERSION\n\n  echo \"-- Pushing to bower-material...\"\n  git push -q origin master\n  git push -q origin v$VERSION\n\n  cd ../\n\n  echo \"-- Cleanup...\"\n  rm -rf bower-material/\n\n  echo \"-- Version $VERSION pushed successfully to angular/bower-material!\"\n}\n\nsource $(dirname $0)/utils.inc\n"
  },
  {
    "path": "scripts/build-asset-cache.sh",
    "content": "#!/bin/bash\n\n# Intended to generate an object literal of SVG images\n# key - relative path to file.\n# value - contents of the SVG.\n#\n# See the following guide about the process to update the asset cache:\n# https://github.com/angular/material/blob/feature/edit-example-on-codepen/docs/guides/CODEPEN.md\n\necho {\nfor i in $(find docs/app/{img/icons,icons} -type f -name *.svg); do\n  filename=`echo $i | sed \"s/docs\\/app\\///\"`\n  contents=`cat $i | tr -d '\\r\\n'`\n  echo -e \\'$filename\\' : \\'$contents\\',\ndone\necho }\n"
  },
  {
    "path": "scripts/circleci/run-tests.sh",
    "content": "#!/bin/bash\n\n# Enable tracing and Terminate the execution if anything fails in the pipeline.\nset -xe\n\n# Ensure that scripts will run from project dir.\ncd $(dirname ${0})/../..\n\n# When Travis CI specifies an AngularJS version, try to install those for tests.\nif [[ -n \"$NG_VERSION\" ]]; then\n  ./scripts/fetch-angular-version.sh \"$NG_VERSION\"\nfi\n\n# Run our check to make sure all tests will actually run\nnpm run ddescribe-iit\n\nnpm run test:ci\n"
  },
  {
    "path": "scripts/circleci/update-snapshot-and-docs.sh",
    "content": "#!/bin/bash\n\nARG_DEFS=(\n  \"--sha=(.*)\"\n)\n\ngit config --global user.email \"ngmaterial@googlegroups.com\"\ngit config --global user.name \"ngMaterial Bot\"\n\nfunction init {\n  # If --git-push-dryrun or --verbose are set, be sure to export them\n  # so they are set in all the other scripts too\n  export GIT_PUSH_DRYRUN=$GIT_PUSH_DRYRUN\n  export VERBOSE=$VERBOSE\n}\n\nfunction run {\n  cd ../../\n\n  NEW_VERSION=\"$(readJsonProp \"package.json\" \"version\")-master-$(echo $SHA | head -c 7)\"\n\n  ./scripts/bower-material-release.sh --version=$NEW_VERSION\n  ./scripts/snapshot-docs-site.sh --version=$NEW_VERSION\n}\n\nsource $(dirname $0)/../utils.inc\n"
  },
  {
    "path": "scripts/fetch-angular-version.sh",
    "content": "#!/bin/bash\n\n# Bash Script to replace the current AngularJS version in the node modules.\n# Accepts a version as an argument. The resolved version will be downloaded, extracted and replaced.\n\nCDN=\"https://code.angularjs.org\"\nANGULAR_FILES=(\n  angular\n  angular-animate\n  angular-route\n  angular-aria\n  angular-messages\n  angular-mocks\n  angular-sanitize\n  angular-touch\n)\n\n# The version will be specified from the first argument.\nVERSION=$1\n\n# Download the AngularJS repository for `find-max-versions` if not present.\nif [ ! -e ./tmp/angular.js/.git ]; then\n  # Cleanup potential broken repository files.\n  rm -rf ./tmp/angular.js/\n  git clone https://github.com/angular/angular.js ./tmp/angular.js\nfi\n\n# this will guarantee that we have the latest versions\n# of AngularJS when testing material in case the HEAD\n# of ./tmp/angular.js is outdated.\ngit --git-dir ./tmp/angular.js/.git fetch\n\n# Determines the exact version name and the download URL.\nif [ $VERSION == \"snapshot\" ]; then\n  ZIP_FILE_SHA=$(curl \"$CDN/snapshot/version.txt\")\n  ZIP_URL=\"$CDN/snapshot/angular-$ZIP_FILE_SHA.zip\"\nelse\n  LATEST_VERSION=$(node ./scripts/find-max-version.js $VERSION)\n  if [ ! $LATEST_VERSION ]; then\n    echo \"Error: version \"$VERSION\" of angular does not exist...\"\n    exit 1\n  fi\n\n  VERSION=$LATEST_VERSION\n  ZIP_FILE_SHA=$VERSION\n  ZIP_URL=\"$CDN/$VERSION/angular-$VERSION.zip\"\nfi\n\nZIP_FILE=\"angular-$VERSION.zip\"\nZIP_FILE_PATH=\"./tmp/$ZIP_FILE\"\nBASE_DIR=\"./tmp/angular-$VERSION\"\n\n# Downloads and extracts the resolved AngularJS version.\nrm -rf $BASE_DIR\ncurl $ZIP_URL > $ZIP_FILE_PATH\nunzip -q -d $BASE_DIR $ZIP_FILE_PATH\nmv \"$BASE_DIR/angular-$ZIP_FILE_SHA\" \"$BASE_DIR/files\"\n\n# Copies over all AngularJS files into the node modules.\nfor ANGULAR_FILE in \"${ANGULAR_FILES[@]}\"; do\n  REPLACEMENT_FILE=\"$BASE_DIR/files/$ANGULAR_FILE.js\"\n  MIN_REPLACEMENT_FILE=\"$BASE_DIR/files/$ANGULAR_FILE.min.js\"\n\n  NODE_LIB_FILE=\"./node_modules/$ANGULAR_FILE/$ANGULAR_FILE.js\"\n  MIN_NODE_LIB_FILE=\"./node_modules/$ANGULAR_FILE/$ANGULAR_FILE.min.js\"\n\n  rm -f $NODE_LIB_FILE\n  cp $REPLACEMENT_FILE $NODE_LIB_FILE\n  echo \"[copy] copied over $REPLACEMENT_FILE to $NODE_LIB_FILE\"\n\n  if [ -e $MIN_NODE_LIB_FILE ]; then\n    rm $MIN_NODE_LIB_FILE\n  fi\n\n  if [ -e $MIN_REPLACEMENT_FILE ]; then\n    cp $MIN_REPLACEMENT_FILE $MIN_NODE_LIB_FILE\n  fi\n  echo \"[copy] copied over $MIN_REPLACEMENT_FILE to $MIN_NODE_LIB_FILE\"\ndone"
  },
  {
    "path": "scripts/find-max-version.js",
    "content": "// INPUT = $1 = VERSION\n//  (something like 1.3 or 1.4.5)\n\n// OUTPUT = a specific version number\n//  (something like 1.3.19 or 1.5.0-beta.2)\n\n// this is used so that we can run a `git`\n// command which is required to parse the\n// collection of tags so that we can figure out\n// the max version for the provided branch value\nconst exec = require('child_process').exec;\n\n// this is the provided input value which could\n// be a general branch like `1.3` or a specific\n// version like `1.4.6`.\nconst version = process.argv[2];\nif (!version) return;\n\nexec(\"git --git-dir ./tmp/angular.js/.git tag\", function(error, output) {\n  const v = findMaxVersion(version, output);\n  if (v) {\n    // drop the `v` prefix from the version\n    // `v1.3.5` => `1.3.5`\n    //\n    // this will relay the version number over\n    // to the build script that used this\n    console.log(v.substr(1));\n  }\n});\n\nfunction findMaxVersion(branch, output) {\n  let lines;\n  let highestVersion;\n  let majorBranch;\n\n  // these weights are used to figure out which\n  // releases are more important than others\n  // (e.g. 1.3.0 > 1.3.0.beta.2)\n  const WEIGHTS = {\n    'beta': 10,\n    'rc': 1000,\n    'stable': 1000000\n  };\n\n  // this happens if the user provides a specific\n  // version like `1.3.5` or `1.5.0-beta.2` instead\n  // of a general branch like `1.3` or `1.5`.\n  if (branch.match(/\\./g).length > 1) {\n    lines = ['v' + branch];\n    majorBranch = branch.match(/^\\d+\\.\\d+/)[0];\n  } else {\n    majorBranch = branch;\n    lines = output.split(\"\\n\");\n  }\n\n  const versionRegex = new RegExp('^v' + majorBranch + '.(\\\\d+)(?:-(beta|rc).(\\\\d+))?');\n\n  for (let i = lines.length - 1; i >= 0; i--) {\n    const line = lines[i];\n    const result = line.match(versionRegex);\n    if (result && result.length > 0) {\n      // stable releases have a higher weight than beta/RC versions\n      // so we want to include\n      let weight = result[1] * WEIGHTS.stable;\n\n      if (result[2]) {\n        // something like \"1.3.0-beta.2\" will have a weight\n        // of 20 while \"1.3.0-rc.2\" will have a weight of\n        // 2000 while \"1.3.2\" will have a weight of 2000000\n        // (which is calculated a few lines above here).\n        // we add \"1\" to the end incase we match something\n        // like \"beta.0\"\n        //\n        // so 1.3.0-beta.0 => 10 and 1.3.0-rc.0 => 1000\n        const multiplier = WEIGHTS[result[2]];\n        weight += multiplier * (result[3] + 1);\n      } else {\n        // this adds an extra 1 as well so that\n        // 1.3.0 => 1000000\n        weight += WEIGHTS.stable;\n      }\n\n      if (!highestVersion || highestVersion.weight < weight) {\n        highestVersion = { version: line, weight: weight };\n      }\n    }\n  }\n\n  // in the event that we don't figure out a version\n  // due to mismatched branches/tags we should not\n  // return anything. The build scripts will detect\n  // this and set a failing exit code.\n  return highestVersion && highestVersion.version;\n}\n"
  },
  {
    "path": "scripts/gulp-utils.js",
    "content": "const gulp = require('gulp');\nconst through2 = require('through2');\nconst gutil = require('gulp-util');\nconst autoprefixer = require('autoprefixer');\nconst gulpPostcss = require('gulp-postcss');\nconst Buffer = require('buffer').Buffer;\nconst fs = require('fs');\nconst path = require('path');\nconst findModule = require('../config/ngModuleData.js');\n\nexports.humanizeCamelCase = function(str) {\n  switch (str) {\n    case 'fabSpeedDial':\n      return 'FAB Speed Dial';\n    case 'fabToolbar':\n      return 'FAB Toolbar';\n    default:\n      return str.charAt(0).toUpperCase() + str.substring(1).replace(/[A-Z]/g, function($1) {\n            return ' ' + $1.toUpperCase();\n          });\n  }\n};\n\n/**\n * Copy all the demo assets to the dist directory\n * NOTE: this excludes the modules demo .js,.css, .html files\n */\nexports.copyDemoAssets = function(component, srcDir, distDir) {\n  gulp.src(srcDir + component + '/demo*/')\n      .pipe(through2.obj(copyAssetsFor));\n\n  function copyAssetsFor(demo, enc, next){\n    const demoID = component + \"/\" + path.basename(demo.path);\n    const demoDir = demo.path + \"/**/*\";\n\n    const notJS  = '!' + demoDir + '.js';\n    const notCSS = '!' + demoDir + '.css';\n    const notHTML= '!' + demoDir + '.html';\n\n    gulp.src([demoDir, notJS, notCSS, notHTML])\n        .pipe(gulp.dest(distDir + demoID));\n\n    next();\n  }\n};\n\n// Gives back a pipe with an array of the parsed data from all of the module's demos\n// @param moduleName module name to parse\n// @param fileTasks: tasks to run on the files found in the demo's folder\n// Emits demo objects\nexports.readModuleDemos = function(moduleName, fileTasks) {\n  const name = moduleName.split('.').pop();\n  return gulp.src('src/{components,services}/' + name + '/demo*/')\n    .pipe(through2.obj(function(demoFolder, enc, next) {\n      const demoId = name + path.basename(demoFolder.path);\n\n      const demo = {\n        ngModule: '',\n        id: demoId,\n        css:[], html:[], js:[]\n      };\n\n      gulp.src(demoFolder.path + '/**/*', { base: path.dirname(demoFolder.path) })\n        .pipe(fileTasks(demoId))\n        .pipe(through2.obj(function(file, enc, cb) {\n          if (/index.html$/.test(file.path)) {\n            demo.moduleName = moduleName;\n            demo.name = path.basename(demoFolder.path);\n            demo.label = exports.humanizeCamelCase(path.basename(demoFolder.path).replace(/^demo/, ''));\n            demo.id = demoId;\n            demo.index = toDemoObject(file);\n\n          } else {\n            const fileType = path.extname(file.path).substring(1);\n            if (fileType === 'js') {\n              demo.ngModule = demo.ngModule || findModule.any(file.contents.toString());\n            }\n            demo[fileType] && demo[fileType].push(toDemoObject(file));\n          }\n          cb();\n        }, function() {\n          next(null, demo);\n        }));\n\n      function toDemoObject(file) {\n        return {\n          contents: file.contents.toString(),\n          name: path.basename(file.path),\n          label: path.basename(file.path),\n          fileType: path.extname(file.path).substring(1),\n          outputPath: 'demo-partials/' + name + '/' + path.basename(demoFolder.path) + '/' + path.basename(file.path)\n        };\n      }\n    }));\n};\n\nconst pathsForModules = {};\n\nexports.pathsForModule = function(name) {\n  return pathsForModules[name] || lookupPath();\n\n  function lookupPath() {\n    gulp.src('src/{services,components,core}/**/*')\n          .pipe(through2.obj(function(file, enc, next) {\n            const module = findModule.any(file.contents);\n            if (module && module.name === name) {\n              const modulePath = file.path.split(path.sep).slice(0, -1).join(path.sep);\n              pathsForModules[name] = modulePath + '/**';\n            }\n            next();\n          }));\n    return pathsForModules[name];\n  }\n};\n\n/**\n * @param {string} name module name\n * @returns {*}\n */\nexports.filesForModule = function(name) {\n  if (pathsForModules[name]) {\n    return srcFiles(pathsForModules[name]);\n  } else {\n    return gulp.src('src/{services,components,core}/**/*')\n      .pipe(through2.obj(function(file, enc, next) {\n        const module = findModule.any(file.contents);\n        if (module && (module.name === name)) {\n          const modulePath = file.path.split(path.sep).slice(0, -1).join(path.sep);\n          pathsForModules[name] = modulePath + '/**';\n          const self = this;\n          srcFiles(pathsForModules[name]).on('data', function(data) {\n            self.push(data);\n          });\n        }\n        next();\n      }));\n  }\n\n  function srcFiles(path) {\n    return gulp.src(path)\n      .pipe(through2.obj(function(file, enc, next) {\n        if (file.stat.isFile()) next(null, file);\n        else next();\n      }));\n  }\n};\n\nexports.appendToFile = function(filePath) {\n  let bufferedContents;\n  return through2.obj(function(file, enc, next) {\n    bufferedContents = file.contents.toString('utf8') + '\\n';\n    next();\n  }, function(done) {\n    const existing = fs.readFileSync(filePath, 'utf8');\n    bufferedContents = existing + '\\n' + bufferedContents;\n    const outputFile = new gutil.File({\n      cwd: process.cwd(),\n      base: path.dirname(filePath),\n      path: filePath,\n      contents: Buffer.from(bufferedContents)\n    });\n    this.push(outputFile);\n    done();\n  });\n};\n\nexports.buildNgMaterialDefinition = function() {\n  let srcBuffer = [];\n  const modulesSeen = [];\n  return through2.obj(function(file, enc, next) {\n    const module = findModule.material(file.contents);\n    if (module) modulesSeen.push(module.name);\n    srcBuffer.push(file);\n    next();\n  }, function(done) {\n    const self = this;\n    const requiredLibs = ['ng', 'ngAnimate', 'ngAria'];\n    const dependencies = JSON.stringify(requiredLibs.concat(modulesSeen));\n    const ngMaterialModule = \"angular.module('ngMaterial', \" + dependencies + ');';\n    const angularFile = new gutil.File({\n      base: process.cwd(),\n      path: process.cwd() + '/ngMaterial.js',\n      contents: Buffer.from(ngMaterialModule)\n    });\n\n    // Elevate ngMaterial module registration to first in queue\n    self.push(angularFile);\n\n    srcBuffer.forEach(function(file) {\n      self.push(file);\n    });\n\n    srcBuffer = [];\n    done();\n  });\n};\n\nfunction moduleNameToClosureName(name) {\n  // For Closure, all modules start with \"ngmaterial\". We specifically don't use `ng.`\n  // because it conflicts with other packages under `ng.`.\n  return 'ng' + name;\n}\nexports.addJsWrapper = function(enforce) {\n  return through2.obj(function(file, enc, next) {\n    const module = findModule.any(file.contents);\n    if (!!enforce || module) {\n      file.contents = Buffer.from([\n          enforce ? '(function(){' : '(function( window, angular, undefined ){',\n          '\"use strict\";\\n',\n          file.contents.toString(),\n          enforce ? '})();' : '})(window, window.angular);'\n      ].join('\\n'));\n    }\n    this.push(file);\n    next();\n  });\n};\nexports.addClosurePrefixes = function() {\n  return through2.obj(function(file, enc, next) {\n    const module = findModule.any(file.contents);\n    if (module) {\n      const closureModuleName = moduleNameToClosureName(module.name);\n      const requires = (module.dependencies || []).sort().map(function(dep) {\n        if (dep.indexOf(module.name) === 0 || /material\\..+/g.test(dep) === false) return '';\n        return 'goog.require(\\'' + moduleNameToClosureName(dep) + '\\');';\n      }).join('\\n');\n\n      file.contents = Buffer.from([\n          'goog.provide(\\'' + closureModuleName + '\\');',\n          requires,\n          file.contents.toString(),\n          closureModuleName + ' = angular.module(\"' + module.name + '\");'\n      ].join('\\n'));\n    }\n    this.push(file);\n    next();\n  });\n};\n\nexports.buildModuleBower = function(name, version) {\n  return through2.obj(function(file, enc, next) {\n    this.push(file);\n    const module = findModule.any(file.contents);\n    if (module) {\n      const bowerDeps = {};\n      (module.dependencies || []).forEach(function(dep) {\n        const convertedName = 'angular-material-' + dep.split('.').pop();\n        bowerDeps[convertedName] = version;\n      });\n      const bowerContents = JSON.stringify({\n        name: 'angular-material-' + name,\n        version: version,\n        dependencies: bowerDeps\n      }, null, 2);\n      const bowerFile = new gutil.File({\n        base: file.base,\n        path: file.base + '/bower.json',\n        contents: Buffer.from(bowerContents)\n      });\n      this.push(bowerFile);\n    }\n    next();\n  });\n};\n\nexports.hoistScssVariables = function() {\n  return through2.obj(function(file, enc, next) {\n    const contents = file.contents.toString().split('\\n');\n    let lastVariableLine = -1;\n\n    let openCount = 0;\n    let closeCount = 0;\n    let openBlock = false;\n\n    for (let currentLine = 0; currentLine < contents.length; ++currentLine) {\n      const line = contents[currentLine];\n\n      if (openBlock || /^\\s*\\$/.test(line) && !/^\\s+/.test(line)) {\n        openCount += (line.match(/\\(/g) || []).length;\n        closeCount += (line.match(/\\)/g) || []).length;\n        openBlock = openCount !== closeCount;\n        const variable = contents.splice(currentLine, 1)[0];\n        contents.splice(++lastVariableLine, 0, variable);\n      }\n    }\n    file.contents = Buffer.from(contents.join('\\n'));\n    this.push(file);\n    next();\n  });\n};\n\n/**\n * Find Sass @use module imports and ensure that they are at the very top of the Sass prior to\n * running it through the Sass compiler. This also deduplicates @use statements to avoid errors.\n */\nexports.hoistScssAtUseStatements = function() {\n  return through2.obj(function(file, enc, next) {\n    const contents = file.contents.toString().split('\\n');\n    let lastAtUseLineNumber = -1;\n    const atUseStatements = [];\n\n    let openCount = 0;\n    let closeCount = 0;\n    let openBlock = false;\n\n    for (let currentLineNumber = 0; currentLineNumber < contents.length; ++currentLineNumber) {\n      const line = contents[currentLineNumber];\n\n      if (openBlock || /^\\s*@use\\s/.test(line) && !/^\\s+/.test(line)) {\n        openCount += (line.match(/\\(/g) || []).length;\n        closeCount += (line.match(/\\)/g) || []).length;\n        openBlock = openCount !== closeCount;\n        // Don't move statements from line 0 to line 0.\n        if (currentLineNumber > 0) {\n          const atUseStatement = contents.splice(currentLineNumber, 1)[0];\n          // Don't write duplicate @use statements to avoid\n          // 'There's already a module with namespace x' errors.\n          if (!atUseStatements.includes(atUseStatement)) {\n            atUseStatements.push(atUseStatement);\n            contents.splice(++lastAtUseLineNumber, 0, atUseStatement);\n          }\n        }\n      }\n    }\n    file.contents = Buffer.from(contents.join('\\n'));\n    this.push(file);\n    next();\n  });\n};\n\nexports.cssToNgConstant = function(ngModule, factoryName) {\n  return through2.obj(function(file, enc, next) {\n\n    const template = '(function(){ \\nangular.module(\"%1\").constant(\"%2\", \"%3\"); \\n})();\\n\\n';\n    const output = file.contents.toString().replace(/\\n/g, '').replace(/\"/g,'\\\\\"');\n\n    const jsFile = new gutil.File({\n      base: file.base,\n      path: file.path.replace('css', 'js'),\n      contents: Buffer.from(\n        template.replace('%1', ngModule)\n          .replace('%2', factoryName)\n          .replace('%3', output)\n      )\n    });\n\n    this.push(jsFile);\n    next();\n  });\n};\n\n/**\n * Use the configuration in the \"browserslist\" field of the package.json as recommended\n * by the autoprefixer docs.\n * @returns {NodeJS.ReadWriteStream | *}\n */\nexports.autoprefix = function() {\n  return gulpPostcss([autoprefixer()]);\n};\n"
  },
  {
    "path": "scripts/sauce/setup-tunnel.sh",
    "content": "#!/bin/bash\n\nSAUCE_BINARY_FILE=\"sc-4.4.6-linux.tar.gz\"\nSAUCE_BINARY_DIR=\"/tmp/sauce\"\nSAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`\n\necho \"Installing Sauce Connector binaries...\"\n\nmkdir -p $SAUCE_BINARY_DIR\n\n# Install the Sauce Connector binary\nwget https://saucelabs.com/downloads/$SAUCE_BINARY_FILE -O $SAUCE_BINARY_DIR/$SAUCE_BINARY_FILE\ntar -xzf $SAUCE_BINARY_DIR/$SAUCE_BINARY_FILE -C $SAUCE_BINARY_DIR --strip-components=1\n\n# Arguments to be applied to the Sauce Connector.\nCONNECT_ARGS=\"--readyfile $SAUCE_READY_FILE\"\n\n# Apply the Travis Job Number to the tunnel\nif [ ! -z \"$TRAVIS_JOB_NUMBER\" ]; then\n  CONNECT_ARGS=\"$CONNECT_ARGS --tunnel-identifier $TRAVIS_JOB_ID\"\nfi\n\necho \"Starting Sauce Connector Tunnel\"\necho \"- Username: $SAUCE_USERNAME\"\necho \"- Arguments: $CONNECT_ARGS\"\n\n# Starting the Sauce Tunnel.\n$SAUCE_BINARY_DIR/bin/sc -vv -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY $CONNECT_ARGS &\n"
  },
  {
    "path": "scripts/sauce/stop-tunnel.sh",
    "content": "#!/bin/bash\n\n# Closes all instances of any Sauce Connector and waits for them to finish.\nkillall --wait sc"
  },
  {
    "path": "scripts/sauce/wait-tunnel.sh",
    "content": "#!/bin/bash\n\n# Wait for the tunnel to be ready.\nwhile [ ! -e $SAUCE_READY_FILE ]; do\n  sleep 1;\ndone\n\necho \"Sauce Tunnel is now ready\""
  },
  {
    "path": "scripts/snapshot-docs-site.sh",
    "content": "#!/bin/bash\n\nARG_DEFS=(\n  \"--version=(.*)\"\n)\n\nfunction run {\n  cd ../\n\n  echo \"-- Building docs site release...\"\n  rm -rf dist/\n  npm run build:docs:prod\n\n  echo \"-- Cloning code.material.angularjs.org...\"\n  rm -rf code.material.angularjs.org\n  git clone https://github.com/angular/code.material.angularjs.org --depth=1\n\n  echo \"-- Remove previous snapshot...\"\n  rm -rf code.material.angularjs.org/HEAD\n\n  echo \"-- Applying substitutions to build...\"\n  sed -i.bak \"s,http://localhost:8080/angular-material,https://gitcdn.xyz/cdn/angular/bower-material/v$VERSION/angular-material,g\" dist/docs/docs.js\n  sed -i.bak \"s,http://localhost:8080/docs.css,https://material.angularjs.org/$VERSION/docs.css,g\" dist/docs/docs.js\n  rm dist/docs/docs.js.bak\n  sed -i.bak \"s,base href=\\\",base href=\\\"/HEAD,g\" dist/docs/index.html\n  rm dist/docs/index.html.bak\n\n  echo \"-- Copying docs site to snapshot...\"\n  cp -Rf dist/docs code.material.angularjs.org/HEAD\n\n  echo \"-- Configuring Git...\"\n  commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)\n  commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)\n\n  cd code.material.angularjs.org/\n\n  git config user.name \"${commitAuthorName}\"\n  git config user.email \"${commitAuthorEmail}\"\n  # GitHub personal access token with push permission specified as environment variable\n  git config credential.helper \"store --file .git/credentials\"\n  echo \"-- Storing credentials...\"\n  echo \"https://${ANGULARJS_MATERIAL_DOCS_SITE_TOKEN}:@github.com\" > .git/credentials\n\n  echo \"-- Committing and tagging snapshot...\"\n  git add -A\n  git commit -am \"snapshot: v$VERSION\"\n  git tag -f v$VERSION\n\n  echo \"-- Pushing snapshot to code.material.angularjs.org...\"\n  git push -q origin master\n\n  cd ../\n\n  echo \"-- Cleanup...\"\n  rm -rf code.material.angularjs.org/\n\n  echo \"-- Successfully pushed the snapshot to angular/code.material.angularjs.org!!\"\n}\n\nsource $(dirname $0)/utils.inc\n"
  },
  {
    "path": "scripts/test-versions.sh",
    "content": "#!/bin/bash\n\n# The purpose of this file is to download\n# assigned AngularJS source files and test\n# them against this build of AngularJS Material using Jenkins.\n\n# This works by pulling in all of the tags\n# from AngularJS, finding the highest version\n# numbers for each branch (e.g. 1.5 => 1.5.X where\n# X is the highest patch release). For each\n# detected version it will then copy over each\n# of the source files to the node_modules/angular-X\n# folder and then run `gulp karma` to see if\n# they pass. If there are one or more failed tests\n# then this script will propagate a failed exit code.\n\n# [INPUT]\n# just run `./scripts/test-versions.sh`\n\n# [OUTPUT]\n# an exit code of \"0\" (passing) or \"1\" (failing)\n\n# [CONFIG VALUES]\n\n# Available Options are: 1.X, 1.X.X, 1.X.X-(beta|rc).X or snapshot\nVERSIONS=(1.5 1.6 1.7 snapshot)\nBROWSERS=\"Chrome\"\n\n#\n# DO NOT EDIT PAST THIS LINE\n#\nFAILED=false\n\nif [ ${#VERSIONS[@]} == 0 ]; then\n  echo \"Error: please specify one or more versions of AngularJS to test...\"\n  exit 1\nfi;\n\n\n\nfor VERSION in \"${VERSIONS[@]}\"; do\n\n  echo \"######################################################################\"\n  echo \"#######                     Jenkins Build                      #######\"\n  echo \"#######   Testing AngularJS Material + AngularJS (${VERSION})  #######\"\n  echo \"######################################################################\"\n\n  ./scripts/fetch-angular-version.sh $VERSION\n\n  echo \"\\n\"\n  pwd\n  node ./node_modules/gulp/bin/gulp.js karma --config=config/karma-jenkins.conf.js --reporters='dots' --browsers=$BROWSERS\n  LAST_EXIT_CODE=$?\n\n  echo \"\\n\"\n  echo \"......................................................................\"\n  echo \".......  Finished:  ngM1 + AngularJS (${VERSION})        .............\"\n  echo \"......................................................................\"\n  echo \"\\n\"\n\n  if [ $LAST_EXIT_CODE != \"0\" ]; then\n    echo \"STATUS: FAILED\"\n    FAILED=true\n  else\n    echo \"STATUS: SUCCESS\"\n  fi\n\n  echo \"\\n\\n\"\ndone\n\nif [ $FAILED == true ]; then\n  echo \"Error: One or more of the karma tests have failed...\"\n  exit 1\nelse\n  echo \"All tests have passed successfully...\"\nfi\n"
  },
  {
    "path": "scripts/utils.inc",
    "content": "# bash utils from angularjs\n\n# This file provides:\n# - a default control flow\n#   * initializes the environment\n#   * able to mock \"git push\" in your script and in all sub scripts\n#   * call a function in your script based on the arguments\n# - named argument parsing and automatic generation of the \"usage\" for your script\n# - intercepting \"git push\" in your script and all sub scripts\n# - utility functions\n#\n# Usage:\n# - define the variable ARGS_DEF (see below) with the arguments for your script\n# - include this file using `source utils.inc` at the end of your script.\n#\n# Default control flow:\n# 0. Set the current directory to the directory of the script. By this\n#    the script can be called from anywhere.\n# 1. Parse the named arguments\n# 2. If the parameter \"git_push_dryrun\" is set, all calls the `git push` in this script\n#    or in child scripts will be intercepted so that the `--dry-run` and `--porcelain` is added\n#    to show what the push would do but not actually do it.\n# 3. If the parameter \"verbose\" is set, the `-x` flag will be set in bash.\n# 4. The function \"init\" will be called if it exists\n# 5. If the parameter \"action\" is set, it will call the function with the name of that parameter.\n#    Otherwise the function \"run\" will be called.\n#\n# Named Argument Parsing:\n# - The variable ARGS_DEF defines the valid command arguments\n#   * Required args syntax: --paramName=paramRegex\n#   * Optional args syntax: [--paramName=paramRegex]\n#   * e.g. ARG_DEFS=(\"--required_param=(.+)\" \"[--optional_param=(.+)]\")\n# - Checks that:\n#   * all arguments match to an entry in ARGS_DEF\n#   * all required arguments are present\n#   * all arguments match their regex\n# - Afterwards, every parameter value will be stored in a variable\n#   with the name of the parameter in upper case (with dash converted to underscore).\n#\n# Special arguments that are always available:\n# - \"--action=.*\": This parameter will be used to dispatch to a function with that name when the\n#   script is started\n# - \"--git_push_dryrun=true\": This will intercept all calls to `git push` in this script\n#   or in child scripts so that the `--dry-run` and `--porcelain` is added\n#   to show what the push would do but not actually do it.\n# - \"--verbose=true\": This will set the `-x` flag in bash so that all calls will be logged\n#\n# Utility functions:\n# - readJsonProp\n# - replaceJsonProp\n# - resolveDir\n# - getVar\n# - serVar\n# - isFunction\n\n# always stop on errors\nset -e\n\nfunction usage {\n  echo \"Usage: ${0} ${ARG_DEFS[@]}\"\n  exit 1\n}\n\n\nfunction parseArgs {\n  local REQUIRED_ARG_NAMES=()\n\n  # -- helper functions\n  function varName {\n    # everything to upper case and dash to underscore\n    echo ${1//-/_} | tr '[:lower:]' '[:upper:]'\n  }\n\n  function readArgDefs {\n    local ARG_DEF\n    local AD_OPTIONAL\n    local AD_NAME\n    local AD_RE\n\n    # -- helper functions\n    function parseArgDef {\n      local ARG_DEF_REGEX=\"(\\[?)--([^=]+)=(.*)\"\n      if [[ ! $1 =~ $ARG_DEF_REGEX ]]; then\n        echo \"Internal error: arg def has wrong format: $ARG_DEF\"\n        exit 1\n      fi\n      AD_OPTIONAL=\"${BASH_REMATCH[1]}\"\n      AD_NAME=\"${BASH_REMATCH[2]}\"\n      AD_RE=\"${BASH_REMATCH[3]}\"\n      if [[ $AD_OPTIONAL ]]; then\n        # Remove last bracket for optional args.\n        # Can't put this into the ARG_DEF_REGEX somehow...\n        AD_RE=${AD_RE%?}\n      fi\n    }\n\n    # -- run\n    for ARG_DEF in \"${ARG_DEFS[@]}\"\n    do\n      parseArgDef $ARG_DEF\n\n      local AD_NAME_UPPER=$(varName $AD_NAME)\n      setVar \"${AD_NAME_UPPER}_OPTIONAL\" \"$AD_OPTIONAL\"\n      setVar \"${AD_NAME_UPPER}_RE\" \"$AD_RE\"\n      if [[ ! $AD_OPTIONAL ]]; then\n        REQUIRED_ARG_NAMES+=($AD_NAME)\n      fi\n    done\n  }\n\n  function readAndValidateArgs {\n    local ARG_NAME\n    local ARG_VALUE\n    local ARG_NAME_UPPER\n\n    # -- helper functions\n    function parseArg {\n      local ARG_REGEX=\"--([^=]+)=?(.*)\"\n\n      if [[ ! $1 =~ $ARG_REGEX ]]; then\n        echo \"Can't parse argument $i\"\n        usage\n      fi\n\n      ARG_NAME=\"${BASH_REMATCH[1]}\"\n      ARG_VALUE=\"${BASH_REMATCH[2]}\"\n      ARG_NAME_UPPER=$(varName $ARG_NAME)\n    }\n\n    function validateArg {\n      local AD_RE=$(getVar ${ARG_NAME_UPPER}_RE)\n\n      if [[ ! $AD_RE ]]; then\n        echo \"Unknown option: $ARG_NAME\"\n        usage\n      fi\n\n      if [[ ! $ARG_VALUE =~ ^${AD_RE}$ ]]; then\n        echo \"Wrong format: $ARG_NAME\"\n        usage;\n      fi\n\n      # validate that the \"action\" option points to a valid function\n      if [[ $ARG_NAME == \"action\" ]] && ! isFunction $ARG_VALUE; then\n        echo \"No action $ARG_VALUE defined in this script\"\n        usage;\n      fi\n    }\n\n    # -- run\n    for i in \"$@\"\n    do\n      parseArg $i\n      validateArg\n      setVar \"${ARG_NAME_UPPER}\" \"$ARG_VALUE\"\n    done\n  }\n\n  function checkMissingArgs {\n    local ARG_NAME\n    for ARG_NAME in \"${REQUIRED_ARG_NAMES[@]}\"\n    do\n      ARG_VALUE=$(getVar $(varName $ARG_NAME))\n\n      if [[ ! $ARG_VALUE ]]; then\n        echo \"Missing: $ARG_NAME\"\n        usage;\n      fi\n    done\n  }\n\n  # -- run\n  readArgDefs\n  readAndValidateArgs \"$@\"\n  checkMissingArgs\n\n}\n\n# getVar(varName)\nfunction getVar {\n  echo ${!1}\n}\n\n# setVar(varName, varValue)\nfunction setVar {\n  eval \"$1=\\\"$2\\\"\"\n}\n\n# isFunction(name)\n# - to be used in an if, so return 0 if successful and 1 if not!\nfunction isFunction {\n  if [[ $(type -t $1) == \"function\" ]]; then\n    return 0\n  else\n    return 1\n  fi\n}\n\n# readJsonProp(jsonFile, property)\n# - restriction: property needs to be on an own line!\nfunction readJsonProp {\n  echo $(sed -En 's/.*\"'$2'\"[ ]*:[ ]*\"(.*)\".*/\\1/p' $1)\n}\n\n# replaceJsonProp(jsonFile, property, newValue)\n# - note: propertyRegex will be automatically placed into a\n#   capturing group! -> all other groups start at index 2!\nfunction replaceJsonProp {\n  replaceInFile $1 \"\\\"$2\\\": \\\".*?\\\"\" \"\\\"$2\\\": \\\"$3\\\"\"\n}\n\n# replaceInFile(file, findPattern, replacePattern)\nfunction replaceInFile {\n  perl -pi -e \"s/$2/$3/g;\" $1\n}\n\n# resolveDir(relativeDir)\n# - resolves a directory relative to the current script\nfunction resolveDir {\n  echo $(cd $SCRIPT_DIR; cd $1; pwd)\n}\n\nfunction git_push_dryrun_proxy {\n  echo \"## git push dryrun proxy enabled!\"\n  export ORIGIN_GIT=$(which git)\n\n  function git {\n\t  local ARGS=(\"$@\")\n\t  local RC\n\t  if [[ $1 == \"push\" ]]; then\n\t    ARGS+=(\"--dry-run\" \"--porcelain\")\n\t    echo \"####### START GIT PUSH DRYRUN #######\"\n      echo \"${ARGS[@]}\"\n\t  fi\n\t  if [[ $1 == \"commit\" ]]; then\n      echo \"${ARGS[@]}\"\n\t  fi\n\t  $ORIGIN_GIT \"${ARGS[@]}\"\n\t  RC=$?\n\t  if [[ $1 == \"push\" ]]; then\n\t    echo \"####### END GIT PUSH DRYRUN #######\"\n\t  fi\n\t  return $RC\n  }\n\n  export -f git\n}\n\nfunction main {\n  # normalize the working dir to the directory of the script\n  cd $(dirname $0);SCRIPT_DIR=$(pwd)\n\n  ARG_DEFS+=(\"[--git-push-dryrun=(true|false)]\" \"[--verbose=(true|false)]\")\n  parseArgs \"$@\"\n\n  # --git_push_dryrun argument\n  if [[ $GIT_PUSH_DRYRUN == \"true\" ]]; then\n    git_push_dryrun_proxy\n  fi\n\n  # --verbose argument\n  if [[ $VERBOSE == \"true\" ]]; then\n    set -x\n  fi\n\n  if isFunction init; then\n    init \"$@\"\n  fi\n\n  # jump to the function denoted by the --action argument,\n  # otherwise call the \"run\" function\n  if [[ $ACTION ]]; then\n    $ACTION \"$@\"\n  else\n    run \"$@\"\n  fi\n}\n\n\nmain \"$@\"\n"
  },
  {
    "path": "scripts/write-presubmit-scheduler.js",
    "content": "#!/usr/bin/env node\n\nconst path = require('path');\nconst fs = require('fs');\nconst GitHubApi = require('github');\nconst github = new GitHubApi();\n\n\n/** CONFIGURATION: change these things if you want to tweak how the runs are made. */\n\n/** Path to the local ng-material. By default based on the location of this script. */\nconst localRepo = path.resolve(__dirname, '..');\n\n/** Where to write the output from the presubmit script. */\nconst logDir = '/tmp/v1-pr-presubmit-logs';\n\n/**\n * The presubmit script to use (can change this if you want to use a locally modified script).\n * The default path is stored in an environment variable because it references an internal-Google\n * location.\n */\nconst presubmitScript = path.join(process.env.MAT_PRESUBMIT_DIR, 'sync-material.sh');\n\n/** Time to start presubmits. */\nconst startTime = '9:30 pm';\n\n/** Number of minutes between presubmit runs. */\nconst intervalMinutes = 20;\n\n/** Instead of querying github for PR numbers, manually provide the PR numbers to be presubmit */\nconst explicitPullRequests = [];\n\n/** END OF CONFIGURATION. */\n\n\n\n/** Number of intervals that have scheduled tasks already. */\nlet presubmitCount = 0;\n\nif (explicitPullRequests.length) {\n  writeScheduleScript(explicitPullRequests.map(n => ({number: n})));\n} else {\n  // Fetch PRs that are merge-ready but not merge-safe\n  github.search.issues({\n    per_page: 100,\n    q: 'repo:angular/material is:open type:pr label:\"pr: merge ready\" -label:\"pr: merge safe\"',\n  }, (error, response) => {\n    if (response) {\n      writeScheduleScript(response.data.items);\n    } else {\n      console.error('Fetching merge-ready PRs failed.');\n      console.error(error);\n    }\n  });\n}\n\n\nfunction writeScheduleScript(prs) {\n  let script =\n    `#!/bin/bash \\n\\n` +\n    `mkdir -p ${logDir} \\n\\n` +\n    `# Be sure you have no locally modified files in your git client before running this. \\n\\n`;\n\n  // Generate a command for each file to be piped into the `at` command, scheduling it to run at\n  // a later time.\n  for (const pr of prs) {\n    script +=\n      `echo '(` +\n        `cd ${localRepo} ; ` +\n        `${presubmitScript} presubmit ${pr.number} --global 2>&1 > ${logDir}/pr-${pr.number}.txt ` +\n      `)' | ` +\n      `at ${startTime} today + ${intervalMinutes * presubmitCount} min ` +\n    `\\n`;\n\n    presubmitCount++;\n  }\n\n  fs.writeFileSync(path.join(localRepo, 'dist', 'schedule-presubmit.sh'), script, 'utf-8');\n\n  console.log('schedule-presubmit.sh written to dist');\n  console.log('Be sure to prodaccess overnight, that you have no locally modified files, ' +\n              'and push_tag has been run');\n}\n"
  },
  {
    "path": "src/components/autocomplete/autocomplete-theme.scss",
    "content": "@mixin md-autocomplete-input($input-color) {\n  md-input-container.md-input-focused {\n    .md-input {\n      border-color: $input-color;\n    }\n    label,\n    md-icon {\n      color: $input-color;\n    }\n  }\n}\n@mixin md-autocomplete-progress($container-color, $bar-color) {\n  md-progress-linear {\n    .md-container {\n      background-color: $container-color;\n    }\n    .md-bar {\n      background-color: $bar-color;\n    }\n  }\n}\nmd-autocomplete.md-THEME_NAME-theme {\n  background: '{{background-hue-1}}';\n  &[disabled]:not([md-floating-label]) {\n    background: '{{background-hue-2}}';\n  }\n  button {\n    md-icon {\n      path {\n        fill: '{{background-600}}';\n      }\n    }\n    &:after {\n      background: '{{background-600-0.3}}';\n    }\n  }\n  input {\n    color: '{{foreground-1}}';\n  }\n  &.md-accent {\n    @include md-autocomplete-input('{{accent-color}}');\n    @include md-autocomplete-progress('{{accent-100}}', '{{accent-color}}');\n  }\n  &.md-warn {\n    @include md-autocomplete-input('{{warn-A700}}');\n    @include md-autocomplete-progress('{{warn-100}}', '{{warn-color}}');\n  }\n}\n.md-autocomplete-suggestions-container.md-THEME_NAME-theme,\n.md-autocomplete-standard-list-container.md-THEME_NAME-theme {\n  background: '{{background-hue-1}}';\n  .md-autocomplete-suggestion {\n    color: '{{foreground-1}}';\n    &:hover,\n    &.selected {\n      background: '{{background-500-0.18}}';\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/autocomplete/autocomplete.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.autocomplete\n */\n/*\n * @see js folder for autocomplete implementation\n */\nangular.module('material.components.autocomplete', [\n  'material.core',\n  'material.components.icon',\n  'material.components.virtualRepeat'\n]);\n"
  },
  {
    "path": "src/components/autocomplete/autocomplete.scss",
    "content": "// The default item height is also specified in the JavaScript.\n$md-autocomplete-item-height: 48px !default;\n$md-autocomplete-clear-size: 30px !default;\n$md-autocomplete-input-offset: 20px !default;\n\nmd-autocomplete {\n  border-radius: 2px;\n  display: block;\n  height: 40px;\n  position: relative;\n  overflow: visible;\n  min-width: 190px;\n  &[disabled] {\n    input {\n      cursor: default;\n    }\n  }\n  &[md-floating-label] {\n    border-radius: 0;\n    background: transparent;\n    height: auto;\n\n    md-input-container {\n      padding-bottom: 0;\n    }\n    md-autocomplete-wrap {\n      height: auto;\n    }\n\n    .md-show-clear-button {\n      button {\n        display: block;\n        position: absolute;\n        right: 0;\n        top: $md-autocomplete-input-offset;\n        width: $md-autocomplete-clear-size;\n        height: $md-autocomplete-clear-size;\n      }\n\n      input {\n        // Add padding to the end of the input to avoid overlapping with the clear button.\n        @include rtl-prop(padding-right, padding-left, $md-autocomplete-clear-size, 0);\n      }\n    }\n  }\n  md-autocomplete-wrap {\n    // Layout [layout='row']\n    display: flex;\n    flex-direction: row;\n    box-sizing: border-box;\n\n    position: relative;\n    overflow: visible;\n    height: 40px;\n    &.md-menu-showing {\n      z-index: $z-index-backdrop + 1;\n    }\n\n    md-input-container,\n    input {\n      // Layout [flex]\n      flex: 1 1 0;\n      box-sizing: border-box;\n      min-width : 0;\n    }\n\n    md-progress-linear {\n      position: absolute;\n      bottom: -2px;\n      left: 0;\n      // When `md-inline` is present, we adjust the offset to go over the `ng-message` space\n      &.md-inline {\n        bottom: 40px;\n        right: 2px;\n        left: 2px;\n        width: auto;\n      }\n      .md-mode-indeterminate {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 100%;\n        height: 3px;\n        transition: none;\n\n        .md-container {\n          transition: none;\n          height: 3px;\n        }\n        &.ng-enter {\n          transition: opacity 0.15s linear;\n          &.ng-enter-active {\n            opacity: 1;\n          }\n        }\n        &.ng-leave {\n          transition: opacity 0.15s linear;\n          &.ng-leave-active {\n            opacity: 0;\n          }\n        }\n      }\n    }\n  }\n  input:not(.md-input) {\n    @include md-flat-input();\n    width: 100%;\n    padding: 0 15px;\n    line-height: 40px;\n    height: 40px;\n  }\n  .md-show-clear-button button {\n    position: relative;\n    line-height: 20px;\n    text-align: center;\n    width: $md-autocomplete-clear-size;\n    height: $md-autocomplete-clear-size;\n    cursor: pointer;\n    border: none;\n    border-radius: 50%;\n    padding: 0;\n    font-size: 12px;\n    background: transparent;\n    margin: auto 5px;\n    &:after {\n      content: '';\n      position: absolute;\n      top: -6px;\n      right: -6px;\n      bottom: -6px;\n      left: -6px;\n      border-radius: 50%;\n      transform: scale(0);\n      opacity: 0;\n      transition: $swift-ease-out;\n    }\n    &:focus {\n      outline: none;\n\n      &:after {\n        transform: scale(1);\n        opacity: 1;\n      }\n    }\n    md-icon {\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate3d(-50%, -50%, 0) scale(0.9);\n      path {\n        stroke-width: 0;\n      }\n    }\n    &.ng-enter {\n      transform: scale(0);\n      transition: transform 0.15s ease-out;\n      &.ng-enter-active {\n        transform: scale(1);\n      }\n    }\n    &.ng-leave {\n      transition: transform 0.15s ease-out;\n      &.ng-leave-active {\n        transform: scale(0);\n      }\n    }\n  }\n  // IE Only\n  @media screen and (-ms-high-contrast: active) {\n    $border-color: #fff;\n\n    input {\n      border: 1px solid $border-color;\n    }\n    .md-autocomplete-suggestion:focus {\n      color: #fff;\n    }\n  }\n}\n\n.md-virtual-repeat-container.md-autocomplete-suggestions-container,\n.md-standard-list-container.md-autocomplete-suggestions-container {\n  position: absolute;\n  box-shadow: 0 2px 5px rgba(black, 0.25);\n  z-index: $z-index-tooltip;\n\n  // Expand the virtualRepeatContainer as much as the max-height from the JavaScript allows.\n  // This is necessary for the virtualRepeatContainer to be able to grow back.\n  height: 100%;\n\n  .highlight {\n    font-weight: bold;\n  }\n}\n\n.md-standard-list-container {\n  box-sizing: border-box;\n  display: block;\n  margin: 0;\n  overflow: hidden;\n  overflow-y: auto;\n  padding: 0;\n}\n\n.md-virtual-repeat-container.md-not-found,\n.md-standard-list-container.md-not-found {\n  height: $md-autocomplete-item-height;\n}\n\n.md-autocomplete-suggestions {\n  margin: 0;\n  list-style: none;\n  padding: 0;\n\n  .md-autocomplete-suggestion {\n    font-size: 14px;\n    overflow: hidden;\n    padding: 0 15px;\n    line-height: $md-autocomplete-item-height;\n    height: $md-autocomplete-item-height;\n    transition: background 0.15s linear;\n    margin: 0;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n\n    &:focus {\n      outline: none;\n    }\n\n    &:not(.md-not-found-wrapper) {\n      cursor: pointer;\n    }\n  }\n}\n\n// IE Only\n@media screen and (-ms-high-contrast: active) {\n  md-autocomplete,\n  .md-autocomplete-suggestions {\n    border: 1px solid #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/autocomplete/autocomplete.spec.js",
    "content": "describe('<md-autocomplete>', function() {\n\n  var element, scope;\n\n  beforeEach(module('material.components.autocomplete'));\n\n  afterEach(function() {\n    scope && scope.$destroy();\n  });\n\n  function compile(template, scope) {\n\n    inject(function($compile) {\n      element = $compile(template)(scope);\n      scope.$apply();\n    });\n\n    return element;\n  }\n\n  function createScope(items, scopeData, matchLowercase) {\n\n    items = items || ['foo', 'bar', 'baz'].map(function(item) {\n        return { display: item };\n      });\n\n    inject(function($rootScope, $timeout) {\n      scope = $rootScope.$new();\n\n      scope.match = function(term) {\n        return items.filter(function(item) {\n          return item.display.indexOf(matchLowercase ? term.toLowerCase() : term) === 0;\n        });\n      };\n\n      scope.asyncMatch = function(term) {\n        return $timeout(function() {\n          return scope.match(term);\n        }, 1000);\n      };\n\n      scope.searchText = '';\n      scope.selectedItem = null;\n      scope.items = items;\n\n      angular.forEach(scopeData, function(value, key) {\n        scope[key] = value;\n      });\n    });\n\n    return scope;\n  }\n\n  function keydownEvent(keyCode) {\n    return {\n      keyCode: keyCode,\n      stopImmediatePropagation: angular.noop,\n      stopPropagation: angular.noop,\n      preventDefault: angular.noop\n    };\n  }\n\n  function waitForVirtualRepeat() {\n    // Because the autocomplete does not make the suggestions menu visible\n    // off the bat, the virtual repeat needs a couple more iterations to\n    // figure out how tall it is and then how tall the repeated items are.\n\n    // Using md-item-size would reduce this to a single flush, but given that\n    // autocomplete allows for custom row templates, it's better to measure\n    // rather than assuming a given size.\n    inject(function($material, $timeout) {\n      $material.flushOutstandingAnimations();\n      $timeout.flush();\n    });\n  }\n\n  describe('basic functionality', function() {\n\n    it('updates selected item and search text', inject(function($timeout, $mdConstant, $material) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      $material.flushInterimElement();\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'fo';\n      waitForVirtualRepeat(element);\n\n      // Check expectations\n      expect(scope.searchText).toBe('fo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n\n      expect(ul.find('li').length).toBe(1);\n\n      // Run our key events\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n      $timeout.flush();\n\n      // Check expectations again\n      expect(scope.searchText).toBe('foo');\n      expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]);\n\n      element.remove();\n    }));\n\n    it('should clear the searchText when the selectedItem manually got cleared',\n      inject(function($timeout, $material, $mdConstant) {\n        var scope = createScope();\n\n        var template =\n          '<md-autocomplete ' +\n          'md-selected-item=\"selectedItem\" ' +\n          'md-search-text=\"searchText\" ' +\n          'md-items=\"item in match(searchText)\" ' +\n          'md-item-text=\"item.display\" ' +\n          'placeholder=\"placeholder\"> ' +\n          '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n          '</md-autocomplete>';\n\n        var element = compile(template, scope);\n        var ctrl = element.controller('mdAutocomplete');\n        var ul = element.find('ul');\n\n        $material.flushInterimElement();\n\n        expect(scope.searchText).toBe('');\n        expect(scope.selectedItem).toBe(null);\n\n        ctrl.focus();\n\n        scope.$apply('searchText = \"fo\"');\n        waitForVirtualRepeat(element);\n\n        expect(scope.searchText).toBe('fo');\n        expect(scope.match(scope.searchText).length).toBe(1);\n\n        expect(ul.find('li').length).toBe(1);\n\n        // Run our key events to trigger a select action\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n        $timeout.flush();\n\n        expect(scope.searchText).toBe('foo');\n        expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]);\n\n        // Reset / Clear the current selected item.\n        scope.$apply('selectedItem = null');\n        waitForVirtualRepeat(element);\n\n        // Run our key events to trigger a select action\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n        $timeout.flush();\n\n        // The autocomplete automatically clears the searchText when the selectedItem was cleared.\n        expect(scope.searchText).toBe('');\n        expect(scope.selectedItem).toBeFalsy();\n\n        element.remove();\n      }));\n\n    it('should should not clear the searchText when clearing the selected item from the input',\n      inject(function($timeout, $material, $mdConstant) {\n        var scope = createScope();\n\n        var template =\n          '<md-autocomplete ' +\n          'md-selected-item=\"selectedItem\" ' +\n          'md-search-text=\"searchText\" ' +\n          'md-items=\"item in match(searchText)\" ' +\n          'md-item-text=\"item.display\" ' +\n          'placeholder=\"placeholder\"> ' +\n          '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n          '</md-autocomplete>';\n\n        var element = compile(template, scope);\n        var ctrl = element.controller('mdAutocomplete');\n        var ul = element.find('ul');\n\n        $material.flushInterimElement();\n\n        expect(scope.searchText).toBe('');\n        expect(scope.selectedItem).toBe(null);\n\n        ctrl.focus();\n\n        scope.$apply('searchText = \"fo\"');\n        waitForVirtualRepeat(element);\n\n        expect(scope.searchText).toBe('fo');\n        expect(scope.match(scope.searchText).length).toBe(1);\n\n        expect(ul.find('li').length).toBe(1);\n\n        // Run our key events to trigger a select action\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n        $timeout.flush();\n\n        expect(scope.searchText).toBe('foo');\n        expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]);\n\n        scope.$apply('searchText = \"food\"');\n\n        $timeout.flush();\n\n        // The autocomplete automatically clears the searchText when the selectedItem was cleared.\n        expect(scope.searchText).toBe('food');\n        expect(scope.selectedItem).toBeFalsy();\n\n        element.remove();\n      }));\n\n    it('allows you to set an input id without floating label', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template = '\\\n          <md-autocomplete\\\n              md-input-id=\"{{inputId}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('id')).toBe(scope.inputId);\n\n      element.remove();\n    }));\n\n    it('should allow you to set a class to the md-virtual-repeat-container element', inject(function() {\n      var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-menu-container-class=\"{{menuContainerClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var repeatContainer = element.find('md-virtual-repeat-container');\n\n      expect(repeatContainer.attr('class')).toContain(scope.menuContainerClass);\n\n      element.remove();\n    }));\n\n    it('should use ng-repeat for standard-mode lists', inject(function() {\n      var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-menu-container-class=\"{{menuContainerClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              md-mode=\"standard\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var repeatingElement = element[0].querySelector('.md-standard-list-container li[ng-repeat]');\n      expect(repeatingElement).toBeDefined();\n\n      element.remove();\n    }));\n\n    it('should use md-virtual-repeat for virtual-mode lists', inject(function() {\n      var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-menu-container-class=\"{{menuContainerClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              md-mode=\"virtual\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var repeatingElement = element[0].querySelector('.md-virtual-repeat-container li[md-virtual-repeat]');\n      expect(repeatingElement).toBeDefined();\n\n      element.remove();\n    }));\n\n    it('should default to virtual-mode lists when md-mode is unspecified', inject(function() {\n      var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-menu-container-class=\"{{menuContainerClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var repeatingElement = element[0].querySelector(\n        '.md-virtual-repeat-container li[md-virtual-repeat]');\n      expect(repeatingElement).toBeDefined();\n\n      element.remove();\n    }));\n\n    it('should allow you to set a class to the standard mode .md-standard-list-container ' +\n        'element', inject(function() {\n      var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-menu-container-class=\"{{menuContainerClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              md-mode=\"standard\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var repeatContainer = element[0].querySelector('.md-standard-list-container');\n      expect(repeatContainer.classList.contains(scope.menuContainerClass)).toBe(true);\n\n      element.remove();\n    }));\n\n    it('allows using ng-readonly', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template = '\\\n          <md-autocomplete\\\n              md-input-id=\"{{inputId}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              ng-readonly=\"readonly\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      scope.readonly = true;\n      scope.$digest();\n\n      expect(input.attr('readonly')).toBe('readonly');\n\n      scope.readonly = false;\n      scope.$digest();\n\n      expect(input.attr('readonly')).toBeUndefined();\n\n      element.remove();\n    }));\n\n    it('does not open panel when ng-readonly is true', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template = '\\\n          <md-autocomplete\\\n              md-input-id=\"{{inputId}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              md-min-length=\"0\"\\\n              ng-readonly=\"readonly\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var input = element.find('input');\n\n      scope.readonly = false;\n      scope.$digest();\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(input.attr('readonly')).toBeUndefined();\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.blur();\n      scope.readonly = true;\n      scope.$digest();\n      expect(ctrl.hidden).toBe(true);\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(input.attr('readonly')).toBe('readonly');\n      expect(ctrl.hidden).toBe(true);\n\n      element.remove();\n    }));\n\n    it('should forward focus to the input element with md-autofocus', inject(function($timeout) {\n\n      var scope = createScope();\n\n      var template =\n        '<md-autocomplete ' +\n        '    md-selected-item=\"selectedItem\" ' +\n        '    md-search-text=\"searchText\" ' +\n        '    md-items=\"item in match(searchText)\" ' +\n        '    md-item-text=\"item.display\" ' +\n        '    placeholder=\"placeholder\"' +\n        '    md-autofocus>' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      document.body.appendChild(element[0]);\n\n      // Initial timeout for gathering elements\n      $timeout.flush();\n\n      element.triggerHandler('focus');\n\n      expect(document.activeElement).toBe(input[0]);\n\n      element.remove();\n    }));\n\n    it('allows using an empty readonly attribute', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template = '\\\n          <md-autocomplete\\\n              md-input-id=\"{{inputId}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              readonly>\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('readonly')).toBe('readonly');\n\n      element.remove();\n    }));\n\n    it('allows you to set an input id with floating label', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template = '\\\n          <md-autocomplete\\\n              md-floating-label=\"Some Label\"\\\n              md-input-id=\"{{inputId}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('id')).toBe(scope.inputId);\n\n      element.remove();\n    }));\n\n    it('forwards the `md-input-class` attribute to the input', function() {\n      var scope = createScope(null, {inputClass: 'custom-input-class'});\n      var template = '\\\n          <md-autocomplete\\\n              md-floating-label=\"Some Label\"\\\n              md-input-class=\"{{inputClass}}\"\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input).toHaveClass(scope.inputClass);\n\n      element.remove();\n    });\n\n    it('forwards the `md-select-on-focus` attribute to the input', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template =\n        '<md-autocomplete ' +\n        'md-input-id=\"{{inputId}}\" ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-select-on-focus=\"\" ' +\n        'tabindex=\"3\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('md-select-on-focus')).toBe(\"\");\n\n      element.remove();\n    }));\n\n    it('should support ng-click on the md-autocomplete', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      scope.test = false;\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'ng-click=\"test = true\" ' +\n        'placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(scope.test).toBe(false);\n\n      input[0].click();\n\n      expect(scope.test).toBe(true);\n\n      element.remove();\n    }));\n\n    it('should support ng-trim for the search input', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'ng-trim=\"false\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('ng-trim')).toBe(\"false\");\n\n      scope.$apply('searchText = \"      Text    \"');\n\n      expect(scope.searchText).not.toBe('Text');\n\n      element.remove();\n    }));\n\n    it('should support ng-pattern for the search input', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template =\n        '<form name=\"testForm\">' +\n        '<md-autocomplete ' +\n        'md-input-name=\"autocomplete\" ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'ng-pattern=\"/^[0-9]$/\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</form>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('ng-pattern')).toBeTruthy();\n\n      scope.$apply('searchText = \"Test\"');\n\n      expect(scope.testForm.autocomplete.$error['pattern']).toBeTruthy();\n\n      scope.$apply('searchText = \"3\"');\n\n      expect(scope.testForm.autocomplete.$error['pattern']).toBeFalsy();\n\n      element.remove();\n    }));\n\n    it('forwards the tabindex to the input', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template =\n        '<md-autocomplete ' +\n        'md-input-id=\"{{inputId}}\" ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'tabindex=\"3\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('tabindex')).toBe('3');\n\n      element.remove();\n    }));\n\n    it('always sets the tabindex of the autocomplete to `-1`', inject(function() {\n      var scope = createScope(null, {inputId: 'custom-input-id'});\n      var template =\n        '<md-autocomplete ' +\n        'md-input-id=\"{{inputId}}\" ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'tabindex=\"3\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n\n      expect(element.attr('tabindex')).toBe('-1');\n\n      element.remove();\n    }));\n\n    it('should emit the ngBlur event from the input', inject(function() {\n      var scope = createScope(null, {\n        onBlur: jasmine.createSpy('onBlur event')\n      });\n\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'ng-blur=\"onBlur($event)\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      input.triggerHandler('blur');\n\n      expect(scope.onBlur).toHaveBeenCalledTimes(1);\n\n      // Confirm that the ngFocus event was called with the $event local.\n      var focusEvent = scope.onBlur.calls.mostRecent().args[0];\n      expect(focusEvent.target).toBe(input[0]);\n\n      element.remove();\n    }));\n\n    it('should emit the ngFocus event from the input', inject(function() {\n      var scope = createScope(null, {\n        onFocus: jasmine.createSpy('onFocus event')\n      });\n\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'ng-focus=\"onFocus($event)\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      input.triggerHandler('focus');\n\n      expect(scope.onFocus).toHaveBeenCalledTimes(1);\n\n      // Confirm that the ngFocus event was called with the $event object.\n      var focusEvent = scope.onFocus.calls.mostRecent().args[0];\n      expect(focusEvent.target).toBe(input[0]);\n\n      element.remove();\n    }));\n\n    it('should not show a loading progress when the items object is invalid', inject(function() {\n      var scope = createScope(null, {\n        match: function() {\n          // Return an invalid object, which is not an array, neither a promise.\n          return {};\n        }\n      });\n\n      var template =\n        '<md-autocomplete ' +\n        'md-input-id=\"{{inputId}}\" ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'tabindex=\"3\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      scope.$apply('searchText = \"test\"');\n\n      expect(ctrl.loading).toBe(false);\n\n      element.remove();\n    }));\n\n    it('clears the value when hitting escape', inject(function($mdConstant, $timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      expect(scope.searchText).toBe('');\n\n      scope.$apply('searchText = \"test\"');\n\n      expect(scope.searchText).toBe('test');\n\n      $timeout.flush();\n      scope.$apply(function() {\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n      });\n\n      expect(scope.searchText).toBe('');\n\n      element.remove();\n    }));\n\n    describe('md-input-maxlength', function() {\n\n      it('should correctly set the form to invalid if floating label is present', function() {\n        var scope = createScope(null, {inputId: 'custom-input-id'});\n        var template =\n          '<form name=\"testForm\">' +\n          '<md-autocomplete ' +\n          'md-input-id=\"{{inputId}}\" ' +\n          'md-input-maxlength=\"2\" ' +\n          'md-input-name=\"testAutocomplete\" ' +\n          'md-selected-item=\"selectedItem\" ' +\n          'md-search-text=\"searchText\" ' +\n          'md-items=\"item in match(searchText)\" ' +\n          'md-item-text=\"item.display\" ' +\n          'tabindex=\"3\" ' +\n          'md-floating-label=\"Favorite state\">' +\n          '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n          '</md-autocomplete>' +\n          '</form>';\n\n        var element = compile(template, scope);\n\n        expect(scope.searchText).toBe('');\n        expect(scope.testForm.$valid).toBe(true);\n\n        scope.$apply('searchText = \"Exceeded\"');\n\n        expect(scope.testForm.$valid).toBe(false);\n\n        element.remove();\n      });\n\n      it('should correctly set the form to invalid when no floating label is present', function() {\n        var scope = createScope(null, {inputId: 'custom-input-id'});\n        var template =\n          '<form name=\"testForm\">' +\n            '<md-autocomplete ' +\n                'md-input-id=\"{{inputId}}\" ' +\n                'md-input-maxlength=\"5\" ' +\n                'md-input-name=\"testAutocomplete\" ' +\n                'md-selected-item=\"selectedItem\" ' +\n                'md-search-text=\"searchText\" ' +\n                'md-items=\"item in match(searchText)\" ' +\n                'md-item-text=\"item.display\" >' +\n              '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n            '</md-autocomplete>' +\n          '</form>';\n\n        var element = compile(template, scope);\n\n        expect(scope.searchText).toBe('');\n        expect(scope.testForm.$valid).toBe(true);\n\n        scope.$apply('searchText = \"Exceeded\"');\n\n        expect(scope.testForm.$valid).toBe(false);\n\n        element.remove();\n      });\n\n      it('should not clear the view value if the input is invalid', function() {\n        var scope = createScope(null, {inputId: 'custom-input-id'});\n        var template =\n          '<form name=\"testForm\">' +\n          '<md-autocomplete ' +\n          'md-input-id=\"{{inputId}}\" ' +\n          'md-input-maxlength=\"2\" ' +\n          'md-input-name=\"testAutocomplete\" ' +\n          'md-selected-item=\"selectedItem\" ' +\n          'md-search-text=\"searchText\" ' +\n          'md-items=\"item in match(searchText)\" ' +\n          'md-item-text=\"item.display\" ' +\n          'tabindex=\"3\" ' +\n          'md-floating-label=\"Favorite state\">' +\n          '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n          '</md-autocomplete>' +\n          '</form>';\n\n        var element = compile(template, scope);\n        var input = element.find('input');\n\n        expect(scope.searchText).toBe('');\n        expect(scope.testForm.$valid).toBe(true);\n\n        input.val('Exceeded');\n        input.triggerHandler('change');\n        scope.$digest();\n\n        expect(scope.testForm.$valid).toBe(false);\n        expect(scope.searchText).toBe('Exceeded');\n\n        element.remove();\n      });\n    });\n\n    describe('md-input-minlength', function() {\n\n      it('should correctly set the form to invalid when floating label is present', function() {\n        var scope = createScope(null, {inputId: 'custom-input-id'});\n        var template =\n          '<form name=\"testForm\">' +\n            '<md-autocomplete ' +\n                'md-input-id=\"{{inputId}}\" ' +\n                'md-input-minlength=\"4\" ' +\n                'md-input-name=\"testAutocomplete\" ' +\n                'md-selected-item=\"selectedItem\" ' +\n                'md-search-text=\"searchText\" ' +\n                'md-items=\"item in match(searchText)\" ' +\n                'md-item-text=\"item.display\" ' +\n                'tabindex=\"3\" ' +\n                'md-floating-label=\"Favorite state\">' +\n              '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n            '</md-autocomplete>' +\n          '</form>';\n\n        var element = compile(template, scope);\n\n        scope.$apply('searchText = \"abc\"');\n\n        expect(scope.testForm.$valid).toBe(false);\n\n        scope.$apply('searchText = \"abcde\"');\n\n        expect(scope.testForm.$valid).toBe(true);\n\n        element.remove();\n      });\n\n      it('should correctly set the form to invalid when no floating label is present', function() {\n        var scope = createScope(null, {inputId: 'custom-input-id'});\n        var template =\n          '<form name=\"testForm\">' +\n            '<md-autocomplete ' +\n                'md-input-id=\"{{inputId}}\" ' +\n                'md-input-minlength=\"4\" ' +\n                'md-input-name=\"testAutocomplete\" ' +\n                'md-selected-item=\"selectedItem\" ' +\n                'md-search-text=\"searchText\" ' +\n                'md-items=\"item in match(searchText)\" ' +\n                'md-item-text=\"item.display\" >' +\n              '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n            '</md-autocomplete>' +\n          '</form>';\n\n        var element = compile(template, scope);\n\n        scope.$apply('searchText = \"abc\"');\n\n        expect(scope.testForm.$valid).toBe(false);\n\n        scope.$apply('searchText = \"abcde\"');\n\n        expect(scope.testForm.$valid).toBe(true);\n\n        element.remove();\n      });\n    });\n\n    describe('md-escape-options checks', function() {\n      var scope, ctrl, element;\n      var template = '\\\n              <md-autocomplete\\\n                  md-escape-options=\"{{escapeOptions}}\"\\\n                  md-search-text=\"searchText\"\\\n                  md-items=\"item in match(searchText)\"\\\n                  md-item-text=\"item.display\"\\\n                  placeholder=\"placeholder\">\\\n                <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n              </md-autocomplete>';\n      beforeEach(inject(function($timeout, $material) {\n        scope = createScope();\n        element = compile(template, scope);\n        ctrl = element.controller('mdAutocomplete');\n\n        $material.flushInterimElement();\n\n        // Update the scope\n        element.scope().searchText = 'fo';\n        waitForVirtualRepeat(element);\n\n        // Focus the input\n        ctrl.focus();\n        $timeout.flush();\n\n        expect(ctrl.hidden).toBe(false);\n\n        expect(scope.searchText).toBe('fo');\n\n        waitForVirtualRepeat(element);\n        $timeout.flush();\n        expect(ctrl.hidden).toBe(false);\n      }));\n\n      afterEach(function() { element.remove(); });\n      it('does not clear the value nor blur when hitting escape', inject(function($mdConstant, $document, $timeout) {\n        scope.$apply('escapeOptions = \"none\"');\n        scope.$apply(function() {\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n          expect(ctrl.hidden).toBe(true);\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n        });\n\n        expect(scope.searchText).toBe('fo');\n        expect($document.activeElement).toBe(ctrl[0]);\n      }));\n\n      it('does not clear the value but does blur when hitting escape', inject(function($mdConstant, $document, $timeout) {\n        scope.$apply('escapeOptions = \"blur\"');\n        scope.$apply(function() {\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n          expect(ctrl.hidden).toBe(true);\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n        });\n\n        expect(scope.searchText).toBe('fo');\n        expect($document.activeElement).toBe(undefined);\n      }));\n\n      it('clear the value but does not blur when hitting escape', inject(function($mdConstant, $document, $timeout) {\n        scope.$apply('escapeOptions = \"clear\"');\n        scope.$apply(function() {\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n          expect(ctrl.hidden).toBe(true);\n          ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n          $timeout.flush();\n        });\n\n        expect(scope.searchText).toBe('');\n        expect($document.activeElement).toBe(ctrl[0]);\n      }));\n\n    });\n\n    it('should not show the progressbar when hitting escape on an empty input', inject(function($mdConstant, $timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\">\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $timeout.flush();\n      scope.$apply(function() {\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n      });\n\n      expect(element.find('md-progress-linear').length).toBe(0);\n\n      element.remove();\n    }));\n\n    it('should not close list on ENTER key if nothing is selected', inject(function($timeout, $mdConstant, $material) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $material.flushInterimElement();\n\n      // Update the scope\n      element.scope().searchText = 'fo';\n      waitForVirtualRepeat(element);\n\n      // Focus the input\n      ctrl.focus();\n      $timeout.flush();\n\n      expect(ctrl.hidden).toBe(false);\n\n      // Run our key events\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n      $timeout.flush();\n\n      // Check expectations again\n      expect(ctrl.hidden).toBe(false);\n\n      element.remove();\n    }));\n  });\n\n  describe('basic functionality with template', function() {\n    it('updates selected item and search text', inject(function($timeout, $material, $mdConstant) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <md-item-template>\\\n              <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n            </md-item-template>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      $material.flushInterimElement();\n\n      // Focus the input\n      ctrl.focus();\n\n      element.scope().searchText = 'fo';\n      waitForVirtualRepeat(element);\n\n      expect(scope.searchText).toBe('fo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n      expect(ul.find('li').length).toBe(1);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('foo');\n      expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]);\n\n      element.remove();\n    }));\n\n    it('properly clears values when the item ends in a space character', inject(function($timeout, $material, $mdConstant) {\n      var myItems = ['foo ', 'bar', 'baz'].map(function(item) {\n        return {display: item};\n      });\n      var scope = createScope(myItems);\n\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <md-item-template>\\\n              <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n            </md-item-template>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      $material.flushInterimElement();\n\n      // Focus the input\n      ctrl.focus();\n\n      element.scope().searchText = 'fo';\n      waitForVirtualRepeat(element);\n\n      expect(scope.searchText).toBe('fo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n      expect(ul.find('li').length).toBe(1);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('foo ');\n      expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]);\n\n      ctrl.clear();\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      element.remove();\n    }));\n\n    it('compiles the template against the parent scope', inject(function($timeout, $material) {\n      var scope = createScope(null, {bang: 'boom'});\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        ' <md-item-template>' +\n        '   <span class=\"find-parent-scope\">{{bang}}</span>' +\n        '   <span class=\"find-index\">{{$index}}</span>' +\n        '   <span class=\"find-item\">{{item.display}}</span>' +\n        ' </md-item-template>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      $material.flushOutstandingAnimations();\n\n      expect(scope.bang).toBe('boom');\n\n      // Focus the input\n      ctrl.focus();\n\n      element.scope().searchText = 'fo';\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      var li = ul.find('li')[0];\n\n      // Expect it to be compiled against the parent scope and have our variables copied\n      expect(li.querySelector('.find-parent-scope').innerHTML).toBe('boom');\n      expect(li.querySelector('.find-index').innerHTML).toBe('0');\n      expect(li.querySelector('.find-item').innerHTML).toBe('foo');\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('removes the md-scroll-mask on cleanup', inject(function($mdUtil, $timeout, $material) {\n      spyOn($mdUtil, 'enableScrolling').and.callThrough();\n\n      var scope = createScope();\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $material.flushOutstandingAnimations();\n\n      // Focus our input\n      ctrl.focus();\n\n      // Set our search text to a value that we know doesn't exist\n      scope.searchText = 'somethingthatdoesnotexist';\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      expect(ctrl.hidden).toBeFalsy();\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n      scope.$destroy();\n\n      // Should be hidden on once the scope is destroyed to ensure proper cleanup (like md-scroll-mask is removed from the DOM)\n      expect($mdUtil.enableScrolling).toHaveBeenCalled();\n    }));\n\n    it('removes the md-scroll-mask when md-autocomplete removed on change', inject(function($mdUtil, $timeout, $material) {\n      spyOn($mdUtil, 'enableScrolling').and.callThrough();\n\n      var scope = createScope();\n      var template =\n        '<div>' +\n        '  <md-autocomplete' +\n        '     ng-if=\"!removeAutocomplete\"' +\n        '     md-selected-item=\"selectedItem\"' +\n        '     md-search-text=\"searchText\"' +\n        '     md-items=\"item in match(searchText)\"' +\n        '     md-item-text=\"item.display\"' +\n        '     placeholder=\"placeholder\">' +\n        '    <md-item-template>{{item.display}}</md-item-template>' +\n        '    <md-not-found>Sorry, not found...</md-not-found>' +\n        '  </md-autocomplete>' +\n        '</div>';\n      var element = compile(template, scope);\n      var ctrl = element.children().controller('mdAutocomplete');\n\n      $material.flushOutstandingAnimations();\n\n      // Focus our input\n      ctrl.focus();\n\n      // Set our search text to a value to make md-scroll-mask added to DOM\n      scope.$apply('searchText = \"searchText\"');\n\n      $timeout.flush();\n\n      // Set removeAutocomplete to false to remove the md-autocomplete\n      scope.$apply('removeAutocomplete = true');\n\n      expect($mdUtil.enableScrolling).toHaveBeenCalled();\n    }));\n\n    it('should initialize the search text with an empty string', inject(function($mdUtil, $timeout, $material) {\n      var scope = createScope();\n\n      // Delete our searchText variable from the generated scope, because we\n      // want to confirm, that the autocomplete uses an empty string by default.\n      delete scope.searchText;\n\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n\n      $material.flushOutstandingAnimations();\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Set our search text to a value that we know doesn't exist\n      expect(scope.searchText).toBe('');\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('ensures the parent scope digests along with the current scope', inject(function($timeout, $material) {\n      var scope = createScope(null, {bang: 'boom'});\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        ' <md-item-template>' +\n        '   <span class=\"find-parent-scope\">{{bang}}</span>' +\n        '   <span class=\"find-index\">{{$index}}</span>' +\n        '   <span class=\"find-item\">{{item.display}}</span>' +\n        ' </md-item-template>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      $material.flushOutstandingAnimations();\n\n      // Focus the input\n      ctrl.focus();\n\n      element.scope().searchText = 'fo';\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      var li = ul.find('li')[0];\n      var parentScope = angular.element(li.querySelector('.find-parent-scope')).scope();\n\n      // When the autocomplete item's scope digests, ensure that the parent\n      // scope does too.\n      parentScope.bang = 'big';\n      scope.$digest();\n\n      expect(li.querySelector('.find-parent-scope').innerHTML).toBe('big');\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('is hidden when no matches are found without an md-not-found template', inject(function($timeout, $material) {\n      var scope = createScope();\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        ' <md-item-template>{{item.display}}</md-item-template>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $material.flushOutstandingAnimations();\n\n      // Focus our input\n      ctrl.focus();\n\n      // Set our search text to a value that we know doesn't exist\n      scope.searchText = 'somethingthatdoesnotexist';\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      // We should be hidden since no md-not-found template was provided\n      expect(ctrl.hidden).toBe(true);\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('is visible when no matches are found with an md-not-found template', inject(function($timeout, $material) {\n      var scope = createScope();\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $material.flushOutstandingAnimations();\n\n      // Focus our input\n      ctrl.focus();\n\n      // Set our search text to a value that we know doesn't exist\n      scope.searchText = 'somethingthatdoesnotexist';\n\n      // Run our initial flush\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      // We should be visible since an md-not-found template was provided\n      expect(ctrl.hidden).toBe(false);\n\n      // Make sure we wrap up anything and remove the element\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('properly sets hasNotFound when element is hidden through ng-if', inject(function() {\n      var scope = createScope();\n      var template1 =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'placeholder=\"placeholder\" ' +\n        'ng-if=\"showAutocomplete\">' +\n        '<md-item-template>{{item.display}}</md-item-template>' +\n        '<md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>' +\n        '</div>';\n      var element = compile(template1, scope);\n      var ctrl = element.children().controller('mdAutocomplete');\n\n      expect(ctrl).toBeUndefined();\n\n      scope.$apply('showAutocomplete = true');\n\n      ctrl = element.children().controller('mdAutocomplete');\n\n      expect(ctrl.hasNotFound).toBe(true);\n    }));\n\n    it('properly sets hasNotFound with multiple autocompletes', function() {\n      var scope = createScope();\n      var template1 =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n      var element1 = compile(template1, scope);\n      var ctrl1 = element1.controller('mdAutocomplete');\n\n      var template2 =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '</md-autocomplete>';\n      var element2 = compile(template2, scope);\n      var ctrl2 = element2.controller('mdAutocomplete');\n\n      // The first autocomplete has a template, the second one does not\n      expect(ctrl1.hasNotFound).toBe(true);\n      expect(ctrl2.hasNotFound).toBe(false);\n    });\n\n    it('shows the md-not-found template even if we have lost focus', inject(function($timeout) {\n      var scope = createScope();\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var controller = element.controller('mdAutocomplete');\n\n      controller.focus();\n\n      scope.searchText = 'somethingthatdoesnotexist';\n\n      $timeout.flush();\n\n      controller.listEnter();\n      expect(controller.notFoundVisible()).toBe(true);\n\n      controller.blur();\n      expect(controller.notFoundVisible()).toBe(true);\n\n      controller.listLeave();\n      expect(controller.notFoundVisible()).toBe(false);\n\n      $timeout.flush();\n      element.remove();\n\n    }));\n\n    it('should not show the md-not-found template if we lost focus and left the list', inject(function($timeout) {\n      var scope = createScope();\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <md-item-template>{{item.display}}</md-item-template>' +\n        '  <md-not-found>Sorry, not found...</md-not-found>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var controller = element.controller('mdAutocomplete');\n\n      controller.focus();\n\n      scope.searchText = 'somethingthatdoesnotexist';\n\n      $timeout.flush();\n\n      controller.listEnter();\n      expect(controller.notFoundVisible()).toBe(true);\n\n      controller.listLeave();\n      controller.blur();\n      expect(controller.notFoundVisible()).toBe(false);\n\n      $timeout.flush();\n      element.remove();\n    }));\n\n    it('should log a warning if the display text does not evaluate to a string',\n      inject(function($log) {\n        spyOn($log, 'warn');\n\n        var scope = createScope();\n\n        var template =\n          '<md-autocomplete ' +\n          'md-selected-item=\"selectedItem\" ' +\n          'md-search-text=\"searchText\" ' +\n          'md-items=\"item in match(searchText)\"> ' +\n          '</md-autocomplete>';\n\n        var element = compile(template, scope);\n\n        scope.$apply(function() {\n          scope.selectedItem = { display: 'foo' };\n        });\n\n        expect($log.warn).toHaveBeenCalled();\n        expect($log.warn.calls.mostRecent().args[0]).toMatch(/md-item-text/);\n\n        element.remove();\n      })\n    );\n  });\n\n  describe('clear button', function() {\n\n    it('should show the clear button for inset autocomplete', function() {\n      var scope = createScope();\n\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'placeholder=\"placeholder\"> ' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var wrapEl = element.find('md-autocomplete-wrap');\n\n      expect(ctrl.scope.clearButton).toBe(true);\n      expect(wrapEl).toHaveClass('md-show-clear-button');\n    });\n\n    it('should not show the clear button for floating label autocomplete', function() {\n      var scope = createScope();\n\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-floating-label=\"Label\"> ' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var wrapEl = element.find('md-autocomplete-wrap');\n\n      expect(ctrl.scope.clearButton).toBe(false);\n      expect(wrapEl).not.toHaveClass('md-show-clear-button');\n    });\n\n    it('should allow developers to toggle the clear button', function() {\n\n      var scope = createScope();\n\n      var template =\n        '<md-autocomplete ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-floating-label=\"Label\" ' +\n        'md-clear-button=\"showButton\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var wrapEl = element.find('md-autocomplete-wrap');\n\n      expect(ctrl.scope.clearButton).toBeFalsy();\n      expect(wrapEl).not.toHaveClass('md-show-clear-button');\n\n      scope.$apply('showButton = true');\n\n      expect(ctrl.scope.clearButton).toBe(true);\n      expect(wrapEl).toHaveClass('md-show-clear-button');\n    });\n  });\n\n  describe('xss prevention', function() {\n\n    it('should not allow html to slip through', inject(function($timeout, $material) {\n      var html = 'foo <img src=\"img\" onerror=\"alert(1)\" alt=\"test\" />';\n      var scope = createScope([{ display: html }]);\n\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              md-min-length=\"0\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      $material.flushOutstandingAnimations();\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      scope.$apply('searchText = \"fo\"');\n      $timeout.flush();\n      waitForVirtualRepeat(element);\n\n      expect(scope.searchText).toBe('fo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n      expect(ul.find('li').length).toBe(1);\n      expect(ul.find('li').find('img').length).toBe(0);\n\n      element.remove();\n    }));\n\n  });\n\n  describe('Async matching', function() {\n\n    it('properly stops the loading indicator when clearing', inject(function($timeout, $material) {\n      var scope = createScope();\n      var template =\n        '<md-autocomplete ' +\n        '    md-search-text=\"searchText\"' +\n        '    md-items=\"item in asyncMatch(searchText)\" ' +\n        '    md-item-text=\"item.display\" ' +\n        '    placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      $material.flushInterimElement();\n\n      scope.$apply('searchText = \"test\"');\n\n      ctrl.clear();\n\n      expect(ctrl.loading).toBe(true);\n\n      $timeout.flush();\n\n      expect(ctrl.loading).toBe(false);\n    }));\n  });\n\n  describe('Accessibility', function() {\n    var $timeout = null, $mdConstant = null, $material = null;\n\n    beforeEach(inject(function ($injector) {\n      $timeout = $injector.get('$timeout');\n      $material = $injector.get('$material');\n      $mdConstant = $injector.get('$mdConstant');\n    }));\n\n    it('should add the placeholder as the input\\'s aria-label', function() {\n      var template =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\">' +\n      '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n      '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).toBe('placeholder');\n    });\n\n    it('should set activeOption when autoselect is off', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'ba';\n      waitForVirtualRepeat(element);\n\n      var suggestions = ul.find('li');\n      expect(suggestions[0].classList).not.toContain('selected');\n\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      $material.flushInterimElement();\n\n      expect(suggestions[0].classList).toContain('selected');\n\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-0');\n      expect(input[0].getAttribute('aria-owns')).toBe('ul-' + ctrl.id);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe('md-option-' + ctrl.id + '-0');\n    });\n\n    it('should start from the end when up arrow is pressed', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'ba';\n      waitForVirtualRepeat(element);\n\n      var suggestions = ul.find('li');\n      expect(suggestions[0].classList).not.toContain('selected');\n\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.UP_ARROW));\n      $material.flushInterimElement();\n\n      expect(suggestions[1].classList).toContain('selected');\n\n      expect(ctrl.index).toBe(1);\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-1');\n      expect(input[0].getAttribute('aria-owns')).toBe('ul-' + ctrl.id);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe('md-option-' + ctrl.id + '-1');\n    });\n\n    it('should not retain the position of the scroll after panel is reopened', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-min-length=\"0\"' +\n        '   md-escape-options=\"clear\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var items = [];\n      for (var i = 0; i < 20; i++) {\n        items.push({ display: 'f' + i});\n      }\n      var scope = createScope(items);\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      // Run our initial flush\n      $timeout.flush();\n\n      // Initial state\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // After getting focus\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.activeOption).toBe(null);\n\n      ctrl.blur();\n\n      // After loosing focus\n      expect(ctrl.hidden).toBe(true);\n\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      // After getting focus again\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.activeOption).toBe(null);\n\n      for (var j = 0; j < 10; j++){\n        ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      }\n      $material.flushInterimElement();\n\n      // After highlighting the 10th element\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(9);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-9');\n\n      ctrl.blur();\n\n      // After loosing focus\n      expect(ctrl.hidden).toBe(true);\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      // After getting focus again\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.activeOption).toBe(null);\n\n      element.remove();\n    });\n\n    it('should move to the last item when up arrow is pressed when on the first item', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-min-length=\"0\"' +\n        '   md-escape-options=\"clear\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      // Run our initial flush\n      $timeout.flush();\n\n      // Initial state\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // After getting focus\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.activeOption).toBe(null);\n\n      // Highlighting the first item\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n\n      // Trying to go to the last item by cycling through the list\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.UP_ARROW));\n      $material.flushInterimElement();\n\n      // We should be on the last item\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(2);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-2');\n\n      element.remove();\n    });\n\n    it('should move to the first item when down arrow is pressed when on the last item', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-min-length=\"0\"' +\n        '   md-escape-options=\"clear\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      // Run our initial flush\n      $timeout.flush();\n\n      // Initial state\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // After getting focus\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.activeOption).toBe(null);\n\n      // Highlighting the first item\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n\n      // Highlighting the last item from the list\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n\n      // Trying to go to the first item by cycling through the list\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      $material.flushInterimElement();\n\n      // We should be on the first item\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-0');\n\n      element.remove();\n    });\n\n    it('should set activeOption when autoselect is on', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-autoselect=\"true\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'ba';\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      var suggestions = ul.find('li');\n      expect(suggestions[0].classList).toContain('selected');\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-0');\n      expect(input[0].getAttribute('aria-owns')).toBe('ul-' + ctrl.id);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe('md-option-' + ctrl.id + '-0');\n\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      $material.flushInterimElement();\n\n      expect(suggestions[1].classList).toContain('selected');\n\n      expect(ctrl.index).toBe(1);\n      expect(ctrl.hidden).toBe(false);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-1');\n    });\n\n    it('should update activeOption when selection is cleared and autoselect is off', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-autoselect=\"false\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'ba';\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      var suggestions = ul.find('li');\n      expect(suggestions[0].classList).not.toContain('selected');\n      expect(ctrl.activeOption).toBe(null);\n      expect(ctrl.hidden).toBe(false);\n      expect(input[0].getAttribute('aria-owns')).toBe('ul-' + ctrl.id);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      $material.flushInterimElement();\n\n      expect(suggestions[0].classList).toContain('selected');\n      expect(input[0].getAttribute('aria-activedescendant')).toBe('md-option-' + ctrl.id + '-0');\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n      $material.flushInterimElement();\n      expect(ctrl.hidden).toBe(true);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(-1);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n    });\n\n    it('should update activeOption when selection is cleared and autoselect is on', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\"' +\n        '   md-autoselect=\"true\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'ba';\n      waitForVirtualRepeat(element);\n\n      // Wait for the next tick when the values will be updated\n      $timeout.flush();\n\n      var suggestions = ul.find('li');\n      expect(suggestions[0].classList).toContain('selected');\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-0');\n      expect(input[0].getAttribute('aria-owns')).toBe('ul-' + ctrl.id);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe('md-option-' + ctrl.id + '-0');\n\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n      $material.flushInterimElement();\n      expect(ctrl.hidden).toBe(true);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE));\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.hidden).toBe(true);\n      expect(ctrl.activeOption).toBe('md-option-' + ctrl.id + '-0');\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-activedescendant')).toBe(null);\n    });\n\n    it('should always define the name attribute on the input', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(input[0].getAttribute('name')).toBe('input-' + ctrl.id);\n    });\n\n    it('should always define the name attribute on the input when floating label is enabled',\n      function() {\n        var template =\n          '<md-autocomplete' +\n          '   md-floating-label=\"Test Label\"' +\n          '   md-selected-item=\"selectedItem\"' +\n          '   md-search-text=\"searchText\"' +\n          '   md-items=\"item in match(searchText)\"' +\n          '   md-item-text=\"item.display\"' +\n          '   placeholder=\"placeholder\">' +\n          '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n          '</md-autocomplete>';\n        var scope = createScope();\n        var element = compile(template, scope);\n        var ctrl = element.controller('mdAutocomplete');\n        var input = element.find('input');\n        // Run our initial flush\n        $timeout.flush();\n\n        expect(input[0].getAttribute('name')).toBe('fl-input-' + ctrl.id);\n    });\n\n    it('should set proper aria values and remove attributes on input when ng-disabled', function() {\n      var template =\n        '<md-autocomplete' +\n        '   ng-disabled=\"true\"' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(input[0].getAttribute('role')).toBe(null);\n      expect(input[0].getAttribute('aria-autocomplete')).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-haspopup')).toBe('false');\n    });\n\n    it('should set proper aria values and remove attributes on input when disabled', function() {\n      var template =\n        '<md-autocomplete' +\n        '   disabled' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n      // Run our initial flush\n      $timeout.flush();\n\n      expect(input[0].getAttribute('role')).toBe(null);\n      expect(input[0].getAttribute('aria-autocomplete')).toBe(null);\n      expect(input[0].getAttribute('aria-owns')).toBe(null);\n      expect(input[0].getAttribute('aria-haspopup')).toBe('false');\n    });\n\n    it('should add IDs to each option', function() {\n      var template =\n        '<md-autocomplete' +\n        '   md-selected-item=\"selectedItem\"' +\n        '   md-search-text=\"searchText\"' +\n        '   md-items=\"item in match(searchText)\"' +\n        '   md-item-text=\"item.display\"' +\n        '   placeholder=\"placeholder\">' +\n        '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      // Focus the input\n      ctrl.focus();\n\n      // Update the scope\n      element.scope().searchText = 'fo';\n      waitForVirtualRepeat(element);\n\n      var suggestions = ul.find('li');\n\n      expect(suggestions[0].getAttribute('id')).toContain('md-option-');\n    });\n\n    it('should add the input-aria-label as the input\\'s aria-label', function() {\n      var template =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   input-aria-label=\"TestLabel\">' +\n      '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).toBe('TestLabel');\n    });\n\n    it('should add the input-aria-labelledby to the input', function() {\n      var template =\n      '<label id=\"test-label\">Test Label</label>' +\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   input-aria-labelledby=\"test-label\">' +\n      '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).not.toExist();\n      expect(input.attr('aria-labelledby')).toBe('test-label');\n    });\n\n    it('should add the input-aria-describedby to the input', function() {\n      var template =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   input-aria-describedby=\"test-desc\">' +\n      '</md-autocomplete>' +\n      '<div id=\"test-desc\">Test Description</div>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-describedby')).toBe('test-desc');\n    });\n\n    it('should not break an aria-label on the autocomplete when using input-aria-label or aria-describedby', function() {\n      var template =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   aria-label=\"TestAriaLabel\"' +\n      '   input-aria-label=\"TestLabel\"' +\n      '   input-aria-describedby=\"test-desc\">' +\n      '</md-autocomplete>' +\n      '<div id=\"test-desc\">Test Description</div>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var autocomplete = element[0];\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).toBe('TestLabel');\n      expect(input.attr('aria-describedby')).toBe('test-desc');\n      expect(autocomplete.getAttribute('aria-label')).toBe('TestAriaLabel');\n    });\n\n    it('should not break an aria-label on the autocomplete', function() {\n      var template =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   aria-label=\"TestAriaLabel\">' +\n      '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).toBe('placeholder');\n      expect(element.attr('aria-label')).toBe('TestAriaLabel');\n    });\n\n    it('should not break an aria-label on the autocomplete when using input-aria-labelledby', function() {\n      var template =\n      '<label id=\"test-label\">Test Label</label>' +\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   placeholder=\"placeholder\"' +\n      '   aria-label=\"TestAriaLabel\"' +\n      '   input-aria-labelledby=\"test-label\">' +\n      '</md-autocomplete>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var autocomplete = element[1];\n      var input = element.find('input');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n\n      expect(input.attr('aria-label')).not.toExist();\n      expect(input.attr('aria-labelledby')).toBe('test-label');\n      expect(autocomplete.getAttribute('aria-label')).toBe('TestAriaLabel');\n    });\n  });\n\n  describe('Accessibility Announcements', function() {\n    var $mdLiveAnnouncer, $timeout, $mdConstant = null;\n    var liveEl, scope, element, ctrl = null;\n\n    var BASIC_TEMPLATE =\n      '<md-autocomplete' +\n      '   md-selected-item=\"selectedItem\"' +\n      '   md-search-text=\"searchText\"' +\n      '   md-items=\"item in match(searchText)\"' +\n      '   md-item-text=\"item.display\"' +\n      '   md-min-length=\"0\"' +\n      '   placeholder=\"placeholder\">' +\n      '  <span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n      '</md-autocomplete>';\n\n    beforeEach(inject(function ($injector) {\n      $mdLiveAnnouncer = $injector.get('$mdLiveAnnouncer');\n      $mdConstant = $injector.get('$mdConstant');\n      $timeout = $injector.get('$timeout');\n\n      liveEl = $mdLiveAnnouncer._liveElement;\n      scope = createScope();\n      element = compile(BASIC_TEMPLATE, scope);\n      ctrl = element.controller('mdAutocomplete');\n\n      // Flush the initial autocomplete timeout to gather the elements.\n      $timeout.flush();\n    }));\n\n    it('should announce count on dropdown open', function() {\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(ctrl.hidden).toBe(false);\n\n      expect(liveEl.textContent).toBe('There are 3 matches available.');\n    });\n\n    it('should announce count and selection on dropdown open', function() {\n      // Manually enable md-autoselect for the autocomplete.\n      ctrl.index = 0;\n\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(ctrl.hidden).toBe(false);\n\n      // Expect the announcement to contain the current selection in the dropdown.\n      expect(liveEl.textContent).toBe(scope.items[0].display + ' There are 3 matches available.');\n    });\n\n    it('should announce when an option is picked', function() {\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n      $timeout.flush();\n\n      expect(ctrl.index).toBe(0);\n      expect(ctrl.hidden).toBe(false);\n\n      ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER));\n\n      // Flush twice, because the display value will be resolved asynchronously and then the\n      // live-announcer will be triggered.\n      $timeout.flush();\n      $timeout.flush();\n\n      expect(liveEl.textContent).toBe(scope.items[0].display + ' ' + ctrl.selectedMessage);\n      expect(ctrl.hidden).toBe(true);\n    });\n\n    it('should announce the count when matches change', function() {\n      ctrl.focus();\n      waitForVirtualRepeat();\n\n      expect(ctrl.hidden).toBe(false);\n      expect(liveEl.textContent).toBe('There are 3 matches available.');\n\n      scope.$apply('searchText = \"fo\"');\n      $timeout.flush();\n\n      expect(liveEl.textContent).toBe('There is 1 match available.');\n    });\n\n  });\n\n  describe('API access', function() {\n    it('clears the selected item', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      element.scope().searchText = 'fo';\n      $timeout.flush();\n\n      ctrl.select(0);\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('foo');\n      expect(scope.selectedItem).not.toBeNull();\n      expect(scope.selectedItem.display).toBe('foo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n\n      ctrl.clear();\n      element.scope().$apply();\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      element.remove();\n    }));\n\n    it('notifies selected item watchers', inject(function($timeout) {\n      var scope = createScope();\n      scope.itemChanged = jasmine.createSpy('itemChanged');\n\n      var registeredWatcher = jasmine.createSpy('registeredWatcher');\n\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-selected-item-change=\"itemChanged(selectedItem)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      ctrl.registerSelectedItemWatcher(registeredWatcher);\n\n      element.scope().searchText = 'fo';\n      $timeout.flush();\n\n      ctrl.select(0);\n      $timeout.flush();\n\n      expect(scope.itemChanged).toHaveBeenCalled();\n      expect(scope.itemChanged.calls.mostRecent().args[0].display).toBe('foo');\n      expect(registeredWatcher).toHaveBeenCalled();\n      expect(registeredWatcher.calls.mostRecent().args[0].display).toBe('foo');\n      expect(registeredWatcher.calls.mostRecent().args[1]).toBeNull();\n      expect(scope.selectedItem).not.toBeNull();\n      expect(scope.selectedItem.display).toBe('foo');\n\n      // Un-register the watcher\n      ctrl.unregisterSelectedItemWatcher(registeredWatcher);\n\n      ctrl.clear();\n      element.scope().$apply();\n\n      expect(registeredWatcher.calls.count()).toBe(1);\n      expect(scope.itemChanged.calls.count()).toBe(2);\n      expect(scope.itemChanged.calls.mostRecent().args[0]).toBeNull();\n      expect(scope.selectedItem).toBeNull();\n\n      element.remove();\n    }));\n\n    it('passes the value to the item watcher', inject(function($timeout) {\n      var scope = createScope();\n      var itemValue = null;\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-selected-item-change=\"itemChanged(item)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      scope.itemChanged = function(item) {\n        itemValue = item;\n      };\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      element.scope().searchText = 'fo';\n      $timeout.flush();\n\n      ctrl.select(0);\n      $timeout.flush();\n\n      expect(itemValue).not.toBeNull();\n      expect(itemValue.display).toBe('foo');\n\n      ctrl.clear();\n      element.scope().$apply();\n\n      element.remove();\n    }));\n  });\n\n  describe('md-select-on-match', function() {\n\n    it('selects matching item on exact match when `md-select-on-match` is toggled', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-select-on-match\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      element.scope().searchText = 'foo';\n      $timeout.flush();\n\n      expect(scope.selectedItem).not.toBe(null);\n      expect(scope.selectedItem.display).toBe('foo');\n\n      element.remove();\n    }));\n\n    it('selects matching item on exact match with caching enabled', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-select-on-match\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      scope.$apply('searchText = \"foo\"');\n      $timeout.flush();\n\n      expect(scope.selectedItem).not.toBe(null);\n      expect(scope.selectedItem.display).toBe('foo');\n\n      scope.$apply('searchText = \"\"');\n      $timeout.flush();\n\n      expect(scope.selectedItem).toBeFalsy();\n\n      scope.$apply('searchText = \"foo\"');\n      $timeout.flush();\n\n      expect(scope.selectedItem).not.toBe(null);\n      expect(scope.selectedItem.display).toBe('foo');\n\n      element.remove();\n    }));\n\n    it('should not select matching item on exact match when `md-select-on-match` is NOT toggled', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      element.scope().searchText = 'foo';\n      $timeout.flush();\n\n      expect(scope.selectedItem).toBe(null);\n\n      element.remove();\n    }));\n\n    it('selects matching item using case insensitive', inject(function($timeout) {\n      var scope = createScope(null, null, true);\n      var template =\n        '<md-autocomplete ' +\n        'md-select-on-match ' +\n        'md-selected-item=\"selectedItem\" ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-match-case-insensitive=\"true\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>';\n      var element = compile(template, scope);\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBe(null);\n\n      element.scope().searchText = 'FoO';\n      $timeout.flush();\n\n      expect(scope.selectedItem).not.toBe(null);\n      expect(scope.selectedItem.display).toBe('foo');\n\n      element.remove();\n    }));\n  });\n\n  describe('when requiring a match', function() {\n\n    it('should correctly update the validity', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <form name=\"form\">\\\n            <md-autocomplete\\\n                md-input-name=\"autocomplete\"\\\n                md-selected-item=\"selectedItem\"\\\n                md-search-text=\"searchText\"\\\n                md-items=\"item in match(searchText)\"\\\n                md-item-text=\"item.display\"\\\n                placeholder=\"placeholder\"\\\n                md-require-match=\"true\">\\\n              <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n            </md-autocomplete>\\\n          </form>';\n      var element = compile(template, scope);\n      var ctrl = element.find('md-autocomplete').controller('mdAutocomplete');\n\n      // Flush the element gathering.\n      $timeout.flush();\n\n      scope.$apply('searchText = \"fo\"');\n      $timeout.flush();\n\n      ctrl.select(0);\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('foo');\n      expect(scope.selectedItem).not.toBeNull();\n      expect(scope.selectedItem.display).toBe('foo');\n      expect(scope.match(scope.searchText).length).toBe(1);\n\n      expect(scope.form.autocomplete.$error['md-require-match']).toBeFalsy();\n\n      scope.$apply('searchText = \"food\"');\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('food');\n      expect(scope.selectedItem).toBeNull();\n      expect(scope.form.autocomplete.$error['md-require-match']).toBeTruthy();\n\n    }));\n\n    it('should not set to invalid if searchText is empty', inject(function($timeout) {\n      var scope = createScope();\n      var template = '\\\n          <form name=\"form\">\\\n            <md-autocomplete\\\n                md-input-name=\"autocomplete\"\\\n                md-selected-item=\"selectedItem\"\\\n                md-search-text=\"searchText\"\\\n                md-items=\"item in match(searchText)\"\\\n                md-item-text=\"item.display\"\\\n                placeholder=\"placeholder\"\\\n                md-require-match=\"true\">\\\n              <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n            </md-autocomplete>\\\n          </form>';\n\n      compile(template, scope);\n\n      // Flush the element gathering.\n      $timeout.flush();\n\n      scope.$apply('searchText = \"food\"');\n      $timeout.flush();\n\n      expect(scope.searchText).toBe('food');\n      expect(scope.selectedItem).toBeNull();\n      expect(scope.form.autocomplete.$error['md-require-match']).toBeTruthy();\n\n      scope.$apply('searchText = \"\"');\n\n      expect(scope.searchText).toBe('');\n      expect(scope.selectedItem).toBeNull();\n      expect(scope.form.autocomplete.$error['md-require-match']).toBeFalsy();\n    }));\n\n  });\n\n  describe('when required', function() {\n    it('properly handles md-min-length=\"0\" and undefined searchText', function() {\n      var scope = createScope();\n      var element;\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              md-min-length=\"0\" \\\n              required\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n\n      var error;\n\n      try {\n        element = compile(template, scope);\n\n        scope.searchText = undefined;\n        scope.$digest();\n      } catch (e) {\n        error = e;\n      }\n\n      expect(error).toBe(undefined);\n\n      element.remove();\n    });\n\n    it('validates an empty `required` as true', function() {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              md-min-length=\"0\" \\\n              required\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      expect(ctrl.isRequired).toBe(true);\n    });\n\n    it('correctly validates an interpolated `ng-required` value', function() {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              md-min-length=\"0\" \\\n              ng-required=\"interpolateRequired\"\\\n              placeholder=\"placeholder\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var ctrl = element.controller('mdAutocomplete');\n\n      expect(ctrl.isRequired).toBe(false);\n\n      scope.interpolateRequired = false;\n      scope.$apply();\n\n      expect(ctrl.isRequired).toBe(false);\n\n      scope.interpolateRequired = true;\n      scope.$apply();\n\n      expect(ctrl.isRequired).toBe(true);\n    });\n\n    it('forwards the md-no-asterisk attribute', function() {\n      var scope = createScope();\n      var template = '\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              md-min-length=\"0\" \\\n              required\\\n              md-no-asterisk=\"true\"\\\n              md-floating-label=\"Asterisk Label\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>';\n      var element = compile(template, scope);\n      var input = element.find('input');\n\n      expect(input.attr('md-no-asterisk')).toBe('true');\n    });\n  });\n\n  describe('dropdown position', function() {\n\n    var DEFAULT_MAX_ITEMS = 5;\n    var DEFAULT_ITEM_HEIGHT = 48;\n\n    var dropdownItems = DEFAULT_MAX_ITEMS;\n\n    /**\n     * Function to create fake matches with the given dropdown items.\n     * Useful when running tests against the dropdown max items calculations.\n     * @returns {Array} Fake matches.\n     */\n    function fakeItemMatch() {\n      var matches = [];\n\n      for (var i = 0; i < dropdownItems; i++) {\n        matches.push('Item ' + i);\n      }\n\n      return matches;\n    }\n\n    it('should adjust the width when the window resizes', inject(function($timeout, $window) {\n      var scope = createScope();\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      expect(ctrl.positionDropdown).toBeTruthy();\n\n      // Focus the Autocomplete to open the dropdown.\n      ctrl.focus();\n\n      scope.$apply('searchText = \"fo\"');\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the current width of the scrollContainer to be the same as of the parent element\n      // at initialization.\n      expect(scrollContainer.style.minWidth).toBe('400px');\n\n      // Change the parents width, to be shrink the scrollContainers width.\n      parent.css('width', '200px');\n\n      // Update the scrollContainers rectangle, by triggering a reposition of the dropdown.\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      // The scroll container should have a width of 200px, since we changed the parents width.\n      expect(scrollContainer.style.minWidth).toBe('200px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should adjust the width of a standard-mode list when the window resizes',\n        inject(function($timeout, $window) {\n      var scope = createScope();\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      expect(ctrl.positionDropdown).toBeTruthy();\n\n      // Focus the Autocomplete to open the dropdown.\n      ctrl.focus();\n\n      scope.$apply('searchText = \"fo\"');\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the current width of the scrollContainer to be the same as of the parent element\n      // at initialization.\n      expect(scrollContainer.style.minWidth).toBe('400px');\n\n      // Change the parents width, to be shrink the scrollContainers width.\n      parent.css('width', '200px');\n\n      // Update the scrollContainers rectangle, by triggering a reposition of the dropdown.\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      // The scroll container should have a width of 200px, since we changed the parents width.\n      expect(scrollContainer.style.minWidth).toBe('200px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should adjust the width of a virtual list when manually repositioning', inject(function($timeout) {\n      var scope = createScope();\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      expect(ctrl.positionDropdown).toBeTruthy();\n\n      // Focus the Autocomplete to open the dropdown.\n      ctrl.focus();\n\n      scope.$apply('searchText = \"fo\"');\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the current width of the scrollContainer to be the same as of the parent element\n      // at initialization.\n      expect(scrollContainer.style.minWidth).toBe('400px');\n\n      // Change the parents width, to be shrink the scrollContainers width.\n      parent.css('width', '200px');\n\n      // Update the scrollContainers rectangle, by triggering a reposition of the dropdown.\n      ctrl.positionDropdown();\n\n      // The scroll container should have a width of 200px, since we changed the parents width.\n      expect(scrollContainer.style.minWidth).toBe('200px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should show standard-mode lists on focus when min-length is met', function() {\n      var scope = createScope();\n\n      // Overwrite the match function to always show some results.\n      scope.match = function() {\n        return scope.items;\n      };\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the current width of the scrollContainer to be the same as of the parent element\n      // at initialization.\n      expect(scrollContainer.offsetParent).toBeTruthy();\n\n      document.body.removeChild(parent[0]);\n    });\n\n    it('should show virtual lists on focus when min-length is met', function() {\n      var scope = createScope();\n\n      // Overwrite the match function to always show some results.\n      scope.match = function() {\n        return scope.items;\n      };\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the current width of the scrollContainer to be the same as of the parent element\n      // at initialization.\n      expect(scrollContainer.offsetParent).toBeTruthy();\n\n      document.body.removeChild(parent[0]);\n    });\n\n    it('should not show virtual lists on focus when min-length is not met', function() {\n      var scope = createScope();\n\n      // Overwrite the match function to always show some results.\n      scope.match = function() {\n        return scope.items;\n      };\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"1\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the dropdown to not show up, because the min-length is not met.\n      expect(scrollContainer.offsetParent).toBeFalsy();\n\n      ctrl.blur();\n\n      // Add one char to the searchText to match the minlength.\n      scope.$apply('searchText = \"X\"');\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // Expect the dropdown to not show up, because the min-length is not met.\n      expect(scrollContainer.offsetParent).toBeTruthy();\n\n      document.body.removeChild(parent[0]);\n    });\n\n    it('should not show standard-mode lists on focus when min-length is not met', function() {\n      var scope = createScope();\n\n      // Overwrite the match function to always show some results.\n      scope.match = function() {\n        return scope.items;\n      };\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"1\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the dropdown to not show up, because the min-length is not met.\n      expect(scrollContainer.offsetParent).toBeFalsy();\n\n      ctrl.blur();\n\n      // Add one char to the searchText to match the minlength.\n      scope.$apply('searchText = \"X\"');\n\n      ctrl.focus();\n      waitForVirtualRepeat(element);\n\n      // Expect the dropdown to not show up, because the min-length is not met.\n      expect(scrollContainer.offsetParent).toBeTruthy();\n\n      document.body.removeChild(parent[0]);\n    });\n\n    it('should calculate the height of a virtual list from the default max items', inject(function($timeout) {\n      var scope = createScope();\n\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px');\n\n      dropdownItems = 6;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"Query 2\"');\n\n      // The dropdown should not increase its height because of the new extra item.\n      expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should calculate the height of a standard-mode list from the default max items', inject(function($timeout) {\n      var scope = createScope();\n\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px');\n\n      dropdownItems = 6;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"Query 2\"');\n\n      // The dropdown should not increase its height because of the new extra item.\n      expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should calculate its height from the specified max items', inject(function($timeout) {\n      var scope = createScope();\n      var maxDropdownItems = 2;\n\n      // Set the current dropdown items to the new maximum.\n      dropdownItems = maxDropdownItems;\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'md-dropdown-items=\"' + maxDropdownItems +'\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      dropdownItems = 6;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"Query 2\"');\n\n      // The dropdown should not increase its height because of the new extra item.\n      expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should calculate the height of a standard-mode list from the specified max items', inject(function($timeout) {\n      var scope = createScope();\n      var maxDropdownItems = 2;\n\n      // Set the current dropdown items to the new maximum.\n      dropdownItems = maxDropdownItems;\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'md-dropdown-items=\"' + maxDropdownItems +'\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      dropdownItems = 6;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"Query 2\"');\n\n      // The dropdown should not increase its height because of the new extra item.\n      expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should default dropdown position to the bottom', inject(function($timeout, $window) {\n      var scope = createScope();\n      scope.topMargin = '0px';\n\n      scope.match = fakeItemMatch;\n\n      var template = '<div style=\"margin-top: {{topMargin}}\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n      // Test that the dropdown displays with position = bottom automatically because there is no\n      // room above the element to display the dropdown using position = top.\n      expect(scrollContainer.style.bottom).toBe('auto');\n      expect(scrollContainer.style.top).toMatch(/[0-9]+px/);\n\n      // Change position and resize to force a DOM update.\n      scope.$apply('topMargin = \"300px\"');\n\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      expect(scrollContainer).toBeTruthy();\n      // Test that the dropdown displays with position = bottom by default, even when there is room\n      // for it to display on the top.\n      expect(scrollContainer.style.bottom).toBe('auto');\n      expect(scrollContainer.style.top).toMatch(/[0-9]+px/);\n\n      parent.remove();\n    }));\n\n    it('should allow dropdown position to be specified (virtual list)', inject(function($timeout, $window) {\n      var scope = createScope();\n\n      scope.match = fakeItemMatch;\n      scope.position = 'top';\n\n      var template = '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'md-dropdown-position=\"{{position}}\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.top).toBe('auto');\n      expect(scrollContainer.style.bottom).toMatch(/[0-9]+px/);\n\n      // Change position and resize to force a DOM update.\n      scope.$apply('position = \"bottom\"');\n\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      expect(scrollContainer.style.top).toMatch(/[0-9]+px/);\n      expect(scrollContainer.style.bottom).toBe('auto');\n\n      parent.remove();\n    }));\n\n    it('should allow dropdown position to be specified (standard list)', inject(function($timeout, $window) {\n      var scope = createScope();\n\n      scope.match = fakeItemMatch;\n      scope.position = 'top';\n\n      var template = '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'md-dropdown-position=\"{{position}}\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n      scope.$apply('searchText = \"Query 1\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.top).toBe('auto');\n      expect(scrollContainer.style.bottom).toMatch(/[0-9]+px/);\n\n      // Change position and resize to force a DOM update.\n      scope.$apply('position = \"bottom\"');\n\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      expect(scrollContainer.style.top).toMatch(/[0-9]+px/);\n      expect(scrollContainer.style.bottom).toBe('auto');\n\n      parent.remove();\n    }));\n\n    it('should not position dropdown on resize when being hidden (virtual list)', inject(function($window, $timeout) {\n      var scope = createScope();\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      expect(ctrl.positionDropdown).toBeTruthy();\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the scroll container to not have minWidth set, because it was never positioned.\n      expect(scrollContainer.style.minWidth).toBe('');\n\n      // Change the parents width, to be shrink the scrollContainers width.\n      parent.css('width', '200px');\n\n      // Trigger a window resize, which should adjust the width of the scroll container.\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      // The scroll container should still have no minWidth, because there was no positioning called yet.\n      expect(scrollContainer.style.minWidth).toBe('');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should not position dropdown on resize when being hidden (standard list)', inject(function($window, $timeout) {\n      var scope = createScope();\n\n      var template =\n        '<div style=\"width: 400px\">' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item.display\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item.display}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      expect(ctrl.positionDropdown).toBeTruthy();\n\n      // The scroll repeat container has been moved to the body element to avoid\n      // z-index / overflow issues.\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n\n      expect(scrollContainer).toBeTruthy();\n\n      // Expect the scroll container to not have minWidth set, because it was never positioned.\n      expect(scrollContainer.style.minWidth).toBe('');\n\n      // Change the parents width, to be shrink the scrollContainers width.\n      parent.css('width', '200px');\n\n      // Trigger a window resize, which should adjust the width of the scroll container.\n      angular.element($window).triggerHandler('resize');\n      $timeout.flush();\n\n      // The scroll container should still have no minWidth, because there was no positioning called yet.\n      expect(scrollContainer.style.minWidth).toBe('');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should grow and shrink virtual list depending on the amount of items', inject(function($timeout) {\n      var scope = createScope();\n\n      dropdownItems = 2;\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n\n      scope.$apply('searchText = \"A\"');\n      waitForVirtualRepeat(element);\n\n      var scrollContainer = document.body.querySelector('.md-virtual-repeat-container');\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style.height).toBe(dropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      dropdownItems = DEFAULT_MAX_ITEMS;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"B\"');\n\n      expect(scrollContainer.style.height).toBe(dropdownItems * DEFAULT_ITEM_HEIGHT + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n    it('should constrain standard lists within a consistent max-height', inject(function($timeout) {\n      var scope = createScope();\n\n      dropdownItems = 2;\n      scope.match = fakeItemMatch;\n\n      var template =\n        '<div>' +\n        '<md-autocomplete ' +\n        'md-search-text=\"searchText\" ' +\n        'md-items=\"item in match(searchText)\" ' +\n        'md-item-text=\"item\" ' +\n        'md-min-length=\"0\" ' +\n        'placeholder=\"placeholder\" ' +\n        'md-mode=\"standard\">' +\n        '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n        '</md-autocomplete>' +\n        '</div>';\n\n      var parent = compile(template, scope);\n      var element = parent.find('md-autocomplete');\n      var ctrl = element.controller('mdAutocomplete');\n\n      // Add container to the DOM to be able to test the rect calculations.\n      document.body.appendChild(parent[0]);\n\n      $timeout.flush();\n\n      // Focus the autocomplete and trigger a query to be able to open the dropdown.\n      ctrl.focus();\n\n      scope.$apply('searchText = \"A\"');\n\n      var scrollContainer = document.body.querySelector('.md-standard-list-container');\n\n      var maxHeight = DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT;\n\n      expect(scrollContainer).toBeTruthy();\n      expect(scrollContainer.style['max-height']).toBe(maxHeight + 'px');\n\n      dropdownItems = DEFAULT_MAX_ITEMS;\n\n      // Trigger a new query to request an update of the items and dropdown.\n      scope.$apply('searchText = \"B\"');\n\n      expect(scrollContainer.style['max-height']).toBe(maxHeight + 'px');\n\n      document.body.removeChild(parent[0]);\n    }));\n\n  });\n\n  describe('md-highlight-text', function() {\n\n    it('updates when content is modified', inject(function() {\n      var template = '<div md-highlight-text=\"query\">{{message}}</div>';\n      var scope = createScope(null, {message: 'some text', query: 'some'});\n      var element = compile(template, scope);\n\n      expect(element.html()).toBe('<span class=\"highlight\">some</span> text');\n\n      scope.query = 'so';\n      scope.$apply();\n\n      expect(element.html()).toBe('<span class=\"highlight\">so</span>me text');\n\n      scope.message = 'some more text';\n      scope.$apply();\n\n      expect(element.html()).toBe('<span class=\"highlight\">so</span>me more text');\n\n      element.remove();\n    }));\n\n    it('should properly apply highlight flags', function() {\n      var template = '<div md-highlight-text=\"query\" md-highlight-flags=\"{{flags}}\">{{message}}</div>';\n      var scope = createScope(null, {message: 'Some text', query: 'some', flags: '^i'});\n      var element = compile(template, scope);\n\n      expect(element.html()).toBe('<span class=\"highlight\">Some</span> text');\n\n      scope.query = 'text';\n      scope.$apply();\n\n      expect(element.html()).toBe('Some text');\n\n      scope.message = 'Some text, some flags';\n      scope.query = 'some';\n      scope.flags = 'ig';\n      element = compile(template, scope);\n\n      expect(element.html()).toBe('<span class=\"highlight\">Some</span> text, <span class=\"highlight\">some</span> flags');\n\n      scope.query = 'some';\n      scope.flags = '^i';\n      element = compile(template, scope);\n\n      expect(element.html()).toBe('<span class=\"highlight\">Some</span> text, some flags');\n\n      scope.query = 's';\n      scope.flags = '$i';\n      element = compile(template, scope);\n\n      expect(element.html()).toBe('Some text, some flag<span class=\"highlight\">s</span>');\n\n      element.remove();\n    });\n\n    it('should correctly parse special text identifiers', function() {\n      var template = '<div md-highlight-text=\"query\">{{message}}</div>';\n\n      var scope = createScope(null, {\n        message: 'AngularJS&Material',\n        query: 'AngularJS&'\n      });\n\n      var element = compile(template, scope);\n\n      expect(element.html()).toBe('<span class=\"highlight\">AngularJS&amp;</span>Material');\n\n      scope.query = 'AngularJS&Material';\n      scope.$apply();\n\n      expect(element.html()).toBe('<span class=\"highlight\">AngularJS&amp;Material</span>');\n\n      element.remove();\n    });\n\n    it('should properly parse html entity identifiers', function() {\n      var template = '<div md-highlight-text=\"query\">{{message}}</div>';\n\n      var scope = createScope(null, {\n        message: 'AngularJS&amp;Material',\n        query: ''\n      });\n\n      var element = compile(template, scope);\n\n      expect(element.html()).toBe('AngularJS&amp;amp;Material');\n\n      scope.query = 'AngularJS&amp;Material';\n      scope.$apply();\n\n      expect(element.html()).toBe('<span class=\"highlight\">AngularJS&amp;amp;Material</span>');\n\n\n      scope.query = 'AngularJS&';\n      scope.$apply();\n\n      expect(element.html()).toBe('<span class=\"highlight\">AngularJS&amp;</span>amp;Material');\n\n      element.remove();\n    });\n\n    it('should prevent XSS attacks from the highlight text', function() {\n\n      spyOn(window, 'alert');\n\n      var template = '<div md-highlight-text=\"query\">{{message}}</div>';\n\n      var scope = createScope(null, {\n        message: 'AngularJS Material',\n        query: '<img src=\"img\" onerror=\"alert(1)\" alt=\"test\">'\n      });\n\n      var element = compile(template, scope);\n\n      expect(element.html()).toBe('AngularJS Material');\n      expect(window.alert).not.toHaveBeenCalled();\n\n      element.remove();\n    });\n  });\n\n  it('should prevent XSS attacks from the content text', function() {\n\n    spyOn(window, 'alert');\n\n    var template = '<div md-highlight-text=\"query\">{{message}}</div>';\n\n    var scope = createScope(null, {\n      message: '<img src=\"img\" onerror=\"alert(1)\" alt=\"test\">',\n      query: ''\n    });\n\n    var element = compile(template, scope);\n\n    // Expect the image to be escaped due to XSS protection.\n    expect(element.html()).toBe('&lt;img src=\"img\" onerror=\"alert(1)\" alt=\"test\"&gt;');\n    expect(window.alert).not.toHaveBeenCalled();\n\n    element.remove();\n  });\n\n  describe('md-autocomplete-snap', function() {\n    it('should match the width of the snap element if width is set', inject(function($timeout, $material) {\n      var template = '\\\n        <div style=\"width: 1000px\" md-autocomplete-snap=\"width\">\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              style=\"width:200px\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>\\\n        </div>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var autoEl = element.find('md-autocomplete');\n      var ctrl = autoEl.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      angular.element(document.body).append(element);\n\n      $material.flushInterimElement();\n      ctrl.focus();\n\n      autoEl.scope().searchText = 'fo';\n      waitForVirtualRepeat(autoEl);\n\n      expect(ul[0].offsetWidth).toBe(1000);\n      element.remove();\n    }));\n\n    it('should match the width of the wrap element if width is not set', inject(function($timeout, $material) {\n      var template = '\\\n        <div style=\"width: 1000px\" md-autocomplete-snap>\\\n          <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in match(searchText)\"\\\n              md-item-text=\"item.display\"\\\n              placeholder=\"placeholder\"\\\n              style=\"width:200px\">\\\n            <span md-highlight-text=\"searchText\">{{item.display}}</span>\\\n          </md-autocomplete>\\\n        </div>';\n      var scope = createScope();\n      var element = compile(template, scope);\n      var autoEl = element.find('md-autocomplete');\n      var ctrl = autoEl.controller('mdAutocomplete');\n      var ul = element.find('ul');\n\n      angular.element(document.body).append(element);\n\n      $material.flushInterimElement();\n      ctrl.focus();\n\n      autoEl.scope().searchText = 'fo';\n      waitForVirtualRepeat(autoEl);\n\n      expect(ul[0].offsetWidth).toBe(200);\n      element.remove();\n    }));\n  });\n\n});\n"
  },
  {
    "path": "src/components/autocomplete/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"DemoCtrl as ctrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <form ng-submit=\"$event.preventDefault()\">\n      <p id=\"autocompleteDescription\">\n        Use <code>md-autocomplete</code> to search for matches from local or remote data sources.\n      </p>\n      <label id=\"favoriteStateLabel\">Favorite State</label>\n      <md-autocomplete\n          ng-disabled=\"ctrl.isDisabled\"\n          md-no-cache=\"ctrl.noCache\"\n          md-selected-item=\"ctrl.selectedItem\"\n          md-search-text-change=\"ctrl.searchTextChange(ctrl.searchText)\"\n          md-search-text=\"ctrl.searchText\"\n          md-selected-item-change=\"ctrl.selectedItemChange(item)\"\n          md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n          md-item-text=\"item.display\"\n          md-min-length=\"0\"\n          placeholder=\"Ex. Alaska\"\n          input-aria-labelledby=\"favoriteStateLabel\">\n        <md-item-template>\n          <span md-highlight-text=\"ctrl.searchText\" md-highlight-flags=\"^i\">{{item.display}}</span>\n        </md-item-template>\n        <md-not-found>\n          No states matching \"{{ctrl.searchText}}\" were found.\n          <a ng-click=\"ctrl.newState(ctrl.searchText)\">Create a new one!</a>\n        </md-not-found>\n      </md-autocomplete>\n      <br/>\n      <md-checkbox ng-model=\"ctrl.simulateQuery\">Simulate query for results?</md-checkbox>\n      <md-checkbox ng-model=\"ctrl.noCache\">Disable caching of queries?</md-checkbox>\n      <md-checkbox ng-model=\"ctrl.isDisabled\">Disable the input?</md-checkbox>\n      <p id=\"autocompleteDetailedDescription\">\n        By default, <code>md-autocomplete</code> will cache results when performing a query.\n        After the initial call is performed, it will use the cached results to eliminate unnecessary\n        server requests or lookup logic. This can be disabled above.\n      </p>\n    </form>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/autocomplete/demoBasicUsage/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('autocompleteDemo', ['ngMaterial'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q, $log) {\n    var self = this;\n\n    self.simulateQuery = false;\n    self.isDisabled    = false;\n\n    // list of `state` value/display objects\n    self.states        = loadAll();\n    self.querySearch   = querySearch;\n    self.selectedItemChange = selectedItemChange;\n    self.searchTextChange   = searchTextChange;\n\n    self.newState = newState;\n\n    function newState(state) {\n      alert(\"Sorry! You'll need to create a Constitution for \" + state + \" first!\");\n    }\n\n    // ******************************\n    // Internal methods\n    // ******************************\n\n    /**\n     * Search for states... use $timeout to simulate\n     * remote dataservice call.\n     */\n    function querySearch (query) {\n      var results = query ? self.states.filter(createFilterFor(query)) : self.states,\n          deferred;\n      if (self.simulateQuery) {\n        deferred = $q.defer();\n        $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n        return deferred.promise;\n      } else {\n        return results;\n      }\n    }\n\n    function searchTextChange(text) {\n      $log.info('Text changed to ' + text);\n    }\n\n    function selectedItemChange(item) {\n      $log.info('Item changed to ' + JSON.stringify(item));\n    }\n\n    /**\n     * Build `states` list of key/value pairs\n     */\n    function loadAll() {\n      var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\\\n              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\\\n              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\\\n              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\\\n              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\\\n              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\\\n              Wisconsin, Wyoming';\n\n      return allStates.split(/, +/g).map(function (state) {\n        return {\n          value: state.toLowerCase(),\n          display: state\n        };\n      });\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(state) {\n        return (state.value.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/autocomplete/demoCustomTemplate/index.html",
    "content": "<div ng-controller=\"DemoCtrl as ctrl\" ng-cloak>\n  <md-content layout-padding layout=\"column\">\n    <form ng-submit=\"$event.preventDefault()\">\n      <p>Use <code>&lt;md-autocomplete&gt;</code> with custom templates to show styled autocomplete results.</p>\n      <md-autocomplete\n          id=\"custom-template\"\n          ng-disabled=\"ctrl.isDisabled\"\n          md-no-cache=\"ctrl.noCache\"\n          md-selected-item=\"ctrl.selectedItem\"\n          md-search-text-change=\"ctrl.searchTextChange(ctrl.searchText)\"\n          md-search-text=\"ctrl.searchText\"\n          md-selected-item-change=\"ctrl.selectedItemChange(item)\"\n          md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n          md-item-text=\"item.name\"\n          md-min-length=\"0\"\n          md-escape-options=\"clear\"\n          input-aria-label=\"Current Repository\"\n          placeholder=\"Pick an Angular repository\"\n          md-menu-class=\"autocomplete-custom-template\"\n          md-menu-container-class=\"custom-container\">\n        <md-item-template>\n          <span class=\"item-title\">\n            <md-icon md-svg-icon=\"img/icons/octicon-repo.svg\" aria-hidden=\"true\"></md-icon>\n            <span> {{item.name}} </span>\n          </span>\n          <span class=\"item-metadata\">\n            <span>\n              <strong>{{item.watchers}}</strong> watchers\n            </span>\n            <span>\n              <strong>{{item.forks}}</strong> forks\n            </span>\n          </span>\n        </md-item-template>\n      </md-autocomplete>\n    </form>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/autocomplete/demoCustomTemplate/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('autocompleteCustomTemplateDemo', ['ngMaterial'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q, $log) {\n    var self = this;\n\n    self.simulateQuery = false;\n    self.isDisabled    = false;\n\n    self.repos         = loadAll();\n    self.querySearch   = querySearch;\n    self.selectedItemChange = selectedItemChange;\n    self.searchTextChange   = searchTextChange;\n\n    // ******************************\n    // Internal methods\n    // ******************************\n\n    /**\n     * Search for repos... use $timeout to simulate\n     * remote dataservice call.\n     */\n    function querySearch (query) {\n      var results = query ? self.repos.filter(createFilterFor(query)) : self.repos,\n          deferred;\n      if (self.simulateQuery) {\n        deferred = $q.defer();\n        $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n        return deferred.promise;\n      } else {\n        return results;\n      }\n    }\n\n    function searchTextChange(text) {\n      $log.info('Text changed to ' + text);\n    }\n\n    function selectedItemChange(item) {\n      $log.info('Item changed to ' + JSON.stringify(item));\n    }\n\n    /**\n     * Build `components` list of key/value pairs\n     */\n    function loadAll() {\n      var repos = [\n        {\n          'name'      : 'AngularJS',\n          'url'       : 'https://github.com/angular/angular.js',\n          'watchers'  : '3,623',\n          'forks'     : '16,175',\n        },\n        {\n          'name'      : 'Angular',\n          'url'       : 'https://github.com/angular/angular',\n          'watchers'  : '469',\n          'forks'     : '760',\n        },\n        {\n          'name'      : 'AngularJS Material',\n          'url'       : 'https://github.com/angular/material',\n          'watchers'  : '727',\n          'forks'     : '1,241',\n        },\n        {\n          'name'      : 'Angular Material',\n          'url'       : 'https://github.com/angular/components',\n          'watchers'  : '727',\n          'forks'     : '1,241',\n        },\n        {\n          'name'      : 'Bower Material',\n          'url'       : 'https://github.com/angular/bower-material',\n          'watchers'  : '42',\n          'forks'     : '84',\n        },\n        {\n          'name'      : 'Material Start',\n          'url'       : 'https://github.com/angular/material-start',\n          'watchers'  : '81',\n          'forks'     : '303',\n        }\n      ];\n      return repos.map(function (repo) {\n        repo.value = repo.name.toLowerCase();\n        return repo;\n      });\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(item) {\n        return (item.value.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/autocomplete/demoCustomTemplate/style.global.css",
    "content": "md-autocomplete#custom-template {\n  width: 200px;\n}\n.autocomplete-custom-template .md-autocomplete-suggestion {\n  border-bottom: 1px solid #ccc;\n  height: auto;\n  padding-top: 8px;\n  padding-bottom: 8px;\n  white-space: normal;\n}\n.autocomplete-custom-template .md-autocomplete-suggestion:last-child {\n  border-bottom-width: 0;\n}\n.autocomplete-custom-template .item-title,\n.autocomplete-custom-template .item-metadata {\n  display: block;\n  line-height: 2;\n}\n.autocomplete-custom-template .item-title md-icon {\n  height: 18px;\n  width: 18px;\n}\n.custom-container {\n  min-width: 300px !important;\n}\n"
  },
  {
    "path": "src/components/autocomplete/demoFloatingLabel/index.html",
    "content": "<div ng-controller=\"DemoCtrl as ctrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <form ng-submit=\"$event.preventDefault()\" name=\"searchForm\">\n      <p>The following example demonstrates floating labels being used as a normal form element.</p>\n      <div layout-gt-sm=\"row\" style=\"background-color: white\" class=\"md-padding\">\n        <md-input-container flex>\n          <label for=\"floatingLabelName\">Name</label>\n          <input id=\"floatingLabelName\" type=\"text\"/>\n        </md-input-container>\n        <md-autocomplete flex required\n          md-input-name=\"autocompleteField\"\n          md-input-minlength=\"2\"\n          md-input-maxlength=\"18\"\n          md-no-cache=\"ctrl.noCache\"\n          md-selected-item=\"ctrl.selectedItem\"\n          md-search-text=\"ctrl.searchText\"\n          md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n          md-item-text=\"item.display\"\n          md-escape-options=\"clear\"\n          md-require-match=\"\"\n          md-floating-label=\"Favorite state\"\n          input-aria-describedby=\"favoriteStateDescription\">\n          <md-item-template>\n            <span md-highlight-text=\"ctrl.searchText\">{{item.display}}</span>\n          </md-item-template>\n          <div ng-messages=\"searchForm.autocompleteField.$error\" ng-if=\"searchForm.autocompleteField.$touched\">\n            <div ng-message=\"required\">You <b>must</b> have a favorite state.</div>\n            <div ng-message=\"md-require-match\">Please select an existing state.</div>\n            <div ng-message=\"minlength\">Your entry is not long enough.</div>\n            <div ng-message=\"maxlength\">Your entry is too long.</div>\n          </div>\n        </md-autocomplete>\n        <p id=\"favoriteStateDescription\" hide>\n          A person's favorite state tells you a lot about them\n        </p>\n      </div>\n    </form>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/autocomplete/demoFloatingLabel/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('autocompleteFloatingLabelDemo', ['ngMaterial', 'ngMessages'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q) {\n    var self = this;\n\n    // list of `state` value/display objects\n    self.states        = loadAll();\n    self.selectedItem  = null;\n    self.searchText    = null;\n    self.querySearch   = querySearch;\n\n    // ******************************\n    // Internal methods\n    // ******************************\n\n    /**\n     * Search for states... use $timeout to simulate\n     * remote dataservice call.\n     */\n    function querySearch (query) {\n      var results = query ? self.states.filter(createFilterFor(query)) : self.states;\n      var deferred = $q.defer();\n      $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n      return deferred.promise;\n    }\n\n    /**\n     * Build `states` list of key/value pairs\n     */\n    function loadAll() {\n      var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\\\n              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\\\n              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\\\n              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\\\n              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\\\n              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\\\n              Wisconsin, Wyoming';\n\n      return allStates.split(/, +/g).map(function (state) {\n        return {\n          value: state.toLowerCase(),\n          display: state\n        };\n      });\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(state) {\n        return (state.value.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/autocomplete/demoInsideDialog/dialog.tmpl.html",
    "content": "<md-dialog aria-label=\"Autocomplete Dialog Example\">\n\n  <md-toolbar>\n    <div class=\"md-toolbar-tools\">\n      <h2>Autocomplete Dialog Example</h2>\n      <span flex></span>\n      <md-button class=\"md-icon-button\" ng-click=\"ctrl.cancel()\">\n        <md-icon md-svg-src=\"img/icons/ic_close_24px.svg\" aria-label=\"Close dialog\"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-dialog-content ng-cloak>\n    <div class=\"md-dialog-content\">\n      <form ng-submit=\"$event.preventDefault()\">\n        <p>\n          Use <code>md-autocomplete</code> to search for matches from local or remote data sources.\n        </p>\n        <md-autocomplete\n            md-selected-item=\"ctrl.selectedItem\"\n            md-search-text=\"ctrl.searchText\"\n            md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n            md-item-text=\"item.display\"\n            md-min-length=\"0\"\n            md-escape-options=\"clear\"\n            placeholder=\"What is your favorite US state?\"\n            input-aria-label=\"Favorite State\"\n            md-autofocus md-autoselect>\n          <md-item-template>\n            <span md-highlight-text=\"ctrl.searchText\" md-highlight-flags=\"^i\">{{item.display}}</span>\n          </md-item-template>\n          <md-not-found>\n            No states matching \"{{ctrl.searchText}}\" were found.\n          </md-not-found>\n        </md-autocomplete>\n      </form>\n    </div>\n  </md-dialog-content>\n\n  <md-dialog-actions>\n    <md-button aria-label=\"Finished\" ng-click=\"ctrl.finish($event)\">Finished</md-button>\n  </md-dialog-actions>\n</md-dialog>\n"
  },
  {
    "path": "src/components/autocomplete/demoInsideDialog/index.html",
    "content": "<div ng-controller=\"DemoCtrl as ctrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <p>\n      Click the button below to open the dialog with an autocomplete.\n    </p>\n    <md-button ng-click=\"ctrl.openDialog($event)\" class=\"md-raised\">Open Dialog</md-button>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/autocomplete/demoInsideDialog/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('autocompleteDemoInsideDialog', ['ngMaterial'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl($mdDialog) {\n    var self = this;\n\n    self.openDialog = function($event) {\n      $mdDialog.show({\n        controller: DialogCtrl,\n        controllerAs: 'ctrl',\n        templateUrl: 'dialog.tmpl.html',\n        parent: angular.element(document.body),\n        targetEvent: $event,\n        clickOutsideToClose:true\n      });\n    };\n  }\n\n  function DialogCtrl ($timeout, $q, $scope, $mdDialog) {\n    var self = this;\n\n    // list of `state` value/display objects\n    self.states        = loadAll();\n    self.querySearch   = querySearch;\n\n    // ******************************\n    // Template methods\n    // ******************************\n\n    self.cancel = function($event) {\n      $mdDialog.cancel();\n    };\n    self.finish = function($event) {\n      $mdDialog.hide();\n    };\n\n    // ******************************\n    // Internal methods\n    // ******************************\n\n    /**\n     * Search for states... use $timeout to simulate\n     * remote dataservice call.\n     */\n    function querySearch (query) {\n      return query ? self.states.filter(createFilterFor(query)) : self.states;\n    }\n\n    /**\n     * Build `states` list of key/value pairs\n     */\n    function loadAll() {\n      var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\\\n              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\\\n              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\\\n              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\\\n              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\\\n              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\\\n              Wisconsin, Wyoming';\n\n      return allStates.split(/, +/g).map(function (state) {\n        return {\n          value: state.toLowerCase(),\n          display: state\n        };\n      });\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(state) {\n        return (state.value.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/autocomplete/demoRepeatMode/index.html",
    "content": "<md-content class=\"md-padding\" ng-cloak>\n  <div layout=\"row\" layout-xs=\"column\">\n    <div class=\"instance-wrapper\" flex-gt-xs=\"50\" ng-controller=\"DemoCtrl as ctrl\">\n      <form ng-submit=\"$event.preventDefault()\">\n        <p id=\"standard-autocomplete-description\">\n          Specify the <code>md-mode</code> as <code>standard</code> to fall back to\n          <code>ng-repeat</code> for the autocomplete options. This allows\n          options in the list to have varying heights. Note that large lists in\n          <code>standard</code> mode will have a negative performance impact\n          on your application.\n        </p>\n        <h4>Standard mode</h4>\n        <md-autocomplete\n            id=\"standard-autocomplete\"\n            ng-disabled=\"ctrl.isDisabled\"\n            md-no-cache=\"ctrl.noCache\"\n            md-selected-item=\"ctrl.selectedItem\"\n            md-search-text-change=\"ctrl.searchTextChange(ctrl.searchText)\"\n            md-search-text=\"ctrl.searchText\"\n            md-selected-item-change=\"ctrl.selectedItemChange(item)\"\n            md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n            md-item-text=\"item.name\"\n            md-min-length=\"0\"\n            md-escape-options=\"clear\"\n            input-aria-describedby=\"standard-autocomplete-description\"\n            input-aria-label=\"Current Repository\"\n            placeholder=\"Pick an Angular repository\"\n            md-menu-class=\"autocomplete-standard-template\"\n            md-menu-container-class=\"standard-container\"\n            md-mode=\"standard\">\n          <md-item-template>\n            <span class=\"item-title\">\n              <md-icon md-svg-icon=\"img/icons/octicon-repo.svg\" aria-hidden=\"true\"></md-icon>\n              <span> {{item.name}} </span>\n            </span>\n            <p class=\"item-desc\">{{item.desc}}</p>\n            <span class=\"item-metadata\">\n              <span>\n                <strong>{{item.watchers}}</strong> watchers\n              </span>\n              <span>\n                <strong>{{item.forks}}</strong> forks\n              </span>\n            </span>\n          </md-item-template>\n        </md-autocomplete>\n      </form>\n    </div>\n\n    <div class=\"instance-wrapper\" flex-gt-xs=\"50\" ng-controller=\"DemoCtrl as ctrl\">\n      <form ng-submit=\"$event.preventDefault()\">\n        <p id=\"virtual-autocomplete-description\">\n          Omit the <code>md-mode</code> attribute (or specify <code>virtual</code>) to\n          use <code>md-virtual-repeat</code> for the autocomplete options.\n          <a ng-href=\"api/directive/mdVirtualRepeat\">Virtual repeat</a>\n          renders only enough DOM nodes to fill the container, recycling them as the\n          user scrolls. This provides smooth and performant scrolling through large\n          lists of options. Note that all options in a <code>md-virtual-repeat</code>\n          list must have the same height.\n        </p>\n        <h4>Virtual mode</h4>\n        <md-autocomplete\n            id=\"virtual-autocomplete\"\n            ng-disabled=\"ctrl.isDisabled\"\n            md-no-cache=\"ctrl.noCache\"\n            md-selected-item=\"ctrl.selectedItem\"\n            md-search-text-change=\"ctrl.searchTextChange(ctrl.searchText)\"\n            md-search-text=\"ctrl.searchText\"\n            md-selected-item-change=\"ctrl.selectedItemChange(item)\"\n            md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n            md-item-text=\"item.name\"\n            md-min-length=\"0\"\n            md-escape-options=\"clear\"\n            input-aria-describedby=\"virtual-autocomplete-description\"\n            input-aria-label=\"Current Repository\"\n            placeholder=\"Pick an Angular repository\"\n            md-menu-class=\"autocomplete-virtual-template\"\n            md-menu-container-class=\"virtual-container\"\n            md-mode=\"virtual\">\n          <md-item-template>\n            <span class=\"item-title\">\n              <md-icon md-svg-icon=\"img/icons/octicon-repo.svg\" aria-hidden=\"true\"></md-icon>\n              <span> {{item.name}} </span>\n            </span>\n            <p class=\"item-desc\">\n              {{item.desc | limitTo:40}}{{item.desc.length > 40 ? '...': ''}}\n            </p>\n            <span class=\"item-metadata\">\n              <span>\n                <strong>{{item.watchers}}</strong> watchers\n              </span>\n              <span>\n                <strong>{{item.forks}}</strong> forks\n              </span>\n            </span>\n          </md-item-template>\n        </md-autocomplete>\n      </form>\n    </div>\n  </div>\n</md-content>\n"
  },
  {
    "path": "src/components/autocomplete/demoRepeatMode/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('autocompleteRepeatModeDemo', ['ngMaterial'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q, $log) {\n    var self = this;\n\n    self.simulateQuery = false;\n    self.isDisabled    = false;\n\n    self.repos         = loadAll();\n    self.querySearch   = querySearch;\n    self.selectedItemChange = selectedItemChange;\n    self.searchTextChange   = searchTextChange;\n\n    // ******************************\n    // Internal methods\n    // ******************************\n\n    /**\n     * Search for repos... use $timeout to simulate\n     * remote dataservice call.\n     */\n    function querySearch (query) {\n      var results = query ? self.repos.filter(createFilterFor(query)) : self.repos,\n          deferred;\n      if (self.simulateQuery) {\n        deferred = $q.defer();\n        $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);\n        return deferred.promise;\n      } else {\n        return results;\n      }\n    }\n\n    function searchTextChange(text) {\n      $log.info('Text changed to ' + text);\n    }\n\n    function selectedItemChange(item) {\n      $log.info('Item changed to ' + JSON.stringify(item));\n    }\n\n    /**\n     * Build `components` list of key/value pairs\n     */\n    function loadAll() {\n      var repos = [\n        {\n          'name'      : 'AngularJS',\n          'url'       : 'https://github.com/angular/angular.js',\n          'desc'      : 'AngularJS is JavaScript MVC made easy.',\n          'watchers'  : '3,623',\n          'forks'     : '16,175',\n        },\n        {\n          'name'      : 'Angular',\n          'url'       : 'https://github.com/angular/angular',\n          'desc'      : 'Angular is a development platform for building mobile ' +\n                        'and desktop web applications using Typescript/JavaScript ' +\n                        'and other languages.',\n          'watchers'  : '469',\n          'forks'     : '760',\n        },\n        {\n          'name'      : 'AngularJS Material',\n          'url'       : 'https://github.com/angular/material',\n          'desc'      : 'An implementation of Google\\'s Material Design Specification ' +\n                        '(2014-2017) for AngularJS developers',\n          'watchers'  : '727',\n          'forks'     : '1,241',\n        },\n        {\n          'name'      : 'Angular Material',\n          'url'       : 'https://github.com/angular/components',\n          'desc'      : 'Material Design (2018+) components built for and with Angular ' +\n                        'and Typescript',\n          'watchers'  : '727',\n          'forks'     : '1,241',\n        },\n        {\n          'name'      : 'Bower Material',\n          'url'       : 'https://github.com/angular/bower-material',\n          'desc'      : 'the repository used for publishing the AngularJS Material ' +\n                        'v1.x library and localized installs using npm.',\n          'watchers'  : '42',\n          'forks'     : '84',\n        },\n        {\n          'name'      : 'Material Start',\n          'url'       : 'https://github.com/angular/material-start',\n          'desc'      : 'A sample application purposed as both a learning tool and a ' +\n                        'skeleton application for a typical AngularJS Material web app.',\n          'watchers'  : '81',\n          'forks'     : '303',\n        }\n      ];\n      return repos.map(function (repo) {\n        repo.value = repo.name.toLowerCase();\n        return repo;\n      });\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(item) {\n        return (item.value.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/autocomplete/demoRepeatMode/style.global.css",
    "content": "#standard-autocomplete,\n#virtual-autocomplete {\n  width: 200px;\n}\n.autocomplete-standard-template .md-autocomplete-suggestion,\n.autocomplete-virtual-template .md-autocomplete-suggestion {\n  border-bottom: 1px solid #ccc;\n  height: auto;\n  padding-top: 8px;\n  padding-bottom: 8px;\n  white-space: normal;\n}\n.autocomplete-virtual-template .md-autocomplete-suggestion:last-child,\n.autocomplete-standard-template .md-autocomplete-suggestion:last-child {\n  border-bottom-width: 0;\n}\n.autocomplete-virtual-template .item-title,\n.autocomplete-virtual-template .item-metadata,\n.autocomplete-standard-template .item-title,\n.autocomplete-standard-template .item-metadata {\n  display: block;\n  line-height: 2;\n}\n.autocomplete-virtual-template .item-title md-icon,\n.autocomplete-standard-template .item-title md-icon {\n  height: 18px;\n  width: 18px;\n}\n.autocomplete-virtual-template .item-desc,\n.autocomplete-standard-template .item-desc {\n  font-size: 12px;\n  margin: 0.8em 0 .8em;\n  max-width: 300px;\n}\n.standard-container,\n.virtual-container {\n  width: 300px;\n}\n.instance-wrapper {\n  padding: 0 8px;\n}\n"
  },
  {
    "path": "src/components/autocomplete/js/autocompleteController.js",
    "content": "angular\n    .module('material.components.autocomplete')\n    .controller('MdAutocompleteCtrl', MdAutocompleteCtrl);\n\nvar ITEM_HEIGHT   = 48,\n    MAX_ITEMS     = 5,\n    MENU_PADDING  = 8,\n    INPUT_PADDING = 2, // Padding provided by `md-input-container`\n    MODE_STANDARD = 'standard',\n    MODE_VIRTUAL = 'virtual';\n\nfunction MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming, $window,\n                             $animate, $rootElement, $attrs, $q, $log, $mdLiveAnnouncer) {\n\n  // Internal Variables.\n  var ctrl                 = this,\n      itemParts            = $scope.itemsExpr.split(/ in /i),\n      itemExpr             = itemParts[ 1 ],\n      elements             = null,\n      cache                = {},\n      noBlur               = false,\n      selectedItemWatchers = [],\n      hasFocus             = false,\n      fetchesInProgress    = 0,\n      enableWrapScroll     = null,\n      inputModelCtrl       = null,\n      debouncedOnResize    = $mdUtil.debounce(onWindowResize),\n      mode                 = MODE_VIRTUAL; // default\n\n  /**\n   * The root document element. This is used for attaching a top-level click handler to\n   * close the options panel when a click outside said panel occurs. We use `documentElement`\n   * instead of body because, when scrolling is disabled, some browsers consider the body element\n   * to be completely off the screen and propagate events directly to the html element.\n   * @type {!Object} angular.JQLite\n   */\n  ctrl.documentElement = angular.element(document.documentElement);\n\n  // Public Exported Variables with handlers\n  defineProperty('hidden', handleHiddenChange, true);\n\n  // Public Exported Variables\n  ctrl.scope = $scope;\n  ctrl.parent = $scope.$parent;\n  ctrl.itemName = itemParts[0];\n  ctrl.matches = [];\n  ctrl.loading = false;\n  ctrl.hidden = true;\n  ctrl.index = -1;\n  ctrl.activeOption = null;\n  ctrl.id = $mdUtil.nextUid();\n  ctrl.isDisabled = null;\n  ctrl.isRequired = null;\n  ctrl.isReadonly = null;\n  ctrl.hasNotFound = false;\n  ctrl.selectedMessage = $scope.selectedMessage || 'selected';\n  ctrl.noMatchMessage = $scope.noMatchMessage || 'There are no matches available.';\n  ctrl.singleMatchMessage = $scope.singleMatchMessage || 'There is 1 match available.';\n  ctrl.multipleMatchStartMessage = $scope.multipleMatchStartMessage || 'There are ';\n  ctrl.multipleMatchEndMessage = $scope.multipleMatchEndMessage || ' matches available.';\n  ctrl.defaultEscapeOptions = 'clear';\n\n  // Public Exported Methods\n  ctrl.keydown = keydown;\n  ctrl.blur = blur;\n  ctrl.focus = focus;\n  ctrl.clear = clearValue;\n  ctrl.select = select;\n  ctrl.listEnter = onListEnter;\n  ctrl.listLeave = onListLeave;\n  ctrl.focusInput = focusInputElement;\n  ctrl.getCurrentDisplayValue = getCurrentDisplayValue;\n  ctrl.registerSelectedItemWatcher = registerSelectedItemWatcher;\n  ctrl.unregisterSelectedItemWatcher = unregisterSelectedItemWatcher;\n  ctrl.notFoundVisible = notFoundVisible;\n  ctrl.loadingIsVisible = loadingIsVisible;\n  ctrl.positionDropdown = positionDropdown;\n\n  /**\n   * Report types to be used for the $mdLiveAnnouncer\n   * @enum {number} Unique flag id.\n   */\n  var ReportType = {\n    Count: 1,\n    Selected: 2\n  };\n\n  return init();\n\n  // initialization methods\n\n  /**\n   * Initialize the controller, setup watchers, gather elements\n   */\n  function init () {\n\n    $mdUtil.initOptionalProperties($scope, $attrs, {\n      searchText: '',\n      selectedItem: null,\n      clearButton: false,\n      disableVirtualRepeat: false,\n    });\n\n    $mdTheming($element);\n    configureWatchers();\n    $mdUtil.nextTick(function () {\n\n      gatherElements();\n      moveDropdown();\n\n      // Touch devices often do not send a click event on tap. We still want to focus the input\n      // and open the options pop-up in these cases.\n      $element.on('touchstart', focusInputElement);\n\n      // Forward all focus events to the input element when autofocus is enabled\n      if ($scope.autofocus) {\n        $element.on('focus', focusInputElement);\n      }\n      if ($scope.inputAriaDescribedBy) {\n        elements.input.setAttribute('aria-describedby', $scope.inputAriaDescribedBy);\n      }\n      if (!$scope.floatingLabel) {\n        if ($scope.inputAriaLabel) {\n          elements.input.setAttribute('aria-label', $scope.inputAriaLabel);\n        } else if ($scope.inputAriaLabelledBy) {\n          elements.input.setAttribute('aria-labelledby', $scope.inputAriaLabelledBy);\n        } else if ($scope.placeholder) {\n          // If no aria-label or aria-labelledby references are defined, then just label using the\n          // placeholder.\n          elements.input.setAttribute('aria-label', $scope.placeholder);\n        }\n      }\n    });\n  }\n\n  function updateModelValidators() {\n    if (!$scope.requireMatch || !inputModelCtrl) return;\n\n    inputModelCtrl.$setValidity('md-require-match', !!$scope.selectedItem || !$scope.searchText);\n  }\n\n  /**\n   * Calculates the dropdown's position and applies the new styles to the menu element\n   * @returns {*}\n   */\n  function positionDropdown () {\n    if (!elements) {\n      return $mdUtil.nextTick(positionDropdown, false, $scope);\n    }\n\n    var dropdownHeight = ($scope.dropdownItems || MAX_ITEMS) * ITEM_HEIGHT;\n    var hrect  = elements.wrap.getBoundingClientRect(),\n        vrect  = elements.snap.getBoundingClientRect(),\n        root   = elements.root.getBoundingClientRect(),\n        top    = vrect.bottom - root.top,\n        bot    = root.bottom - vrect.top,\n        left   = hrect.left - root.left,\n        width  = hrect.width,\n        offset = getVerticalOffset(),\n        position = $scope.dropdownPosition,\n        styles, enoughBottomSpace, enoughTopSpace;\n    var bottomSpace = root.bottom - vrect.bottom - MENU_PADDING + $mdUtil.getViewportTop();\n    var topSpace = vrect.top - MENU_PADDING;\n\n    // Automatically determine dropdown placement based on available space in viewport.\n    if (!position) {\n      enoughTopSpace = topSpace > dropdownHeight;\n      enoughBottomSpace = bottomSpace > dropdownHeight;\n      if (enoughBottomSpace) {\n        position = 'bottom';\n      } else if (enoughTopSpace) {\n        position = 'top';\n      } else {\n        position = topSpace > bottomSpace ? 'top' : 'bottom';\n      }\n    }\n    // Adjust the width to account for the padding provided by `md-input-container`\n    if ($attrs.mdFloatingLabel) {\n      left += INPUT_PADDING;\n      width -= INPUT_PADDING * 2;\n    }\n    styles = {\n      left:     left + 'px',\n      minWidth: width + 'px',\n      maxWidth: Math.max(hrect.right - root.left, root.right - hrect.left) - MENU_PADDING + 'px'\n    };\n\n    if (position === 'top') {\n      styles.top       = 'auto';\n      styles.bottom    = bot + 'px';\n      styles.maxHeight = Math.min(dropdownHeight, topSpace) + 'px';\n    } else {\n      bottomSpace = root.bottom - hrect.bottom - MENU_PADDING + $mdUtil.getViewportTop();\n\n      styles.top       = (top - offset) + 'px';\n      styles.bottom    = 'auto';\n      styles.maxHeight = Math.min(dropdownHeight, bottomSpace) + 'px';\n    }\n\n    elements.$.scrollContainer.css(styles);\n    $mdUtil.nextTick(correctHorizontalAlignment, false, $scope);\n\n    /**\n     * Calculates the vertical offset for floating label examples to account for ngMessages\n     * @returns {number}\n     */\n    function getVerticalOffset () {\n      var offset = 0;\n      var inputContainer = $element.find('md-input-container');\n      if (inputContainer.length) {\n        var input = inputContainer.find('input');\n        offset = inputContainer.prop('offsetHeight');\n        offset -= input.prop('offsetTop');\n        offset -= input.prop('offsetHeight');\n        // add in the height left up top for the floating label text\n        offset += inputContainer.prop('offsetTop');\n      }\n      return offset;\n    }\n\n    /**\n     * Makes sure that the menu doesn't go off of the screen on either side.\n     */\n    function correctHorizontalAlignment () {\n      var dropdown = elements.scrollContainer.getBoundingClientRect(),\n          styles   = {};\n      if (dropdown.right > root.right) {\n        styles.left = (hrect.right - dropdown.width) + 'px';\n      }\n      elements.$.scrollContainer.css(styles);\n    }\n  }\n\n  /**\n   * Moves the dropdown menu to the body tag in order to avoid z-index and overflow issues.\n   */\n  function moveDropdown () {\n    if (!elements.$.root.length) return;\n    $mdTheming(elements.$.scrollContainer);\n    elements.$.scrollContainer.detach();\n    elements.$.root.append(elements.$.scrollContainer);\n    if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n  }\n\n  /**\n   * Sends focus to the input element.\n   */\n  function focusInputElement () {\n    elements.input.focus();\n  }\n\n  /**\n   * Update the activeOption based on the selected item in the listbox.\n   * The activeOption is used in the template to set the aria-activedescendant attribute, which\n   * enables screen readers to properly handle visual focus within the listbox and announce the\n   * item's place in the list. I.e. \"List item 3 of 50\". Anytime that `ctrl.index` changes, this\n   * function needs to be called to update the activeOption.\n   */\n  function updateActiveOption() {\n    var selectedOption = elements.scroller.querySelector('.selected');\n    if (selectedOption) {\n      ctrl.activeOption = selectedOption.id;\n    } else {\n      ctrl.activeOption = null;\n    }\n  }\n\n  /**\n   * Sets up any watchers used by autocomplete\n   */\n  function configureWatchers () {\n    var wait = parseInt($scope.delay, 10) || 0;\n\n    $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n    $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n    $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n\n    $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n    $scope.$watch('selectedItem', selectedItemChange);\n\n    angular.element($window).on('resize', debouncedOnResize);\n\n    $scope.$on('$destroy', cleanup);\n  }\n\n  /**\n   * Removes any events or leftover elements created by this controller\n   */\n  function cleanup () {\n    if (!ctrl.hidden) {\n      $mdUtil.enableScrolling();\n    }\n\n    angular.element($window).off('resize', debouncedOnResize);\n\n    if (elements){\n      var items = ['ul', 'scroller', 'scrollContainer', 'input'];\n      angular.forEach(items, function(key){\n        elements.$[key].remove();\n      });\n    }\n  }\n\n  /**\n   * Event handler to be called whenever the window resizes.\n   */\n  function onWindowResize() {\n    if (!ctrl.hidden) {\n      positionDropdown();\n    }\n  }\n\n  /**\n   * Gathers all of the elements needed for this controller\n   */\n  function gatherElements () {\n\n    var snapWrap = gatherSnapWrap();\n\n    elements = {\n      main:  $element[0],\n      scrollContainer: $element[0].querySelector('.md-virtual-repeat-container, .md-standard-list-container'),\n      scroller: $element[0].querySelector('.md-virtual-repeat-scroller, .md-standard-list-scroller'),\n      ul:    $element.find('ul')[0],\n      input: $element.find('input')[0],\n      wrap:  snapWrap.wrap,\n      snap:  snapWrap.snap,\n      root:  document.body,\n    };\n\n    elements.li   = elements.ul.getElementsByTagName('li');\n    elements.$    = getAngularElements(elements);\n    mode = elements.scrollContainer.classList.contains('md-standard-list-container') ? MODE_STANDARD : MODE_VIRTUAL;\n    inputModelCtrl = elements.$.input.controller('ngModel');\n  }\n\n  /**\n   * Gathers the snap and wrap elements\n   *\n   */\n  function gatherSnapWrap() {\n    var element;\n    var value;\n    for (element = $element; element.length; element = element.parent()) {\n      value = element.attr('md-autocomplete-snap');\n      if (angular.isDefined(value)) break;\n    }\n\n    if (element.length) {\n      return {\n        snap: element[0],\n        wrap: (value.toLowerCase() === 'width') ? element[0] : $element.find('md-autocomplete-wrap')[0]\n      };\n    }\n\n    var wrap = $element.find('md-autocomplete-wrap')[0];\n    return {\n      snap: wrap,\n      wrap: wrap\n    };\n  }\n\n  /**\n   * Gathers angular-wrapped versions of each element\n   * @param elements\n   * @returns {{}}\n   */\n  function getAngularElements (elements) {\n    var obj = {};\n    for (var key in elements) {\n      if (elements.hasOwnProperty(key)) obj[ key ] = angular.element(elements[ key ]);\n    }\n    return obj;\n  }\n\n  // event/change handlers\n\n  /**\n   * @param {Event} $event\n   */\n  function preventDefault($event) {\n    $event.preventDefault();\n  }\n\n  /**\n   * @param {Event} $event\n   */\n  function stopPropagation($event) {\n    $event.stopPropagation();\n  }\n\n  /**\n   * Handles changes to the `hidden` property.\n   * @param {boolean} hidden true to hide the options pop-up, false to show it.\n   * @param {boolean} oldHidden the previous value of hidden\n   */\n  function handleHiddenChange (hidden, oldHidden) {\n    var scrollContainerElement;\n\n    if (elements) {\n      scrollContainerElement = angular.element(elements.scrollContainer);\n    }\n    if (!hidden && oldHidden) {\n      positionDropdown();\n\n      // Report in polite mode, because the screen reader should finish the default description of\n      // the input element.\n      reportMessages(true, ReportType.Count | ReportType.Selected);\n\n      if (elements) {\n        $mdUtil.disableScrollAround(elements.scrollContainer);\n        enableWrapScroll = disableElementScrollEvents(elements.wrap);\n        if ($mdUtil.isIos) {\n          ctrl.documentElement.on('touchend', handleTouchOutsidePanel);\n          if (scrollContainerElement) {\n            scrollContainerElement.on('touchstart touchmove touchend', stopPropagation);\n          }\n        }\n        ctrl.index = getDefaultIndex();\n        $mdUtil.nextTick(function() {\n          updateActiveOption();\n          updateScroll();\n        });\n      }\n    } else if (hidden && !oldHidden) {\n      if ($mdUtil.isIos) {\n        ctrl.documentElement.off('touchend', handleTouchOutsidePanel);\n        if (scrollContainerElement) {\n          scrollContainerElement.off('touchstart touchmove touchend', stopPropagation);\n        }\n      }\n      $mdUtil.enableScrolling();\n\n      if (enableWrapScroll) {\n        enableWrapScroll();\n        enableWrapScroll = null;\n      }\n    }\n  }\n\n  /**\n   * Handling touch events that bubble up to the document is required for closing the dropdown\n   * panel on touch outside of the options pop-up panel on iOS.\n   * @param {Event} $event\n   */\n  function handleTouchOutsidePanel($event) {\n    ctrl.hidden = true;\n    // iOS does not blur the pop-up for touches on the scroll mask, so we have to do it.\n    doBlur(true);\n  }\n\n  /**\n   * Disables scrolling for a specific element.\n   * @param {!string|!DOMElement} element to disable scrolling\n   * @return {Function} function to call to re-enable scrolling for the element\n   */\n  function disableElementScrollEvents(element) {\n    var elementToDisable = angular.element(element);\n    elementToDisable.on('wheel touchmove', preventDefault);\n\n    return function() {\n      elementToDisable.off('wheel touchmove', preventDefault);\n    };\n  }\n\n  /**\n   * When the user mouses over the dropdown menu, ignore blur events.\n   */\n  function onListEnter () {\n    noBlur = true;\n  }\n\n  /**\n   * When the user's mouse leaves the menu, blur events may hide the menu again.\n   */\n  function onListLeave () {\n    if (!hasFocus && !ctrl.hidden) elements.input.focus();\n    noBlur = false;\n    ctrl.hidden = shouldHide();\n  }\n\n  /**\n   * Handles changes to the selected item.\n   * @param selectedItem\n   * @param previousSelectedItem\n   */\n  function selectedItemChange (selectedItem, previousSelectedItem) {\n\n    updateModelValidators();\n\n    if (selectedItem) {\n      getDisplayValue(selectedItem).then(function (val) {\n        $scope.searchText = val;\n        handleSelectedItemChange(selectedItem, previousSelectedItem);\n      });\n    } else if (previousSelectedItem && $scope.searchText) {\n      getDisplayValue(previousSelectedItem).then(function(displayValue) {\n        // Clear the searchText, when the selectedItem is set to null.\n        // Do not clear the searchText, when the searchText isn't matching with the previous\n        // selected item.\n        if (angular.isString($scope.searchText)\n          && displayValue.toString().toLowerCase() === $scope.searchText.toLowerCase()) {\n          $scope.searchText = '';\n        }\n      });\n    }\n\n    if (selectedItem !== previousSelectedItem) {\n      announceItemChange();\n    }\n  }\n\n  /**\n   * Use the user-defined expression to announce changes each time a new item is selected\n   */\n  function announceItemChange () {\n    angular.isFunction($scope.itemChange) &&\n      $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n  }\n\n  /**\n   * Use the user-defined expression to announce changes each time the search text is changed\n   */\n  function announceTextChange () {\n    angular.isFunction($scope.textChange) && $scope.textChange();\n  }\n\n  /**\n   * Calls any external watchers listening for the selected item.  Used in conjunction with\n   * `registerSelectedItemWatcher`.\n   * @param selectedItem\n   * @param previousSelectedItem\n   */\n  function handleSelectedItemChange (selectedItem, previousSelectedItem) {\n    selectedItemWatchers.forEach(function (watcher) {\n      watcher(selectedItem, previousSelectedItem);\n    });\n  }\n\n  /**\n   * Register a function to be called when the selected item changes.\n   * @param cb\n   */\n  function registerSelectedItemWatcher (cb) {\n    if (selectedItemWatchers.indexOf(cb) === -1) {\n      selectedItemWatchers.push(cb);\n    }\n  }\n\n  /**\n   * Unregister a function previously registered for selected item changes.\n   * @param cb\n   */\n  function unregisterSelectedItemWatcher (cb) {\n    var i = selectedItemWatchers.indexOf(cb);\n    if (i !== -1) {\n      selectedItemWatchers.splice(i, 1);\n    }\n  }\n\n  /**\n   * Handles changes to the searchText property.\n   * @param {string} searchText\n   * @param {string} previousSearchText\n   */\n  function handleSearchText (searchText, previousSearchText) {\n    ctrl.index = getDefaultIndex();\n\n    // do nothing on init\n    if (searchText === previousSearchText) return;\n\n    updateModelValidators();\n\n    getDisplayValue($scope.selectedItem).then(function (val) {\n      // clear selected item if search text no longer matches it\n      if (searchText !== val) {\n        $scope.selectedItem = null;\n\n        // trigger change event if available\n        if (searchText !== previousSearchText) {\n          announceTextChange();\n        }\n\n        // cancel results if search text is not long enough\n        if (!isMinLengthMet()) {\n          ctrl.matches = [];\n\n          setLoading(false);\n          reportMessages(true, ReportType.Count);\n\n        } else {\n          handleQuery();\n        }\n      }\n    });\n\n  }\n\n  /**\n   * Handles input blur event, determines if the dropdown should hide.\n   * @param {Event=} $event\n   */\n  function blur($event) {\n    hasFocus = false;\n\n    if (!noBlur) {\n      ctrl.hidden = shouldHide();\n      evalAttr('ngBlur', { $event: $event });\n    } else if (angular.isObject($event)) {\n      $event.stopImmediatePropagation();\n    }\n  }\n\n  /**\n   * Force blur on input element\n   * @param {boolean} forceBlur\n   */\n  function doBlur(forceBlur) {\n    if (forceBlur) {\n      noBlur = false;\n      hasFocus = false;\n    }\n    elements.input.blur();\n  }\n\n  /**\n   * Handles input focus event, determines if the dropdown should show.\n   */\n  function focus($event) {\n    hasFocus = true;\n\n    if (isSearchable() && isMinLengthMet()) {\n      handleQuery();\n    }\n\n    ctrl.hidden = shouldHide();\n\n    evalAttr('ngFocus', { $event: $event });\n  }\n\n  /**\n   * Handles keyboard input.\n   * @param event\n   */\n  function keydown (event) {\n    switch (event.keyCode) {\n      case $mdConstant.KEY_CODE.DOWN_ARROW:\n        if (ctrl.loading || hasSelection()) return;\n        event.stopPropagation();\n        event.preventDefault();\n        ctrl.index = ctrl.index + 1 > ctrl.matches.length - 1 ? 0 : Math.min(ctrl.index + 1, ctrl.matches.length - 1);\n        $mdUtil.nextTick(updateActiveOption);\n        updateScroll();\n        break;\n      case $mdConstant.KEY_CODE.UP_ARROW:\n        if (ctrl.loading || hasSelection()) return;\n        event.stopPropagation();\n        event.preventDefault();\n        ctrl.index = ctrl.index - 1 < 0 ? ctrl.matches.length - 1 : Math.max(0, ctrl.index - 1);\n        $mdUtil.nextTick(updateActiveOption);\n        updateScroll();\n        break;\n      case $mdConstant.KEY_CODE.TAB:\n        // If we hit tab, assume that we've left the list so it will close\n        onListLeave();\n\n        if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;\n        select(ctrl.index);\n        break;\n      case $mdConstant.KEY_CODE.ENTER:\n        if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;\n        if (hasSelection()) return;\n        event.stopImmediatePropagation();\n        event.preventDefault();\n        select(ctrl.index);\n        break;\n      case $mdConstant.KEY_CODE.ESCAPE:\n        event.preventDefault(); // Prevent browser from always clearing input\n        if (!shouldProcessEscape()) return;\n        event.stopPropagation();\n\n        clearSelectedItem();\n        if ($scope.searchText && hasEscapeOption('clear')) {\n          clearSearchText();\n        }\n\n        // Manually hide (needed for mdNotFound support)\n        ctrl.hidden = true;\n\n        if (hasEscapeOption('blur')) {\n          // Force the component to blur if they hit escape\n          doBlur(true);\n        }\n\n        break;\n      default:\n    }\n  }\n\n  // getters\n\n  /**\n   * Returns the minimum length needed to display the dropdown.\n   * @returns {*}\n   */\n  function getMinLength () {\n    return angular.isNumber($scope.minLength) ? $scope.minLength : 1;\n  }\n\n  /**\n   * Returns the display value for an item.\n   * @param {*} item\n   * @returns {*}\n   */\n  function getDisplayValue (item) {\n    return $q.when(getItemText(item) || item).then(function(itemText) {\n      if (itemText && !angular.isString(itemText)) {\n        $log.warn('md-autocomplete: Could not resolve display value to a string. ' +\n          'Please check the `md-item-text` attribute.');\n      }\n\n      return itemText;\n    });\n\n    /**\n     * Getter function to invoke user-defined expression (in the directive)\n     * to convert your object to a single string.\n     * @param {*} item\n     * @returns {string|null}\n     */\n    function getItemText (item) {\n      return (item && $scope.itemText) ? $scope.itemText(getItemAsNameVal(item)) : null;\n    }\n  }\n\n  /**\n   * Returns the locals object for compiling item templates.\n   * @param {*} item\n   * @returns {Object|undefined}\n   */\n  function getItemAsNameVal (item) {\n    if (!item) {\n      return undefined;\n    }\n\n    var locals = {};\n    if (ctrl.itemName) {\n      locals[ ctrl.itemName ] = item;\n    }\n\n    return locals;\n  }\n\n  /**\n   * Returns the default index based on whether or not autoselect is enabled.\n   * @returns {number} 0 if autoselect is enabled, -1 if not.\n   */\n  function getDefaultIndex () {\n    return $scope.autoselect ? 0 : -1;\n  }\n\n  /**\n   * Sets the loading parameter and updates the hidden state.\n   * @param value {boolean} Whether or not the component is currently loading.\n   */\n  function setLoading(value) {\n    if (ctrl.loading !== value) {\n      ctrl.loading = value;\n    }\n\n    // Always refresh the hidden variable as something else might have changed\n    ctrl.hidden = shouldHide();\n  }\n\n  /**\n   * Determines if the menu should be hidden.\n   * @returns {boolean} true if the menu should be hidden\n   */\n  function shouldHide () {\n    return !shouldShow();\n  }\n\n  /**\n   * Determines whether the autocomplete is able to query within the current state.\n   * @returns {boolean} true if the query can be run\n   */\n  function isSearchable() {\n    if (ctrl.loading && !hasMatches()) {\n      // No query when query is in progress.\n      return false;\n    } else if (hasSelection()) {\n      // No query if there is already a selection\n      return false;\n    }\n    else if (!hasFocus) {\n      // No query if the input does not have focus\n      return false;\n    }\n    return true;\n  }\n\n  /**\n   * @returns {boolean} if the escape keydown should be processed, return true.\n   *  Otherwise return false.\n   */\n  function shouldProcessEscape() {\n    return hasEscapeOption('blur') || !ctrl.hidden || ctrl.loading || hasEscapeOption('clear') && $scope.searchText;\n  }\n\n  /**\n   * @param {string} option check if this option is set\n   * @returns {boolean} if the specified escape option is set, return true. Return false otherwise.\n   */\n  function hasEscapeOption(option) {\n    if (!angular.isString($scope.escapeOptions)) {\n      return ctrl.defaultEscapeOptions.indexOf(option) !== -1;\n    } else {\n      return $scope.escapeOptions.toLowerCase().indexOf(option) !== -1;\n    }\n  }\n\n  /**\n   * Determines if the menu should be shown.\n   * @returns {boolean} true if the menu should be shown\n   */\n  function shouldShow() {\n    if (ctrl.isReadonly) {\n      // Don't show if read only is set\n      return false;\n    } else if (!isSearchable()) {\n      // Don't show if a query is in progress, there is already a selection,\n      // or the input is not focused.\n      return false;\n    }\n    return (isMinLengthMet() && hasMatches()) || notFoundVisible();\n  }\n\n  /**\n   * @returns {boolean} true if the search text has matches.\n   */\n  function hasMatches() {\n    return ctrl.matches.length ? true : false;\n  }\n\n  /**\n   * @returns {boolean} true if the autocomplete has a valid selection.\n   */\n  function hasSelection() {\n    return ctrl.scope.selectedItem ? true : false;\n  }\n\n  /**\n   * @returns {boolean} true if the loading indicator is, or should be, visible.\n   */\n  function loadingIsVisible() {\n    return ctrl.loading && !hasSelection();\n  }\n\n  /**\n   * @returns {*} the display value of the current item.\n   */\n  function getCurrentDisplayValue () {\n    return getDisplayValue(ctrl.matches[ ctrl.index ]);\n  }\n\n  /**\n   * Determines if the minimum length is met by the search text.\n   * @returns {*} true if the minimum length is met by the search text\n   */\n  function isMinLengthMet () {\n    return ($scope.searchText || '').length >= getMinLength();\n  }\n\n  // actions\n\n  /**\n   * Defines a public property with a handler and a default value.\n   * @param {string} key\n   * @param {Function} handler function\n   * @param {*} defaultValue default value\n   */\n  function defineProperty (key, handler, defaultValue) {\n    Object.defineProperty(ctrl, key, {\n      get: function () { return defaultValue; },\n      set: function (newValue) {\n        var oldValue = defaultValue;\n        defaultValue        = newValue;\n        handler(newValue, oldValue);\n      }\n    });\n  }\n\n  /**\n   * Selects the item at the given index.\n   * @param {number} index to select\n   */\n  function select (index) {\n    // force form to update state for validation\n    $mdUtil.nextTick(function () {\n      getDisplayValue(ctrl.matches[ index ]).then(function (val) {\n        var ngModel = elements.$.input.controller('ngModel');\n        $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive');\n        ngModel.$setViewValue(val);\n        ngModel.$render();\n      }).finally(function () {\n        $scope.selectedItem = ctrl.matches[ index ];\n        setLoading(false);\n      });\n    }, false);\n  }\n\n  /**\n   * Clears the searchText value and selected item.\n   * @param {Event} $event\n   */\n  function clearValue ($event) {\n    if ($event) {\n      $event.stopPropagation();\n    }\n    clearSelectedItem();\n    clearSearchText();\n  }\n\n  /**\n   * Clears the selected item\n   */\n  function clearSelectedItem () {\n    // Reset our variables\n    ctrl.index = -1;\n    $mdUtil.nextTick(updateActiveOption);\n    ctrl.matches = [];\n  }\n\n  /**\n   * Clears the searchText value\n   */\n  function clearSearchText () {\n    // Set the loading to true so we don't see flashes of content.\n    // The flashing will only occur when an async request is running.\n    // So the loading process will stop when the results had been retrieved.\n    setLoading(true);\n\n    $scope.searchText = '';\n\n    // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n    // But some browsers are not detecting it properly, which means that we have to trigger the event.\n    // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n    // The `change` event is a good alternative and is supported by all supported browsers.\n    var eventObj = document.createEvent('CustomEvent');\n    eventObj.initCustomEvent('change', true, true, { value: '' });\n    elements.input.dispatchEvent(eventObj);\n\n    // For some reason, firing the above event resets the value of $scope.searchText if\n    // $scope.searchText has a space character at the end, so we blank it one more time and then\n    // focus.\n    elements.input.blur();\n    $scope.searchText = '';\n    elements.input.focus();\n  }\n\n  /**\n   * Fetches the results for the provided search text.\n   * @param searchText\n   */\n  function fetchResults (searchText) {\n    var items = $scope.$parent.$eval(itemExpr),\n        term  = searchText.toLowerCase(),\n        isList = angular.isArray(items),\n        isPromise = !!items.then; // Every promise should contain a `then` property\n\n    if (isList) onResultsRetrieved(items);\n    else if (isPromise) handleAsyncResults(items);\n\n    function handleAsyncResults(items) {\n      if (!items) return;\n\n      items = $q.when(items);\n      fetchesInProgress++;\n      setLoading(true);\n\n      $mdUtil.nextTick(function () {\n          items\n            .then(onResultsRetrieved)\n            .finally(function(){\n              if (--fetchesInProgress === 0) {\n                setLoading(false);\n              }\n            });\n      },true, $scope);\n    }\n\n    function onResultsRetrieved(matches) {\n      cache[term] = matches;\n\n      // Just cache the results if the request is now outdated.\n      // The request becomes outdated, when the new searchText has changed during the result fetching.\n      if ((searchText || '') !== ($scope.searchText || '')) {\n        return;\n      }\n\n      handleResults(matches);\n    }\n  }\n\n\n  /**\n   * Reports given message types to supported screen readers.\n   * @param {boolean} isPolite Whether the announcement should be polite.\n   * @param {!number} types Message flags to be reported to the screen reader.\n   */\n  function reportMessages(isPolite, types) {\n    var politeness = isPolite ? 'polite' : 'assertive';\n    var messages = [];\n\n    if (types & ReportType.Selected && ctrl.index !== -1) {\n      messages.push(getCurrentDisplayValue());\n    }\n\n    if (types & ReportType.Count) {\n      messages.push($q.resolve(getCountMessage()));\n    }\n\n    $q.all(messages).then(function(data) {\n      $mdLiveAnnouncer.announce(data.join(' '), politeness);\n    });\n  }\n\n  /**\n   * @returns {string} the ARIA message for how many results match the current query.\n   */\n  function getCountMessage () {\n    switch (ctrl.matches.length) {\n      case 0:\n        return ctrl.noMatchMessage;\n      case 1:\n        return ctrl.singleMatchMessage;\n      default:\n        return ctrl.multipleMatchStartMessage + ctrl.matches.length + ctrl.multipleMatchEndMessage;\n    }\n  }\n\n  /**\n   * Makes sure that the focused element is within view.\n   */\n  function updateScroll () {\n    if (!elements.li[0]) return;\n    if (mode === MODE_STANDARD) {\n      updateStandardScroll();\n    } else {\n      updateVirtualScroll();\n    }\n  }\n\n  function updateVirtualScroll() {\n    // elements in virtual scroll have consistent heights\n    var optionHeight = elements.li[0].offsetHeight,\n        top = optionHeight * Math.max(0, ctrl.index),\n        bottom = top + optionHeight,\n        containerHeight = elements.scroller.clientHeight,\n        scrollTop = elements.scroller.scrollTop;\n\n    if (top < scrollTop) {\n      scrollTo(top);\n    } else if (bottom > scrollTop + containerHeight) {\n      scrollTo(bottom - containerHeight);\n    }\n  }\n\n  function updateStandardScroll() {\n    // elements in standard scroll have variable heights\n    var selected =  elements.li[Math.max(0, ctrl.index)];\n    var containerHeight = elements.scrollContainer.offsetHeight,\n        top = selected && selected.offsetTop || 0,\n        bottom = top + selected.clientHeight,\n        scrollTop = elements.scrollContainer.scrollTop;\n\n    if (top < scrollTop) {\n      scrollTo(top);\n    } else if (bottom > scrollTop + containerHeight) {\n      scrollTo(bottom - containerHeight);\n    }\n  }\n\n  function isPromiseFetching() {\n    return fetchesInProgress !== 0;\n  }\n\n  function scrollTo (offset) {\n    if (mode === MODE_STANDARD) {\n      elements.scrollContainer.scrollTop = offset;\n    } else {\n      elements.$.scrollContainer.controller('mdVirtualRepeatContainer').scrollTo(offset);\n    }\n  }\n\n  function notFoundVisible () {\n    var textLength = (ctrl.scope.searchText || '').length;\n\n    return ctrl.hasNotFound && !hasMatches() && (!ctrl.loading || isPromiseFetching()) && textLength >= getMinLength() && (hasFocus || noBlur) && !hasSelection();\n  }\n\n  /**\n   * Starts the query to gather the results for the current searchText.  Attempts to return cached\n   * results first, then forwards the process to `fetchResults` if necessary.\n   */\n  function handleQuery () {\n    var searchText = $scope.searchText || '';\n    var term = searchText.toLowerCase();\n\n    // If caching is enabled and the current searchText is stored in the cache\n    if (!$scope.noCache && cache[term]) {\n      // The results should be handled as same as a normal un-cached request does.\n      handleResults(cache[term]);\n    } else {\n      fetchResults(searchText);\n    }\n\n    ctrl.hidden = shouldHide();\n  }\n\n  /**\n   * Handles the retrieved results by showing them in the autocompletes dropdown.\n   * @param results Retrieved results\n   */\n  function handleResults(results) {\n    ctrl.matches = results;\n    ctrl.hidden  = shouldHide();\n\n    // If loading is in progress, then we'll end the progress. This is needed for example,\n    // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.\n    if (ctrl.loading) setLoading(false);\n\n    if ($scope.selectOnMatch) selectItemOnMatch();\n\n    positionDropdown();\n    reportMessages(true, ReportType.Count);\n  }\n\n  /**\n   * If there is only one matching item and the search text matches its display value exactly,\n   * automatically select that item.  Note: This function is only called if the user uses the\n   * `md-select-on-match` flag.\n   */\n  function selectItemOnMatch () {\n    var searchText = $scope.searchText,\n        matches    = ctrl.matches,\n        item       = matches[ 0 ];\n    if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n      var isMatching = searchText === displayValue;\n      if ($scope.matchInsensitive && !isMatching) {\n        isMatching = searchText.toLowerCase() === displayValue.toLowerCase();\n      }\n\n      if (isMatching) {\n        select(0);\n      }\n    });\n  }\n\n  /**\n   * Evaluates an attribute expression against the parent scope.\n   * @param {String} attr Name of the attribute to be evaluated.\n   * @param {Object?} locals Properties to be injected into the evaluation context.\n   */\n function evalAttr(attr, locals) {\n    if ($attrs[attr]) {\n      $scope.$parent.$eval($attrs[attr], locals || {});\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/components/autocomplete/js/autocompleteDirective.js",
    "content": "angular\n    .module('material.components.autocomplete')\n    .directive('mdAutocomplete', MdAutocomplete);\n\n/**\n * @ngdoc directive\n * @name mdAutocomplete\n * @module material.components.autocomplete\n *\n * @description\n * `<md-autocomplete>` is a special input component with a drop-down of all possible matches to a\n *     custom query. This component allows you to provide real-time suggestions as the user types\n *     in the input area.\n *\n * To start, you will need to specify the required parameters and provide a template for your\n *     results. The content inside `md-autocomplete` will be treated as a template.\n *\n * In more complex cases, you may want to include other content such as a message to display when\n *     no matches were found.  You can do this by wrapping your template in `md-item-template` and\n *     adding a tag for `md-not-found`.  An example of this is shown below.\n *\n * To reset the displayed value you must clear both values for `md-search-text` and\n * `md-selected-item`.\n *\n * ### Validation\n *\n * You can use `ng-messages` to include validation the same way that you would normally validate;\n *     however, if you want to replicate a standard input with a floating label, you will have to\n *     do the following:\n *\n * - Make sure that your template is wrapped in `md-item-template`\n * - Add your `ng-messages` code inside of `md-autocomplete`\n * - Add your validation properties to `md-autocomplete` (ie. `required`)\n * - Add a `name` to `md-autocomplete` (to be used on the generated `input`)\n *\n * There is an example below of how this should look.\n *\n * ### Snapping Drop-Down\n *\n * You can cause the autocomplete drop-down to snap to an ancestor element by applying the\n *     `md-autocomplete-snap` attribute to that element. You can also snap to the width of\n *     the `md-autocomplete-snap` element by setting the attribute's value to `width`\n *     (ie. `md-autocomplete-snap=\"width\"`).\n *\n * ### Notes\n *\n * **Autocomplete Dropdown Items Rendering**\n *\n * The `md-autocomplete` uses the the <a ng-href=\"api/directive/mdVirtualRepeat\">\n *   mdVirtualRepeat</a> directive for displaying the results inside of the dropdown.<br/>\n *\n * > When encountering issues regarding the item template please take a look at the\n *   <a ng-href=\"api/directive/mdVirtualRepeatContainer\">VirtualRepeatContainer</a> documentation.\n *\n * **Autocomplete inside of a Virtual Repeat**\n *\n * When using the `md-autocomplete` directive inside of a\n * <a ng-href=\"api/directive/mdVirtualRepeatContainer\">VirtualRepeatContainer</a> the dropdown items\n * might not update properly, because caching of the results is enabled by default.\n *\n * The autocomplete will then show invalid dropdown items, because the Virtual Repeat only updates\n * the scope bindings rather than re-creating the `md-autocomplete`. This means that the previous\n * cached results will be used.\n *\n * > To avoid such problems, ensure that the autocomplete does not cache any results via\n * `md-no-cache=\"true\"`:\n *\n * <hljs lang=\"html\">\n *   <md-autocomplete\n *       md-no-cache=\"true\"\n *       md-selected-item=\"selectedItem\"\n *       md-items=\"item in items\"\n *       md-search-text=\"searchText\"\n *       md-item-text=\"item.display\">\n *     <span>{{ item.display }}</span>\n *   </md-autocomplete>\n * </hljs>\n *\n *\n * @param {expression} md-items An expression in the format of `item in results` to iterate over\n *     matches for your search.<br/><br/>\n *     The `results` expression can be also a function, which returns the results synchronously\n *     or asynchronously (per Promise).\n * @param {expression=} md-selected-item-change An expression to be run each time a new item is\n *     selected.\n * @param {expression=} md-search-text-change An expression to be run each time the search text\n *     updates.\n * @param {expression=} md-search-text A model to bind the search query text to.\n * @param {object=} md-selected-item A model to bind the selected item to.\n * @param {expression=} md-item-text An expression that will convert your object to a single string.\n * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n * @param {boolean=} md-no-cache Disables the internal caching that happens in autocomplete.\n * @param {boolean=} ng-disabled Determines whether or not to disable the input field.\n * @param {boolean=} md-require-match When set to true, the autocomplete will add a validator,\n *     which will evaluate to false, when no item is currently selected.\n * @param {number=} md-min-length Specifies the minimum length of text before autocomplete will\n *     make suggestions.\n * @param {number=} md-delay Specifies the amount of time (in milliseconds) to wait before looking\n *     for results.\n * @param {boolean=} md-clear-button Whether the clear button for the autocomplete input should show\n *     up or not. When `md-floating-label` is set, defaults to false, defaults to true otherwise.\n * @param {boolean=} md-autofocus If true, the autocomplete will be automatically focused when a\n *     `$mdDialog`, `$mdBottomsheet` or `$mdSidenav`, which contains the autocomplete, is opening.\n *     <br/><br/>\n *     Also the autocomplete will immediately focus the input element.\n * @param {boolean=} md-no-asterisk When present, asterisk will not be appended to the floating\n *     label.\n * @param {boolean=} md-autoselect If set to true, the first item will be automatically selected\n *     in the dropdown upon open.\n * @param {string=} md-input-name The name attribute given to the input element to be used with\n *     FormController.\n * @param {string=} md-menu-class This class will be applied to the dropdown menu for styling.\n * @param {string=} md-menu-container-class This class will be applied to the parent container\n *     of the dropdown panel.\n * @param {string=} md-input-class This will be applied to the input for styling. This attribute\n *     is only valid when a `md-floating-label` is defined.\n * @param {string=} md-floating-label This will add a floating label to autocomplete and wrap it in\n *     `md-input-container`.\n * @param {string=} md-select-on-focus When present the input's text will be automatically selected\n *     on focus.\n * @param {string=} md-input-id An ID to be added to the input element.\n * @param {number=} md-input-minlength The minimum length for the input's value for validation.\n * @param {number=} md-input-maxlength The maximum length for the input's value for validation.\n * @param {boolean=} md-select-on-match When set, autocomplete will automatically select\n *     the item if the search text is an exact match. <br/><br/>\n *     An exact match is when only one match is displayed.\n * @param {boolean=} md-match-case-insensitive When set and using `md-select-on-match`, autocomplete\n *     will select on case-insensitive match.\n * @param {string=} md-escape-options Override escape key logic. Default is `clear`.<br/>\n *     Options: `blur`, `clear`, `none`.\n * @param {string=} md-dropdown-items Specifies the maximum amount of items to be shown in\n *     the dropdown.<br/><br/>\n *     When the dropdown doesn't fit into the viewport, the dropdown will shrink\n *     as much as possible.\n * @param {string=} md-dropdown-position Overrides the default dropdown position. Options: `top`,\n *    `bottom`.\n * @param {string=} input-aria-describedby A space-separated list of element IDs. This should\n *     contain the IDs of any elements that describe this autocomplete. Screen readers will read the\n *     content of these elements at the end of announcing that the autocomplete has been selected\n *     and describing its current state. The descriptive elements do not need to be visible on the\n *     page.\n * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use case\n *     is that this would contain the ID of a `<label>` element that is associated with this\n *     autocomplete. This will only have affect when `md-floating-label` is not defined.<br><br>\n *     For `<label id=\"state\">US State</label>`, you would set this to\n *     `input-aria-labelledby=\"state\"`.\n * @param {string=} input-aria-label A label that will be applied to the autocomplete's input.\n *    This will be announced by screen readers before the placeholder.\n *    This will only have affect when `md-floating-label` is not defined. If you define both\n *    `input-aria-label` and `input-aria-labelledby`, then `input-aria-label` will take precedence.\n * @param {string=} md-selected-message Attribute to specify the text that the screen reader will\n *    announce after a value is selected. Default is: \"selected\". If `Alaska` is selected in the\n *    options panel, it will read \"Alaska selected\". You will want to override this when your app\n *    runs in a non-English locale.\n * @param {string=} md-no-match-message Attribute to specify the text that the screen reader will\n *    announce after a query returns no matching results.\n *    Default is: \"There are no matches available.\". You will want to override this when your app\n *    runs in a non-English locale.\n * @param {string=} md-single-match-message Attribute to specify the text that the screen reader\n *    will announce after a query returns a single matching result.\n *    Default is: \"There is 1 match available.\". You will want to override this when your app\n *    runs in a non-English locale.\n * @param {string=} md-multiple-match-start-message Attribute to specify the text that the screen\n *    reader will announce after a query returns multiple matching results. The number of matching\n *    results will be read after this text. Default is: \"There are \". You will want to override this\n *    when your app runs in a non-English locale.\n * @param {string=} md-multiple-match-end-message Attribute to specify the text that the screen\n *    reader will announce after a query returns multiple matching results. The number of matching\n *    results will be read before this text. Default is: \" matches available.\". You will want to\n *    override this when your app runs in a non-English locale.\n * @param {boolean=} ng-trim If set to false, the search text will be not trimmed automatically.\n *     Defaults to true.\n * @param {string=} ng-pattern Adds the pattern validator to the ngModel of the search text.\n *     See the [ngPattern Directive](https://docs.angularjs.org/api/ng/directive/ngPattern)\n *     for more details.\n * @param {string=} md-mode Specify the repeat mode for suggestion lists. Acceptable values include\n *     `virtual` (md-virtual-repeat) and `standard` (ng-repeat). See the\n *     `Specifying Repeat Mode` example for mode details. Default is `virtual`.\n *\n * @usage\n * ### Basic Example\n * <hljs lang=\"html\">\n *   <md-autocomplete\n *       md-selected-item=\"selectedItem\"\n *       md-search-text=\"searchText\"\n *       md-items=\"item in getMatches(searchText)\"\n *       md-item-text=\"item.display\">\n *     <span md-highlight-text=\"searchText\">{{item.display}}</span>\n *   </md-autocomplete>\n * </hljs>\n *\n * ### Example with \"not found\" message\n * <hljs lang=\"html\">\n * <md-autocomplete\n *     md-selected-item=\"selectedItem\"\n *     md-search-text=\"searchText\"\n *     md-items=\"item in getMatches(searchText)\"\n *     md-item-text=\"item.display\">\n *   <md-item-template>\n *     <span md-highlight-text=\"searchText\">{{item.display}}</span>\n *   </md-item-template>\n *   <md-not-found>\n *     No matches found.\n *   </md-not-found>\n * </md-autocomplete>\n * </hljs>\n *\n * In this example, our code utilizes `md-item-template` and `md-not-found` to specify the\n *     different parts that make up our component.\n *\n * ### Clear button for the input\n * By default, the clear button is displayed when there is input. This aligns with the spec's\n * [Search Pattern](https://material.io/archive/guidelines/patterns/search.html#search-in-app-search).\n * In floating label mode, when `md-floating-label=\"My Label\"` is applied, the clear button is not\n * displayed by default (see the spec's\n * [Autocomplete Text Field](https://material.io/archive/guidelines/components/text-fields.html#text-fields-layout)).\n *\n * Nevertheless, developers are able to explicitly toggle the clear button for all autocomplete\n * components with `md-clear-button`.\n *\n * <hljs lang=\"html\">\n *   <md-autocomplete ... md-clear-button=\"true\"></md-autocomplete>\n *   <md-autocomplete ... md-clear-button=\"false\"></md-autocomplete>\n * </hljs>\n *\n * In previous versions, the clear button was always hidden when the component was disabled.\n * This changed in `1.1.5` to give the developer control of this behavior. This example\n * will hide the clear button only when the component is disabled.\n *\n * <hljs lang=\"html\">\n *   <md-autocomplete ... ng-disabled=\"disabled\" md-clear-button=\"!disabled\"></md-autocomplete>\n * </hljs>\n *\n * ### Example with validation\n * <hljs lang=\"html\">\n * <form name=\"autocompleteForm\">\n *   <md-autocomplete\n *       required\n *       md-input-name=\"autocomplete\"\n *       md-selected-item=\"selectedItem\"\n *       md-search-text=\"searchText\"\n *       md-items=\"item in getMatches(searchText)\"\n *       md-item-text=\"item.display\">\n *     <md-item-template>\n *       <span md-highlight-text=\"searchText\">{{item.display}}</span>\n *     </md-item-template>\n *     <div ng-messages=\"autocompleteForm.autocomplete.$error\">\n *       <div ng-message=\"required\">This field is required</div>\n *     </div>\n *   </md-autocomplete>\n * </form>\n * </hljs>\n *\n * In this example, our code utilizes `md-item-template` and `ng-messages` to specify\n *     input validation for the field.\n *\n * ### Asynchronous Results\n * The autocomplete items expression also supports promises, which will resolve with the query\n * results.\n *\n * <hljs lang=\"js\">\n *   function AppController($scope, $http) {\n *     $scope.query = function(searchText) {\n *       return $http\n *         .get(BACKEND_URL + '/items/' + searchText)\n *         .then(function(data) {\n *           // Map the response object to the data object.\n *           return data;\n *         });\n *     };\n *   }\n * </hljs>\n *\n * <hljs lang=\"html\">\n *   <md-autocomplete\n *       md-selected-item=\"selectedItem\"\n *       md-search-text=\"searchText\"\n *       md-items=\"item in query(searchText)\">\n *     <md-item-template>\n *       <span md-highlight-text=\"searchText\">{{item}}</span>\n *     </md-item-template>\n * </md-autocomplete>\n * </hljs>\n *\n * ### Specifying Repeat Mode\n * You can use `md-mode` to specify whether to use standard or virtual lists for\n * rendering autocomplete options.\n * The `md-mode` accepts two values:\n * - `virtual` (default) Uses `md-virtual-repeat` to render list items. Virtual\n *    mode requires you to have consistent heights for all suggestions.\n * - `standard` uses `ng-repeat` to render list items. This allows you to have\n *    options of varying heights.\n *\n * Note that using 'standard' mode will require you to address any list\n * performance issues (e.g. pagination) separately within your application.\n *\n * <hljs lang=\"html\">\n *   <md-autocomplete\n *       md-selected-item=\"selectedItem\"\n *       md-search-text=\"searchText\"\n *       md-items=\"item in getMatches(searchText)\"\n *       md-item-text=\"item.display\"\n *       md-mode=\"standard\">\n *     <span md-highlight-text=\"searchText\">{{item.display}}</span>\n *   </md-autocomplete>\n * </hljs>\n */\nfunction MdAutocomplete ($$mdSvgRegistry) {\n  var REPEAT_STANDARD = 'standard';\n  var REPEAT_VIRTUAL = 'virtual';\n  var REPEAT_MODES = [REPEAT_STANDARD, REPEAT_VIRTUAL];\n\n  /** get a valid repeat mode from an md-mode attribute string. */\n  function getRepeatMode(modeStr) {\n    if (!modeStr) { return REPEAT_VIRTUAL; }\n    modeStr = modeStr.toLowerCase();\n    return  REPEAT_MODES.indexOf(modeStr) > -1 ? modeStr : REPEAT_VIRTUAL;\n  }\n\n  return {\n    controller:   'MdAutocompleteCtrl',\n    controllerAs: '$mdAutocompleteCtrl',\n    scope:        {\n      inputName:          '@mdInputName',\n      inputMinlength:     '@mdInputMinlength',\n      inputMaxlength:     '@mdInputMaxlength',\n      searchText:         '=?mdSearchText',\n      selectedItem:       '=?mdSelectedItem',\n      itemsExpr:          '@mdItems',\n      itemText:           '&mdItemText',\n      placeholder:        '@placeholder',\n      inputAriaDescribedBy: '@?inputAriaDescribedby',\n      inputAriaLabelledBy: '@?inputAriaLabelledby',\n      inputAriaLabel:     '@?inputAriaLabel',\n      noCache:            '=?mdNoCache',\n      requireMatch:       '=?mdRequireMatch',\n      selectOnMatch:      '=?mdSelectOnMatch',\n      matchInsensitive:   '=?mdMatchCaseInsensitive',\n      itemChange:         '&?mdSelectedItemChange',\n      textChange:         '&?mdSearchTextChange',\n      minLength:          '=?mdMinLength',\n      delay:              '=?mdDelay',\n      autofocus:          '=?mdAutofocus',\n      floatingLabel:      '@?mdFloatingLabel',\n      autoselect:         '=?mdAutoselect',\n      menuClass:          '@?mdMenuClass',\n      menuContainerClass: '@?mdMenuContainerClass',\n      inputClass:         '@?mdInputClass',\n      inputId:            '@?mdInputId',\n      escapeOptions:      '@?mdEscapeOptions',\n      dropdownItems:      '=?mdDropdownItems',\n      dropdownPosition:   '@?mdDropdownPosition',\n      clearButton:        '=?mdClearButton',\n      selectedMessage:    '@?mdSelectedMessage',\n      noMatchMessage:     '@?mdNoMatchMessage',\n      singleMatchMessage: '@?mdSingleMatchMessage',\n      multipleMatchStartMessage: '@?mdMultipleMatchStartMessage',\n      multipleMatchEndMessage: '@?mdMultipleMatchEndMessage',\n      mdMode: '=?mdMode'\n    },\n    compile: function(tElement, tAttrs) {\n      var attributes = ['md-select-on-focus', 'md-no-asterisk', 'ng-trim', 'ng-pattern'];\n      var input = tElement.find('input');\n\n      attributes.forEach(function(attribute) {\n        var attrValue = tAttrs[tAttrs.$normalize(attribute)];\n\n        if (attrValue !== null) {\n          input.attr(attribute, attrValue);\n        }\n      });\n\n      return function(scope, element, attrs, ctrl) {\n        // Retrieve the state of using a md-not-found template by using our attribute, which will\n        // be added to the element in the template function.\n        ctrl.hasNotFound = !!element.attr('md-has-not-found');\n\n        // By default the inset autocomplete should show the clear button when not explicitly\n        // overwritten or in floating label mode.\n        if (!angular.isDefined(attrs.mdClearButton) && !scope.floatingLabel) {\n          scope.clearButton = true;\n        }\n\n        scope.mdMode = getRepeatMode(attrs.mdMode);\n\n        // Stop click events from bubbling up to the document and triggering a flicker of the\n        // options panel while still supporting ng-click to be placed on md-autocomplete.\n        element.on('click touchstart touchend', function(event) {\n          event.stopPropagation();\n        });\n      };\n    },\n    template: function (element, attr) {\n      var noItemsTemplate = getNoItemsTemplate(),\n          itemTemplate    = getItemTemplate(),\n          leftover        = element.html(),\n          tabindex        = attr.tabindex;\n\n      // Set our attribute for the link function above which runs later.\n      // We will set an attribute, because otherwise the stored variables will be trashed when\n      // removing the element is hidden while retrieving the template. For example when using ngIf.\n      if (noItemsTemplate) element.attr('md-has-not-found', true);\n\n      // Always set our tabindex of the autocomplete directive to -1, because our input\n      // will hold the actual tabindex.\n      element.attr('tabindex', '-1');\n\n      return '\\\n        <md-autocomplete-wrap\\\n            ng-class=\"{ \\'md-whiteframe-z1\\': !floatingLabel, \\\n                        \\'md-menu-showing\\': !$mdAutocompleteCtrl.hidden, \\\n                        \\'md-show-clear-button\\': !!clearButton }\">\\\n          ' + getInputElement() + '\\\n          ' + getClearButton() + '\\\n          <md-progress-linear\\\n              class=\"' + (attr.mdFloatingLabel ? 'md-inline' : '') + '\"\\\n              ng-if=\"$mdAutocompleteCtrl.loadingIsVisible()\"\\\n              md-mode=\"indeterminate\"></md-progress-linear>\\\n          ' + getContainer(attr.mdMenuContainerClass, attr.mdMode) + '\\\n            <ul class=\"md-autocomplete-suggestions\"\\\n                ng-class=\"::menuClass\"\\\n                id=\"ul-{{$mdAutocompleteCtrl.id}}\"\\\n                ng-mouseup=\"$mdAutocompleteCtrl.focusInput()\"\\\n                role=\"listbox\">\\\n              <li class=\"md-autocomplete-suggestion\" ' + getRepeatType(attr.mdMode) + ' =\"item in $mdAutocompleteCtrl.matches\"\\\n                  ng-class=\"{ selected: $index === $mdAutocompleteCtrl.index }\"\\\n                  ng-attr-id=\"{{\\'md-option-\\' + $mdAutocompleteCtrl.id + \\'-\\' + $index}}\"\\\n                  ng-click=\"$mdAutocompleteCtrl.select($index)\"\\\n                  role=\"option\"\\\n                  aria-setsize=\"{{$mdAutocompleteCtrl.matches.length}}\"\\\n                  aria-posinset=\"{{$index+1}}\"\\\n                  aria-selected=\"{{$index === $mdAutocompleteCtrl.index ? true : false}}\" \\\n                  md-extra-name=\"$mdAutocompleteCtrl.itemName\">\\\n                  ' + itemTemplate + '\\\n                  </li>' + noItemsTemplate + '\\\n            </ul>\\\n          '  + getContainerClosingTags(attr.mdMode) + '\\\n        </md-autocomplete-wrap>';\n\n      function getItemTemplate() {\n        var templateTag = element.find('md-item-template').detach(),\n            html = templateTag.length ? templateTag.html() : element.html();\n        if (!templateTag.length) element.empty();\n        return '<md-autocomplete-parent-scope md-autocomplete-replace>' + html +\n               '</md-autocomplete-parent-scope>';\n      }\n\n      function getNoItemsTemplate() {\n        var templateTag = element.find('md-not-found').detach(),\n            template = templateTag.length ? templateTag.html() : '';\n        return template\n            ? '<li ng-if=\"$mdAutocompleteCtrl.notFoundVisible()\" class=\"md-autocomplete-suggestion\"\\\n                         md-autocomplete-parent-scope>' + template + '</li>'\n            : '';\n      }\n\n      function getContainer(menuContainerClass, repeatMode) {\n        // prepend a space if needed\n        menuContainerClass = menuContainerClass ? ' ' + menuContainerClass : '';\n\n        if (isVirtualRepeatDisabled(repeatMode)) {\n          return '\\\n            <div \\\n                ng-hide=\"$mdAutocompleteCtrl.hidden\"\\\n                class=\"md-standard-list-container md-autocomplete-suggestions-container md-whiteframe-z1' + menuContainerClass + '\"\\\n                ng-class=\"{ \\'md-not-found\\': $mdAutocompleteCtrl.notFoundVisible() }\"\\\n                ng-mouseenter=\"$mdAutocompleteCtrl.listEnter()\"\\\n                ng-mouseleave=\"$mdAutocompleteCtrl.listLeave()\"\\\n                role=\"presentation\">\\\n              <div class=\"md-standard-list-scroller\" role=\"presentation\">';\n        }\n\n        return '\\\n          <md-virtual-repeat-container\\\n              md-auto-shrink\\\n              md-auto-shrink-min=\"1\"\\\n              ng-hide=\"$mdAutocompleteCtrl.hidden\"\\\n              class=\"md-virtual-repeat-container md-autocomplete-suggestions-container md-whiteframe-z1' + menuContainerClass + '\"\\\n              ng-class=\"{ \\'md-not-found\\': $mdAutocompleteCtrl.notFoundVisible() }\"\\\n              ng-mouseenter=\"$mdAutocompleteCtrl.listEnter()\"\\\n              ng-mouseleave=\"$mdAutocompleteCtrl.listLeave()\"\\\n              role=\"presentation\">';\n      }\n\n      function getContainerClosingTags(repeatMode) {\n        return isVirtualRepeatDisabled(repeatMode) ?\n            '   </div>\\\n              </div>\\\n            </div>' : '</md-virtual-repeat-container>';\n      }\n\n      function getRepeatType(repeatMode) {\n        return isVirtualRepeatDisabled(repeatMode)  ?\n          'ng-repeat' : 'md-virtual-repeat';\n      }\n\n      function isVirtualRepeatDisabled(repeatMode) {\n        // ensure we have a valid repeat mode\n        var correctedRepeatMode = getRepeatMode(repeatMode);\n        return correctedRepeatMode !== REPEAT_VIRTUAL;\n      }\n\n      function getInputElement () {\n        if (attr.mdFloatingLabel) {\n          return '\\\n            <md-input-container ng-if=\"floatingLabel\">\\\n              <label>{{floatingLabel}}</label>\\\n              <input type=\"text\"\\\n                ' + (tabindex != null ? 'tabindex=\"' + tabindex + '\"' : '') + '\\\n                id=\"{{inputId || \\'fl-input-\\' + $mdAutocompleteCtrl.id}}\"\\\n                name=\"{{inputName || \\'fl-input-\\' + $mdAutocompleteCtrl.id }}\"\\\n                ng-class=\"::inputClass\"\\\n                autocomplete=\"off\"\\\n                ng-required=\"$mdAutocompleteCtrl.isRequired\"\\\n                ng-readonly=\"$mdAutocompleteCtrl.isReadonly\"\\\n                ng-minlength=\"inputMinlength\"\\\n                ng-maxlength=\"inputMaxlength\"\\\n                ng-disabled=\"$mdAutocompleteCtrl.isDisabled\"\\\n                ng-model=\"$mdAutocompleteCtrl.scope.searchText\"\\\n                ng-model-options=\"{ allowInvalid: true }\"\\\n                ng-mousedown=\"$mdAutocompleteCtrl.focusInput()\"\\\n                ng-keydown=\"$mdAutocompleteCtrl.keydown($event)\"\\\n                ng-blur=\"$mdAutocompleteCtrl.blur($event)\"\\\n                ng-focus=\"$mdAutocompleteCtrl.focus($event)\"\\\n                aria-label=\"{{floatingLabel}}\"\\\n                ng-attr-aria-autocomplete=\"{{$mdAutocompleteCtrl.isDisabled ? undefined : \\'list\\'}}\"\\\n                ng-attr-role=\"{{$mdAutocompleteCtrl.isDisabled ? undefined : \\'combobox\\'}}\"\\\n                aria-haspopup=\"{{!$mdAutocompleteCtrl.isDisabled}}\"\\\n                aria-expanded=\"{{!$mdAutocompleteCtrl.hidden}}\"\\\n                ng-attr-aria-owns=\"{{$mdAutocompleteCtrl.hidden || $mdAutocompleteCtrl.isDisabled ? undefined : \\'ul-\\' + $mdAutocompleteCtrl.id}}\"\\\n                ng-attr-aria-activedescendant=\"{{!$mdAutocompleteCtrl.hidden && $mdAutocompleteCtrl.activeOption ? $mdAutocompleteCtrl.activeOption : undefined}}\">\\\n              <div md-autocomplete-parent-scope md-autocomplete-replace>' + leftover + '</div>\\\n            </md-input-container>';\n        } else {\n          return '\\\n            <input type=\"text\"\\\n              ' + (tabindex != null ? 'tabindex=\"' + tabindex + '\"' : '') + '\\\n              id=\"{{inputId || \\'input-\\' + $mdAutocompleteCtrl.id}}\"\\\n              name=\"{{inputName || \\'input-\\' + $mdAutocompleteCtrl.id }}\"\\\n              ng-class=\"::inputClass\"\\\n              ng-if=\"!floatingLabel\"\\\n              autocomplete=\"off\"\\\n              ng-required=\"$mdAutocompleteCtrl.isRequired\"\\\n              ng-disabled=\"$mdAutocompleteCtrl.isDisabled\"\\\n              ng-readonly=\"$mdAutocompleteCtrl.isReadonly\"\\\n              ng-minlength=\"inputMinlength\"\\\n              ng-maxlength=\"inputMaxlength\"\\\n              ng-model=\"$mdAutocompleteCtrl.scope.searchText\"\\\n              ng-mousedown=\"$mdAutocompleteCtrl.focusInput()\"\\\n              ng-keydown=\"$mdAutocompleteCtrl.keydown($event)\"\\\n              ng-blur=\"$mdAutocompleteCtrl.blur($event)\"\\\n              ng-focus=\"$mdAutocompleteCtrl.focus($event)\"\\\n              placeholder=\"{{placeholder}}\"\\\n              aria-label=\"{{placeholder}}\"\\\n              ng-attr-aria-autocomplete=\"{{$mdAutocompleteCtrl.isDisabled ? undefined : \\'list\\'}}\"\\\n              ng-attr-role=\"{{$mdAutocompleteCtrl.isDisabled ? undefined : \\'combobox\\'}}\"\\\n              aria-haspopup=\"{{!$mdAutocompleteCtrl.isDisabled}}\"\\\n              aria-expanded=\"{{!$mdAutocompleteCtrl.hidden}}\"\\\n              ng-attr-aria-owns=\"{{$mdAutocompleteCtrl.hidden || $mdAutocompleteCtrl.isDisabled ? undefined : \\'ul-\\' + $mdAutocompleteCtrl.id}}\"\\\n              ng-attr-aria-activedescendant=\"{{!$mdAutocompleteCtrl.hidden && $mdAutocompleteCtrl.activeOption ? $mdAutocompleteCtrl.activeOption : undefined}}\">';\n        }\n      }\n\n      function getClearButton() {\n        return '' +\n          '<button ' +\n              'type=\"button\" ' +\n              'aria-label=\"Clear Input\" ' +\n              'tabindex=\"0\" ' +\n              'ng-if=\"clearButton && $mdAutocompleteCtrl.scope.searchText\" ' +\n              'ng-click=\"$mdAutocompleteCtrl.clear($event)\">' +\n            '<md-icon md-svg-src=\"' + $$mdSvgRegistry.mdClose + '\"></md-icon>' +\n          '</button>';\n        }\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/autocomplete/js/autocompleteParentScopeDirective.js",
    "content": "angular\n  .module('material.components.autocomplete')\n  .directive('mdAutocompleteParentScope', MdAutocompleteItemScopeDirective);\n\nfunction MdAutocompleteItemScopeDirective($compile, $mdUtil) {\n  return {\n    restrict: 'AE',\n    compile: compile,\n    terminal: true,\n    transclude: 'element'\n  };\n\n  function compile(tElement, tAttr, transclude) {\n    return function postLink(scope, element, attr) {\n      var ctrl = scope.$mdAutocompleteCtrl;\n      var newScope = ctrl.parent.$new();\n      var itemName = ctrl.itemName;\n\n      // Watch for changes to our scope's variables and copy them to the new scope\n      watchVariable('$index', '$index');\n      watchVariable('item', itemName);\n\n      // Ensure that $digest calls on our scope trigger $digest on newScope.\n      connectScopes();\n\n      // Link the element against newScope.\n      transclude(newScope, function(clone) {\n        element.after(clone);\n      });\n\n      /**\n       * Creates a watcher for variables that are copied from the parent scope\n       * @param variable\n       * @param alias\n       */\n      function watchVariable(variable, alias) {\n        newScope[alias] = scope[variable];\n\n        scope.$watch(variable, function(value) {\n          $mdUtil.nextTick(function() {\n            newScope[alias] = value;\n          });\n        });\n      }\n\n      /**\n       * Creates watchers on scope and newScope that ensure that for any\n       * $digest of scope, newScope is also $digested.\n       */\n      function connectScopes() {\n        var scopeDigesting = false;\n        var newScopeDigesting = false;\n\n        scope.$watch(function() {\n          if (newScopeDigesting || scopeDigesting) {\n            return;\n          }\n\n          scopeDigesting = true;\n          scope.$$postDigest(function() {\n            if (!newScopeDigesting) {\n              newScope.$digest();\n            }\n\n            scopeDigesting = newScopeDigesting = false;\n          });\n        });\n\n        newScope.$watch(function() {\n          newScopeDigesting = true;\n        });\n      }\n    };\n  }\n}"
  },
  {
    "path": "src/components/autocomplete/js/highlightController.js",
    "content": "angular\n    .module('material.components.autocomplete')\n    .controller('MdHighlightCtrl', MdHighlightCtrl);\n\nfunction MdHighlightCtrl ($scope, $element, $attrs, $mdUtil) {\n  this.$scope = $scope;\n  this.$element = $element;\n  this.$attrs = $attrs;\n  this.$mdUtil = $mdUtil;\n\n  // Cache the Regex to avoid rebuilding each time.\n  this.regex = null;\n}\n\nMdHighlightCtrl.prototype.init = function(unsafeTermFn, unsafeContentFn) {\n\n  this.flags = this.$attrs.mdHighlightFlags || '';\n\n  this.unregisterFn = this.$scope.$watch(function($scope) {\n    return {\n      term: unsafeTermFn($scope),\n      contentText: unsafeContentFn($scope)\n    };\n  }.bind(this), this.onRender.bind(this), true);\n\n  this.$element.on('$destroy', this.unregisterFn);\n};\n\n/**\n * Triggered once a new change has been recognized and the highlighted\n * text needs to be updated.\n */\nMdHighlightCtrl.prototype.onRender = function(state, prevState) {\n\n  var contentText = state.contentText;\n\n  /* Update the regex if it's outdated, because we don't want to rebuilt it constantly. */\n  if (this.regex === null || state.term !== prevState.term) {\n    this.regex = this.createRegex(state.term, this.flags);\n  }\n\n  /* If a term is available apply the regex to the content */\n  if (state.term) {\n    this.applyRegex(contentText);\n  } else {\n    this.$element.text(contentText);\n  }\n\n};\n\n/**\n * Decomposes the specified text into different tokens (whether match or not).\n * Breaking down the string guarantees proper XSS protection due to the native browser\n * escaping of unsafe text.\n */\nMdHighlightCtrl.prototype.applyRegex = function(text) {\n  var tokens = this.resolveTokens(text);\n\n  this.$element.empty();\n\n  tokens.forEach(function (token) {\n\n    if (token.isMatch) {\n      var tokenEl = angular.element('<span class=\"highlight\">').text(token.text);\n\n      this.$element.append(tokenEl);\n    } else {\n      this.$element.append(document.createTextNode(token));\n    }\n\n  }.bind(this));\n\n};\n\n  /**\n * Decomposes the specified text into different tokens by running the regex against the text.\n */\nMdHighlightCtrl.prototype.resolveTokens = function(string) {\n  var tokens = [];\n  var lastIndex = 0;\n\n  // Use replace here, because it supports global and single regular expressions at same time.\n  string.replace(this.regex, function(match, index) {\n    appendToken(lastIndex, index);\n\n    tokens.push({\n      text: match,\n      isMatch: true\n    });\n\n    lastIndex = index + match.length;\n  });\n\n  // Append the missing text as a token.\n  appendToken(lastIndex);\n\n  return tokens;\n\n  function appendToken(from, to) {\n    var targetText = string.slice(from, to);\n    targetText && tokens.push(targetText);\n  }\n};\n\n/** Creates a regex for the specified text with the given flags. */\nMdHighlightCtrl.prototype.createRegex = function(term, flags) {\n  var startFlag = '', endFlag = '';\n  var regexTerm = this.$mdUtil.sanitize(term);\n\n  if (flags.indexOf('^') >= 0) startFlag = '^';\n  if (flags.indexOf('$') >= 0) endFlag = '$';\n\n  return new RegExp(startFlag + regexTerm + endFlag, flags.replace(/[$^]/g, ''));\n};\n"
  },
  {
    "path": "src/components/autocomplete/js/highlightDirective.js",
    "content": "angular\n    .module('material.components.autocomplete')\n    .directive('mdHighlightText', MdHighlight);\n\n/**\n * @ngdoc directive\n * @name mdHighlightText\n * @module material.components.autocomplete\n *\n * @description\n * The `md-highlight-text` directive allows you to specify text that should be highlighted within\n *     an element.  Highlighted text will be wrapped in `<span class=\"highlight\"></span>` which can\n *     be styled through CSS.  Please note that child elements may not be used with this directive.\n *\n * @param {string} md-highlight-text A model to be searched for\n * @param {string=} md-highlight-flags A list of flags (loosely based on JavaScript RexExp flags).\n * #### **Supported flags**:\n * - `g`: Find all matches within the provided text\n * - `i`: Ignore case when searching for matches\n * - `$`: Only match if the text ends with the search term\n * - `^`: Only match if the text begins with the search term\n *\n * @usage\n * <hljs lang=\"html\">\n * <input placeholder=\"Enter a search term...\" ng-model=\"searchTerm\" type=\"text\" />\n * <ul>\n *   <li ng-repeat=\"result in results\" md-highlight-text=\"searchTerm\" md-highlight-flags=\"i\">\n *     {{result.text}}\n *   </li>\n * </ul>\n * </hljs>\n */\n\nfunction MdHighlight ($interpolate, $parse) {\n  return {\n    terminal: true,\n    controller: 'MdHighlightCtrl',\n    compile: function mdHighlightCompile(tElement, tAttr) {\n      var termExpr = $parse(tAttr.mdHighlightText);\n      var unsafeContentExpr = $interpolate(tElement.html());\n\n      return function mdHighlightLink(scope, element, attr, ctrl) {\n        ctrl.init(termExpr, unsafeContentExpr);\n      };\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/backdrop/backdrop-theme.scss",
    "content": "md-backdrop {\n\n  background-color: '{{background-900-0.0}}';\n\n  &.md-opaque.md-THEME_NAME-theme {\n    background-color: '{{background-900-1.0}}';\n  }\n\n}\n"
  },
  {
    "path": "src/components/backdrop/backdrop.js",
    "content": "/*\n * @ngdoc module\n * @name material.components.backdrop\n * @description Backdrop\n */\n\n/**\n * @ngdoc directive\n * @name mdBackdrop\n * @module material.components.backdrop\n *\n * @restrict E\n *\n * @description\n * `<md-backdrop>` is a backdrop element used by other components, such as dialog and bottom sheet.\n * Apply class `opaque` to make the backdrop use the theme backdrop color.\n *\n */\n\nangular\n  .module('material.components.backdrop', ['material.core'])\n  .directive('mdBackdrop', function BackdropDirective($mdTheming, $mdUtil, $animate, $rootElement, $window, $log, $$rAF, $document) {\n    var ERROR_CSS_POSITION = '<md-backdrop> may not work properly in a scrolled, static-positioned parent container.';\n\n    return {\n      restrict: 'E',\n      link: postLink\n    };\n\n    function postLink(scope, element, attrs) {\n      // backdrop may be outside the $rootElement, tell ngAnimate to animate regardless\n      if ($animate.pin) $animate.pin(element, $rootElement);\n\n      var bodyStyles;\n\n      $$rAF(function() {\n        // If body scrolling has been disabled using mdUtil.disableBodyScroll(),\n        // adjust the 'backdrop' height to account for the fixed 'body' top offset.\n        // Note that this can be pretty expensive and is better done inside the $$rAF.\n        bodyStyles = $window.getComputedStyle($document[0].body);\n\n        if (bodyStyles.position === 'fixed') {\n          var resizeHandler = $mdUtil.debounce(function(){\n            bodyStyles = $window.getComputedStyle($document[0].body);\n            resize();\n          }, 60, null, false);\n\n          resize();\n          angular.element($window).on('resize', resizeHandler);\n\n          scope.$on('$destroy', function() {\n            angular.element($window).off('resize', resizeHandler);\n          });\n        }\n\n        // Often $animate.enter() is used to append the backDrop element\n        // so let's wait until $animate is done...\n        var parent = element.parent();\n\n        if (parent.length) {\n          if (parent[0].nodeName === 'BODY') {\n            element.css('position', 'fixed');\n          }\n\n          var styles = $window.getComputedStyle(parent[0]);\n\n          if (styles.position === 'static') {\n            // backdrop uses position:absolute and will not work properly with parent position:static (default)\n            $log.warn(ERROR_CSS_POSITION);\n          }\n\n          // Only inherit the parent if the backdrop has a parent.\n          $mdTheming.inherit(element, parent);\n        }\n      });\n\n      function resize() {\n        var viewportHeight = parseInt(bodyStyles.height, 10) + Math.abs(parseInt(bodyStyles.top, 10));\n        element.css('height', viewportHeight + 'px');\n      }\n    }\n\n  });\n"
  },
  {
    "path": "src/components/backdrop/backdrop.scss",
    "content": "// !!Important - Theme-based Background-color can be configured in backdrop-theme.scss\n//             - Animate background-color opacity only for `.md-opaque` styles\n\nmd-backdrop {\n  transition: opacity 450ms;\n\n  position: absolute;\n  top:0;\n  bottom:0;\n  left: 0;\n  right: 0;\n\n  z-index: $z-index-backdrop;\n\n  &.md-menu-backdrop {\n    position: fixed !important;\n    z-index: $z-index-menu - 1;\n  }\n  &.md-select-backdrop {\n    z-index: $z-index-dialog + 1;\n    transition-duration: 0;\n  }\n  &.md-dialog-backdrop {\n    z-index: $z-index-dialog - 1;\n  }\n  &.md-bottom-sheet-backdrop {\n    z-index: $z-index-bottom-sheet - 1;\n  }\n  &.md-sidenav-backdrop {\n    z-index: $z-index-sidenav - 1;\n  }\n\n\n  &.md-click-catcher {\n    position: absolute;\n  }\n\n  &.md-opaque {\n\n    opacity: .48;\n\n    &.ng-enter {\n      opacity: 0;\n    }\n    &.ng-enter.md-opaque.ng-enter-active {\n      opacity: .48;\n    }\n    &.ng-leave {\n      opacity: .48;\n      transition: opacity 400ms;\n    }\n    &.ng-leave.md-opaque.ng-leave-active {\n      opacity: 0;\n    }\n  }\n\n}\n\n"
  },
  {
    "path": "src/components/bottomSheet/bottom-sheet-theme.scss",
    "content": "md-bottom-sheet.md-THEME_NAME-theme {\n  background-color: '{{background-color}}';\n  border-top-color: '{{background-hue-3}}';\n\n  &.md-list {\n    md-list-item {\n      color: '{{foreground-1}}';\n    }\n  }\n\n  .md-subheader {\n    background-color: '{{background-color}}';\n  }\n\n  .md-subheader {\n    color: '{{foreground-1}}';\n  }\n}\n"
  },
  {
    "path": "src/components/bottomSheet/bottom-sheet.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.bottomSheet\n * @description\n * BottomSheet\n */\nangular\n  .module('material.components.bottomSheet', [\n    'material.core',\n    'material.components.backdrop'\n  ])\n  .directive('mdBottomSheet', MdBottomSheetDirective)\n  .provider('$mdBottomSheet', MdBottomSheetProvider);\n\n/* @ngInject */\nfunction MdBottomSheetDirective($mdBottomSheet) {\n  return {\n    restrict: 'E',\n    link : function postLink(scope, element) {\n      element.addClass('_md');     // private md component indicator for styling\n\n      // When navigation force destroys an interimElement, then\n      // listen and $destroy() that interim instance...\n      scope.$on('$destroy', function() {\n        $mdBottomSheet.destroy();\n      });\n    }\n  };\n}\n\n\n/**\n * @ngdoc service\n * @name $mdBottomSheet\n * @module material.components.bottomSheet\n *\n * @description\n * `$mdBottomSheet` opens a bottom sheet over the app and provides a simple promise API.\n *\n * ## Restrictions\n *\n * - The bottom sheet's template must have an outer `<md-bottom-sheet>` element.\n * - Add the `md-grid` class to the bottom sheet for a grid layout.\n * - Add the `md-list` class to the bottom sheet for a list layout.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyController\">\n *   <md-button ng-click=\"openBottomSheet()\">\n *     Open a Bottom Sheet!\n *   </md-button>\n * </div>\n * </hljs>\n * <hljs lang=\"js\">\n * var app = angular.module('app', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdBottomSheet) {\n *   $scope.openBottomSheet = function() {\n *     $mdBottomSheet.show({\n *       template: '<md-bottom-sheet>' +\n *       'Hello! <md-button ng-click=\"closeBottomSheet()\">Close</md-button>' +\n *       '</md-bottom-sheet>'\n *     })\n *\n *     // Fires when the hide() method is used\n *     .then(function() {\n *       console.log('You clicked the button to close the bottom sheet!');\n *     })\n *\n *     // Fires when the cancel() method is used\n *     .catch(function() {\n *       console.log('You hit escape or clicked the backdrop to close.');\n *     });\n *   };\n *\n *   $scope.closeBottomSheet = function($scope, $mdBottomSheet) {\n *     $mdBottomSheet.hide();\n *   }\n *\n * });\n * </hljs>\n *\n * ### Custom Presets\n * Developers are also able to create their own preset, which can be easily used without repeating\n * their options each time.\n *\n * <hljs lang=\"js\">\n *   $mdBottomSheetProvider.addPreset('testPreset', {\n *     options: function() {\n *       return {\n *         template:\n *           '<md-bottom-sheet>' +\n *             'This is a custom preset' +\n *           '</md-bottom-sheet>',\n *         controllerAs: 'bottomSheet',\n *         bindToController: true,\n *         clickOutsideToClose: true,\n *         escapeToClose: true\n *       };\n *     }\n *   });\n * </hljs>\n *\n * After you create your preset during the config phase, you can easily access it.\n *\n * <hljs lang=\"js\">\n *   $mdBottomSheet.show(\n *     $mdBottomSheet.testPreset()\n *   );\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#show\n *\n * @description\n * Show a bottom sheet with the specified options.\n *\n * <em><b>Note:</b> You should <b>always</b> provide a `.catch()` method in case the user hits the\n * `esc` key or clicks the background to close. In this case, the `cancel()` method will\n * automatically be called on the bottom sheet which will `reject()` the promise. See the @usage\n * section above for an example.\n *\n * Newer versions of Angular will throw a `Possibly unhandled rejection` exception if you forget\n * this.</em>\n *\n * @param {Object} optionsOrPreset Either provide an `$mdBottomSheetPreset` defined during the\n * config phase or an options object, with the following properties:\n *\n *   - `templateUrl` - `{string=}`: The url of an html template file that will\n *   be used as the content of the bottom sheet. Restrictions: the template must\n *   have an outer `md-bottom-sheet` element.\n *   - `template` - `{string=}`: Same as templateUrl, except this is an actual\n *   template string.\n *   - `scope` - `{Object=}`: the scope to link the template / controller to. If none is specified,\n *   it will create a new child scope. This scope will be destroyed when the bottom sheet is\n *   removed unless `preserveScope` is set to true.\n *   - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed.\n *   Default is false\n *   - `controller` - `{string=}`: The controller to associate with this bottom sheet.\n *   - `locals` - `{string=}`: An object containing key/value pairs. The keys will be used as names\n *   of values to inject into the controller. For example, `locals: {three: 3}` would inject\n *   `three` into the controller with the value of 3.\n *   - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the bottom sheet to\n *     close it. Default true.\n *   - `bindToController` - `{boolean=}`: When set to true, the locals will be bound to the\n *   controller instance and available in it's $onInit function.\n *   - `disableBackdrop` - `{boolean=}`: When set to true, the bottomsheet will not show a backdrop.\n *   - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the bottom sheet.\n *     Default true.\n *   - `isLockedOpen` - `{boolean=}`: Disables all default ways of closing the bottom sheet.\n *   **Note:** this will override the `clickOutsideToClose` and `escapeToClose` options, leaving\n *   only the `hide` and `cancel` methods as ways of closing the bottom sheet. Defaults to false.\n *   - `resolve` - `{Object=}`: Similar to locals, except it takes promises as values\n *   and the bottom sheet will not open until the promises resolve.\n *   - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n *   - `parent` - `{element=}`: The element to append the bottom sheet to. The `parent` may be a\n *   `function`, `string`, `Object`, or null. Defaults to appending to the body of the root element\n *   (or the root element) of the application.\n *   e.g. angular.element(document.getElementById('content')) or \"#content\"\n *   - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the bottom sheet is\n *   open. Default true.\n *\n * @returns {promise} A promise that can be resolved with `$mdBottomSheet.hide()` or\n * rejected with `$mdBottomSheet.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#hide\n *\n * @description\n * Hide the existing bottom sheet and resolve the promise returned from\n * `$mdBottomSheet.show()`. This call will close the most recently opened/current bottom sheet (if\n * any).\n *\n * <em><b>Note:</b> Use a `.then()` on your `.show()` to handle this callback.</em>\n *\n * @param {*=} response An argument for the resolved promise.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#cancel\n *\n * @description\n * Hide the existing bottom sheet and reject the promise returned from\n * `$mdBottomSheet.show()`.\n *\n * <em><b>Note:</b> Use a `.catch()` on your `.show()` to handle this callback.</em>\n *\n * @param {*=} response An argument for the rejected promise.\n *\n */\n\nfunction MdBottomSheetProvider($$interimElementProvider) {\n  // how fast we need to flick down to close the sheet, pixels/ms\n  var CLOSING_VELOCITY = 0.5;\n  var PADDING = 80; // same as css\n\n  return $$interimElementProvider('$mdBottomSheet')\n    .setDefaults({\n      methods: ['disableParentScroll', 'escapeToClose', 'clickOutsideToClose'],\n      options: bottomSheetDefaults\n    });\n\n  /* @ngInject */\n  function bottomSheetDefaults($animate, $mdConstant, $mdUtil, $mdTheming, $mdBottomSheet, $rootElement,\n                               $mdGesture, $log) {\n    var backdrop;\n\n    return {\n      themable: true,\n      onShow: onShow,\n      onRemove: onRemove,\n      disableBackdrop: false,\n      escapeToClose: true,\n      clickOutsideToClose: true,\n      disableParentScroll: true,\n      isLockedOpen: false\n    };\n\n    function onShow(scope, element, options) {\n      element = $mdUtil.extractElementByName(element, 'md-bottom-sheet');\n\n      // prevent tab focus or click focus on the bottom-sheet container\n      element.attr('tabindex', '-1');\n\n      // Once the md-bottom-sheet has `ng-cloak` applied on his template the opening animation will not work properly.\n      // This is a very common problem, so we have to notify the developer about this.\n      if (element.hasClass('ng-cloak')) {\n        var message = '$mdBottomSheet: using `<md-bottom-sheet ng-cloak>` will affect the bottom-sheet opening animations.';\n        $log.warn(message, element[0]);\n      }\n\n      if (options.isLockedOpen) {\n        options.clickOutsideToClose = false;\n        options.escapeToClose = false;\n      } else {\n        options.cleanupGestures = registerGestures(element, options.parent);\n      }\n\n      if (!options.disableBackdrop) {\n        // Add a backdrop that will close on click\n        backdrop = $mdUtil.createBackdrop(scope, \"md-bottom-sheet-backdrop md-opaque\");\n\n        // Prevent mouse focus on backdrop; ONLY programmatic focus allowed.\n        // This allows clicks on backdrop to propagate to the $rootElement and\n        // ESC key events to be detected properly.\n        backdrop[0].tabIndex = -1;\n\n        if (options.clickOutsideToClose) {\n          backdrop.on('click', function() {\n            $mdUtil.nextTick($mdBottomSheet.cancel, true);\n          });\n        }\n\n        $mdTheming.inherit(backdrop, options.parent);\n\n        $animate.enter(backdrop, options.parent, null);\n      }\n\n      $mdTheming.inherit(element, options.parent);\n\n      if (options.disableParentScroll) {\n        options.restoreScroll = $mdUtil.disableScrollAround(element, options.parent);\n      }\n\n      return $animate.enter(element, options.parent, backdrop)\n        .then(function() {\n          var focusable = $mdUtil.findFocusTarget(element) || angular.element(\n            element[0].querySelector('button') ||\n            element[0].querySelector('a') ||\n            element[0].querySelector($mdUtil.prefixer('ng-click', true))\n          ) || backdrop;\n\n          if (options.escapeToClose) {\n            options.rootElementKeyupCallback = function(e) {\n              if (e.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n                $mdUtil.nextTick($mdBottomSheet.cancel, true);\n              }\n            };\n\n            $rootElement.on('keyup', options.rootElementKeyupCallback);\n            focusable && focusable.focus();\n          }\n        });\n\n    }\n\n    function onRemove(scope, element, options) {\n      if (!options.disableBackdrop) $animate.leave(backdrop);\n\n      return $animate.leave(element).then(function() {\n        if (options.disableParentScroll) {\n          options.restoreScroll();\n          delete options.restoreScroll;\n        }\n\n        options.cleanupGestures && options.cleanupGestures();\n      });\n    }\n\n    /**\n     * Adds the drag gestures to the bottom sheet.\n     * @param {JQLite} element where CSS transitions will be applied\n     * @param {JQLite} parent used for registering gesture listeners\n     * @return {Function} function that removes gesture listeners that were set up by\n     *  registerGestures()\n     */\n    function registerGestures(element, parent) {\n      var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });\n      parent.on('$md.dragstart', onDragStart)\n        .on('$md.drag', onDrag)\n        .on('$md.dragend', onDragEnd);\n\n      return function cleanupGestures() {\n        deregister();\n        parent.off('$md.dragstart', onDragStart);\n        parent.off('$md.drag', onDrag);\n        parent.off('$md.dragend', onDragEnd);\n      };\n\n      function onDragStart() {\n        // Disable transitions on transform so that it feels fast\n        element.css($mdConstant.CSS.TRANSITION_DURATION, '0ms');\n      }\n\n      function onDrag(ev) {\n        var transform = ev.pointer.distanceY;\n        if (transform < 5) {\n          // Slow down drag when trying to drag up, and stop after PADDING\n          transform = Math.max(-PADDING, transform / 2);\n        }\n        element.css($mdConstant.CSS.TRANSFORM, 'translate3d(0,' + (PADDING + transform) + 'px,0)');\n      }\n\n      function onDragEnd(ev) {\n        if (ev.pointer.distanceY > 0 &&\n            (ev.pointer.distanceY > 20 || Math.abs(ev.pointer.velocityY) > CLOSING_VELOCITY)) {\n          var distanceRemaining = element.prop('offsetHeight') - ev.pointer.distanceY;\n          var transitionDuration = Math.min(distanceRemaining / ev.pointer.velocityY * 0.75, 500);\n          element.css($mdConstant.CSS.TRANSITION_DURATION, transitionDuration + 'ms');\n          $mdUtil.nextTick($mdBottomSheet.cancel, true);\n        } else {\n          element.css($mdConstant.CSS.TRANSITION_DURATION, '');\n          element.css($mdConstant.CSS.TRANSFORM, '');\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/bottomSheet/bottom-sheet.scss",
    "content": "$bottom-sheet-horizontal-padding: 2 * $baseline-grid !default;\n$bottom-sheet-vertical-padding: 1 * $baseline-grid !default;\n$bottom-sheet-icon-after-margin: 4 * $baseline-grid !default;\n$bottom-sheet-list-item-height: 6 * $baseline-grid !default;\n$bottom-sheet-hidden-bottom-padding: 80px !default;\n$bottom-sheet-header-height: 7 * $baseline-grid !default;\n$bottom-sheet-grid-font-weight: 400 !default;\n\nmd-bottom-sheet {\n  position: absolute;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  padding: $bottom-sheet-vertical-padding $bottom-sheet-horizontal-padding $bottom-sheet-vertical-padding + $bottom-sheet-hidden-bottom-padding $bottom-sheet-horizontal-padding;\n  z-index: $z-index-bottom-sheet;\n\n  border-top-width: 1px;\n  border-top-style: solid;\n\n  transform: translate3d(0, $bottom-sheet-hidden-bottom-padding, 0);\n  transition: $swift-ease-out;\n  transition-property: transform;\n\n  &.md-has-header {\n    padding-top: 0;\n  }\n\n  &.ng-enter {\n    opacity: 0;\n    transform: translate3d(0, 100%, 0);\n  }\n\n  &.ng-enter-active {\n    opacity: 1;\n    display: block;\n    transform: translate3d(0, $bottom-sheet-hidden-bottom-padding, 0) !important;\n  }\n\n\n  &.ng-leave-active {\n    transform: translate3d(0, 100%, 0) !important;\n    transition: $swift-ease-in;\n  }\n\n  .md-subheader {\n    background-color: transparent;\n    font-family: $font-family;\n    line-height: $bottom-sheet-header-height;\n    padding: 0;\n    white-space: nowrap;\n  }\n\n  md-inline-icon {\n    display: inline-block;\n    height: 24px;\n    width: 24px;\n    fill: #444;\n  }\n\n  md-list-item {\n    display: flex;\n    outline: none;\n\n    &:hover {\n      cursor: pointer;\n    }\n  }\n\n  &.md-list {\n    md-list-item {\n      padding: 0;\n      align-items: center;\n      height: $bottom-sheet-list-item-height;\n\n    }\n  }\n\n\n\n  &.md-grid {\n    padding-left: 3 * $baseline-grid;\n    padding-right: 3 * $baseline-grid;\n    padding-top: 0;\n\n    md-list {\n      display: flex;\n      flex-direction: row;\n      flex-wrap: wrap;\n      transition: all 0.5s;\n      align-items: center;\n    }\n\n    md-list-item {\n      flex-direction: column;\n      align-items: center;\n      transition: all 0.5s;\n\n      height: 12 * $baseline-grid;\n\n      margin-top: $baseline-grid;\n      margin-bottom: $baseline-grid;\n\n      /* Mixin for how many grid items to show per row */\n      @mixin grid-items-per-row($num, $alignEdges: false) {\n        $width: math.div(100%, $num);\n        flex: 1 1 $width;\n        max-width: $width;\n\n        @if $alignEdges {\n          &:nth-of-type(#{$num}n + 1) {\n            align-items: flex-start;\n          }\n          &:nth-of-type(#{$num}n) {\n            align-items: flex-end;\n          }\n        }\n      }\n\n      @media (max-width: $layout-breakpoint-sm) {\n        @include grid-items-per-row(3, true);\n      }\n\n      @media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {\n        @include grid-items-per-row(4);\n      }\n\n      @media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {\n        @include grid-items-per-row(6);\n      }\n\n      @media (min-width: $layout-breakpoint-lg) {\n        @include grid-items-per-row(7);\n      }\n\n      // Override of the IE11 fix from @mixin ie11-min-height-flexbug, line 109 _mixins.scss\n      &::before {\n        display: none;\n      }\n\n      .md-list-item-content {\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        width: 6 * $baseline-grid;\n        padding-bottom: 2 * $baseline-grid;\n      }\n\n      .md-grid-item-content {\n        border: 1px solid transparent;\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        width: 10 * $baseline-grid;\n      }\n\n      .md-grid-text {\n        font-weight: $bottom-sheet-grid-font-weight;\n        line-height: 2 * $baseline-grid;\n        font-size: 2 * $baseline-grid - 3;\n        margin: 0;\n        white-space: nowrap;\n        width: 8 * $baseline-grid;\n        text-align: center;\n        text-transform: none;\n        padding-top: 1 * $baseline-grid;\n      }\n    }\n  }\n}\n\n// IE only\n@media screen and (-ms-high-contrast: active) {\n  md-bottom-sheet {\n    border: 1px solid #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/bottomSheet/bottom-sheet.spec.js",
    "content": "describe('$mdBottomSheet service', function () {\n  var $mdBottomSheet, $rootElement, $rootScope, $material, $mdConstant;\n\n  beforeEach(function() {\n    module('material.components.bottomSheet');\n    inject(function(_$mdBottomSheet_, _$rootElement_, _$rootScope_, _$material_, _$mdConstant_) {\n      $mdBottomSheet = _$mdBottomSheet_;\n      $rootElement = _$rootElement_;\n      $rootScope = _$rootScope_;\n      $material = _$material_;\n      $mdConstant = _$mdConstant_;\n    });\n  });\n\n  describe('#build()', function() {\n    it('should have `._md` class indicator', function() {\n        var parent = angular.element('<div>');\n        $mdBottomSheet.show({\n          template: '<md-bottom-sheet>',\n          parent: parent\n        });\n        $material.flushOutstandingAnimations();\n\n        var sheet = parent.find('md-bottom-sheet');\n        expect(sheet.hasClass('_md')).toBe(true);\n    });\n\n    it('should close when `clickOutsideToClose == true`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        clickOutsideToClose: true\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      var backdrop = parent.find('md-backdrop');\n\n      backdrop.triggerHandler({\n        type: 'click',\n        target: backdrop[0]\n      });\n\n      $material.flushInterimElement();\n      expect(parent.find('md-bottom-sheet').length).toBe(0);\n    });\n\n    it('should not close when `clickOutsideToClose == false`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        clickOutsideToClose: false\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      var backdrop = parent.find('md-backdrop');\n\n      backdrop.triggerHandler({\n        type: 'click',\n        target: backdrop[0]\n      });\n\n      $material.flushInterimElement();\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n    });\n\n    it('should warn if the template contains a `ng-cloak`', inject(function($log) {\n      var parent = angular.element('<div>');\n\n      // Enable spy on $log.warn\n      spyOn($log, 'warn');\n\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet ng-cloak>',\n        parent: parent,\n        clickOutsideToClose: false\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should not append any backdrop when `disableBackdrop === true`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        disableBackdrop: true\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      var backdrop = parent.find('md-backdrop');\n      expect(backdrop.length).toBe(0);\n    });\n\n    it('should append a backdrop by default to the bottomsheet', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      var backdrop = parent.find('md-backdrop');\n      expect(backdrop.length).toBe(1);\n    });\n\n    it('should close when `escapeToClose == true`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        escapeToClose: true\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      $rootElement.triggerHandler({\n        type: 'keyup',\n        keyCode: $mdConstant.KEY_CODE.ESCAPE\n      });\n\n      $material.flushInterimElement();\n      expect(parent.find('md-bottom-sheet').length).toBe(0);\n    });\n\n    it('should not close when `escapeToClose == false`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        escapeToClose: false\n      });\n      $rootScope.$apply();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      $rootElement.triggerHandler({type: 'keyup', keyCode: $mdConstant.KEY_CODE.ESCAPE});\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n    });\n\n    it('should close when navigation fires `scope.$destroy()`', function() {\n      var parent = angular.element('<div>');\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent,\n        escapeToClose: false\n      });\n\n      $rootScope.$apply();\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n      $rootScope.$destroy();\n      $material.flushInterimElement();\n      expect(parent.find('md-bottom-sheet').length).toBe(0);\n    });\n\n    it('should focus child with md-autofocus',\n      inject(function ($document) {\n        jasmine.mockElementFocus(this);\n        var parent = angular.element('<div>');\n        var markup = '' +\n          '<md-bottom-sheet>' +\n          '  <md-input-container><label>Label</label>' +\n          '    <input type=\"text\" md-autofocus>' +\n          '  </md-input-container>' +\n          '  <md-input-container><label>Label</label>' +\n          '    <input type=\"text\" md-autofocus>' +\n          '  </md-input-container>' +\n          '<md-bottom-sheet>';\n\n        $mdBottomSheet.show({\n          template: '<md-bottom-sheet>',\n          parent: parent,\n          escapeToClose: false\n        });\n        $rootScope.$apply();\n\n        var sheet = parent.find('md-bottom-sheet');\n        expect(sheet.length).toBe(1);\n        var focusEl = sheet.find('input');\n\n        // Focus should be on the last md-autofocus element\n        expect($document.activeElement).toBe(focusEl[1]);\n      }));\n\n    // This test is mainly for touch devices as the -webkit-overflow-scrolling causes z-index issues\n    // if the scroll mask is appended to the body element\n    it('appends the scroll mask to the same parent', function() {\n      var parent = angular.element('<div>');\n\n      $mdBottomSheet.show({\n        template: '<md-bottom-sheet>',\n        parent: parent\n      });\n\n      $rootScope.$apply();\n\n      var scrollMask = parent[0].querySelector('.md-scroll-mask');\n\n      expect(scrollMask).not.toBeNull();\n    });\n\n    describe('isLockedOpen option', function() {\n      it('should not close, even though `escapeToClose` is true', function() {\n        var parent = angular.element('<div>');\n        $mdBottomSheet.show({\n          template: '<md-bottom-sheet>',\n          parent: parent,\n          escapeToClose: true,\n          isLockedOpen: true\n        });\n\n        $material.flushOutstandingAnimations();\n\n        expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n        $rootElement.triggerHandler({\n          type: 'keyup',\n          keyCode: $mdConstant.KEY_CODE.ESCAPE\n        });\n\n        $material.flushInterimElement();\n        expect(parent.find('md-bottom-sheet').length).toBe(1);\n      });\n\n      it('should not close, even though `clickOutsideToClose` is true', function() {\n        var parent = angular.element('<div>');\n        $mdBottomSheet.show({\n          template: '<md-bottom-sheet>',\n          parent: parent,\n          clickOutsideToClose: true,\n          isLockedOpen: true\n        });\n\n        $material.flushOutstandingAnimations();\n\n        expect(parent.find('md-bottom-sheet').length).toBe(1);\n\n        var backdrop = parent.find('md-backdrop');\n\n        backdrop.triggerHandler({\n          type: 'click',\n          target: backdrop[0]\n        });\n\n        $material.flushInterimElement();\n        expect(parent.find('md-bottom-sheet').length).toBe(1);\n      });\n\n    });\n\n  });\n\n});\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/bottom-sheet-grid-template.html",
    "content": "<md-bottom-sheet class=\"md-grid\" layout=\"column\">\n  <div layout=\"row\" layout-align=\"center center\" ng-cloak>\n    <h4>Since <code>clickOutsideToClose = false</code>, drag down or press ESC to close</h4>\n  </div>\n  <div ng-cloak>\n    <md-list flex layout=\"row\" layout-align=\"center center\">\n      <md-list-item ng-repeat=\"item in items\">\n        <div>\n          <md-button class=\"md-grid-item-content\" ng-click=\"listItemClick($index)\">\n            <md-icon md-svg-src=\"{{item.icon}}\"></md-icon>\n            <div class=\"md-grid-text\"> {{ item.name }} </div>\n          </md-button>\n        </div>\n      </md-list-item>\n    </md-list>\n  </div>\n</md-bottom-sheet>\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/bottom-sheet-list-template.html",
    "content": "<md-bottom-sheet class=\"md-list md-has-header\">\n  <md-subheader ng-cloak>Comment Actions</md-subheader>\n  <md-list ng-cloak>\n    <md-list-item ng-repeat=\"item in items\">\n\n      <md-button\n          ng-click=\"listItemClick($index)\"\n          md-autofocus=\"$index == 2\"\n          class=\"md-list-item-content\">\n        <md-icon md-svg-src=\"{{item.icon}}\"></md-icon>\n        <span class=\"md-inline-list-icon-label\">{{ item.name }}</span>\n      </md-button>\n\n    </md-list-item>\n  </md-list>\n</md-bottom-sheet>\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"BottomSheetExample\" class=\"md-padding\" ng-cloak>\n  <h2 class=\"md-title\">Usage</h2>\n  <p>Bottom sheets can be displayed by clicking one of the buttons below.  Once shown, it can be\n  dismissed by either swiping down or clicking in the shaded area.</p>\n  <h2 class=\"md-title\">Actions</h2>\n  <p>Use one of the following buttons to display a bottom sheet.</p>\n  <div class=\"bottom-sheet-demo inset\" layout=\"row\" layout-sm=\"column\" layout-align=\"center\" >\n    <md-button flex=\"50\" class=\"md-primary md-raised\" ng-click=\"showListBottomSheet()\">Show as List</md-button>\n    <md-button flex=\"50\" class=\"md-primary md-raised\" ng-click=\"showGridBottomSheet()\">Show as Grid</md-button>\n  </div>\n\n  <div ng-if=\"alert\">\n    <br/>\n    <b layout=\"row\" layout-align=\"center center\" class=\"md-padding\">\n      {{alert}}\n    </b>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/readme.html",
    "content": "<p>This UX pattern is intended for mobile devices only, and may not make sense to use\non responsive sites.</p>\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/script.js",
    "content": "angular.module('bottomSheetDemo1', ['ngMaterial'])\n.config(function($mdIconProvider) {\n    $mdIconProvider\n      .icon('share', 'img/icons/baseline-share-24px.svg', 24)\n      .icon('upload', 'img/icons/upload.svg', 24)\n      .icon('copy', 'img/icons/copy.svg', 24)\n      .icon('print', 'img/icons/print.svg', 24)\n      .icon('hangout', 'img/icons/hangout.svg', 24)\n      .icon('mail', 'img/icons/mail.svg', 24)\n      .icon('message', 'img/icons/message.svg', 24)\n      .icon('copy2', 'img/icons/copy2.svg', 24)\n      .icon('facebook', 'img/icons/facebook.svg', 24)\n      .icon('twitter', 'img/icons/twitter.svg', 24);\n  })\n.controller('BottomSheetExample', function($scope, $timeout, $mdBottomSheet, $mdToast) {\n  $scope.alert = '';\n\n  $scope.showListBottomSheet = function() {\n    $scope.alert = '';\n    $mdBottomSheet.show({\n      templateUrl: 'bottom-sheet-list-template.html',\n      controller: 'ListBottomSheetCtrl'\n    }).then(function(clickedItem) {\n      $scope.alert = clickedItem['name'] + ' clicked!';\n    }).catch(function(error) {\n      // User clicked outside or hit escape\n    });\n  };\n\n  $scope.showGridBottomSheet = function() {\n    $scope.alert = '';\n    $mdBottomSheet.show({\n      templateUrl: 'bottom-sheet-grid-template.html',\n      controller: 'GridBottomSheetCtrl',\n      clickOutsideToClose: false\n    }).then(function(clickedItem) {\n      $mdToast.show(\n            $mdToast.simple()\n              .textContent(clickedItem['name'] + ' clicked!')\n              .position('top right')\n              .hideDelay(1500)\n          );\n    }).catch(function(error) {\n      // User clicked outside or hit escape\n    });\n  };\n})\n\n.controller('ListBottomSheetCtrl', function($scope, $mdBottomSheet) {\n\n  $scope.items = [\n    { name: 'Share', icon: 'share' },\n    { name: 'Upload', icon: 'upload' },\n    { name: 'Copy', icon: 'copy' },\n    { name: 'Print this page', icon: 'print' },\n  ];\n\n  $scope.listItemClick = function($index) {\n    var clickedItem = $scope.items[$index];\n    $mdBottomSheet.hide(clickedItem);\n  };\n})\n.controller('GridBottomSheetCtrl', function($scope, $mdBottomSheet) {\n  $scope.items = [\n    { name: 'Hangout', icon: 'hangout' },\n    { name: 'Mail', icon: 'mail' },\n    { name: 'Message', icon: 'message' },\n    { name: 'Copy', icon: 'copy2' },\n    { name: 'Facebook', icon: 'facebook' },\n    { name: 'Twitter', icon: 'twitter' },\n  ];\n\n  $scope.listItemClick = function($index) {\n    var clickedItem = $scope.items[$index];\n    $mdBottomSheet.hide(clickedItem);\n  };\n})\n.run(function($templateRequest) {\n\n    var urls = [\n      'img/icons/baseline-share-24px.svg',\n      'img/icons/upload.svg',\n      'img/icons/copy.svg',\n      'img/icons/print.svg',\n      'img/icons/hangout.svg',\n      'img/icons/mail.svg',\n      'img/icons/message.svg',\n      'img/icons/copy2.svg',\n      'img/icons/facebook.svg',\n      'img/icons/twitter.svg'\n    ];\n\n    angular.forEach(urls, function(url) {\n      $templateRequest(url);\n    });\n\n  });\n"
  },
  {
    "path": "src/components/bottomSheet/demoBasicUsage/style.css",
    "content": ".md-inline-list-icon-label {\n  display: inline-block;\n  padding-left: 10px;\n  padding-right: 10px;\n  margin-top: -10px;\n  height: 24px;\n  vertical-align: middle;\n}\n.md-grid-item-content {\n  height: 90px;\n  padding-top: 10px;\n}\n.md-grid-item-content md-icon {\n  height: 48px;\n  width: 48px;\n}\n.md-grid-text {\n  padding-bottom: 5px;\n}\nmd-list-item, md-list-item .md-list-item-inner {\n  min-height: 48px;\n}\nh2 {\n  line-height: 36px;\n  padding-top: 10px;\n}\n.md-subheader .md-subheader-inner {\n  padding: 0;\n}\nmd-toast .md-toast-content {\n  background-color: #B14141;\n}\nmd-toast > * {\n  font-weight: bolder;\n}\n"
  },
  {
    "path": "src/components/button/button-theme.scss",
    "content": ".md-button.md-THEME_NAME-theme {\n\n  &:not([disabled]) {\n    &:hover {\n      background-color: '{{background-500-0.2}}';\n    }\n    &.md-focused {\n      background-color: '{{background-500-0.2}}';\n    }\n    &.md-icon-button:hover {\n      background-color: transparent;\n    }\n  }\n\n  &.md-fab {\n    background-color: '{{accent-color}}';\n    color: '{{accent-contrast}}';\n    md-icon {\n      color: '{{accent-contrast}}';\n    }\n    &:not([disabled]) {\n      &:hover {\n        background-color: '{{accent-A700}}';\n      }\n      &.md-focused {\n        background-color: '{{accent-A700}}';\n      }\n    }\n  }\n\n  &.md-primary {\n    color: '{{primary-color}}';\n    &.md-raised,\n    &.md-fab {\n      color: '{{primary-contrast}}';\n      background-color: '{{primary-color}}';\n      &:not([disabled]) {\n        md-icon {\n          color: '{{primary-contrast}}';\n        }\n        &:hover {\n          background-color: '{{primary-600}}';\n        }\n        &.md-focused {\n          background-color: '{{primary-600}}';\n        }\n      }\n    }\n    &:not([disabled]) {\n      md-icon {\n        color: '{{primary-color}}';\n      }\n    }\n  }\n\n  &.md-raised {\n    color: '{{background-900}}';\n    background-color: '{{background-50}}';\n    &:not([disabled]) {\n      md-icon {\n        color: '{{background-900}}';\n      }\n      &:hover {\n        background-color: '{{background-50}}';\n      }\n      &.md-focused {\n        background-color: '{{background-200}}';\n      }\n    }\n  }\n\n  &.md-warn {\n    color: '{{warn-color}}';\n\n    &.md-raised,\n    &.md-fab {\n      color: '{{warn-contrast}}';\n      background-color: '{{warn-color}}';\n      &:not([disabled]) {\n        md-icon {\n          color: '{{warn-contrast}}';\n        }\n        &:hover {\n          background-color: '{{warn-600}}';\n        }\n        &.md-focused {\n          background-color: '{{warn-600}}';\n        }\n      }\n    }\n    &:not([disabled]) {\n      md-icon {\n        color: '{{warn-color}}';\n      }\n    }\n  }\n\n  &.md-accent {\n    color: '{{accent-color}}';\n    &.md-raised,\n    &.md-fab {\n      color: '{{accent-contrast}}';\n      background-color: '{{accent-color}}';\n      &:not([disabled]) {\n        md-icon {\n          color: '{{accent-contrast}}';\n        }\n        &:hover {\n          background-color: '{{accent-A700}}';\n        }\n        &.md-focused {\n          background-color: '{{accent-A700}}';\n        }\n      }\n    }\n    &:not([disabled]) {\n      md-icon {\n        color: '{{accent-color}}';\n      }\n    }\n  }\n\n  &[disabled],\n  &.md-raised[disabled],\n  &.md-fab[disabled],\n  &.md-accent[disabled],\n  &.md-warn[disabled] {\n    color: '{{foreground-3}}';\n    cursor: default;\n\n    md-icon {\n      color: '{{foreground-3}}';\n    }\n  }\n  &.md-raised[disabled],\n  &.md-fab[disabled] {\n    background-color: '{{foreground-4}}';\n  }\n  &[disabled] {\n    background-color: transparent;\n  }\n}\n\n\n._md {\n  a.md-THEME_NAME-theme:not(.md-button) {\n    &.md-primary {\n      color: '{{primary-color}}';\n\n      &:hover {\n        color: '{{primary-700}}';\n      }\n    }\n\n    &.md-accent {\n      color: '{{accent-color}}';\n\n      &:hover {\n        color: '{{accent-A700}}';\n      }\n    }\n\n    &.md-warn {\n      color: '{{warn-color}}';\n\n      &:hover {\n        color: '{{warn-700}}';\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/button/button.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.button\n * @description\n *\n * Button\n */\nangular\n    .module('material.components.button', ['material.core'])\n    .directive('mdButton', MdButtonDirective)\n    .directive('a', MdAnchorDirective);\n\n\n/**\n * @private\n * @restrict E\n *\n * @description\n * `a` is an anchor directive used to inherit theme colors for md-primary, md-accent, etc.\n *\n * @usage\n *\n * <hljs lang=\"html\">\n *  <md-content md-theme=\"myTheme\">\n *    <a href=\"#chapter1\" class=\"md-accent\"></a>\n *  </md-content>\n * </hljs>\n */\nfunction MdAnchorDirective($mdTheming) {\n  return {\n    restrict : 'E',\n    link : function postLink(scope, element) {\n      // Make sure to inherit theme so stand-alone anchors\n      // support theme colors for md-primary, md-accent, etc.\n      $mdTheming(element);\n    }\n  };\n}\n\n\n/**\n * @ngdoc directive\n * @name mdButton\n * @module material.components.button\n *\n * @restrict E\n *\n * @description\n * `<md-button>` is a button directive with optional ink ripples (default enabled).\n *\n * If you supply a `href` or `ng-href` attribute, it will become an `<a>` element. Otherwise, it\n * will become a `<button>` element. As per the\n * [Material Design specifications](https://material.google.com/style/color.html#color-color-palette)\n * the FAB button background is filled with the accent color [by default]. The primary color palette\n * may be used with the `md-primary` class.\n *\n * Developers can also change the color palette of the button, by using the following classes\n * - `md-primary`\n * - `md-accent`\n * - `md-warn`\n *\n * See for example\n *\n * <hljs lang=\"html\">\n *   <md-button class=\"md-primary\">Primary Button</md-button>\n * </hljs>\n *\n * Button can be also raised, which means that they will use the current color palette to fill the button.\n *\n * <hljs lang=\"html\">\n *   <md-button class=\"md-accent md-raised\">Raised and Accent Button</md-button>\n * </hljs>\n *\n * It is also possible to disable the focus effect on the button, by using the following markup.\n *\n * <hljs lang=\"html\">\n *   <md-button class=\"md-no-focus\">No Focus Style</md-button>\n * </hljs>\n *\n * @param {string=} aria-label Adds alternative text to button for accessibility, useful for icon buttons.\n * If no default text is found, a warning will be logged.\n * @param {boolean=} md-no-ink If present, disable ink ripple effects.\n * @param {string=} md-ripple-size Overrides the default ripple size logic. Options: `full`, `partial`, `auto`.\n * @param {expression=} ng-disabled Disable the button when the expression is truthy.\n * @param {expression=} ng-blur Expression evaluated when focus is removed from the button.\n *\n * @usage\n *\n * Regular buttons:\n *\n * <hljs lang=\"html\">\n *  <md-button> Flat Button </md-button>\n *  <md-button href=\"http://google.com\"> Flat link </md-button>\n *  <md-button class=\"md-raised\"> Raised Button </md-button>\n *  <md-button ng-disabled=\"true\"> Disabled Button </md-button>\n *  <md-button>\n *    <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n *    Register Now\n *  </md-button>\n * </hljs>\n *\n * FAB buttons:\n *\n * <hljs lang=\"html\">\n *  <md-button class=\"md-fab\" aria-label=\"FAB\">\n *    <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n *  </md-button>\n *  <!-- mini-FAB -->\n *  <md-button class=\"md-fab md-mini\" aria-label=\"Mini FAB\">\n *    <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n *  </md-button>\n *  <!-- Button with SVG Icon -->\n *  <md-button class=\"md-icon-button\" aria-label=\"Custom Icon Button\">\n *    <md-icon md-svg-icon=\"path/to/your.svg\"></md-icon>\n *  </md-button>\n * </hljs>\n */\nfunction MdButtonDirective($mdButtonInkRipple, $mdTheming, $mdAria, $mdInteraction) {\n\n  return {\n    restrict: 'EA',\n    replace: true,\n    transclude: true,\n    template: getTemplate,\n    link: postLink\n  };\n\n  function isAnchor(attr) {\n    return angular.isDefined(attr.href) || angular.isDefined(attr.ngHref) || angular.isDefined(attr.ngLink) || angular.isDefined(attr.uiSref);\n  }\n\n  function getTemplate(element, attr) {\n    if (isAnchor(attr)) {\n      return '<a class=\"md-button\" ng-transclude></a>';\n    } else {\n      // If buttons don't have type=\"button\", they will submit forms automatically.\n      var btnType = (typeof attr.type === 'undefined') ? 'button' : attr.type;\n      return '<button class=\"md-button\" type=\"' + btnType + '\" ng-transclude></button>';\n    }\n  }\n\n  function postLink(scope, element, attr) {\n    $mdTheming(element);\n    $mdButtonInkRipple.attach(scope, element);\n\n    // Use async expect to support possible bindings in the button label\n    $mdAria.expectWithoutText(element, 'aria-label');\n\n    // For anchor elements, we have to set tabindex manually when the element is disabled.\n    // We don't do this for md-nav-bar anchors as the component manages its own tabindex values.\n    if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) &&\n        !element.hasClass('_md-nav-button')) {\n      scope.$watch(attr.ngDisabled, function(isDisabled) {\n        element.attr('tabindex', isDisabled ? -1 : 0);\n      });\n    }\n\n    // disabling click event when disabled is true\n    element.on('click', function(e){\n      if (attr.disabled === true) {\n        e.preventDefault();\n        e.stopImmediatePropagation();\n      }\n    });\n\n    if (!element.hasClass('md-no-focus')) {\n\n      element.on('focus', function() {\n\n        // Only show the focus effect when being focused through keyboard interaction or programmatically\n        if (!$mdInteraction.isUserInvoked() || $mdInteraction.getLastInteractionType() === 'keyboard') {\n          element.addClass('md-focused');\n        }\n\n      });\n\n      element.on('blur', function() {\n        element.removeClass('md-focused');\n      });\n    }\n\n  }\n\n}\n"
  },
  {
    "path": "src/components/button/button.scss",
    "content": "// Material Design Button: https://material.io/archive/guidelines/components/buttons.html\n\n$button-border-radius: 2px !default;\n$button-fab-border-radius: 50% !default;\n$button-icon-border-radius: $button-fab-border-radius !default;\n\n$button-font-size: $body-font-size-base !default;\n$button-font-size-dense: math.div($body-font-size-base * 13, 14) !default;\n\n$button-line-height: rem(3.60) !default;\n$button-line-height-dense: rem(3.20) !default;\n$button-margin: rem(0.600) rem(0.800) !default;\n$button-min-width: rem(8.800) !default;\n$button-padding: 0 $button-left-right-padding !default;\n\n\n// Fab buttons\n$button-fab-line-height: rem(5.600) !default;\n$button-fab-mini-width: rem(4.00) !default;\n$button-fab-mini-height: rem(4.00) !default;\n$button-fab-mini-line-height: rem(4.00) !default;\n\n$button-fab-toast-offset: $button-fab-height * 0.75 !default;\n\n$icon-button-margin: rem(0.600) !default;\n\n// Fix issue causing buttons in Firefox to be 2px bigger than they should\nbutton.md-button::-moz-focus-inner {\n  border: 0;\n}\n\n.md-button {\n  display: inline-block;\n  position: relative; // Required for absolute canvas child elements.\n  cursor: pointer;\n\n  /** Alignment adjustments */\n  @include dense(min-height, $button-line-height, $button-line-height-dense);\n  min-width: $button-min-width;\n  @include dense(line-height, $button-line-height, $button-line-height-dense);\n\n  vertical-align: middle;\n  align-items: center;\n  text-align: center;\n\n  border-radius: $button-border-radius;\n  box-sizing: border-box;\n\n  /* Reset default button appearance */\n  user-select: none;\n  outline: none;\n  border: 0;\n\n  /** Custom styling for button */\n  padding: $button-padding;\n  margin: $button-margin;\n\n  background: transparent;\n  color: currentColor;\n  white-space: nowrap;\n\n  /* Uppercase text content */\n  text-transform: uppercase;\n  font-weight: 500;\n  @include dense(font-size, $button-font-size, $button-font-size-dense);\n  font-style: inherit;\n  font-variant: inherit;\n  font-family: inherit;\n  text-decoration: none;\n\n  // Ink Ripple should not create any overflow.\n  overflow: hidden;\n\n  transition: box-shadow $swift-ease-out-duration $swift-ease-out-timing-function,\n              background-color $swift-ease-out-duration $swift-ease-out-timing-function;\n\n  &:focus {\n    outline: none;\n  }\n\n  &:hover, &:focus {\n    text-decoration: none;\n  }\n\n  // By default $ngAnimate looks for transition durations on the element, when using ng-hide, ng-if, ng-show.\n  // The .md-button has a transition duration applied, which means, that $ngAnimate delays the hide process.\n  // To avoid this, we need to reset the transition, when $ngAnimate looks for the duration.\n  &.ng-hide, &.ng-leave {\n    transition: none;\n  }\n\n  &.md-cornered {\n    border-radius: 0;\n  }\n\n  &.md-icon {\n    padding: 0;\n    background: none;\n  }\n\n  &.md-raised {\n    &:not([disabled]) {\n      @include md-shadow-bottom-z-1();\n    }\n  }\n\n  &.md-icon-button {\n    margin: 0 $icon-button-margin;\n    height: $icon-button-height;\n    min-width: 0;\n    line-height: $icon-size;\n    padding: $baseline-grid;\n    width: $icon-button-width;\n    border-radius: $button-icon-border-radius;\n  }\n\n  &.md-fab {\n\n    // Include the top/left/bottom/right fab positions\n    @include fab-all-positions();\n\n    z-index: $z-index-fab;\n\n    line-height: $button-fab-line-height;\n\n    min-width: 0;\n    width: $button-fab-width;\n    height: $button-fab-height;\n    vertical-align: middle;\n\n    @include md-shadow-bottom-z-1();\n    border-radius: $button-fab-border-radius;\n    background-clip: padding-box;\n    overflow: hidden;\n\n    transition: $swift-ease-in;\n    transition-property: background-color, box-shadow, transform;\n\n    &.md-mini {\n      line-height: $button-fab-mini-line-height;\n      width: $button-fab-mini-width;\n      height: $button-fab-mini-height;\n    }\n\n    &.ng-hide, &.ng-leave {\n      transition: none;\n    }\n\n    &[disabled] {\n      box-shadow: none;\n    }\n  }\n\n  &:not([disabled]) {\n    &.md-raised,\n    &.md-fab {\n      &.md-focused {\n        @include md-shadow-bottom-z-1();\n      }\n      &:active {\n        @include md-shadow-bottom-z-2();\n      }\n    }\n  }\n\n  .md-ripple-container {\n    border-radius: inherit;\n    background-clip: padding-box;\n    overflow: hidden;\n\n    // Workaround for rounded corner overflow bug\n    // Force Safari and Chrome to use a compositing layer\n    -webkit-transform:translateZ(0);\n  }\n}\n\n// Using `display:block;` is required for correct vertical alignment\n// because '.md-button' uses `display:inline-block;`.\n.md-button.md-icon-button,\nbutton.md-button.md-fab {\n  md-icon {\n    display: block;\n  }\n}\n\n.md-toast-open-top {\n  .md-button.md-fab-top-left,\n  .md-button.md-fab-top-right {\n    transition: $swift-ease-out;\n    transform: translate3d(0, $button-fab-toast-offset, 0);\n    &:not([disabled]) {\n      &.md-focused,\n      &:hover {\n        transform: translate3d(0, $button-fab-toast-offset - 1, 0);\n      }\n    }\n  }\n}\n\n.md-toast-open-bottom {\n  .md-button.md-fab-bottom-left,\n  .md-button.md-fab-bottom-right {\n    transition: $swift-ease-out;\n    transform: translate3d(0, -$button-fab-toast-offset, 0);\n    &:not([disabled]) {\n      &.md-focused,\n      &:hover {\n        transform: translate3d(0, -$button-fab-toast-offset - 1, 0);\n      }\n    }\n  }\n}\n\n.md-button-group {\n  display: flex;\n  flex: 1;\n  width: 100%;\n\n  & > .md-button {\n    flex: 1;\n\n    display: block;\n\n    overflow: hidden;\n\n    width: 0;\n\n    border-width: 1px 0px 1px 1px;\n    border-radius: 0;\n\n    text-align: center;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n\n    &:first-child {\n      border-radius: 2px 0px 0px 2px;\n    }\n    &:last-child {\n      border-right-width: 1px;\n      border-radius: 0px 2px 2px 0px;\n    }\n  }\n}\n// IE only\n@media screen and (-ms-high-contrast: active) {\n  .md-button.md-raised,\n  .md-button.md-fab {\n    border: 1px solid #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/button/button.spec.js",
    "content": "describe('md-button', function() {\n\n  beforeEach(module('material.components.button'));\n\n  it('should convert attributes on an md-button to attributes on the generated button', inject(function($compile, $rootScope) {\n    var button = $compile('<md-button hide hide-sm></md-button>')($rootScope);\n    $rootScope.$apply();\n    expect(button[0]).toHaveClass('hide');\n    expect(button[0]).toHaveClass('hide-sm');\n  }));\n\n  describe('with ARIA support', function() {\n\n    it('should only have one ripple container when a custom ripple color is set', inject(function ($compile, $rootScope) {\n      var button = $compile('<md-button md-ink-ripple=\"#f00\">button</md-button>')($rootScope);\n\n      button.triggerHandler({ type: '$md.pressdown', pointer: { x: 0, y: 0 } });\n      expect(button[0].getElementsByClassName('md-ripple-container').length).toBe(0);\n    }));\n\n\n    it('should expect an aria-label if element has no text', inject(function($compile, $rootScope, $log) {\n      spyOn($log, 'warn');\n      var button = $compile('<md-button><md-icon></md-icon></md-button>')($rootScope);\n      $rootScope.$apply();\n      expect($log.warn).toHaveBeenCalled();\n\n      $log.warn.calls.reset();\n      button = $compile('<md-button aria-label=\"something\"><md-icon></md-icon></md-button>')($rootScope);\n      $rootScope.$apply();\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should not expect an aria-label if element has text content', inject(function($compile, $rootScope, $log) {\n      spyOn($log, 'warn');\n\n      var button = $compile('<md-button>Hello</md-button>')($rootScope);\n      expect(button.attr('aria-label')).toBeUndefined();\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should not set an aria-label if the text content uses bindings', inject(function($$rAF, $compile, $rootScope, $log, $timeout) {\n      spyOn($log, 'warn');\n\n      var scope = angular.extend($rootScope.$new(),{greetings : \"Welcome\"});\n      var button = $compile('<md-button>{{greetings}}</md-button>')(scope);\n\n      $rootScope.$apply();\n      $$rAF.flush();    // needed for $mdAria.expectAsync()\n\n      expect(button.attr('aria-label')).toBeUndefined();\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n  });\n\n  it('should allow attribute directive syntax', inject(function($compile, $rootScope) {\n    var button = $compile('<a md-button href=\"https://google.com\">google</a>')($rootScope.$new());\n    expect(button.hasClass('md-button')).toBe(true);\n  }));\n\n  it('should apply focus effect with keyboard interaction', inject(function ($compile, $rootScope){\n    var button = $compile('<md-button>')($rootScope.$new());\n    var body = angular.element(document.body);\n\n    $rootScope.$apply();\n\n    // Fake a keyboard interaction for the $mdInteraction service.\n    body.triggerHandler('keydown');\n    button.triggerHandler('focus');\n\n    expect(button).toHaveClass('md-focused');\n\n    button.triggerHandler('blur');\n\n    expect(button).not.toHaveClass('md-focused');\n  }));\n\n  it('should apply focus effect when programmatically focusing', inject(function ($compile, $rootScope){\n    var button = $compile('<md-button>')($rootScope.$new());\n\n    $rootScope.$apply();\n\n    button.triggerHandler('focus');\n\n    expect(button).toHaveClass('md-focused');\n\n    button.triggerHandler('blur');\n\n    expect(button).not.toHaveClass('md-focused');\n  }));\n\n  it('should not apply focus effect with mouse interaction', inject(function ($compile, $rootScope){\n    var button = $compile('<md-button>')($rootScope.$new());\n    var body = angular.element(document.body);\n\n    $rootScope.$apply();\n\n    // Fake a mouse interaction for the $mdInteraction service.\n    body.triggerHandler('mousedown');\n    button.triggerHandler('focus');\n\n    expect(button).not.toHaveClass('md-focused');\n\n    button.triggerHandler('blur');\n\n    expect(button).not.toHaveClass('md-focused');\n  }));\n\n  it('should not set the focus state if focus is disabled', inject(function($compile, $rootScope) {\n    var button = $compile('<md-button class=\"md-no-focus\">')($rootScope.$new());\n    $rootScope.$apply();\n\n    button.triggerHandler('focus');\n\n    expect(button).not.toHaveClass('md-focused');\n  }));\n\n  describe('with href or ng-href', function() {\n\n    it('should be anchor if href attr', inject(function($compile, $rootScope) {\n      var button = $compile('<md-button href=\"/link\">')($rootScope.$new());\n      $rootScope.$apply();\n      expect(button[0].tagName.toLowerCase()).toEqual('a');\n    }));\n\n    it('should be anchor if ng-href attr', inject(function($compile, $rootScope) {\n      var button = $compile('<md-button ng-href=\"/link\">')($rootScope.$new());\n      $rootScope.$apply();\n      expect(button[0].tagName.toLowerCase()).toEqual('a');\n    }));\n\n    it('should be anchor if ui-sref attr', inject(function($compile, $rootScope) {\n      var button = $compile('<md-button ui-sref=\"state\">')($rootScope.$new());\n      $rootScope.$apply();\n      expect(button[0].tagName.toLowerCase()).toEqual('a');\n    }));\n\n    it('should be anchor if ng-link attr', inject(function($compile, $rootScope) {\n      var button = $compile('<md-button ng-link=\"component\">')($rootScope.$new());\n      $rootScope.$apply();\n      expect(button[0].tagName.toLowerCase()).toEqual('a');\n    }));\n\n    it('should be button otherwise', inject(function($compile, $rootScope) {\n      var button = $compile('<md-button>')($rootScope.$new());\n      $rootScope.$apply();\n      expect(button[0].tagName.toLowerCase()).toEqual('button');\n    }));\n\n  });\n\n\n  describe('with ng-disabled', function() {\n\n    it('should not set `tabindex` when used without anchor attributes', inject(function ($compile, $rootScope, $timeout) {\n      var scope = angular.extend($rootScope.$new(), { isDisabled : true });\n      var button = $compile('<md-button ng-disabled=\"isDisabled\">button</md-button>')(scope);\n      $rootScope.$apply();\n\n      expect(button[0].hasAttribute('tabindex')).toBe(false);\n    }));\n\n    it('should set `tabindex == -1` when used with href', inject(function ($compile, $rootScope, $timeout) {\n      var scope = angular.extend($rootScope.$new(), { isDisabled : true });\n      var button = $compile('<md-button ng-disabled=\"isDisabled\" href=\"#nowhere\">button</md-button>')(scope);\n\n      $rootScope.$apply();\n      expect(button.attr('tabindex')).toBe(\"-1\");\n\n      $rootScope.$apply(function(){\n        scope.isDisabled = false;\n      });\n      expect(button.attr('tabindex')).toBe(\"0\");\n\n    }));\n\n    it('should set `tabindex == -1` when used with ng-href', inject(function ($compile, $rootScope, $timeout) {\n      var scope = angular.extend($rootScope.$new(), { isDisabled : true, url : \"http://material.angularjs.org\" });\n      var button = $compile('<md-button ng-disabled=\"isDisabled\" ng-href=\"url\">button</md-button>')(scope);\n      $rootScope.$apply();\n\n      expect(button.attr('tabindex')).toBe(\"-1\");\n    }));\n\n    it('should not trigger click on button when disabled', inject(function ($compile, $rootScope) {\n      var clicked = false;\n      var onClick = function(){ clicked = true;};\n      var scope   = angular.extend($rootScope.$new(), { isDisabled : true, onClick : onClick});\n\n      var element = $compile('<md-button ng-disabled=\"isDisabled\" ng-click=\"onClick()\">button</md-button>')(scope);\n      $rootScope.$apply();\n\n      element.find('button').triggerHandler('click');\n      expect(clicked).toBe(false);\n    }));\n\n    it('should not trigger click on anchor when disabled', inject(function ($compile, $rootScope) {\n      var clicked = false;\n      var onClick = function(){ clicked = true;};\n      var scope   = angular.extend($rootScope.$new(), { isDisabled : true, onClick : onClick});\n\n      var element = $compile('<md-button ng-disabled=\"isDisabled\" ng-href=\"#\" ng-click=\"onClick()\">button</md-button>')(scope);\n      $rootScope.$apply();\n\n      element.find('a').triggerHandler('click');\n      expect(clicked).toBe(false);\n    }));\n\n  });\n\n});\n"
  },
  {
    "path": "src/components/button/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button>Button</md-button>\n      <md-button md-no-ink class=\"md-primary\">Primary (md-noink)</md-button>\n      <md-button ng-disabled=\"true\" class=\"md-primary\">Disabled</md-button>\n      <md-button class=\"md-warn\">Warn</md-button>\n      <div class=\"label\">Flat</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button class=\"md-raised\">Button</md-button>\n      <md-button class=\"md-raised md-primary\">Primary</md-button>\n      <md-button ng-disabled=\"true\" class=\"md-raised md-primary\">Disabled</md-button>\n      <md-button class=\"md-raised md-accent\">Accent</md-button>\n      <div class=\"label\">Raised</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n        <md-button class=\"md-fab\" aria-label=\"Eat cake\">\n            <md-icon md-svg-src=\"img/icons/cake.svg\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-fab md-primary\" aria-label=\"Use Android\">\n          <md-icon md-svg-src=\"img/icons/android.svg\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-fab\" ng-disabled=\"true\" aria-label=\"Comment\">\n            <md-icon md-svg-src=\"img/icons/ic_comment_24px.svg\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-fab md-primary md-hue-2\" aria-label=\"Profile\">\n            <md-icon md-svg-src=\"img/icons/ic_people_24px.svg\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-fab md-raised md-mini\" aria-label=\"Eat cake\">\n            <md-icon md-svg-src=\"img/icons/cake.svg\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-fab md-mini md-primary\" aria-label=\"Use Android\">\n          <md-icon md-svg-src=\"img/icons/android.svg\" style=\"color: greenyellow;\"></md-icon>\n        </md-button>\n      <div class=\"label\">FAB</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n        <md-button ng-href=\"{{googleUrl}}\" target=\"_blank\">Default Link</md-button>\n        <md-button class=\"md-primary\" ng-href=\"{{googleUrl}}\" target=\"_blank\">\n          Primary Link\n        </md-button>\n        <md-button>Default Button</md-button>\n      <div class=\"label\">Link vs. Button</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button class=\"md-primary md-hue-2\">Primary Hue 2</md-button>\n      <md-button class=\"md-warn md-raised md-hue-1\">Warn Hue 1</md-button>\n      <md-button class=\"md-accent md-raised md-hue-2\">Accent Hue 2</md-button>\n      <md-button class=\"md-accent md-hue-3\">Accent Hue 3</md-button>\n      <div class=\"label\">Themed</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button class=\"md-icon-button md-primary\" aria-label=\"Settings\">\n        <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n      </md-button>\n      <md-button class=\"md-icon-button md-accent\" aria-label=\"Favorite\">\n        <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n      </md-button>\n      <md-button class=\"md-icon-button\" aria-label=\"More\">\n        <md-icon md-svg-icon=\"img/icons/more_vert.svg\"></md-icon>\n      </md-button>\n      <md-button href=\"http://google.com\"\n                 title=\"Launch Google.com in new window\"\n                 target=\"_blank\"\n                 ng-disabled=\"true\"\n                 aria-label=\"Google.com\"\n                 class=\"md-icon-button launch\">\n        <md-icon md-svg-icon=\"img/icons/launch.svg\"></md-icon>\n      </md-button>\n      <div class=\"label\">Icon Button</div>\n    </section>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/button/demoBasicUsage/script.js",
    "content": "angular.module('buttonsDemoBasic', ['ngMaterial'])\n.controller('AppCtrl', function($scope) {\n  $scope.isDisabled = true;\n  $scope.googleUrl = 'http://google.com';\n});\n"
  },
  {
    "path": "src/components/button/demoBasicUsage/style.css",
    "content": "section {\n  border-radius: 3px;\n  text-align: center;\n  margin: 1em;\n  position: relative !important;\n}\nsection .md-button {\n  margin-top: 16px;\n  margin-bottom: 16px;\n}\n.label {\n  position: absolute;\n  bottom: 5px;\n  left: 7px;\n  font-size: 14px;\n}\n"
  },
  {
    "path": "src/components/button/demoDense/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-dense\">\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button>Button</md-button>\n      <md-button md-no-ink class=\"md-primary\">Primary (md-noink)</md-button>\n      <md-button ng-disabled=\"true\" class=\"md-primary\">Disabled</md-button>\n      <md-button class=\"md-warn\">Warn</md-button>\n      <div class=\"label\">Flat</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button class=\"md-raised\">Button</md-button>\n      <md-button class=\"md-raised md-primary\">Primary</md-button>\n      <md-button ng-disabled=\"true\" class=\"md-raised md-primary\">Disabled</md-button>\n      <md-button class=\"md-raised md-accent\">Accent</md-button>\n      <div class=\"label\">Raised</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n        <md-button ng-href=\"{{googleUrl}}\" target=\"_blank\">Default Link</md-button>\n        <md-button class=\"md-primary\" ng-href=\"{{googleUrl}}\" target=\"_blank\">\n          Primary Link\n        </md-button>\n        <md-button>Default Button</md-button>\n      <div class=\"label\">Link vs. Button</div>\n    </section>\n    <md-divider></md-divider>\n\n    <section layout=\"row\" layout-sm=\"column\" layout-align=\"center center\" layout-wrap>\n      <md-button class=\"md-primary md-hue-2\">Primary Hue 2</md-button>\n      <md-button class=\"md-warn md-raised md-hue-1\">Warn Hue 1</md-button>\n      <md-button class=\"md-accent md-raised md-hue-2\">Accent Hue 2</md-button>\n      <md-button class=\"md-accent md-hue-3\">Accent Hue 3</md-button>\n      <div class=\"label\">Themed</div>\n    </section>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/button/demoDense/script.js",
    "content": "angular.module('buttonsDemoDense', ['ngMaterial'])\n.controller('AppCtrl', function($scope) {\n  $scope.isDisabled = true;\n  $scope.googleUrl = 'http://google.com';\n});\n"
  },
  {
    "path": "src/components/button/demoDense/style.css",
    "content": "section {\n  text-align: center;\n  margin: 8px;\n  position: relative !important;\n}\n.label {\n  position: absolute;\n  bottom: 5px;\n  left: 7px;\n  font-size: 12px;\n}\n"
  },
  {
    "path": "src/components/card/card-theme.scss",
    "content": "$card-border-radius: 2px !default;\n\nmd-card.md-THEME_NAME-theme {\n  color: '{{foreground-1}}';\n  background-color: '{{background-hue-1}}';\n  border-radius: $card-border-radius;\n\n  .md-card-image {\n    border-radius: $card-border-radius $card-border-radius 0 0;\n  }\n\n  md-card-header {\n    md-card-avatar {\n      md-icon {\n        color: '{{background-color}}';\n        background-color: '{{foreground-3}}';\n      }\n    }\n\n    md-card-header-text {\n      .md-subhead {\n        color: '{{foreground-2}}'\n      }\n    }\n  }\n\n  md-card-title {\n    md-card-title-text {\n      &:not(:only-child) {\n        .md-subhead {\n          color: '{{foreground-2}}';\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/card/card.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.card\n *\n * @description\n * Card components.\n */\nangular.module('material.components.card', [\n    'material.core'\n  ])\n  .directive('mdCard', mdCardDirective);\n\n\n/**\n * @ngdoc directive\n * @name mdCard\n * @module material.components.card\n *\n * @restrict E\n *\n * @description\n * The `<md-card>` directive is a container element used within `<md-content>` containers.\n *\n * An image included as a direct descendant will fill the card's width. If you want to avoid this,\n * you can add the `md-image-no-fill` class to the parent element. The `<md-card-content>`\n * container will wrap text content and provide padding. An `<md-card-footer>` element can be\n * optionally included to put content flush against the bottom edge of the card.\n *\n * Action buttons can be included in an `<md-card-actions>` element, similar to `<md-dialog-actions>`.\n * You can then position buttons using layout attributes.\n *\n * Card is built with:\n * * `<md-card-header>` - Header for the card, holds avatar, text and squared image\n *  - `<md-card-avatar>` - Card avatar\n *    - `md-user-avatar` - Class for user image\n *    - `<md-icon>`\n *  - `<md-card-header-text>` - Contains elements for the card description\n *    - `md-title` - Class for the card title\n *    - `md-subhead` - Class for the card sub header\n * * `<img>` - Image for the card\n * * `<md-card-title>` - Card content title\n *  - `<md-card-title-text>`\n *    - `md-headline` - Class for the card content title\n *    - `md-subhead` - Class for the card content sub header\n *  - `<md-card-title-media>` - Squared image within the title\n *    - `md-media-sm` - Class for small image\n *    - `md-media-md` - Class for medium image\n *    - `md-media-lg` - Class for large image\n *    - `md-media-xl` - Class for extra large image\n * * `<md-card-content>` - Card content\n * * `<md-card-actions>` - Card actions\n *  - `<md-card-icon-actions>` - Icon actions\n *\n * Cards have constant width and variable heights; where the maximum height is limited to what can\n * fit within a single view on a platform, but it can temporarily expand as needed.\n *\n * @usage\n * ### Card with optional footer\n * <hljs lang=\"html\">\n * <md-card>\n *  <img src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n *  <md-card-content>\n *    <h2>Card headline</h2>\n *    <p>Card content</p>\n *  </md-card-content>\n *  <md-card-footer>\n *    Card footer\n *  </md-card-footer>\n * </md-card>\n * </hljs>\n *\n * ### Card with actions\n * <hljs lang=\"html\">\n * <md-card>\n *  <img src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n *  <md-card-content>\n *    <h2>Card headline</h2>\n *    <p>Card content</p>\n *  </md-card-content>\n *  <md-card-actions layout=\"row\" layout-align=\"end center\">\n *    <md-button>Action 1</md-button>\n *    <md-button>Action 2</md-button>\n *  </md-card-actions>\n * </md-card>\n * </hljs>\n *\n * ### Card with header, image, title actions and content\n * <hljs lang=\"html\">\n * <md-card>\n *   <md-card-header>\n *     <md-card-avatar>\n *       <img class=\"md-user-avatar\" src=\"avatar.png\"/>\n *     </md-card-avatar>\n *     <md-card-header-text>\n *       <span class=\"md-title\">Title</span>\n *       <span class=\"md-subhead\">Sub header</span>\n *     </md-card-header-text>\n *   </md-card-header>\n *   <img ng-src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n *   <md-card-title>\n *     <md-card-title-text>\n *       <span class=\"md-headline\">Card headline</span>\n *       <span class=\"md-subhead\">Card subheader</span>\n *     </md-card-title-text>\n *   </md-card-title>\n *   <md-card-actions layout=\"row\" layout-align=\"start center\">\n *     <md-button>Action 1</md-button>\n *     <md-button>Action 2</md-button>\n *     <md-card-icon-actions>\n *       <md-button class=\"md-icon-button\" aria-label=\"icon\">\n *         <md-icon md-svg-icon=\"icon\"></md-icon>\n *       </md-button>\n *     </md-card-icon-actions>\n *   </md-card-actions>\n *   <md-card-content>\n *     <p>\n *      Card content\n *     </p>\n *   </md-card-content>\n * </md-card>\n * </hljs>\n */\nfunction mdCardDirective($mdTheming) {\n  return {\n    restrict: 'E',\n    link: function ($scope, $element, attr) {\n      $element.addClass('_md');     // private md component indicator for styling\n      $mdTheming($element);\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/card/card.scss",
    "content": "$card-padding: 16px !default;\n$card-box-shadow: $whiteframe-shadow-1dp !default;\n\nmd-card {\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  margin: $baseline-grid;\n\n  box-shadow: $card-box-shadow;\n\n  md-card-header {\n    padding: $card-padding;\n    display: flex;\n    flex-direction: row;\n\n    &:first-child {\n      md-card-avatar {\n       @include rtl-prop(margin-right, margin-left, 12px, auto);\n      }\n    }\n\n    &:last-child {\n      md-card-avatar {\n        @include rtl-prop(margin-left, margin-right, 12px, auto);\n      }\n    }\n\n    md-card-avatar {\n      width: 40px;\n      height: 40px;\n\n      .md-user-avatar,\n      md-icon{\n        border-radius: 50%;\n      }\n\n      md-icon {\n        padding: 8px;\n        > svg {\n          // Safari workaround for any SVG with padded parent\n          height: inherit;\n          width: inherit;\n        }\n      }\n\n      & + md-card-header-text {\n        max-height: 40px;\n\n        .md-title {\n          font-size: 14px;\n        }\n      }\n    }\n\n    md-card-header-text {\n      display: flex;\n      flex: 1;\n      flex-direction: column;\n\n      .md-subhead {\n        font-size: 14px;\n      }\n    }\n  }\n\n  > img,\n  > md-card-header img,\n  md-card-title-media img {\n    box-sizing: border-box;\n    display: flex;\n    flex: 0 0 auto;\n    width: 100%;\n    height: auto;\n  }\n\n  md-card-title {\n    padding: 3 * $card-padding * 0.5 $card-padding $card-padding;\n    display: flex;\n    flex: 1 1 auto;\n    flex-direction: row;\n\n    & + md-card-content {\n      padding-top: 0;\n    }\n\n    md-card-title-text {\n      flex: 1;\n      flex-direction: column;\n      display: flex;\n\n      .md-subhead {\n        padding-top: 0;\n        font-size: 14px;\n      }\n\n      &:only-child {\n        .md-subhead {\n          padding-top: 3 * $card-padding * 0.25;\n        }\n      }\n    }\n\n    md-card-title-media {\n      margin-top: - $card-padding * 0.5;\n\n      .md-media-sm {\n        height: 80px;\n        width: 80px;\n      }\n      .md-media-md {\n        height: 112px;\n        width: 112px;\n      }\n      .md-media-lg {\n        height: 152px;\n        width: 152px;\n      }\n    }\n  }\n\n  md-card-content {\n    display: block;\n    padding: $card-padding;\n\n    & > p {\n      &:first-child {\n        margin-top: 0;\n      }\n\n      &:last-child {\n        margin-bottom: 0;\n      }\n    }\n\n    .md-media-xl {\n      height: 240px;\n      width: 240px;\n    }\n  }\n\n  md-card-actions {\n    margin: $baseline-grid;\n\n    &.layout-column {\n      .md-button {\n        &:not(.md-icon-button) {\n          margin: $baseline-grid * 0.25 0;\n\n          &:first-of-type {\n            margin-top: 0;\n          }\n\n          &:last-of-type {\n            margin-bottom: 0;\n          }\n        }\n\n        &.md-icon-button {\n          margin-top: 3 * $baseline-grid * 0.25;\n          margin-bottom: 3 * $baseline-grid * 0.25;\n        }\n      }\n    }\n\n    md-card-icon-actions {\n      flex: 1;\n      justify-content: flex-start;\n      display: flex;\n      flex-direction: row;\n    }\n\n    &:not(.layout-column) .md-button {\n      &:not(.md-icon-button) {\n        margin: 0 $baseline-grid * .5;\n\n        &:first-of-type {\n          @include rtl-prop(margin-left, margin-right, 0, auto);\n        }\n\n        &:last-of-type {\n          @include rtl-prop(margin-right, margin-left, 0, auto);\n        }\n      }\n\n      &.md-icon-button {\n        margin-left: 3 * $baseline-grid * 0.25;\n        margin-right: 3 * $baseline-grid * 0.25;\n\n        &:first-of-type {\n          @include rtl-prop(margin-left, margin-right, 3 * $baseline-grid * 0.5, auto);\n        }\n\n        &:last-of-type {\n          @include rtl-prop(margin-right, margin-left, 3 * $baseline-grid * 0.5, auto);\n        }\n      }\n\n      & + md-card-icon-actions {\n        flex: 1;\n        justify-content: flex-end;\n        display: flex;\n        flex-direction: row;\n      }\n    }\n  }\n\n  md-card-footer {\n    margin-top: auto;\n    padding: $card-padding;\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-card {\n    border: 1px solid #fff;\n  }\n}\n\n.md-image-no-fill {\n  > img {\n    width: auto;\n    height: auto;\n  }\n}\n\n"
  },
  {
    "path": "src/components/card/card.spec.js",
    "content": "describe('mdCard directive', function() {\n\n  var $mdThemingMock = function() { $mdThemingMock.called = true; };\n  var $compile;\n  var $rootScope;\n\n  beforeEach(function() {\n    module('material.components.card');\n    module(function($provide) {\n      $provide.value('$mdTheming', $mdThemingMock);\n    });\n    inject(function(_$compile_, _$rootScope_) {\n      $compile = _$compile_;\n      $rootScope = _$rootScope_;\n    });\n  });\n\n  it('should be themable', function() {\n    $compile('<md-card></md-card>')($rootScope.$new());\n    expect($mdThemingMock.called).toBe(true);\n  });\n\n  it('should have `._md` class indicator', function() {\n    var element = $compile('<md-card></md-card>')($rootScope.$new());\n    expect(element.hasClass('_md')).toBe(true);\n  });\n});\n"
  },
  {
    "path": "src/components/card/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak >\n  <md-content class=\"md-padding\" layout-xs=\"column\" layout=\"row\">\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card md-theme=\"{{ showDarkTheme ? 'dark-grey' : 'default' }}\" md-theme-watch>\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Card with image</span>\n            <span class=\"md-subhead\">Large</span>\n          </md-card-title-text>\n          <md-card-title-media>\n            <div class=\"md-media-lg card-media\"></div>\n          </md-card-title-media>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n      </md-card>\n      <md-card md-theme=\"{{ showDarkTheme ? 'dark-orange' : 'default' }}\" md-theme-watch>\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Card with image</span>\n            <span class=\"md-subhead\">Extra Large</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content layout=\"row\" layout-align=\"space-between\">\n          <div class=\"md-media-xl card-media\"></div>\n\n          <md-card-actions layout=\"column\">\n            <md-button class=\"md-icon-button\" aria-label=\"Favorite\">\n              <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n            </md-button>\n            <md-button class=\"md-icon-button\" aria-label=\"Settings\">\n              <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n            </md-button>\n            <md-button class=\"md-icon-button\" aria-label=\"Share\">\n              <md-icon md-svg-icon=\"img/icons/baseline-share-24px.svg\"></md-icon>\n            </md-button>\n          </md-card-actions>\n        </md-card-content>\n      </md-card>\n    </div>\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card md-theme=\"{{ showDarkTheme ? 'dark-purple' : 'default' }}\" md-theme-watch>\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Card with image</span>\n            <span class=\"md-subhead\">Small</span>\n          </md-card-title-text>\n          <md-card-title-media>\n            <div class=\"md-media-sm card-media\"></div>\n          </md-card-title-media>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n      </md-card>\n      <md-card md-theme=\"{{ showDarkTheme ? 'dark-blue' : 'default' }}\" md-theme-watch>\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Card with image</span>\n            <span class=\"md-subhead\">Medium</span>\n          </md-card-title-text>\n          <md-card-title-media>\n            <div class=\"md-media-md card-media\"></div>\n          </md-card-title-media>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n      </md-card>\n      <div layout layout-padding layout-align=\"center end\" style=\"height:200px\">\n        <md-checkbox ng-model=\"showDarkTheme\">Use 'Dark' Themed Cards</md-checkbox>\n      </div>\n    </div>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/card/demoBasicUsage/script.js",
    "content": "\nangular.module('cardDemo1', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n  $scope.imagePath = 'img/washedout.png';\n})\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.theme('dark-grey').backgroundPalette('grey').dark();\n  $mdThemingProvider.theme('dark-orange').backgroundPalette('orange').dark();\n  $mdThemingProvider.theme('dark-purple').backgroundPalette('deep-purple').dark();\n  $mdThemingProvider.theme('dark-blue').backgroundPalette('blue').dark();\n});\n"
  },
  {
    "path": "src/components/card/demoBasicUsage/style.css",
    "content": ".card-media {\n  background-color: #999999;\n}"
  },
  {
    "path": "src/components/card/demoCardActionButtons/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-padding\" layout-xs=\"column\" layout=\"row\">\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Action buttons</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n      </md-card>\n      <md-card>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Vertical action buttons</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n        <md-card-actions layout=\"column\" layout-align=\"start\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n      </md-card>\n    </div>\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Icon action buttons</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button class=\"md-icon-button\" aria-label=\"Favorite\">\n            <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n          </md-button>\n          <md-button class=\"md-icon-button\" aria-label=\"Settings\">\n            <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n          </md-button>\n          <md-button class=\"md-icon-button\" aria-label=\"Share\">\n            <md-icon md-svg-icon=\"img/icons/baseline-share-24px.svg\"></md-icon>\n          </md-button>\n        </md-card-actions>\n      </md-card>\n      <md-card>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-actions layout=\"row\" layout-align=\"end center\">\n          <md-button class=\"md-icon-button\" aria-label=\"Favorite\">\n            <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n          </md-button>\n          <md-button class=\"md-icon-button\" aria-label=\"Settings\">\n            <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n          </md-button>\n          <md-button class=\"md-icon-button\" aria-label=\"Share\">\n            <md-icon md-svg-icon=\"img/icons/baseline-share-24px.svg\"></md-icon>\n          </md-button>\n        </md-card-actions>\n      </md-card>\n\n      <md-card>\n        <md-card-header>\n          <md-card-avatar>\n            <img src=\"img/logo.svg\" alt=\"Washed Out\"/>\n          </md-card-avatar>\n          <md-card-header-text>\n            <span class=\"md-title\">AngularJS</span>\n            <span class=\"md-subhead\">Material</span>\n          </md-card-header-text>\n        </md-card-header>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">Card header</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n      </md-card>\n\n    </div>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/card/demoCardActionButtons/script.js",
    "content": "\nangular.module('cardDemo2', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n  $scope.imagePath = 'img/washedout.png';\n});\n"
  },
  {
    "path": "src/components/card/demoInCardActions/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-padding\" layout-xs=\"column\" layout=\"row\">\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">In-card mixed actions</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"start center\">\n          <md-card-icon-actions>\n            <md-button class=\"md-icon-button\" aria-label=\"Favorite\">\n              <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n            </md-button>\n            <md-button class=\"md-icon-button\" aria-label=\"Share\">\n              <md-icon md-svg-icon=\"img/icons/baseline-share-24px.svg\"></md-icon>\n            </md-button>\n          </md-card-icon-actions>\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n      </md-card>\n      <md-card>\n        <md-card-header>\n          <md-card-avatar>\n            <img class=\"md-user-avatar\" src=\"img/100-2.jpeg\" alt=\"Washed Out\"/>\n          </md-card-avatar>\n          <md-card-header-text>\n            <span class=\"md-title\">User</span>\n            <span class=\"md-subhead\">subhead</span>\n          </md-card-header-text>\n        </md-card-header>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">In-card mixed actions</span>\n            <span class=\"md-subhead\">Reversed</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"start center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n          <md-card-icon-actions>\n            <md-button class=\"md-icon-button\" aria-label=\"toggle\">\n              <md-icon md-svg-icon=\"md-toggle-arrow\"></md-icon>\n            </md-button>\n          </md-card-icon-actions>\n        </md-card-actions>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n      </md-card>\n    </div>\n    <div flex-xs flex-gt-xs=\"50\" layout=\"column\">\n      <md-card>\n        <md-card-header>\n          <md-card-avatar>\n            <md-icon class=\"md-avatar-icon\" md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n          </md-card-avatar>\n          <md-card-header-text>\n            <span class=\"md-title\">Title</span>\n            <span class=\"md-subhead\">subhead</span>\n          </md-card-header-text>\n        </md-card-header>\n        <img ng-src=\"{{imagePath}}\" class=\"md-card-image\" alt=\"Washed Out\">\n        <md-card-title>\n          <md-card-title-text>\n            <span class=\"md-headline\">In-card actions</span>\n            <span class=\"md-subhead\">Description</span>\n          </md-card-title-text>\n        </md-card-title>\n        <md-card-actions layout=\"row\" layout-align=\"start center\">\n          <md-button>Action 1</md-button>\n          <md-button>Action 2</md-button>\n        </md-card-actions>\n        <md-card-content>\n          <p>\n            The titles of Washed Out's breakthrough song and the first single from Paracosm share the\n            two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...\n          </p>\n        </md-card-content>\n      </md-card>\n    </div>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/card/demoInCardActions/script.js",
    "content": "\nangular.module('cardDemo3', ['ngMaterial'])\n\n.config(['$mdIconProvider', function($mdIconProvider) {\n  $mdIconProvider.icon('md-toggle-arrow', 'img/icons/toggle-arrow.svg', 48);\n}])\n.controller('AppCtrl', function($scope) {\n  $scope.imagePath = 'img/washedout.png';\n});\n"
  },
  {
    "path": "src/components/checkbox/checkbox-theme.scss",
    "content": "md-checkbox.md-THEME_NAME-theme {\n  .md-ripple {\n    color: '{{accent-A700}}';\n  }\n\n  &.md-checked .md-ripple {\n    color: '{{background-600}}';\n  }\n\n  &.md-checked.md-focused .md-container:before {\n    background-color: '{{accent-color-0.26}}';\n  }\n\n  .md-ink-ripple {\n    color: '{{foreground-2}}';\n  }\n\n  &.md-checked .md-ink-ripple {\n    color: '{{accent-color-0.87}}';\n  }\n\n  &:not(.md-checked) .md-icon {\n    border-color: '{{foreground-2}}';\n  }\n\n  &.md-checked .md-icon {\n    background-color: '{{accent-color-0.87}}';\n  }\n\n  &.md-checked .md-icon:after {\n    border-color: '{{background-default}}';\n  }\n\n  &:not([disabled]) {\n    &.md-primary {\n     @include checkbox-primary;\n    }\n\n    &.md-warn {\n      .md-ripple {\n        color: '{{warn-600}}';\n      }\n\n      .md-ink-ripple {\n        color: '{{foreground-2}}';\n      }\n\n      &.md-checked .md-ink-ripple {\n        color: '{{warn-color-0.87}}';\n      }\n\n      &:not(.md-checked) .md-icon {\n        border-color: '{{foreground-2}}';\n      }\n\n      &.md-checked .md-icon {\n        background-color: '{{warn-color-0.87}}';\n      }\n\n      &.md-checked.md-focused:not([disabled]) .md-container:before {\n        background-color: '{{warn-color-0.26}}';\n      }\n    }\n  }\n\n  &[disabled] {\n    &:not(.md-checked) .md-icon {\n      border-color: '{{foreground-3}}';\n    }\n\n    &.md-checked .md-icon {\n      background-color: '{{foreground-3}}';\n    }\n\n    .md-label {\n      color: '{{foreground-3}}';\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/checkbox/checkbox.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.checkbox\n * @description Checkbox module!\n */\nangular\n  .module('material.components.checkbox', ['material.core'])\n  .directive('mdCheckbox', MdCheckboxDirective);\n\n/**\n * @ngdoc directive\n * @name mdCheckbox\n * @module material.components.checkbox\n * @restrict E\n *\n * @description\n * The checkbox directive is used like the normal\n * [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).\n *\n * As per the [Material Design spec](https://material.io/archive/guidelines/style/color.html#color-color-palette)\n * the checkbox is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {expression} ng-model Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ng-true-value The value to which the expression should be set when selected.\n * @param {expression=} ng-false-value The value to which the expression should be set when not\n *    selected.\n * @param {expression=} ng-change Expression to be executed when the model value changes.\n * @param {boolean=} md-no-ink If present, disable ink ripple effects.\n * @param {string=} aria-label Adds label to checkbox for accessibility.\n *    Defaults to checkbox's text. If no default text is found, a warning will be logged.\n * @param {expression=} md-indeterminate This determines when the checkbox should be rendered as\n *    'indeterminate'. If a truthy expression or no value is passed in the checkbox renders in the\n *    md-indeterminate state. If falsy expression is passed in it just looks like a normal unchecked\n *    checkbox. The indeterminate, checked, and unchecked states are mutually exclusive. A box\n *    cannot be in any two states at the same time. Adding the 'md-indeterminate' attribute\n *    overrides any checked/unchecked rendering logic. When using the 'md-indeterminate' attribute\n *    use 'ng-checked' to define rendering logic instead of using 'ng-model'.\n * @param {expression=} ng-checked If this expression evaluates as truthy, the 'md-checked' css\n *    class is added to the checkbox and it will appear checked.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-checkbox ng-model=\"isChecked\" aria-label=\"Finished?\">\n *   Finished ?\n * </md-checkbox>\n *\n * <md-checkbox md-no-ink ng-model=\"hasInk\" aria-label=\"No Ink Effects\">\n *   No Ink Effects\n * </md-checkbox>\n *\n * <md-checkbox ng-disabled=\"true\" ng-model=\"isDisabled\" aria-label=\"Disabled\">\n *   Disabled\n * </md-checkbox>\n *\n * </hljs>\n *\n */\nfunction MdCheckboxDirective(inputDirective, $mdAria, $mdConstant, $mdTheming, $mdUtil, $mdInteraction) {\n  inputDirective = inputDirective[0];\n\n  return {\n    restrict: 'E',\n    transclude: true,\n    require: ['^?mdInputContainer', '?ngModel', '?^form'],\n    priority: $mdConstant.BEFORE_NG_ARIA,\n    template:\n      '<div class=\"md-container\" md-ink-ripple md-ink-ripple-checkbox>' +\n        '<div class=\"md-icon\"></div>' +\n      '</div>' +\n      '<div ng-transclude class=\"md-label\"></div>',\n    compile: compile\n  };\n\n  // **********************************************************\n  // Private Methods\n  // **********************************************************\n\n  function compile (tElement, tAttrs) {\n    tAttrs.$set('tabindex', tAttrs.tabindex || '0');\n    tAttrs.$set('type', 'checkbox');\n    tAttrs.$set('role', tAttrs.type);\n    tElement.addClass('md-auto-horizontal-margin');\n\n    return  {\n      pre: function(scope, element) {\n        // Attach a click handler during preLink, in order to immediately stop propagation\n        // (especially for ng-click) when the checkbox is disabled.\n        element.on('click', function(e) {\n          if (this.hasAttribute('disabled')) {\n            e.stopImmediatePropagation();\n          }\n        });\n      },\n      post: postLink\n    };\n\n    function postLink(scope, element, attr, ctrls) {\n      var isIndeterminate;\n      var containerCtrl = ctrls[0];\n      var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();\n      var formCtrl = ctrls[2];\n      var labelHasLink = element.find('a').length > 0;\n\n      // The original component structure is not accessible when the checkbox's label contains a link.\n      // In order to keep backwards compatibility, we're only changing the structure of the component\n      // when we detect a link within the label. Using a span after the md-checkbox and attaching it\n      // via aria-labelledby allows screen readers to find and work with the link within the label.\n      if (labelHasLink) {\n        var labelId = 'label-' + $mdUtil.nextUid();\n        attr.$set('aria-labelledby', labelId);\n\n        var label = element.children()[1];\n        // Use jQLite here since ChildNode.remove() is not supported in IE11.\n        angular.element(label).remove();\n        label.removeAttribute('ng-transclude');\n        label.className = 'md-checkbox-link-label';\n        label.setAttribute('id', labelId);\n        element.after(label);\n        // Make sure that clicking on the label still causes the checkbox to be toggled, when appropriate.\n        var externalLabel = element.next();\n        externalLabel.on('click', listener);\n      }\n\n      if (containerCtrl) {\n        var isErrorGetter = containerCtrl.isErrorGetter || function() {\n          return ngModelCtrl.$invalid && (ngModelCtrl.$touched || (formCtrl && formCtrl.$submitted));\n        };\n\n        containerCtrl.input = element;\n\n        scope.$watch(isErrorGetter, containerCtrl.setInvalid);\n      }\n\n      $mdTheming(element);\n\n      // Redirect focus events to the root element, because IE11 is always focusing the container element instead\n      // of the md-checkbox element. This causes issues when using ngModelOptions: `updateOnBlur`\n      element.children().on('focus', function() {\n        element.focus();\n      });\n\n      if ($mdUtil.parseAttributeBoolean(attr.mdIndeterminate)) {\n        setIndeterminateState();\n        scope.$watch(attr.mdIndeterminate, setIndeterminateState);\n      }\n\n      if (attr.ngChecked) {\n        scope.$watch(scope.$eval.bind(scope, attr.ngChecked), function(value) {\n          ngModelCtrl.$setViewValue(value);\n          ngModelCtrl.$render();\n        });\n      }\n\n      $$watchExpr('ngDisabled', 'tabindex', {\n        true: '-1',\n        false: attr.tabindex\n      });\n\n      // Don't emit a warning when the label has a link within it. In that case we'll use\n      // aria-labelledby to point to another span that should be read as the label.\n      if (!labelHasLink) {\n        $mdAria.expectWithText(element, 'aria-label');\n      }\n\n      // Reuse the original input[type=checkbox] directive from AngularJS core.\n      // This is a bit hacky as we need our own event listener and own render\n      // function.\n      inputDirective.link.pre(scope, {\n        on: angular.noop,\n        0: {}\n      }, attr, [ngModelCtrl]);\n\n      element.on('click', listener)\n        .on('keypress', keypressHandler)\n        .on('focus', function() {\n          if ($mdInteraction.getLastInteractionType() === 'keyboard') {\n            element.addClass('md-focused');\n          }\n        })\n        .on('blur', function() {\n          element.removeClass('md-focused');\n        });\n\n      ngModelCtrl.$render = render;\n\n      function $$watchExpr(expr, htmlAttr, valueOpts) {\n        if (attr[expr]) {\n          scope.$watch(attr[expr], function(val) {\n            if (valueOpts[val]) {\n              element.attr(htmlAttr, valueOpts[val]);\n            }\n          });\n        }\n      }\n\n      /**\n       * @param {KeyboardEvent} ev 'keypress' event to handle\n       */\n      function keypressHandler(ev) {\n        var keyCode = ev.which || ev.keyCode;\n        var submit, form;\n\n        ev.preventDefault();\n        switch (keyCode) {\n          case $mdConstant.KEY_CODE.SPACE:\n            element.addClass('md-focused');\n            listener(ev);\n            break;\n          case $mdConstant.KEY_CODE.ENTER:\n            // Match the behavior of the native <input type=\"checkbox\">.\n            // When the enter key is pressed while focusing a native checkbox inside a form,\n            // the browser will trigger a `click` on the first non-disabled submit button/input\n            // in the form. Note that this is different from text inputs, which\n            // will directly submit the form without needing a submit button/input to be present.\n            form = $mdUtil.getClosest(ev.target, 'form');\n            if (form) {\n              submit = form.querySelector('button[type=\"submit\"]:enabled, input[type=\"submit\"]:enabled');\n              if (submit) {\n                submit.click();\n              }\n            }\n            break;\n        }\n      }\n\n      function listener(ev) {\n        // skipToggle boolean is used by the switch directive to prevent the click event\n        // when releasing the drag. There will be always a click if releasing the drag over the checkbox.\n        // If the click came from a link in the checkbox, don't toggle the value.\n        // We want the link to be opened without changing the value in this case.\n        if (element[0].hasAttribute('disabled') || scope.skipToggle || ev.target.tagName === 'A') {\n          return;\n        }\n\n        scope.$apply(function() {\n          // Toggle the checkbox value...\n          var viewValue = attr.ngChecked && attr.ngClick ? attr.checked : !ngModelCtrl.$viewValue;\n\n          ngModelCtrl.$setViewValue(viewValue, ev && ev.type);\n          ngModelCtrl.$render();\n        });\n      }\n\n      function render() {\n        // Cast the $viewValue to a boolean since it could be undefined\n        var checked = !!ngModelCtrl.$viewValue && !isIndeterminate;\n        element.toggleClass('md-checked', checked);\n        if (!isIndeterminate) {\n          if (checked) {\n            element.attr('aria-checked', 'true');\n          } else {\n            element.attr('aria-checked', 'false');\n          }\n        }\n      }\n\n      /**\n       * @param {string=} newValue\n       */\n      function setIndeterminateState(newValue) {\n        isIndeterminate = newValue !== false;\n        if (isIndeterminate) {\n          element.attr('aria-checked', 'mixed');\n        }\n        element.toggleClass('md-indeterminate', isIndeterminate);\n        ngModelCtrl.$render();\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/checkbox/checkbox.scss",
    "content": "//$checkbox-width: 18px !default;\n//$checkbox-height: $checkbox-width !default;\n//$checkbox-border-radius: 2px !default;\n//$checkbox-border-width: 2px !default;\n//\n// ^^ defined in _variables.scss\n//\n$checkbox-text-margin-top: 10px !default;\n$container-checkbox-margin: 3px !default;\n\n$checkbox-min-height: 48px !default;\n$checkbox-min-height-dense: 36px !default;\n$checkbox-text-margin: 36px !default;\n\n$md-inline-alignment: $input-container-vertical-margin + $input-container-padding\n                    + $input-padding-top + $input-padding-bottom + $input-border-width-default\n                    - $checkbox-text-margin-top !default;\n\n.md-inline-form {\n  md-checkbox {\n    margin-top: $md-inline-alignment;\n    margin-bottom: auto;\n  }\n}\n\nmd-checkbox {\n  box-sizing: border-box;\n  display: inline-block;\n  white-space: nowrap;\n  cursor: pointer;\n  outline: none;\n  user-select: none;\n  position: relative;\n  min-width: $checkbox-width;\n  @include dense(min-height, $checkbox-min-height, $checkbox-min-height-dense);\n\n  &.md-focused:not([disabled]) {\n    .md-container:before {\n      left: -8px;\n      top: -8px;\n      right: -8px;\n      bottom: -8px;\n    }\n\n    &:not(.md-checked) {\n      .md-container:before {\n        background-color: rgba(0, 0, 0, 0.12);\n      }\n    }\n  }\n\n  @include checkbox-container;\n\n  .md-container {\n    // Use auto for compatibility with md-checkbox padding\n    top: auto;\n    left: auto;\n    right: auto;\n    margin: $container-checkbox-margin;\n    margin-top: $checkbox-height + $container-checkbox-margin;\n  }\n\n  .md-label {\n    box-sizing: border-box;\n    position: relative;\n    display: inline-block;\n    vertical-align: middle;\n    white-space: normal;\n    user-select: text;\n    margin-top: $checkbox-text-margin-top;\n    margin-bottom: auto;\n\n    @include rtl-prop(margin-left, margin-right, $checkbox-text-margin, 0);\n\n    &:empty {\n      // clamp to checkbox-container margins\n      @include rtl(margin-left, $checkbox-height + ($container-checkbox-margin * 2), 0);\n      @include rtl(margin-right, 0, $checkbox-height + ($container-checkbox-margin * 2));\n    }\n\n  }\n}\nmd-input-container .md-checkbox-link-label {\n  box-sizing: border-box;\n  position: relative;\n  display: inline-block;\n  vertical-align: middle;\n  white-space: normal;\n  user-select: text;\n  cursor: pointer;\n  // The span is actually after the checkbox in the DOM, but we need it to line up, so we move it up\n  // while not introducing any breaking changes to existing styles.\n  top: -21px;\n\n  // In this mode, the checkbox's width needs to be factored in as well.\n  @include rtl(margin-left, $checkbox-text-margin - $checkbox-width, 0);\n  @include rtl(margin-right, 0, $checkbox-text-margin - $checkbox-width);\n}\n"
  },
  {
    "path": "src/components/checkbox/checkbox.spec.js",
    "content": "\ndescribe('mdCheckbox', function() {\n  var CHECKED_CSS = 'md-checked';\n  var INDETERMINATE_CSS = 'md-indeterminate';\n  var $compile, $log, pageScope, $mdConstant, $window;\n\n  beforeEach(module('ngAria', 'material.components.checkbox'));\n\n  beforeEach(inject(function($injector) {\n    $compile = $injector.get('$compile');\n    $log = $injector.get('$log');\n    $mdConstant = $injector.get('$mdConstant');\n    $window = $injector.get('$window');\n\n    var $rootScope = $injector.get('$rootScope');\n    pageScope = $rootScope.$new(false);\n  }));\n\n  function compileAndLink(template, opt_scope) {\n    var element = $compile(template)(opt_scope || pageScope);\n    pageScope.$apply();\n\n    return element;\n  }\n\n  it('should warn developers they need a label', function() {\n    spyOn($log, \"warn\");\n\n    compileAndLink('<md-checkbox ng-model=\"blue\"></md-checkbox>');\n\n    expect($log.warn).toHaveBeenCalled();\n  });\n\n  it('should copy text content to aria-label', function() {\n    var element = compileAndLink(\n        '<div>' +\n          '<md-checkbox ng-model=\"blue\">Some text</md-checkbox>' +\n        '</div>');\n\n    var checkboxElement = element.find('md-checkbox').eq(0);\n    expect(checkboxElement.attr('aria-label')).toBe('Some text');\n  });\n\n  it('should handle text content that contains a link', function() {\n    var element = compileAndLink(\n        '<md-input-container>' +\n          '<md-checkbox ng-model=\"blue\">I agree to the <a href=\"/license\">license</a>.</md-checkbox>' +\n        '</md-input-container>');\n\n    var checkboxElement = element.find('md-checkbox').eq(0);\n    expect(checkboxElement.attr('aria-labelledby')).toContain('label-');\n    var labelElement = element.children()[1];\n    expect(labelElement.getAttribute('id')).toContain('label-');\n    expect(labelElement.innerHTML).toContain('I agree to the ');\n    var linkElement = element.find('A').eq(0);\n    expect(linkElement[0].innerHTML).toBe('license');\n  });\n\n  it('should set checked css class and aria-checked attributes', function() {\n    var element = compileAndLink(\n        '<div>' +\n          '<md-checkbox ng-model=\"blue\"></md-checkbox>' +\n          '<md-checkbox ng-model=\"green\"></md-checkbox>' +\n        '</div>');\n\n    pageScope.$apply(function() {\n      pageScope.blue = false;\n      pageScope.green = true;\n    });\n\n    var checkboxElements = element.find('md-checkbox');\n    var blueCheckbox = checkboxElements.eq(0);\n    var greenCheckbox = checkboxElements.eq(1);\n\n    expect(blueCheckbox.hasClass(CHECKED_CSS)).toEqual(false);\n    expect(greenCheckbox.hasClass(CHECKED_CSS)).toEqual(true);\n\n    expect(blueCheckbox.attr('aria-checked')).toEqual('false');\n    expect(greenCheckbox.attr('aria-checked')).toEqual('true');\n\n    expect(blueCheckbox.attr('role')).toEqual('checkbox');\n  });\n\n  it('should be disabled with ngDisabled attr', function() {\n    var element = compileAndLink(\n        '<div>' +\n          '<md-checkbox ng-disabled=\"isDisabled\" ng-model=\"blue\"></md-checkbox>' +\n        '</div>');\n\n    var checkbox = element.find('md-checkbox');\n\n    pageScope.isDisabled = true;\n    pageScope.blue = false;\n    pageScope.$apply();\n\n    checkbox.triggerHandler('click');\n    expect(pageScope.blue).toBe(false);\n\n    pageScope.isDisabled = false;\n    pageScope.$apply();\n\n    checkbox.triggerHandler('click');\n    expect(pageScope.blue).toBe(true);\n  });\n\n  it('should prevent click handlers from firing when disabled', function() {\n    pageScope.toggle = jasmine.createSpy('toggle');\n\n    var checkbox = compileAndLink(\n        '<md-checkbox disabled ng-click=\"toggle()\">On</md-checkbox>')[0];\n\n    checkbox.click();\n\n    expect(pageScope.toggle).not.toHaveBeenCalled();\n  });\n\n  it('should preserve existing tabindex', function() {\n    var element = compileAndLink(\n        '<md-checkbox ng-model=\"blue\" tabindex=\"2\"></md-checkbox>');\n\n    expect(element.attr('tabindex')).toBe('2');\n  });\n\n  it('should disable with tabindex=\"-1\" ', function() {\n    var checkbox = compileAndLink(\n        '<md-checkbox ng-disabled=\"isDisabled\" ng-model=\"blue\"></md-checkbox>');\n\n    pageScope.isDisabled = true;\n    pageScope.$apply();\n\n    expect(checkbox.attr('tabindex')).toBe('-1');\n\n    pageScope.isDisabled = false;\n    pageScope.$apply();\n    expect(checkbox.attr('tabindex')).toBe('0');\n  });\n\n  it('should not set focus state on mousedown', function() {\n    var checkbox = compileAndLink(\n        '<md-checkbox ng-model=\"blue\"></md-checkbox>');\n\n    checkbox.triggerHandler('mousedown');\n    expect(checkbox[0]).not.toHaveClass('md-focused');\n  });\n\n  it('should apply focus effect with keyboard interaction', function() {\n    var checkbox = compileAndLink('<md-checkbox ng-model=\"blue\"></md-checkbox>');\n    var body = angular.element(document.body);\n\n    // Fake a keyboard interaction for the $mdInteraction service.\n    body.triggerHandler('keydown');\n    checkbox.triggerHandler('focus');\n\n    expect(checkbox[0]).toHaveClass('md-focused');\n\n    checkbox.triggerHandler('blur');\n    expect(checkbox[0]).not.toHaveClass('md-focused');\n  });\n\n  it('should not apply focus effect with mouse interaction', function() {\n    var checkbox = compileAndLink('<md-checkbox ng-model=\"blue\"></md-checkbox>');\n    var body = angular.element(document.body);\n\n    // Fake a mouse interaction for the $mdInteraction service.\n    body.triggerHandler('mouse');\n    checkbox.triggerHandler('focus');\n\n    expect(checkbox[0]).not.toHaveClass('md-focused');\n\n    checkbox.triggerHandler('blur');\n    expect(checkbox[0]).not.toHaveClass('md-focused');\n  });\n\n  it('should redirect focus of container to the checkbox element', function() {\n    var checkbox = compileAndLink('<md-checkbox ng-model=\"blue\"></md-checkbox>');\n\n    document.body.appendChild(checkbox[0]);\n\n    var container = checkbox.children().eq(0);\n    expect(container[0]).toHaveClass('md-container');\n\n    // We simulate IE11's focus bug, which always focuses an unfocusable div\n    // https://connect.microsoft.com/IE/feedback/details/1028411/\n    container[0].tabIndex = -1;\n\n    container.triggerHandler('focus');\n\n    expect(document.activeElement).toBe(checkbox[0]);\n\n    checkbox.remove();\n  });\n\n  it('should set focus state on keyboard interaction after clicking', function() {\n    var checkbox = compileAndLink('<md-checkbox ng-model=\"blue\"></md-checkbox>');\n\n    checkbox.triggerHandler('mousedown');\n    checkbox.triggerHandler({\n      type: 'keypress',\n      keyCode: $mdConstant.KEY_CODE.SPACE\n    });\n    expect(checkbox[0]).toHaveClass('md-focused');\n  });\n\n  describe('ng core checkbox tests', function() {\n\n    function isChecked(checkboxElement) {\n      return checkboxElement.hasClass(CHECKED_CSS);\n    }\n\n    it('should format booleans', function() {\n      var inputElement = compileAndLink('<md-checkbox ng-model=\"name\"></md-checkbox>');\n\n      pageScope.name = false;\n      pageScope.$apply();\n      expect(isChecked(inputElement)).toBe(false);\n\n      pageScope.name = true;\n      pageScope.$apply();\n      expect(isChecked(inputElement)).toBe(true);\n    });\n\n    it('should support type=\"checkbox\" with non-standard capitalization', function() {\n      var inputElm = compileAndLink('<md-checkbox ng-model=\"checkbox\"></md-checkbox>');\n\n      inputElm.triggerHandler('click');\n      expect(pageScope.checkbox).toBe(true);\n\n      inputElm.triggerHandler('click');\n      expect(pageScope.checkbox).toBe(false);\n    });\n\n    it('should allow custom enumeration', function() {\n      var checkbox = compileAndLink(\n          '<md-checkbox ng-model=\"name\" ng-true-value=\"\\'y\\'\" ng-false-value=\"\\'n\\'\">');\n\n      pageScope.name = 'y';\n      pageScope.$apply();\n      expect(isChecked(checkbox)).toBe(true);\n\n      pageScope.name ='n';\n      pageScope.$apply();\n      expect(isChecked(checkbox)).toBe(false);\n\n      pageScope.name = 'something else';\n      pageScope.$apply();\n      expect(isChecked(checkbox)).toBe(false);\n\n      checkbox.triggerHandler('click');\n      expect(pageScope.name).toEqual('y');\n\n      checkbox.triggerHandler('click');\n      expect(pageScope.name).toEqual('n');\n    });\n\n    it('should throw if ngTrueValue is present and not a constant expression', function() {\n      expect(function() {\n        compileAndLink('<md-checkbox ng-model=\"value\" ng-true-value=\"yes\"></md-checkbox>');\n      }).toThrow();\n    });\n\n    it('should throw if ngFalseValue is present and not a constant expression', function() {\n      expect(function() {\n        compileAndLink('<md-checkbox ng-model=\"value\" ng-false-value=\"no\"></md-checkbox>');\n      }).toThrow();\n    });\n\n    it('should not throw if ngTrueValue or ngFalseValue are not present', function() {\n      expect(function() {\n        compileAndLink('<md-checkbox ng-model=\"value\"></md-checkbox>');\n      }).not.toThrow();\n    });\n\n    it('should be required if false', function() {\n      var checkbox = compileAndLink('<md-checkbox ng:model=\"value\" required></md-checkbox>');\n\n      checkbox.triggerHandler('click');\n      expect(isChecked(checkbox)).toBe(true);\n      expect(checkbox.hasClass('ng-valid')).toBe(true);\n\n      checkbox.triggerHandler('click');\n      expect(isChecked(checkbox)).toBe(false);\n      expect(checkbox.hasClass('ng-invalid')).toBe(true);\n    });\n\n    it('properly unsets the md-checked CSS if ng-checked is undefined', function() {\n      var checkbox = compileAndLink('<md-checkbox ng-checked=\"value\"></md-checkbox>');\n\n      expect(checkbox.hasClass(CHECKED_CSS)).toBe(false);\n    });\n\n    it('properly handles click event when ng-checked is set', function() {\n      pageScope.checked = false;\n      var checkbox = compileAndLink('<md-checkbox ng-checked=\"checked\"></md-checkbox>');\n\n      checkbox.triggerHandler('click');\n      expect(isChecked(checkbox)).toBe(true);\n    });\n\n    it('should set the checkbox to checked when focused and SPACE keypress event fired', function () {\n      var checkbox = compileAndLink('<md-checkbox ng-checked=\"value\"></md-checkbox>');\n      checkbox.triggerHandler({\n        type: 'keypress',\n        keyCode: $mdConstant.KEY_CODE.SPACE\n      });\n      expect(isChecked(checkbox)).toBe(true);\n    });\n\n    it('should NOT set the checkbox to checked when focused and ENTER keypress event fired', function () {\n      var checkbox = compileAndLink('<md-checkbox ng-checked=\"value\"></md-checkbox>');\n      checkbox.triggerHandler({\n        type: 'keypress',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n      expect(isChecked(checkbox)).toBe(false);\n    });\n\n    it('should not submit a parent form when ENTER is pressed and there is no submit button/input',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink('<form name=\"form\" ng-submit=\"onSubmit()\">' +\n          '<md-checkbox ng-checked=\"value\"></md-checkbox></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(false);\n        expect(pageScope.form.$submitted).toBe(false);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click an enabled submit button when ENTER is pressed',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\"></md-checkbox>' +\n          '<button type=\"submit\" ng-click=\"onSubmit()\">Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click an enabled submit input when ENTER is pressed',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\"></md-checkbox>' +\n          '<input type=\"submit\" ng-click=\"onSubmit()\" value=\"Submit\"></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should submit a parent form when ENTER is pressed and there is an enabled submit button',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\" ng-submit=\"onSubmit()\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><button type=\"submit\">Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should submit a parent form when ENTER is pressed and there is an enabled submit input',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\" ng-submit=\"onSubmit()\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><input type=\"submit\" value=\"Submit\"></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should not submit a parent form when ENTER is pressed and the submit components are disabled',\n      function() {\n        var submitted = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\"></md-checkbox>' +\n          '<input type=\"submit\" ng-click=\"onSubmit()\" value=\"Submit\" disabled>' +\n          '<button type=\"submit\" ng-click=\"onSubmit()\" disabled>Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(false);\n        expect(pageScope.form.$submitted).toBe(false);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the first enabled submit input when there are multiple',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><input type=\"submit\" value=\"Submit\" ng-click=\"onSubmit()\">' +\n          '<input type=\"submit\" value=\"Second Submit\" ng-click=\"onSubmit2()\"></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(submitted2).toBe(false);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the first enabled submit button when there are multiple',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><button type=\"submit\" ng-click=\"onSubmit()\">Submit</button>' +\n          '<button type=\"submit\" ng-click=\"onSubmit2()\">Second Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(submitted2).toBe(false);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the first submit button when there is a submit input after it',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><button type=\"submit\" ng-click=\"onSubmit()\">Submit</button>' +\n          '<input type=\"submit\" value=\"Second Submit\" ng-click=\"onSubmit2()\"></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(submitted2).toBe(false);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the first submit input when there is a submit button after it',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><input type=\"submit\" value=\"Submit\" ng-click=\"onSubmit()\">' +\n          '<button type=\"submit\" ng-click=\"onSubmit2()\">Second Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(true);\n        expect(submitted2).toBe(false);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the submit button when the first submit input is disabled',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><input type=\"submit\" value=\"Submit\" ng-click=\"onSubmit()\" disabled>' +\n          '<button type=\"submit\" ng-click=\"onSubmit2()\">Second Submit</button></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(false);\n        expect(submitted2).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should click the submit input when the first submit button is disabled',\n      function() {\n        var submitted = false, submitted2 = false;\n        pageScope.onSubmit = function() {\n          submitted = true;\n        };\n        pageScope.onSubmit2 = function() {\n          submitted2 = true;\n        };\n        var form = compileAndLink(\n          '<form name=\"form\"><md-checkbox ng-checked=\"value\">' +\n          '</md-checkbox><button type=\"submit\" ng-click=\"onSubmit()\" disabled>Submit</button>' +\n          '<input type=\"submit\" value=\"Second Submit\" ng-click=\"onSubmit2()\"></form>');\n\n        // We need to add the form to the DOM in order for `submit` events to be properly fired.\n        var node = $window.document.body.appendChild(form[0]);\n        angular.element(form[0].getElementsByTagName('md-checkbox')[0]).triggerHandler({\n          type: 'keypress',\n          keyCode: $mdConstant.KEY_CODE.ENTER\n        });\n        pageScope.$apply();\n        expect(submitted).toBe(false);\n        expect(submitted2).toBe(true);\n        expect(pageScope.form.$submitted).toBe(true);\n        $window.document.body.removeChild(node);\n      });\n\n    it('should mark the checkbox as selected on load with ng-checked', function() {\n      pageScope.isChecked = function() { return true; };\n\n      var checkbox = compileAndLink('<md-checkbox ng-model=\"checked\" ng-checked=\"isChecked()\"></md-checkbox>');\n\n      expect(checkbox).toHaveClass(CHECKED_CSS);\n    });\n\n    describe('with the md-indeterminate attribute', function() {\n\n      it('should set md-indeterminate attr to true by default', function() {\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate></md-checkbox>');\n\n        expect(checkbox).toHaveClass(INDETERMINATE_CSS);\n      });\n\n      it('should be set \"md-indeterminate\" class according to a passed in function', function() {\n        pageScope.isIndeterminate = function() { return true; };\n\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate=\"isIndeterminate()\"></md-checkbox>');\n\n        expect(checkbox).toHaveClass(INDETERMINATE_CSS);\n      });\n\n      it('should set aria-checked attr to \"mixed\"', function() {\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate></md-checkbox>');\n\n        expect(checkbox.attr('aria-checked')).toEqual('mixed');\n      });\n\n      it('should never have both the \"md-indeterminate\" and \"md-checked\" classes at the same time', function() {\n        pageScope.isChecked = function() { return true; };\n\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate ng-checked=\"isChecked()\"></md-checkbox>');\n\n        expect(checkbox).toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox).not.toHaveClass(CHECKED_CSS);\n      });\n\n      it('should change from the indeterminate to checked state correctly', function() {\n        var checked = false;\n        pageScope.isChecked = function() { return checked; };\n        pageScope.isIndeterminate = function() { return !checked; };\n\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate=\"isIndeterminate()\" ng-checked=\"isChecked()\"></md-checkbox>');\n\n        expect(checkbox).toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox).not.toHaveClass(CHECKED_CSS);\n        expect(checkbox.attr('aria-checked')).toEqual('mixed');\n\n        checked = true;\n        pageScope.$apply();\n\n        expect(checkbox).not.toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox).toHaveClass(CHECKED_CSS);\n        expect(checkbox.attr('aria-checked')).toEqual('true');\n      });\n\n      it('should change from the indeterminate to unchecked state correctly', function() {\n        var checked = true;\n        pageScope.isChecked = function() { return checked; };\n        pageScope.isIndeterminate = function() { return checked; };\n\n        var checkbox = compileAndLink('<md-checkbox md-indeterminate=\"isIndeterminate()\" ng-checked=\"isChecked()\"></md-checkbox>');\n\n        expect(checkbox).toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox).not.toHaveClass(CHECKED_CSS);\n        expect(checkbox.attr('aria-checked')).toEqual('mixed');\n\n        checked = false;\n        pageScope.$apply();\n\n        expect(checkbox).not.toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox).not.toHaveClass(CHECKED_CSS);\n        expect(checkbox.attr('aria-checked')).toEqual('false');\n      });\n\n      it('should mark the checkbox as selected, if the model is true and \"md-indeterminate\" is false', function() {\n        pageScope.checked = true;\n        var checkbox = compileAndLink('<md-checkbox ng-model=\"checked\" md-indeterminate=\"false\"></md-checkbox>');\n\n        expect(checkbox).toHaveClass(CHECKED_CSS);\n        expect(checkbox).not.toHaveClass(INDETERMINATE_CSS);\n        expect(checkbox.attr('aria-checked')).toEqual('true');\n      });\n\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/checkbox/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" class=\"md-padding\" ng-cloak>\n  <div>\n    <fieldset class=\"standard\">\n      <legend>Using &lt;ng-model&gt;</legend>\n      <div layout-wrap layout-gt-sm=\"row\">\n        <div flex-gt-sm=\"50\">\n          <md-checkbox ng-model=\"data.cb1\" aria-label=\"Checkbox 1\">\n            Checkbox 1: {{ data.cb1 }}\n          </md-checkbox>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <div>\n            <md-checkbox\n              ng-model=\"data.cb2\"\n              aria-label=\"Checkbox 2\"\n              ng-true-value=\"'yup'\"\n              ng-false-value=\"'nope'\"\n              class=\"md-warn md-align-top-left\" flex>\n            Checkbox 2 (md-warn)  <br/>\n            <span class=\"ipsum\">\n              Duis placerat lectus et justo mollis, nec sodales orci congue. Vestibulum semper non urna ac suscipit.\n              Vestibulum tempor, ligula id laoreet hendrerit, massa augue iaculis magna,\n              sit amet dapibus tortor ligula non nibh.\n            </span>\n            <br/>\n            {{ data.cb2 }}\n          </md-checkbox>\n          </div>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <md-checkbox ng-disabled=\"true\" aria-label=\"Disabled checkbox\" ng-model=\"data.cb3\">\n            Checkbox: Disabled\n          </md-checkbox>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <md-checkbox ng-disabled=\"true\" aria-label=\"Disabled checked checkbox\" ng-model=\"data.cb4\" ng-init=\"data.cb4=true\">\n            Checkbox: Disabled, Checked\n          </md-checkbox>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <md-checkbox md-no-ink aria-label=\"Checkbox No Ink\" ng-model=\"data.cb5\" class=\"md-primary\">\n            Checkbox (md-primary): No Ink\n          </md-checkbox>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <md-checkbox md-indeterminate\n              aria-label=\"Checkbox Indeterminate\" class=\"md-primary\">\n            Checkbox: Indeterminate\n          </md-checkbox>\n        </div>\n        <div flex-gt-sm=\"50\">\n          <md-checkbox md-indeterminate aria-label=\"Checkbox Disabled Indeterminate\"\n              ng-disabled=\"true\" class=\"md-primary\">\n            Checkbox: Disabled, Indeterminate\n          </md-checkbox>\n        </div>\n      </div>\n    </fieldset>\n  </div>\n  <br/>\n  <div layout='row'>\n    <fieldset class=\"standard\">\n      <legend>Default Spacing</legend>\n      <div>\n        <md-checkbox ng-model=\"data.cb1\" aria-label=\"Checkbox 1\">\n          Checkbox 1: {{ data.cb1 }}\n        </md-checkbox>\n        <div>\n          <md-checkbox\n            ng-model=\"data.cb2\"\n            aria-label=\"Checkbox 2\"\n            ng-true-value=\"'yup'\"\n            ng-false-value=\"'nope'\"\n            class=\"md-warn md-align-top-left\" flex>\n            Checkbox 2 (md-warn)  <br/>\n            <span class=\"ipsum\">\n              Duis placerat lectus et justo mollis, nec sodales orci congue. Vestibulum semper non urna ac suscipit.\n              Vestibulum tempor, ligula id laoreet hendrerit, massa augue iaculis magna,\n              sit amet dapibus tortor ligula non nibh.\n            </span>\n            <br/>\n            {{ data.cb2 }}\n          </md-checkbox>\n        </div>\n          <md-checkbox ng-disabled=\"true\" aria-label=\"Disabled checkbox\" ng-model=\"data.cb3\">\n            Checkbox: Disabled\n          </md-checkbox>\n      </div>\n    </fieldset>\n    <fieldset class=\"standard md-dense\">\n      <legend>Dense Spacing with \"md-dense\"</legend>\n      <div>\n        <md-checkbox ng-model=\"data.cb1\" aria-label=\"Checkbox 1\">\n          Checkbox 1: {{ data.cb1 }}\n        </md-checkbox>\n        <div>\n          <md-checkbox\n            ng-model=\"data.cb2\"\n            aria-label=\"Checkbox 2\"\n            ng-true-value=\"'yup'\"\n            ng-false-value=\"'nope'\"\n            class=\"md-warn md-align-top-left\" flex>\n            Checkbox 2 (md-warn)  <br/>\n            <span class=\"ipsum\">\n              Duis placerat lectus et justo mollis, nec sodales orci congue. Vestibulum semper non urna ac suscipit.\n              Vestibulum tempor, ligula id laoreet hendrerit, massa augue iaculis magna,\n              sit amet dapibus tortor ligula non nibh.\n            </span>\n            <br/>\n            {{ data.cb2 }}\n          </md-checkbox>\n        </div>\n          <md-checkbox ng-disabled=\"true\" aria-label=\"Disabled checkbox\" ng-model=\"data.cb3\">\n            Checkbox: Disabled\n          </md-checkbox>\n      </div>\n    </fieldset>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/checkbox/demoBasicUsage/script.js",
    "content": "\nangular.module('checkboxDemo1', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n\n  $scope.data = {};\n  $scope.data.cb1 = true;\n  $scope.data.cb2 = false;\n  $scope.data.cb3 = false;\n  $scope.data.cb4 = false;\n  $scope.data.cb5 = false;\n\n});\n"
  },
  {
    "path": "src/components/checkbox/demoBasicUsage/style.css",
    "content": "div.flex-xs {\n  min-height:40px;\n}\n.checkboxDemo1 div {\n  clear: both;\n}\np {\n  padding-left: 8px;\n}\nfieldset.standard {\n  border-style: solid;\n  border-width: 1px;\n}\nlegend {\n  color: #3F51B5;\n}\n.ipsum {\n  color: saddlebrown;\n}\n"
  },
  {
    "path": "src/components/checkbox/demoLabels/index.html",
    "content": "<div ng-controller=\"AppCtrl\" class=\"md-padding\" ng-cloak>\n  <div>\n    <fieldset class=\"standard\">\n      <legend>Using Different Layouts and Labels</legend>\n      <div layout=\"column\">\n        <div class=\"md-dense\" layout=\"column\">\n          <md-checkbox ng-model=\"data.cb1\">\n            Default Checkbox and Label\n          </md-checkbox>\n          <md-checkbox ng-model=\"data.cb2\">\n            Dynamic Label: {{data.cb2 ? 'Checked' : 'Unchecked'}}\n          </md-checkbox>\n        </div>\n        <div layout=\"row\" layout-align=\"start center\" class=\"md-dense\">\n          <!-- Extra work is needed by the developer to make this work, including a11y. -->\n          <label for=\"label-in-front\" ng-click=\"data.cb3 = !data.cb3\"\n                 aria-hidden=\"true\" tabindex=\"-1\">\n            Label in Front\n          </label>\n          <md-checkbox ng-model=\"data.cb3\" id=\"label-in-front\"\n                       aria-label=\"Label in Front\">\n          </md-checkbox>\n        </div>\n        <md-input-container>\n          <md-checkbox ng-model=\"data.cb4\">\n            Checkbox in an md-input-container\n          </md-checkbox>\n        </md-input-container>\n        <md-subheader>Checkbox with an accessible link in the label</md-subheader>\n        <md-input-container>\n          <md-checkbox ng-model=\"data.cb5\">\n            I agree to the <a href=\"/license\">license</a>.\n          </md-checkbox>\n        </md-input-container>\n      </div>\n    </fieldset>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/checkbox/demoLabels/script.js",
    "content": "angular.module('checkboxDemo1', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n  $scope.data = {};\n  $scope.data.cb1 = true;\n  $scope.data.cb2 = true;\n  $scope.data.cb3 = false;\n  $scope.data.cb4 = false;\n  $scope.data.cb5 = false;\n});\n"
  },
  {
    "path": "src/components/checkbox/demoLabels/style.css",
    "content": "fieldset.standard {\n  border: 1px solid;\n}\nlegend {\n  color: #3F51B5;\n}\nlabel {\n  cursor: pointer;\n  margin-right: 10px;\n  user-select: none;\n  height: 16px;\n}\n"
  },
  {
    "path": "src/components/checkbox/demoSelectAll/index.html",
    "content": "<div ng-controller=\"AppCtrl\" class=\"md-padding\">\n  <!--\n    In IE, we cannot apply flex directly to <fieldset>\n    @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\n  -->\n  <fieldset>\n    <legend>Using &lt;md-checkbox&gt; with the 'indeterminate' attribute</legend>\n      <md-checkbox aria-label=\"Select All\"\n                   ng-checked=\"isChecked()\"\n                   md-indeterminate=\"isIndeterminate()\"\n                   ng-click=\"toggleAll()\">\n        <span ng-if=\"isChecked()\">Un-</span>Select All\n      </md-checkbox>\n      <div class=\"demo-select-all-checkboxes\" ng-repeat=\"item in items\">\n        <md-checkbox ng-checked=\"exists(item, selected)\" ng-click=\"toggle(item, selected)\">\n          {{ item }}\n        </md-checkbox>\n      </div>\n  </fieldset>\n</div>\n"
  },
  {
    "path": "src/components/checkbox/demoSelectAll/script.js",
    "content": "\nangular.module('checkboxDemo3', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n  $scope.items = [1,2,3,4,5];\n  $scope.selected = [1];\n  $scope.toggle = function (item, list) {\n    var idx = list.indexOf(item);\n    if (idx > -1) {\n      list.splice(idx, 1);\n    }\n    else {\n      list.push(item);\n    }\n  };\n\n  $scope.exists = function (item, list) {\n    return list.indexOf(item) > -1;\n  };\n\n  $scope.isIndeterminate = function() {\n    return ($scope.selected.length !== 0 &&\n        $scope.selected.length !== $scope.items.length);\n  };\n\n  $scope.isChecked = function() {\n    return $scope.selected.length === $scope.items.length;\n  };\n\n  $scope.toggleAll = function() {\n    if ($scope.selected.length === $scope.items.length) {\n      $scope.selected = [];\n    } else if ($scope.selected.length === 0 || $scope.selected.length > 0) {\n      $scope.selected = $scope.items.slice(0);\n    }\n  };\n});\n"
  },
  {
    "path": "src/components/checkbox/demoSelectAll/style.css",
    "content": "legend {\n  color: #3F51B5;\n}\nfieldset {\n  border-style: solid;\n  border-width: 1px;\n}\n.demo-select-all-checkboxes {\n  padding-left: 30px;\n}\n"
  },
  {
    "path": "src/components/checkbox/demoSyncing/index.html",
    "content": "<div ng-controller=\"AppCtrl\" class=\"md-padding\" ng-cloak style=\"min-height:270px\">\n  <div layout=\"row\" layout-wrap>\n    <div flex=\"100\" flex-gt-sm=\"50\" layout=\"column\">\n      <!--\n        In IE, we cannot apply flex directly to <fieldset>\n        @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\n      -->\n      <fieldset class=\"standard\">\n        <legend>Using &lt;md-checkbox&gt; with &lt;ng-checked&gt;</legend>\n        <div layout=\"row\" layout-wrap flex>\n          <div flex=\"50\" ng-repeat=\"item in items\">\n            <md-checkbox ng-checked=\"exists(item, selected)\" ng-click=\"toggle(item, selected)\">\n              {{ item }} <span ng-if=\"exists(item, selected)\">selected</span>\n            </md-checkbox>\n          </div>\n        </div>\n      </fieldset>\n    </div>\n\n    <div flex=\"100\" flex-gt-sm=\"50\" layout=\"column\">\n      <fieldset class=\"standard\">\n        <legend>Using &lt;input type=\"checkbox\"&gt;</legend>\n        <div layout=\"row\" layout-wrap flex>\n          <div ng-repeat=\"item in items\" class=\"standard\" flex=\"50\">\n            <label>\n              <input type=\"checkbox\" ng-checked=\"exists(item, selected)\"\n                     ng-click=\"toggle(item, selected)\"/>\n              {{ item }}\n            </label>\n          </div>\n        </div>\n      </fieldset>\n    </div>\n\n    <div flex=\"100\">\n      <h2 class=\"md-title\">Selected Items</h2>\n      <code style=\"display: block; padding: 8px;\">{{selected | json}}</code>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/checkbox/demoSyncing/script.js",
    "content": "\nangular.module('checkboxDemo2', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n\n    $scope.items = [1,2,3,4,5];\n      $scope.selected = [];\n\n      $scope.toggle = function (item, list) {\n        var idx = list.indexOf(item);\n        if (idx > -1) {\n          list.splice(idx, 1);\n        }\n        else {\n          list.push(item);\n        }\n      };\n\n      $scope.exists = function (item, list) {\n        return list.indexOf(item) > -1;\n      };\n});\n"
  },
  {
    "path": "src/components/checkbox/demoSyncing/style.css",
    "content": ".checkboxDemo1 div {\n  clear: both;\n}\nlegend {\n  color: #3F51B5;\n}\np {\n  padding-left: 8px;\n}\n.info {\n  padding-left: 13px;\n}\ndiv.standard {\n  padding: 8px 8px 8px 15px;\n}\nfieldset.standard {\n  border-style: solid;\n  border-width: 1px;\n}\n"
  },
  {
    "path": "src/components/chips/chips-theme.scss",
    "content": "md-chips.md-THEME_NAME-theme {\n\n  .md-chips {\n    box-shadow: 0 1px '{{foreground-4}}';\n\n    &.md-focused {\n      box-shadow: 0 2px '{{primary-color}}';\n    }\n\n    .md-chip-input-container {\n      input {\n        @include input-placeholder-color('\\'{{foreground-3}}\\'');\n        color: '{{foreground-1}}';\n      }\n    }\n  }\n\n  md-chip {\n    background: '{{background-300}}';\n    color: '{{background-800}}';\n\n    md-icon {\n      color: '{{background-700}}';\n    }\n\n    &.md-focused {\n      background: '{{primary-color}}';\n      color: '{{primary-contrast}}';\n\n      md-icon {\n        color: '{{primary-contrast}}';\n      }\n    }\n\n    &._md-chip-editing {\n      background: transparent;\n      color: '{{background-800}}';\n    }\n  }\n  .md-chip-remove-container {\n    button {\n      &md-chip-remove,\n      &.md-chip-remove {\n        md-icon {\n          color: '{{foreground-2}}';\n          fill: '{{foreground-2}}';\n        }\n      }\n    }\n  }\n}\n\n.md-contact-suggestion {\n  span.md-contact-email {\n    color: '{{background-400}}';\n  }\n}\n"
  },
  {
    "path": "src/components/chips/chips.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.chips\n */\n/*\n * @see js folder for chips implementation\n */\nangular.module('material.components.chips', [\n  'material.core',\n  'material.components.autocomplete'\n]);\n"
  },
  {
    "path": "src/components/chips/chips.scss",
    "content": "$chip-font-size: rem(1.3) !default;\n$chip-height: rem(3.2) !default;\n$chip-padding: 0 rem(1.2) 0 rem(1.2) !default;\n$chip-input-padding: 0 !default;\n$chip-remove-padding-right: rem(2.8) !default;\n$chip-remove-line-height: rem(2.2) !default;\n$chip-margin: rem(0.8) rem(0.8) 0 0 !default;\n$chip-wrap-padding: 0 0 rem(0.8) rem(0.3) !default;\n$chip-delete-icon-size: rem(1.8) !default;\n$contact-chip-padding: 0 rem(2.5) 0 0 !default;\n$contact-chip-suggestion-image-height: rem(4.0) !default;\n$contact-chip-suggestion-margin: rem(0.8) !default;\n$contact-chip-name-width: rem(12) !default;\n\n.md-contact-chips {\n  .md-chips {\n    md-chip {\n      @include rtl(padding, $contact-chip-padding, rtl-value($contact-chip-padding));\n      .md-contact-avatar {\n        @include rtl(float, left, right);\n        img {\n          height: $chip-height;\n          border-radius: $chip-height * 0.5;\n        }\n      }\n      .md-contact-name {\n        display: inline-block;\n        height: $chip-height;\n        @include rtl-prop(margin-left, margin-right, rem(0.8), auto);\n      }\n    }\n  }\n}\n.md-contact-suggestion {\n  height: ($contact-chip-suggestion-margin * 2) + $contact-chip-suggestion-image-height;\n  img {\n    height: $contact-chip-suggestion-image-height;\n    border-radius: $contact-chip-suggestion-image-height * 0.5;\n    margin-top: $contact-chip-suggestion-margin;\n  }\n  .md-contact-name {\n    @include rtl-prop(margin-left, margin-right, $contact-chip-suggestion-margin, auto);\n    width: $contact-chip-name-width;\n  }\n  .md-contact-name, .md-contact-email {\n    display: inline-block;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n}\n.md-contact-chips-suggestions li {\n  height: 100%;\n}\nmd-chips {\n  display: flex;\n}\n.md-chips {\n  @include pie-clearfix();\n\n  display: flex;\n  flex-wrap: wrap;\n  flex-grow: 1;\n  font-family: $font-family;\n  font-size: $chip-font-size;\n  @include rtl(padding, $chip-wrap-padding, rtl-value($chip-wrap-padding));\n  vertical-align: middle;\n\n  &.md-readonly .md-chip-input-container {\n    min-height: $chip-height;\n  }\n\n  &:not(.md-readonly) {\n    cursor: text;\n  }\n\n  &.md-removable {\n\n    md-chip {\n      @include rtl-prop(padding-right, padding-left, $chip-remove-padding-right, 0);\n\n      .md-chip-content {\n        @include rtl-prop(padding-right, padding-left, rem(0.4), 0);\n      }\n    }\n\n  }\n\n  md-chip {\n    cursor: default;\n    border-radius: $chip-height * 0.5;\n    display: block;\n    height: $chip-height;\n    line-height: $chip-height;\n    @include rtl(margin, $chip-margin, rtl-value($chip-margin));\n    padding: $chip-padding;\n    @include rtl(float, left, right);\n    box-sizing: border-box;\n    max-width: 100%;\n    position: relative;\n\n    .md-chip-content {\n      display: block;\n      @include rtl(float, left, right);\n      white-space: nowrap;\n      max-width: 100%;\n      overflow: hidden;\n      text-overflow: ellipsis;\n      &:focus {\n        outline: none;\n      }\n    }\n    &._md-chip-content-edit-is-enabled {\n      -webkit-user-select: none; /* webkit (safari, chrome) browsers */\n      -moz-user-select: none; /* mozilla browsers */\n      -khtml-user-select: none; /* webkit (konqueror) browsers */\n      -ms-user-select: none; /* IE10+ */\n    }\n    .md-chip-remove-container {\n      position: absolute;\n      @include rtl-prop(right, left, 0, auto);\n      line-height: $chip-remove-line-height;\n    }\n    .md-chip-remove {\n      text-align: center;\n      width: $chip-height;\n      height: $chip-height;\n      min-width: 0;\n      padding: 0;\n      background: transparent;\n      border: none;\n      box-shadow: none;\n      margin: 0;\n      position: relative;\n      md-icon {\n        height: $chip-delete-icon-size;\n        width: $chip-delete-icon-size;\n        min-height: $chip-delete-icon-size;\n        min-width: $chip-delete-icon-size;\n        position: absolute;\n        top: 50%;\n        left: 50%;\n        transform: translate3d(-50%, -50%, 0);\n      }\n    }\n  }\n  .md-chip-input-container {\n    display: block;\n    line-height: $chip-height;\n    @include rtl(margin, $chip-margin, rtl-value($chip-margin));\n    padding: $chip-input-padding;\n    flex-grow: 1;\n    @include rtl(float, left, right);\n    input {\n      width: 100%;\n\n      &:not([type]),\n      &[type=\"email\"],\n      &[type=\"number\"],\n      &[type=\"tel\"],\n      &[type=\"url\"],\n      &[type=\"text\"] {\n        border: 0;\n        height: $chip-height;\n        line-height: $chip-height;\n        padding: 0;\n        &:focus {\n          outline: none;\n        }\n      }\n    }\n    md-autocomplete, md-autocomplete-wrap {\n      background: transparent;\n      height: $chip-height;\n    }\n    md-autocomplete {\n      md-autocomplete-wrap {\n        box-shadow: none;\n      }\n      input {\n        position: relative;\n      }\n    }\n    input {\n      border:0;\n      height: $chip-height;\n      line-height: $chip-height;\n      padding: 0;\n      &:focus {\n        outline:none;\n      }\n    }\n    md-autocomplete, md-autocomplete-wrap {\n      height: $chip-height;\n    }\n    md-autocomplete {\n      box-shadow: none;\n      input {\n        position: relative;\n      }\n    }\n    &:not(:first-child) {\n      @include rtl(margin, $chip-margin, rtl-value($chip-margin));\n    }\n    input {\n      background:transparent;\n      border-width: 0;\n    }\n  }\n  md-autocomplete {\n    button {\n      display: none;\n    }\n  }\n}\n// IE only\n@media screen and (-ms-high-contrast: active) {\n  .md-chip-input-container,\n  md-chip {\n    border: 1px solid #fff;\n  }\n  .md-chip-input-container md-autocomplete {\n    border: none;\n  }\n}\n\n"
  },
  {
    "path": "src/components/chips/chips.spec.js",
    "content": "describe('<md-chips>', function() {\n  var attachedElements = [];\n  var scope, $exceptionHandler, $timeout;\n\n  var BASIC_CHIP_TEMPLATE =\n    '<md-chips ng-model=\"items\"></md-chips>';\n  var CHIP_TRANSFORM_TEMPLATE =\n    '<md-chips ng-model=\"items\" md-transform-chip=\"transformChip($chip)\"></md-chips>';\n  var CHIP_ADD_TEMPLATE =\n    '<md-chips ng-model=\"items\" md-on-add=\"addChip($chip, $index)\"></md-chips>';\n  var CHIP_REMOVE_TEMPLATE =\n    '<md-chips ng-model=\"items\" md-on-remove=\"removeChip($chip, $index, $event)\"></md-chips>';\n  var CHIP_SELECT_TEMPLATE =\n    '<md-chips ng-model=\"items\" md-on-select=\"selectChip($chip)\"></md-chips>';\n  var CHIP_NG_CHANGE_TEMPLATE =\n    '<md-chips ng-model=\"items\" ng-change=\"onModelChange(items)\"></md-chips>';\n  var CHIP_READONLY_TEMPLATE =\n    '<md-chips ng-model=\"items\" readonly=\"isReadonly\"></md-chips>';\n  var CHIP_READONLY_AUTOCOMPLETE_TEMPLATE =\n    '<md-chips ng-model=\"items\" readonly=\"true\">' +\n    '  <md-autocomplete md-items=\"item in [\\'hi\\', \\'ho\\', \\'he\\']\"></md-autocomplete>' +\n    '</md-chips>';\n  var CHIP_NOT_REMOVABLE_TEMPLATE =\n    '<md-chips ng-model=\"items\" readonly=\"true\" md-removable=\"false\"></md-chips>';\n  var CHIP_APPEND_DELAY_TEMPLATE =\n        '<md-chips ng-model=\"items\" md-chip-append-delay=\"800\"></md-chips>';\n\n  afterEach(function() {\n    attachedElements.forEach(function(element) {\n      var scope = element.scope();\n\n      scope && scope.$destroy();\n      element.remove();\n    });\n    attachedElements = [];\n  });\n\n\n  describe('with no overrides', function() {\n    beforeEach(module('material.components.chips', 'material.components.autocomplete'));\n    beforeEach(inject(function($rootScope, _$exceptionHandler_, _$timeout_) {\n      scope = $rootScope.$new(false);\n      scope.items = ['Apple', 'Banana', 'Orange'];\n      $exceptionHandler = _$exceptionHandler_;\n      $timeout = _$timeout_;\n    }));\n\n    describe('basic functionality', function() {\n\n      it('should render a default input element', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        var input = element.find('input');\n        expect(input.length).toBe(1);\n      });\n\n      it('should render a list of chips', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n\n        var chips = getChipElements(element);\n        expect(chips.length).toBe(3);\n        expect(chips[0].innerHTML).toContain('Apple');\n        expect(chips[1].innerHTML).toContain('Banana');\n        expect(chips[2].innerHTML).toContain('Orange');\n      });\n\n      it('should render a user-provided chip template', function() {\n        var template =\n          '<md-chips ng-model=\"items\">' +\n          '  <md-chip-template><div class=\"mychiptemplate\">{$chip}</div></md-chip-template>' +\n          '</md-chips>';\n        var element = buildChips(template);\n        var chip = element.find('md-chip');\n        expect(chip[0].querySelector('div.mychiptemplate')).not.toBeNull();\n      });\n\n      it('should add a chip', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Grape';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.items.length).toBe(4);\n\n        var chips = getChipElements(element);\n        expect(chips.length).toBe(4);\n        expect(chips[0].innerHTML).toContain('Apple');\n        expect(chips[1].innerHTML).toContain('Banana');\n        expect(chips[2].innerHTML).toContain('Orange');\n\n        expect(chips[3].innerHTML).toContain('Grape');\n      });\n\n      it('should not add a blank chip', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = '';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.items.length).toBe(3);\n      });\n\n      it('should remove a chip', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        element.scope().$apply(function() {\n          // Remove \"Banana\"\n          ctrl.removeChip(1);\n        });\n\n        var chips = getChipElements(element);\n        expect(chips.length).toBe(2);\n        expect(chips[0].innerHTML).toContain('Apple');\n        expect(chips[1].innerHTML).toContain('Orange');\n      });\n\n      it('should call the transform method when adding a chip', function() {\n        var element = buildChips(CHIP_TRANSFORM_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        var doubleText = function(text) {\n          return \"\" + text + text;\n        };\n        scope.transformChip = jasmine.createSpy('transformChip').and.callFake(doubleText);\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Grape';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.transformChip).toHaveBeenCalled();\n        expect(scope.transformChip.calls.mostRecent().args[0]).toBe('Grape');\n        expect(scope.items.length).toBe(4);\n        expect(scope.items[3]).toBe('GrapeGrape');\n      });\n\n      it('should not add the chip if md-transform-chip returns null', function() {\n        var element = buildChips(CHIP_TRANSFORM_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        var nullChip = function(text) {\n          return null;\n        };\n        scope.transformChip = jasmine.createSpy('transformChip').and.callFake(nullChip);\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Grape';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.transformChip).toHaveBeenCalled();\n        expect(scope.transformChip.calls.mostRecent().args[0]).toBe('Grape');\n        expect(scope.items.length).toBe(3);\n      });\n\n      it('should call the add method when adding a chip', function() {\n        var element = buildChips(CHIP_ADD_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        scope.addChip = jasmine.createSpy('addChip');\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Grape';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.addChip).toHaveBeenCalled();\n        expect(scope.addChip.calls.mostRecent().args[0]).toBe('Grape'); // Chip\n        expect(scope.addChip.calls.mostRecent().args[1]).toBe(3);       // Index\n      });\n\n      it('should update the view if the add method changes or removes the chip', function() {\n        var element = buildChips(CHIP_ADD_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        scope.addChip = function ($chip, $index) {\n          if ($chip === 'Grape') {\n            var grape = scope.items.pop();\n            grape += '[' + $index + ']';\n            scope.items.push(grape);\n          }\n          if ($chip === 'Broccoli') {\n            scope.items.pop();\n          }\n        };\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Broccoli';\n          simulateInputEnterKey(ctrl);\n          ctrl.chipBuffer = 'Grape';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(scope.items[3]).toBe('Grape[3]');\n      });\n\n      it('should call the remove method when removing a chip', function() {\n        var element = buildChips(CHIP_REMOVE_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        scope.removeChip = jasmine.createSpy('removeChip');\n\n        element.scope().$apply(function() {\n          ctrl.items = ['Grape'];\n          ctrl.removeChip(0);\n        });\n\n        expect(scope.removeChip).toHaveBeenCalled();\n        expect(scope.removeChip.calls.mostRecent().args[0]).toBe('Grape'); // Chip\n        expect(scope.removeChip.calls.mostRecent().args[1]).toBe(0);       // Index\n      });\n\n      it('should make the event available when removing a chip', function() {\n        var element = buildChips(CHIP_REMOVE_TEMPLATE);\n        var chips = getChipElements(element);\n\n        scope.removeChip = jasmine.createSpy('removeChip');\n        var chipButton = angular.element(chips[1]).find('button');\n        chipButton[0].click();\n\n        expect(scope.removeChip).toHaveBeenCalled();\n        expect(scope.removeChip.calls.mostRecent().args[2].type).toBe('click');\n      });\n\n      it('should trigger ng-change on chip addition/removal', function() {\n        var element = buildChips(CHIP_NG_CHANGE_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        scope.onModelChange = jasmine.createSpy('onModelChange');\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Melon';\n          simulateInputEnterKey(ctrl);\n        });\n        expect(scope.onModelChange).toHaveBeenCalled();\n        expect(scope.onModelChange.calls.count()).toBe(1);\n        expect(scope.onModelChange.calls.mostRecent().args[0].length).toBe(4);\n\n        element.scope().$apply(function() {\n          ctrl.removeChip(0);\n        });\n        expect(scope.onModelChange).toHaveBeenCalled();\n        expect(scope.onModelChange.calls.count()).toBe(2);\n        expect(scope.onModelChange.calls.mostRecent().args[0].length).toBe(3);\n      });\n\n      it('should call the select method when selecting a chip', function() {\n        var element = buildChips(CHIP_SELECT_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        scope.selectChip = jasmine.createSpy('selectChip');\n\n        element.scope().$apply(function() {\n          ctrl.items = ['Grape'];\n          ctrl.selectChip(0);\n        });\n\n        expect(scope.selectChip).toHaveBeenCalled();\n        expect(scope.selectChip.calls.mostRecent().args[0]).toBe('Grape');\n      });\n\n      describe('when adding chips on blur', function() {\n\n        it('should append a new chip for the remaining text', function() {\n          var element = buildChips(\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\">' +\n            '</md-chips>'\n          );\n\n          var input = element.find('input');\n\n          expect(scope.items.length).toBe(3);\n\n          input.val('Remaining');\n          input.triggerHandler('change');\n\n          // Trigger a blur event, to check if the text was converted properly.\n          input.triggerHandler('blur');\n\n          expect(scope.items.length).toBe(4);\n        });\n\n        it('should update form state when a chip is added', inject(function($mdConstant) {\n          scope.items = [];\n          var template =\n              '<form name=\"form\">' +\n              '  <md-chips name=\"chips\" ng-model=\"items\"></md-chips>' +\n              '</form>';\n\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n          var chips = getChipElements(element);\n          var input = element.find('input');\n\n          expect(scope.form.$pristine).toBeTruthy();\n          expect(scope.form.$dirty).toBeFalsy();\n\n          // Add 'Banana'\n          input.val('Banana');\n\n          // IE11 does not support the `input` event to update the ngModel. An alternative for\n          // `input` is to use the `change` event.\n          input.triggerHandler('change');\n\n          var enterEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.ENTER,\n            which: $mdConstant.KEY_CODE.ENTER\n          };\n\n          input.triggerHandler(enterEvent);\n          scope.$digest();\n\n          expect(scope.form.$pristine).toBeFalsy();\n          expect(scope.form.$dirty).toBeTruthy();\n          expect(scope.items).toEqual(['Banana']);\n        }));\n\n        it('should allow adding the first chip on blur when required exists', function() {\n          scope.items = [];\n          var template =\n              '<form name=\"form\">' +\n              ' <md-chips name=\"chips\" ng-required=\"true\" ng-model=\"items\" md-add-on-blur=\"true\"></md-chips>' +\n              '</form>';\n\n          var element = buildChips(template);\n          var ctrl = element.find('md-chips').controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test';\n          });\n          element.find('input').triggerHandler('blur');\n\n          expect(scope.form.chips.$error['required']).toBeUndefined();\n          expect(scope.items).toEqual(['Test']);\n        });\n\n        it('should not append a new chip if the limit has reached', function() {\n          var element = buildChips(\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\" md-max-chips=\"3\">' +\n            '</md-chips>'\n          );\n\n          var input = element.find('input');\n\n          expect(scope.items.length).toBe(3);\n\n          input.val('Remaining');\n          input.triggerHandler('change');\n\n          // Trigger a blur event, to check if the text was converted properly.\n          input.triggerHandler('blur');\n\n          expect(scope.items.length).toBe(3);\n        });\n\n        it('should not append a new chip when the chips model is invalid', function() {\n          var element = buildChips(\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\">'\n          );\n\n          var input = element.find('input');\n          var ngModelCtrl = element.controller('ngModel');\n\n          expect(scope.items.length).toBe(3);\n\n          input.val('Remaining');\n\n          input.triggerHandler('change');\n          input.triggerHandler('blur');\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(4);\n\n          input.val('Second');\n\n          ngModelCtrl.$setValidity('is-valid', false);\n\n          input.triggerHandler('change');\n          input.triggerHandler('blur');\n\n          expect(scope.items.length).toBe(4);\n        });\n\n        it('should not append a new chip when the custom input model is invalid', function() {\n          var element = buildChips(\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\">' +\n              '<input ng-model=\"subModel\" ng-maxlength=\"2\">' +\n            '</md-chips>'\n          );\n\n          $timeout.flush();\n\n          var input = element.find('input');\n\n          expect(scope.items.length).toBe(3);\n\n          input.val('EN');\n\n          input.triggerHandler('change');\n          input.triggerHandler('blur');\n\n          // Flush the timeout after each blur, because custom inputs have listeners running\n          // in an AngularJS digest.\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(4);\n\n          input.val('Another');\n\n          input.triggerHandler('change');\n          input.triggerHandler('blur');\n\n          // Flush the timeout after each blur, because custom inputs have listeners running\n          // in an AngularJS digest.\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(4);\n        });\n\n        it('should not append a new chip when requireMatch is enabled', function() {\n          var template =\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\" md-require-match=\"true\">' +\n              '<md-autocomplete ' +\n                  'md-selected-item=\"selectedItem\" ' +\n                  'md-search-text=\"searchText\" ' +\n                  'md-items=\"item in querySearch(searchText)\" ' +\n                  'md-item-text=\"item\">' +\n                '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n              '</md-autocomplete>' +\n            '</md-chips>';\n\n          setupScopeForAutocomplete();\n\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n          var input = element.find('input');\n\n          expect(ctrl.shouldAddOnBlur()).toBeFalsy();\n\n          // Flush the initial timeout of the md-autocomplete.\n          $timeout.flush();\n\n          scope.$apply('searchText = \"Hello\"');\n\n          expect(ctrl.shouldAddOnBlur()).toBeFalsy();\n        });\n\n        it('should not append a new chip on blur when the autocomplete is showing', function() {\n          var template =\n            '<md-chips ng-model=\"items\" md-add-on-blur=\"true\">' +\n              '<md-autocomplete ' +\n                  'md-selected-item=\"selectedItem\" ' +\n                  'md-search-text=\"searchText\" ' +\n                  'md-items=\"item in querySearch(searchText)\" ' +\n                  'md-item-text=\"item\">' +\n                '<span md-highlight-text=\"searchText\">{{item}}</span>' +\n              '</md-autocomplete>' +\n            '</md-chips>';\n\n          setupScopeForAutocomplete();\n\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n          var input = element.find('input');\n\n          expect(ctrl.shouldAddOnBlur()).toBeFalsy();\n\n          // Flush the initial timeout of the md-autocomplete.\n          $timeout.flush();\n\n          var autocompleteCtrl = element.find('md-autocomplete').controller('mdAutocomplete');\n\n          // Open the dropdown by searching for a possible item and focusing the input.\n          scope.$apply('searchText = \"Ki\"');\n          autocompleteCtrl.focus();\n\n          expect(ctrl.shouldAddOnBlur()).toBeFalsy();\n        });\n\n      });\n\n      describe('when removable', function() {\n\n        it('should not append the input div when not removable and readonly is enabled', function() {\n          var element = buildChips(CHIP_NOT_REMOVABLE_TEMPLATE);\n          var wrap = element.children();\n          var controller = element.controller(\"mdChips\");\n\n          expect(wrap.hasClass(\"md-removable\")).toBe(false);\n          expect(controller.removable).toBe(false);\n\n          var containers = wrap[0].querySelectorAll(\".md-chip-input-container\");\n\n          expect(containers.length).toBe(0);\n\n          var removeContainer = wrap[0].querySelector('.md-chip-remove-container');\n          expect(removeContainer).not.toBeTruthy();\n        });\n\n        it('should not remove chip through the backspace/delete key when removable is set to false', inject(function($mdConstant) {\n          var element = buildChips(CHIP_NOT_REMOVABLE_TEMPLATE);\n          var wrap = element.find('md-chips-wrap');\n          var controller = element.controller(\"mdChips\");\n          var chips = getChipElements(element);\n\n          expect(wrap.hasClass(\"md-removable\")).toBe(false);\n          expect(controller.removable).toBe(false);\n\n          controller.selectChip(0);\n\n          wrap.triggerHandler({\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.BACKSPACE\n          });\n\n          var updatedChips = getChipElements(element);\n\n          expect(chips.length).toBe(updatedChips.length);\n        }));\n\n        it('should remove a chip by default through the backspace/delete key', inject(function($mdConstant) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var wrap = element.find('md-chips-wrap');\n          var controller = element.controller(\"mdChips\");\n          var chips = getChipElements(element);\n\n          controller.selectChip(0);\n\n          wrap.triggerHandler({\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.BACKSPACE\n          });\n\n          var updatedChips = getChipElements(element);\n\n          expect(updatedChips.length).toBe(chips.length - 1);\n        }));\n\n        it('should set removable to true by default', function() {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var wrap = element.children();\n          var controller = element.controller('mdChips');\n\n          expect(wrap.hasClass('md-removable')).toBe(true);\n          // The controller variable is kept undefined by default, to allow us to difference between the default value\n          // and a user-provided value.\n          expect(controller.removable).toBe(undefined);\n\n          var containers = wrap[0].querySelectorAll(\".md-chip-input-container\");\n          expect(containers.length).not.toBe(0);\n\n          var removeContainer = wrap[0].querySelector('.md-chip-remove-container');\n          expect(removeContainer).toBeTruthy();\n        });\n\n        it('should append dynamically the remove button', function() {\n          var template = '<md-chips ng-model=\"items\" readonly=\"true\" md-removable=\"removable\"></md-chips>';\n\n          scope.removable = false;\n\n          var element = buildChips(template);\n          var wrap = element.children();\n          var controller = element.controller(\"mdChips\");\n\n          expect(wrap.hasClass(\"md-removable\")).toBe(false);\n          expect(controller.removable).toBe(false);\n\n          var containers = wrap[0].querySelectorAll(\".md-chip-remove-container\");\n          expect(containers.length).toBe(0);\n\n          scope.$apply('removable = true');\n\n          expect(wrap.hasClass(\"md-removable\")).toBe(true);\n          expect(controller.removable).toBe(true);\n\n          containers = wrap[0].querySelector(\".md-chip-remove-container\");\n          expect(containers).toBeTruthy();\n        });\n\n      });\n\n      describe('when readonly', function() {\n        var element, ctrl;\n\n        it(\"properly toggles the controller's readonly property\", function() {\n          element = buildChips(CHIP_READONLY_TEMPLATE);\n          ctrl = element.controller('mdChips');\n\n          expect(ctrl.readonly).toBeFalsy();\n\n          scope.$apply('isReadonly = true');\n\n          expect(ctrl.readonly).toBeTruthy();\n        });\n\n        it(\"properly toggles the wrapper's .md-readonly class\", function() {\n          element = buildChips(CHIP_READONLY_TEMPLATE);\n          ctrl = element.controller('mdChips');\n\n          expect(element.find('md-chips-wrap')).not.toHaveClass('md-readonly');\n\n          scope.$apply('isReadonly = true');\n\n          expect(element.find('md-chips-wrap')).toHaveClass('md-readonly');\n        });\n\n        it('is false with empty items should not hide the chips wrapper', function() {\n          scope.isReadonly = false;\n          scope.items = [];\n          element = buildChips(CHIP_READONLY_TEMPLATE);\n\n          expect(element.find('md-chips-wrap').length).toBe(1);\n        });\n\n        it('is true with empty items should not hide the chips wrapper', function() {\n          scope.isReadonly = true;\n          scope.items = [];\n          element = buildChips(CHIP_READONLY_TEMPLATE);\n\n          expect(element.find('md-chips-wrap').length).toBe(1);\n        });\n\n        it('is true should not throw an error when used with an autocomplete', function() {\n          element = buildChips(CHIP_READONLY_AUTOCOMPLETE_TEMPLATE);\n          $timeout.flush();\n\n          expect($exceptionHandler.errors).toEqual([]);\n        });\n\n        it('should disable removing when `md-removable` is not defined', function() {\n          element = buildChips(\n            '<md-chips ng-model=\"items\" readonly=\"isReadonly\" md-removable=\"isRemovable\"></md-chips>'\n          );\n\n          var wrap = element.find('md-chips-wrap');\n          ctrl = element.controller('mdChips');\n\n          expect(element.find('md-chips-wrap')).not.toHaveClass('md-readonly');\n\n          scope.$apply('isReadonly = true');\n\n          expect(element.find('md-chips-wrap')).toHaveClass('md-readonly');\n\n          expect(ctrl.removable).toBeUndefined();\n\n          var removeContainer = wrap[0].querySelector('.md-chip-remove-container');\n          expect(removeContainer).toBeFalsy();\n\n          scope.$apply('isRemovable = true');\n\n          removeContainer = wrap[0].querySelector('.md-chip-remove-container');\n          expect(removeContainer).toBeTruthy();\n        });\n\n      });\n\n      it('should disallow duplicate object chips', function() {\n        var element = buildChips(CHIP_TRANSFORM_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        // Manually set the items\n        ctrl.items = [{name: 'Apple', uppername: 'APPLE'}];\n\n        // Make our custom transformChip function return our existing item\n        var chipObj = function(chip) {\n          return ctrl.items[0];\n        };\n\n        scope.transformChip = jasmine.createSpy('transformChip').and.callFake(chipObj);\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Apple';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(ctrl.items.length).toBe(1);\n        expect(scope.transformChip).toHaveBeenCalled();\n        expect(scope.transformChip.calls.mostRecent().args[0]).toBe('Apple');\n      });\n\n      it('should disallow identical object chips', function() {\n        var element = buildChips(CHIP_TRANSFORM_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        ctrl.items = [{name: 'Apple', uppername: 'APPLE'}];\n\n        var chipObj = function(chip) {\n          return {\n            name: chip,\n            uppername: chip.toUpperCase()\n          };\n        };\n        scope.transformChip = jasmine.createSpy('transformChip').and.callFake(chipObj);\n\n        element.scope().$apply(function() {\n          ctrl.chipBuffer = 'Apple';\n          simulateInputEnterKey(ctrl);\n        });\n\n        expect(ctrl.items.length).toBe(1);\n        expect(scope.transformChip).toHaveBeenCalled();\n        expect(scope.transformChip.calls.mostRecent().args[0]).toBe('Apple');\n      });\n\n      it('should prevent the default when backspace is pressed', inject(function($mdConstant) {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        var backspaceEvent = {\n          type: 'keydown',\n          keyCode: $mdConstant.KEY_CODE.BACKSPACE,\n          which: $mdConstant.KEY_CODE.BACKSPACE,\n          preventDefault: jasmine.createSpy('preventDefault')\n        };\n\n        element.find('input').triggerHandler(backspaceEvent);\n\n        expect(backspaceEvent.preventDefault).toHaveBeenCalled();\n      }));\n\n      describe('with input text', function() {\n\n        it('should prevent the default when enter is pressed', inject(function($mdConstant) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n\n          var enterEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.ENTER,\n            which: $mdConstant.KEY_CODE.ENTER,\n            preventDefault: jasmine.createSpy('preventDefault')\n          };\n\n          ctrl.chipBuffer = 'Test';\n          element.find('input').triggerHandler(enterEvent);\n\n          expect(enterEvent.preventDefault).toHaveBeenCalled();\n        }));\n\n        it('should trim the buffer when a chip will be added', inject(function($mdConstant) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n          var input = element.find('input');\n\n          // This string contains a lot of spaces, which should be trimmed.\n          input.val('    Test    ');\n\n          // We have to trigger the `change` event, because IE11 does not support\n          // the `input` event to update the ngModel. An alternative for `input` is to use the\n          // `change` event.\n          input.triggerHandler('change');\n\n          expect(ctrl.chipBuffer).toBeTruthy();\n\n          var enterEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.ENTER,\n            which: $mdConstant.KEY_CODE.ENTER\n          };\n\n          input.triggerHandler(enterEvent);\n\n          expect(scope.items).toEqual(['Apple', 'Banana', 'Orange', 'Test']);\n        }));\n\n        describe('with backspace event', function() {\n\n          var backspaceEvent, element, input, ctrl, isValidInput;\n\n          beforeEach(inject(function($mdConstant) {\n            backspaceEvent = {\n              type: 'keydown',\n              keyCode: $mdConstant.KEY_CODE.BACKSPACE,\n              which: $mdConstant.KEY_CODE.BACKSPACE,\n              preventDefault: jasmine.createSpy('preventDefault')\n            };\n          }));\n\n          afterEach(function() {\n            element && element.remove();\n          });\n\n          function createChips(template) {\n            element = buildChips(template);\n            input = element.find('input');\n            ctrl = element.controller('mdChips');\n\n            $timeout.flush();\n\n            // Add the element to the document's body, because otherwise we won't be able\n            // to set the selection of the chip input.\n            document.body.appendChild(element[0]);\n\n            /** Detect whether the current input is supporting the `selectionStart` property */\n            var oldInputValue = input.val();\n            input.val('2');\n            isValidInput = angular.isDefined(ctrl.getCursorPosition(input[0]));\n            input.val(oldInputValue);\n          }\n\n          /**\n           * Updates the cursor position of the input.\n           * This is necessary to test the cursor position.\n           */\n          function updateInputCursor() {\n            if (isValidInput) {\n              var inputLength = input[0].value.length;\n\n              try {\n                input[0].selectionStart = input[0].selectionEnd = inputLength;\n              } catch (e) {\n                // Chrome does not allow setting a selection for number inputs and just throws\n                // a DOMException as soon as something tries to set a selection programmatically.\n                // Faking the selection properties for the ChipsController works for our tests.\n                var selectionDescriptor = { writable: true, value: inputLength };\n                Object.defineProperty(input[0], 'selectionStart', selectionDescriptor);\n                Object.defineProperty(input[0], 'selectionEnd', selectionDescriptor);\n              }\n            }\n          }\n\n          it('should properly cancel the backspace event to select the chip before', function() {\n            createChips(BASIC_CHIP_TEMPLATE);\n\n            input.val('    ');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n            input.triggerHandler(backspaceEvent);\n            expect(backspaceEvent.preventDefault).not.toHaveBeenCalled();\n\n            input.val('');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n\n            input.triggerHandler(backspaceEvent);\n            expect(backspaceEvent.preventDefault).toHaveBeenCalledTimes(1);\n          });\n\n          it('should properly cancel the backspace event to select the chip before', function() {\n            createChips(BASIC_CHIP_TEMPLATE);\n\n            input.val('    ');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n\n            input.triggerHandler(backspaceEvent);\n            expect(backspaceEvent.preventDefault).not.toHaveBeenCalled();\n\n            input.val('');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n            input.triggerHandler(backspaceEvent);\n            expect(backspaceEvent.preventDefault).toHaveBeenCalledTimes(1);\n          });\n\n          it('should properly handle the cursor position when using a number input', function() {\n            createChips(\n              '<md-chips ng-model=\"items\">' +\n                '<input type=\"number\" placeholder=\"Enter a number\">' +\n              '</md-chips>'\n            );\n\n            input.val('2');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n            input.triggerHandler(backspaceEvent);\n            $timeout.flush();\n\n            expect(backspaceEvent.preventDefault).not.toHaveBeenCalled();\n\n            input.val('');\n            updateInputCursor();\n            input.triggerHandler('change');\n\n            input.triggerHandler(backspaceEvent);\n            $timeout.flush();\n\n            expect(backspaceEvent.preventDefault).toHaveBeenCalledTimes(1);\n          });\n\n        });\n\n      });\n\n      it('focuses/blurs the component when focusing/blurring the input', inject(function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        // Focus the input and check\n        element.find('input').triggerHandler('focus');\n        expect(ctrl.inputHasFocus).toBe(true);\n        expect(element.find('md-chips-wrap').hasClass('md-focused')).toBe(true);\n\n        // Blur the input and check\n        element.find('input').triggerHandler('blur');\n        expect(ctrl.inputHasFocus).toBe(false);\n        expect(element.find('md-chips-wrap').hasClass('md-focused')).toBe(false);\n      }));\n\n      describe('placeholder', function() {\n\n        it('should put placeholder text in the input element when chips exist but there is no secondary-placeholder text', inject(function() {\n          var template =\n            '<md-chips ng-model=\"items\" placeholder=\"placeholder text\"></md-chips>';\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n          var input = element.find('input')[0];\n\n          expect(scope.items.length).toBeGreaterThan(0);\n          expect(input.placeholder).toBe('placeholder text');\n        }));\n\n        it('should put placeholder text in the input element when there are no chips', inject(function() {\n          var ctrl, element, input, template;\n\n          scope.items = [];\n          template =\n            '<md-chips ng-model=\"items\" placeholder=\"placeholder text\" ' +\n            'secondary-placeholder=\"secondary-placeholder text\"></md-chips>';\n          element = buildChips(template);\n          ctrl = element.controller('mdChips');\n          input = element.find('input')[0];\n\n          expect(scope.items.length).toBe(0);\n          expect(input.placeholder).toBe('placeholder text');\n        }));\n\n        it('should put secondary-placeholder text in the input element when there is at least one chip', inject(function() {\n          var template =\n            '<md-chips ng-model=\"items\" placeholder=\"placeholder text\" ' +\n            'secondary-placeholder=\"secondary-placeholder text\"></md-chips>';\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n          var input = element.find('input')[0];\n\n          expect(scope.items.length).toBeGreaterThan(0);\n          expect(input.placeholder).toBe('secondary-placeholder text');\n        }));\n\n      });\n\n      it('utilizes the default chip append delay of 300ms', inject(function($timeout) {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        // Append element to body\n        angular.element(document.body).append(element);\n\n        // Append a new chips which will fire the delay\n        ctrl.appendChip('test');\n\n        // Before 300ms timeout, focus should be on the chip (i.e. the chip content)\n        $timeout.flush(299);\n        expect(document.activeElement).toHaveClass('md-chip-content');\n\n        // At/after 300ms timeout, focus should be on the input\n        $timeout.flush();\n\n        expect(document.activeElement.tagName.toUpperCase()).toEqual('INPUT');\n\n        // cleanup\n        element.remove();\n      }));\n\n      it('utilizes a custom chip append delay', inject(function($timeout) {\n        var element = buildChips(CHIP_APPEND_DELAY_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        // Append element to body\n        angular.element(document.body).append(element);\n\n        // Append a new chips which will fire the delay\n        ctrl.appendChip('test');\n\n        // Before custom timeout, focus should be on the chip (i.e. the chip content)\n        $timeout.flush(ctrl.chipAppendDelay - 1);\n        expect(document.activeElement).toHaveClass('md-chip-content');\n\n        // At/after custom timeout, focus should be on the input\n        $timeout.flush();\n        expect(document.activeElement.tagName.toUpperCase()).toEqual('INPUT');\n\n        // cleanup\n        element.remove();\n      }));\n\n    });\n\n    describe('custom inputs', function() {\n\n      describe('separator-keys', function() {\n        var SEPARATOR_KEYS_CHIP_TEMPLATE =\n          '<md-chips ng-model=\"items\" md-separator-keys=\"keys\"></md-chips>';\n\n        it('should create a new chip when a comma is entered', inject(function($mdConstant) {\n          scope.keys = [$mdConstant.KEY_CODE.ENTER, $mdConstant.KEY_CODE.COMMA];\n          var element = buildChips(SEPARATOR_KEYS_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n\n          var commaInput = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.COMMA,\n            which: $mdConstant.KEY_CODE.COMMA,\n            preventDefault: jasmine.createSpy('preventDefault')\n          };\n\n          ctrl.chipBuffer = 'Test';\n          element.find('input').triggerHandler(commaInput);\n\n          expect(commaInput.preventDefault).toHaveBeenCalled();\n        }));\n\n        it('supports custom separator key codes', inject(function($mdConstant) {\n          var semicolon = 186;\n          scope.keys = [$mdConstant.KEY_CODE.ENTER, $mdConstant.KEY_CODE.COMMA, semicolon];\n\n          var element = buildChips(SEPARATOR_KEYS_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n\n          var semicolonInput = {\n            type: 'keydown',\n            keyCode: semicolon,\n            which: semicolon,\n            preventDefault: jasmine.createSpy('preventDefault')\n          };\n\n          ctrl.chipBuffer = 'Test';\n          element.find('input').triggerHandler(semicolonInput);\n\n          expect(semicolonInput.preventDefault).toHaveBeenCalled();\n        }));\n      });\n\n      describe('md-max-chips', function() {\n\n        beforeEach(function() {\n          // Clear default items to test the max chips functionality\n          scope.items = [];\n        });\n\n        it('should not add a new chip if the max-chips limit is reached', function () {\n          var element = buildChips('<md-chips ng-model=\"items\" md-max-chips=\"1\"></md-chips>');\n          var ctrl = element.controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(scope.items.length).toBe(1);\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test 2';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(scope.items.length).not.toBe(2);\n        });\n\n        it('should update the md-max-chips model validator for forms', function() {\n          var template =\n            '<form name=\"form\">' +\n            '<md-chips name=\"chips\" ng-model=\"items\" md-max-chips=\"1\"></md-chips>' +\n            '</form>';\n\n          var element = buildChips(template);\n          var ctrl = element.find('md-chips').controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(scope.form.chips.$error['md-max-chips']).toBe(true);\n        });\n\n        it('should not reset the buffer if the maximum is reached', function() {\n          var element = buildChips('<md-chips ng-model=\"items\" md-max-chips=\"1\"></md-chips>');\n          var ctrl = element.controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(scope.items.length).toBe(1);\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test 2';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(ctrl.chipBuffer).toBe('Test 2');\n          expect(scope.items.length).not.toBe(2);\n        });\n\n        it('should not append the chip when maximum is reached and using an autocomplete', function() {\n          var template =\n            '<md-chips ng-model=\"items\" md-max-chips=\"1\">' +\n              '<md-autocomplete ' +\n                'md-selected-item=\"selectedItem\" ' +\n                'md-search-text=\"searchText\" ' +\n                'md-items=\"item in querySearch(searchText)\" ' +\n                'md-item-text=\"item\">' +\n             '<span md-highlight-text=\"searchText\">{{itemtype}}</span>' +\n            '</md-autocomplete>' +\n          '</md-chips>';\n\n          setupScopeForAutocomplete();\n          var element = buildChips(template);\n          var ctrl = element.controller('mdChips');\n\n          // Flush the autocompletes init timeout.\n          $timeout.flush();\n\n          var autocompleteCtrl = element.find('md-autocomplete').controller('mdAutocomplete');\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.scope.searchText = 'K';\n          });\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.select(0);\n          });\n\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(1);\n          expect(scope.items[0]).toBe('Kiwi');\n          expect(element.find('input').val()).toBe('');\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.scope.searchText = 'O';\n          });\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.select(0);\n          });\n\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(1);\n          expect(element.find('input').val()).toBe('Orange');\n        });\n\n      });\n\n      describe('ng-required', function() {\n        beforeEach(function() {\n          // Clear default items to test the required chips functionality\n          scope.items = [];\n        });\n\n        it('should set the required error when chips is compiled with an empty array', function() {\n          var template =\n              '<form name=\"form\">' +\n              '<md-chips name=\"chips\" ng-required=\"true\" ng-model=\"items\"></md-chips>' +\n              '</form>';\n\n          var element = buildChips(template);\n          element.scope().$apply();\n\n          expect(scope.form.chips.$error['required']).toBe(true);\n        });\n\n        it('should unset the required error when the first chip is added', function() {\n          var template =\n              '<form name=\"form\">' +\n              '<md-chips name=\"chips\" ng-required=\"true\" ng-model=\"items\"></md-chips>' +\n              '</form>';\n\n          var element = buildChips(template);\n          var ctrl = element.find('md-chips').controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.chipBuffer = 'Test';\n            simulateInputEnterKey(ctrl);\n          });\n\n          expect(scope.form.chips.$error['required']).toBeUndefined();\n        });\n\n        it('should set the required when the last chip is removed', function() {\n          scope.items = ['test'];\n          var template =\n              '<form name=\"form\">' +\n              '<md-chips name=\"chips\" required ng-model=\"items\"></md-chips>' +\n              '</form>';\n\n          var element = buildChips(template);\n          var ctrl = element.find('md-chips').controller('mdChips');\n\n          element.scope().$apply(function() {\n            ctrl.removeChip(0);\n          });\n\n          expect(scope.form.chips.$error['required']).toBe(true);\n        });\n      });\n\n      describe('focus functionality', function() {\n        var element, ctrl;\n\n        beforeEach(function() {\n          element = buildChips(CHIP_SELECT_TEMPLATE);\n          ctrl = element.controller('mdChips');\n          document.body.appendChild(element[0]);\n        });\n\n        afterEach(function() {\n          element.remove();\n          element = ctrl = null;\n        });\n\n        it('should focus the chip when clicking / touching on the chip', function() {\n          ctrl.focusChip = jasmine.createSpy('focusChipSpy');\n\n          var chips = getChipElements(element);\n          expect(chips.length).toBe(3);\n\n          chips.children().eq(0).triggerHandler('click');\n\n          expect(ctrl.focusChip).toHaveBeenCalledTimes(1);\n        });\n\n        it('should focus the chip through normal content focus', function() {\n          scope.selectChip = jasmine.createSpy('focusChipSpy');\n          var chips = getChipElements(element);\n          expect(chips.length).toBe(3);\n\n          chips.children().eq(0).triggerHandler('focus');\n\n          expect(scope.selectChip).toHaveBeenCalledTimes(1);\n        });\n\n        it('should blur the chip correctly', function() {\n          var chips = getChipElements(element);\n          expect(chips.length).toBe(3);\n\n          var chipContent = chips.children().eq(0);\n          chipContent.triggerHandler('focus');\n\n          expect(ctrl.selectedChip).toBe(0);\n\n          chipContent.eq(0).triggerHandler('blur');\n\n          scope.$digest();\n\n          expect(ctrl.selectedChip).toBe(-1);\n        });\n\n      });\n\n      describe('md-autocomplete', function() {\n        var AUTOCOMPLETE_CHIPS_TEMPLATE = '\\\n          <md-chips ng-model=\"items\">\\\n            <md-autocomplete\\\n              md-selected-item=\"selectedItem\"\\\n              md-search-text=\"searchText\"\\\n              md-items=\"item in querySearch(searchText)\"\\\n              md-item-text=\"item\">\\\n            <span md-highlight-text=\"searchText\">{{itemtype}}</span>\\\n          </md-autocomplete>\\\n        </md-chips>';\n\n        it('should use the selected item as a buffer', inject(function($timeout) {\n          setupScopeForAutocomplete();\n          var element = buildChips(AUTOCOMPLETE_CHIPS_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n          $timeout.flush(); // mdAutcomplete needs a flush for its init.\n          var autocompleteCtrl = element.find('md-autocomplete').controller('mdAutocomplete');\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.scope.searchText = 'K';\n          });\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.select(0);\n          });\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(4);\n          expect(scope.items[3]).toBe('Kiwi');\n          expect(element.find('input').val()).toBe('');\n        }));\n\n        it('should properly cancel the backspace event to select the chip before', inject(function($mdConstant) {\n          setupScopeForAutocomplete();\n          var element = buildChips(AUTOCOMPLETE_CHIPS_TEMPLATE);\n\n          // Add the element to the document's body, because otherwise we won't be able\n          // to set the selection of the chip input.\n          document.body.appendChild(element[0]);\n\n          // The embedded `md-autocomplete` needs a timeout flush for it's initialization.\n          $timeout.flush();\n          $timeout.flush();\n          scope.$apply();\n\n          var input = angular.element(element[0].querySelector('md-autocomplete input'));\n\n\n          input.val('    ');\n          input.triggerHandler('input');\n\n          expect(input.controller('ngModel').$modelValue).toBe('');\n          // Since the `md-chips` component is testing the backspace select previous chip functionality by\n          // checking the current caret / cursor position, we have to set the cursor to the end of the current\n          // value.\n          input[0].selectionStart = input[0].selectionEnd = input[0].value.length;\n\n          var backspaceEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.BACKSPACE,\n            which: $mdConstant.KEY_CODE.BACKSPACE,\n            preventDefault: jasmine.createSpy('preventDefault')\n          };\n\n          input.triggerHandler(backspaceEvent);\n\n          // We have to trigger a digest, because the event listeners for the chips component will be called\n          // with an async digest evaluation.\n          scope.$digest();\n\n          expect(backspaceEvent.preventDefault).not.toHaveBeenCalled();\n\n          input.val('');\n          input.triggerHandler('input');\n\n          // Since the `md-chips` component is testing the backspace select previous chip functionality by\n          // checking the current caret / cursor position, we have to set the cursor to the end of the current\n          // value.\n          input[0].selectionStart = input[0].selectionEnd = input[0].value.length;\n\n          input.triggerHandler(backspaceEvent);\n          scope.$digest();\n\n          expect(backspaceEvent.preventDefault).toHaveBeenCalledTimes(1);\n\n          // Remove the chips element from the document's body.\n          document.body.removeChild(element[0]);\n        }));\n\n        it('simultaneously allows selecting an existing chip AND adding a new one', inject(function($mdConstant) {\n          // Setup our scope and function\n          setupScopeForAutocomplete();\n          scope.transformChip = jasmine.createSpy('transformChip');\n\n          // Modify the base template to add md-transform-chip\n          var modifiedTemplate = AUTOCOMPLETE_CHIPS_TEMPLATE\n            .replace('<md-chips', '<md-chips md-transform-chip=\"transformChip($chip)\"');\n\n          var element = buildChips(modifiedTemplate);\n\n          var ctrl = element.controller('mdChips');\n          $timeout.flush(); // mdAutcomplete needs a flush for its init.\n          var autocompleteCtrl = element.find('md-autocomplete').controller('mdAutocomplete');\n\n          element.scope().$apply(function() {\n            autocompleteCtrl.scope.searchText = 'K';\n          });\n          autocompleteCtrl.focus();\n          $timeout.flush();\n\n          /*\n           * Send a down arrow/enter to select the right fruit\n           */\n          var downArrowEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.DOWN_ARROW,\n            which: $mdConstant.KEY_CODE.DOWN_ARROW\n          };\n          var enterEvent = {\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.ENTER,\n            which: $mdConstant.KEY_CODE.ENTER\n          };\n          element.find('input').triggerHandler(downArrowEvent);\n          element.find('input').triggerHandler(enterEvent);\n          $timeout.flush();\n\n          // Check our transformChip calls\n          expect(scope.transformChip).not.toHaveBeenCalledWith('K');\n          expect(scope.transformChip).toHaveBeenCalledWith('Kiwi');\n          expect(scope.transformChip.calls.count()).toBe(1);\n\n          // Check our output\n          expect(scope.items.length).toBe(4);\n          expect(scope.items[3]).toBe('Kiwi');\n          expect(element.find('input').val()).toBe('');\n\n          // Reset our jasmine spy\n          scope.transformChip.calls.reset();\n\n          /*\n           * Use the \"new chip\" functionality\n           */\n\n          // Set the search text\n          element.scope().$apply(function() {\n            autocompleteCtrl.scope.searchText = 'Acai Berry';\n          });\n\n          // Fire our event and flush any timeouts\n          element.find('input').triggerHandler(enterEvent);\n          $timeout.flush();\n\n          // Check our transformChip calls\n          expect(scope.transformChip).toHaveBeenCalledWith('Acai Berry');\n          expect(scope.transformChip.calls.count()).toBe(1);\n\n          // Check our output\n          expect(scope.items.length).toBe(5);\n          expect(scope.items[4]).toBe('Acai Berry');\n          expect(element.find('input').val()).toBe('');\n        }));\n\n        it('should remove a chip on click and return focus to the input', function() {\n\n          var template =\n            '<md-chips ng-model=\"items\" md-max-chips=\"1\">' +\n              '<md-autocomplete ' +\n                  'md-selected-item=\"selectedItem\" ' +\n                  'md-search-text=\"searchText\" ' +\n                  'md-items=\"item in querySearch(searchText)\" ' +\n                  'md-item-text=\"item\">' +\n                '<span md-highlight-text=\"searchText\">{{itemtype}}</span>' +\n              '</md-autocomplete>' +\n            '</md-chips>';\n\n          setupScopeForAutocomplete();\n\n          var element = buildChips(template);\n\n          document.body.appendChild(element[0]);\n\n          // Flush the autocomplete's init timeout.\n          $timeout.flush();\n\n          var input = element.find('input');\n          var removeButton = element[0].querySelector('.md-chip-remove');\n\n          expect(scope.items.length).toBe(3);\n\n          angular.element(removeButton).triggerHandler('click');\n\n          $timeout.flush();\n\n          expect(scope.items.length).toBe(2);\n          expect(document.activeElement).toBe(input[0]);\n        });\n      });\n\n      describe('user input templates', function() {\n        var NG_MODEL_TEMPLATE = '\\\n          <md-chips ng-model=\"items\">\\\n            <input type=\"text\" ng-model=\"inputText\">\\\n          </md-chips>';\n        var INPUT_TEMPLATE = '\\\n          <md-chips ng-model=\"items\">\\\n            <input type=\"text\">\\\n          </md-chips>';\n\n        it('focuses/blurs the component when focusing/blurring the input', inject(function($timeout) {\n          var element = buildChips(INPUT_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n          $timeout.flush();\n\n          // Focus the input and check\n          element.find('input').triggerHandler('focus');\n          $timeout.flush();\n          expect(ctrl.inputHasFocus).toBe(true);\n          expect(element.find('md-chips-wrap').hasClass('md-focused')).toBe(true);\n\n          // Blur the input and check\n          element.find('input').triggerHandler('blur');\n          $timeout.flush();\n          expect(ctrl.inputHasFocus).toBe(false);\n          expect(element.find('md-chips-wrap').hasClass('md-focused')).toBe(false);\n        }));\n\n        describe('using ngModel', function() {\n          it('should add the ngModelCtrl.$viewValue when <enter> is pressed',\n            inject(function($timeout) {\n              var element = buildChips(NG_MODEL_TEMPLATE);\n              var ctrl = element.controller('mdChips');\n              $timeout.flush();\n\n              var ngModelCtrl = ctrl.userInputNgModelCtrl;\n\n              element.scope().$apply(function() {\n                ngModelCtrl.$viewValue = 'Grape';\n                simulateInputEnterKey(ctrl);\n              });\n\n              expect(scope.items.length).toBe(4);\n              expect(scope.items[3]).toBe('Grape');\n            }));\n\n          it('should use an empty string if ngModel value is falsy', inject(function($timeout) {\n            var element = buildChips(NG_MODEL_TEMPLATE);\n            var ctrl = element.controller('mdChips');\n\n            $timeout.flush();\n\n            var ngModelCtrl = ctrl.userInputNgModelCtrl;\n\n            expect(ngModelCtrl.$viewValue).toBeFalsy();\n            expect(ctrl.getChipBuffer()).toBe('');\n          }));\n\n        });\n\n        describe('without ngModel', function() {\n          it('should support an input without an ngModel', inject(function($timeout) {\n            var element = buildChips(INPUT_TEMPLATE);\n            var ctrl = element.controller('mdChips');\n            $timeout.flush();\n\n            element.scope().$apply(function() {\n              ctrl.userInputElement[0].value = 'Kiwi';\n              simulateInputEnterKey(ctrl);\n            });\n\n            expect(scope.items.length).toBe(4);\n            expect(scope.items[3]).toBe('Kiwi');\n          }));\n        });\n      });\n    });\n\n    describe('static chips', function() {\n      var STATIC_CHIPS_TEMPLATE = '\\\n        <md-chips>\\\n          <md-chip>Hockey</md-chip>\\\n          <md-chip>Lacrosse</md-chip>\\\n          <md-chip>Baseball</md-chip>\\\n          <md-chip>{{chipItem}}</md-chip>\\\n        </md-chips>';\n\n      var STATIC_CHIPS_NGREPEAT_TEMPLATE = '\\\n        <div>\\\n          <div ng-repeat=\"i in [1,2,3]\">\\\n            <md-chips>\\\n              <md-chip>{{i}}</md-chip>\\\n            </md-chips>\\\n          </div>\\\n        </div>\\\n      ';\n\n      it('should transclude static chips', inject(function($timeout) {\n        scope.chipItem = 'Football';\n        var element = buildChips(STATIC_CHIPS_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n        $timeout.flush();\n\n        var chips = getChipElements(element);\n        expect(chips.length).toBe(4);\n        expect(chips[0].innerHTML).toContain('Hockey');\n        expect(chips[1].innerHTML).toContain('Lacrosse');\n        expect(chips[2].innerHTML).toContain('Baseball');\n        expect(chips[3].innerHTML).toContain('Football');\n      }));\n\n      it('allows ng-repeat outside of md-chips', function() {\n        var element = buildChips(STATIC_CHIPS_NGREPEAT_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n\n        $timeout.flush();\n\n        var chipsArray = getChipsElements(element);\n        var chipArray = getChipElements(element);\n\n        // Check the lengths\n        expect(chipsArray.length).toBe(3);\n        expect(chipArray.length).toBe(3);\n\n        // Check the chip's text\n        expect(chipArray[0].innerHTML).toContain('1');\n        expect(chipArray[1].innerHTML).toContain('2');\n        expect(chipArray[2].innerHTML).toContain('3');\n      });\n\n      it('does not allow removal of chips', function() {\n        scope.chipItem = 'Football';\n        var element = buildChips(STATIC_CHIPS_TEMPLATE);\n        var wrap = element.find('md-chips-wrap');\n\n        expect(wrap).not.toHaveClass('md-removable');\n      });\n    });\n\n    describe('<md-chip-remove>', function() {\n      it('should remove a chip', function() {\n        var element = buildChips(BASIC_CHIP_TEMPLATE);\n        var ctrl = element.controller('mdChips');\n        var chips = getChipElements(element);\n\n        expect(chips.length).toBe(3);\n\n        // Remove 'Banana'\n        var chipButton = angular.element(chips[1]).find('button');\n        chipButton[0].click();\n\n        scope.$digest();\n        chips = getChipElements(element);\n        expect(chips.length).toBe(2);\n\n        // Remove 'Orange'\n        chipButton = angular.element(chips[1]).find('button');\n        chipButton[0].click();\n\n        scope.$digest();\n        chips = getChipElements(element);\n        expect(chips.length).toBe(1);\n      });\n\n      it('should update form state when a chip is removed', function() {\n        var template =\n            '<form name=\"form\">' +\n            '  <md-chips name=\"chips\" ng-model=\"items\"></md-chips>' +\n            '</form>';\n\n        var element = buildChips(template);\n        var ctrl = element.controller('mdChips');\n        var chips = getChipElements(element);\n\n        expect(scope.form.$pristine).toBeTruthy();\n        expect(scope.form.$dirty).toBeFalsy();\n\n        // Remove 'Banana'\n        var chipButton = angular.element(chips[1]).find('button');\n        chipButton[0].click();\n\n        scope.$digest();\n\n        expect(scope.form.$pristine).toBeFalsy();\n        expect(scope.form.$dirty).toBeTruthy();\n        expect(scope.items).toEqual(['Apple', 'Orange']);\n      });\n    });\n\n    describe('keyboard navigation', function() {\n      var leftEvent, rightEvent;\n\n      beforeEach(inject(function($mdConstant) {\n        leftEvent = {\n          type: 'keydown',\n          keyCode: $mdConstant.KEY_CODE.LEFT_ARROW,\n          which: $mdConstant.KEY_CODE.LEFT_ARROW\n        };\n        rightEvent = {\n          type: 'keydown',\n          keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW,\n          which: $mdConstant.KEY_CODE.RIGHT_ARROW\n        };\n      }));\n\n      describe('when readonly', function() {\n        // TODO: Add readonly specific tests\n      });\n\n      describe('when we have an input', function() {\n        it('clears the selected chip when the input is focused', inject(function($timeout) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n\n          // Focus the input\n          ctrl.focusInput();\n          $timeout.flush();\n\n          // Expect no chip to be selected\n          expect(ctrl.selectedChip).toBe(-1);\n        }));\n\n        it('selects the previous chip', inject(function($timeout) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n          var chips = getChipElements(element);\n\n          // Select the second chip\n          ctrl.selectAndFocusChipSafe(1);\n          $timeout.flush();\n\n          expect(ctrl.selectedChip).toBe(1);\n\n          // Select the 1st chip\n          element.find('md-chips-wrap').triggerHandler(angular.copy(leftEvent));\n          $timeout.flush();\n\n          expect(ctrl.selectedChip).toBe(0);\n        }));\n\n        it('and the first chip is selected, selects the input', inject(function($timeout) {\n          var element = buildChips(BASIC_CHIP_TEMPLATE);\n          var ctrl = element.controller('mdChips');\n          var chips = getChipElements(element);\n\n          // Append so we can focus the input\n          angular.element(document.body).append(element);\n\n          // Select the second chip\n          ctrl.selectAndFocusChipSafe(0);\n          $timeout.flush();\n\n          expect(ctrl.selectedChip).toBe(0);\n\n          // Selecting past the first should wrap back to the input\n          element.find('md-chips-wrap').triggerHandler(angular.copy(leftEvent));\n          $timeout.flush();\n\n          expect(ctrl.selectedChip).toBe(-1);\n          expect(document.activeElement).toBe(element.find('input')[0]);\n\n          // Cleanup after ourselves\n          element.remove();\n        }));\n      });\n    });\n  });\n\n  describe('with $interpolate.start/endSymbol override', function() {\n    beforeEach(module(function($interpolateProvider) {\n      $interpolateProvider.startSymbol('[[').endSymbol(']]');\n    }));\n\n    beforeEach(module('material.components.chips', 'material.components.autocomplete'));\n\n    beforeEach(inject(function($rootScope) {\n      scope = $rootScope.$new();\n      scope.items = ['Apple', 'Banana', 'Orange'];\n    }));\n\n    it('should render a user-provided chip template with custom start/end symbols', function() {\n      var template =\n        '<md-chips ng-model=\"items\">' +\n        '  <md-chip-template><div class=\"mychiptemplate\">[[$chip]]</div></md-chip-template>' +\n        '</md-chips>';\n      var element = buildChips(template);\n      var chips = element[0].querySelectorAll('md-chip .mychiptemplate');\n\n      expect(angular.element(chips[0]).text().trim()).toEqual('Apple');\n      expect(angular.element(chips[1]).text().trim()).toEqual('Banana');\n      expect(angular.element(chips[2]).text().trim()).toEqual('Orange');\n    });\n\n    it('should not interpolate old-style tags in a user-provided chip template', function() {\n      var template =\n        '<md-chips ng-model=\"items\">' +\n        '  <md-chip-template><div class=\"mychiptemplate\">{{$chip}}</div></md-chip-template>' +\n        '</md-chips>';\n      var element = buildChips(template);\n      var chips = element[0].querySelectorAll('md-chip .mychiptemplate');\n\n      expect(angular.element(chips[0]).text().trim()).toEqual('{{$chip}}');\n      expect(angular.element(chips[1]).text().trim()).toEqual('{{$chip}}');\n      expect(angular.element(chips[2]).text().trim()).toEqual('{{$chip}}');\n    });\n  });\n\n  // *******************************\n  // Internal helper methods\n  // *******************************\n\n  function buildChips(str) {\n    var container;\n    inject(function($compile) {\n      container = $compile(str)(scope);\n      container.scope().$apply();\n    });\n    attachedElements.push(container);\n    return container;\n  }\n\n  function setupScopeForAutocomplete() {\n    scope.selectedItem = '';\n    scope.searchText = '';\n    scope.fruits = ['Apple', 'Banana', 'Orange', 'Kiwi', 'Grape'];\n    scope.querySearch = function(searchText) {\n      return scope.fruits.filter(function(item) {\n        return item.toLowerCase().indexOf(searchText.toLowerCase()) === 0;\n      });\n    };\n  }\n\n  function simulateInputEnterKey(ctrl) {\n    var event = {};\n    event.preventDefault = jasmine.createSpy('preventDefault');\n    inject(function($mdConstant) {\n      event.keyCode = $mdConstant.KEY_CODE.ENTER;\n    });\n    ctrl.inputKeydown(event);\n  }\n\n  function getChipsElements(root) {\n    return angular.element(root[0].querySelectorAll('md-chips'));\n  }\n\n  function getChipElements(root) {\n    return angular.element(root[0].querySelectorAll('md-chip'));\n  }\n});\n"
  },
  {
    "path": "src/components/chips/contact-chips.spec.js",
    "content": "describe('<md-contact-chips>', function() {\n  var scope;\n  var CONTACT_CHIPS_TEMPLATE = '\\\n      <md-contact-chips\\\n          ng-model=\"contacts\"\\\n          md-contacts=\"querySearch($query)\"\\\n          md-contact-name=\"name\"\\\n          md-contact-image=\"image\"\\\n          md-contact-email=\"email\"\\\n          md-highlight-flags=\"i\"\\\n          md-min-length=\"1\"\\\n          md-chip-append-delay=\"2000\"\\\n          ng-change=\"onModelChange(contacts)\"\\\n          placeholder=\"To\">\\\n      </md-contact-chips>';\n\n  beforeEach(module('material.components.chips'));\n\n  beforeEach(inject(function($rootScope, $mdConstant) {\n    scope = $rootScope.$new(false);\n    var img = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n    scope.allContacts = [\n      {\n        name: 'NAME',\n        email: 'email',\n        image: img\n      }, {\n        name: 'NAME2',\n        email: 'email2',\n        image: img\n      }, {\n        name: 'NAME3',\n        email: 'email3',\n        image: img\n      }\n    ];\n    scope.contacts = [];\n    scope.keys = [$mdConstant.KEY_CODE.COMMA];\n\n    scope.highlightFlags = 'i';\n  }));\n\n  var attachedElements = [];\n  afterEach(function() {\n    attachedElements.forEach(function(element) {\n      var scope = element.scope();\n\n      scope && scope.$destroy();\n      element.remove();\n    });\n    attachedElements = [];\n  });\n\n  describe('basic functionality', function() {\n    it('should show the placeholder', inject(function() {\n      var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n\n      expect(element.find('input').length).toBe(1);\n      expect(element.find('input')[0].placeholder).toBe('To');\n    }));\n\n    it('binds the md-highlight-flags to the controller', function() {\n      var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n      var ctrl = element.controller('mdContactChips');\n\n      expect(ctrl.highlightFlags).toEqual('i');\n    });\n\n    it('should trigger ng-change on chip addition/removal', function() {\n      var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n      var chipsElement = element.find('md-chips');\n      var chipsCtrl = chipsElement.controller('mdChips');\n\n      scope.onModelChange = jasmine.createSpy('onModelChange');\n\n      element.scope().$apply(function() {\n        chipsCtrl.appendChip(scope.allContacts[0]);\n      });\n      expect(scope.onModelChange).toHaveBeenCalled();\n      expect(scope.onModelChange.calls.count()).toBe(1);\n      expect(scope.onModelChange.calls.mostRecent().args[0].length).toBe(1);\n      expect(scope.contacts.length).toBe(1);\n\n      element.scope().$apply(function() {\n        chipsCtrl.removeChip(0);\n      });\n      expect(scope.onModelChange).toHaveBeenCalled();\n      expect(scope.onModelChange.calls.count()).toBe(2);\n      expect(scope.onModelChange.calls.mostRecent().args[0].length).toBe(0);\n      expect(scope.contacts.length).toBe(0);\n    });\n\n    it('forwards the md-chips-append-delay attribute to the md-chips', function() {\n      var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n      var chipsCtrl = element.find('md-chips').controller('mdChips');\n\n      expect(chipsCtrl.chipAppendDelay).toEqual(2000);\n    });\n\n    it('renders an image element for contacts with an image property', function() {\n        scope.contacts.push(scope.allContacts[2]);\n\n        var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n        var chip = angular.element(element[0].querySelector('.md-chip-content'));\n\n        expect(chip.find('img').length).toBe(1);\n    });\n\n    it('does not render an image element for contacts without an image property', function() {\n        var noImageContact = scope.allContacts[2];\n        delete noImageContact.image;\n        scope.contacts.push(noImageContact);\n\n        var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n        var chip = angular.element(element[0].querySelector('.md-chip-content'));\n\n        expect(chip.find('img').length).toBe(0);\n    });\n\n    it('should forward md-min-length attribute to the autocomplete', inject(function() {\n        var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n\n        var autocompleteElement = element.find('md-autocomplete');\n        var autocompleteCtrl = autocompleteElement.controller('mdAutocomplete');\n\n        expect(autocompleteCtrl.scope.minLength).toBe(parseInt(element.attr('md-min-length')));\n      }));\n\n    describe('filtering selected items', function() {\n      it('should filter', inject(function() {\n        scope.querySearch = jasmine.createSpy('querySearch').and.callFake(function(q) {\n          return scope.allContacts;\n        });\n        scope.contacts.push(scope.allContacts[2]);\n\n        var element = buildChips(CONTACT_CHIPS_TEMPLATE);\n\n        var autocompleteElement = element.find('md-autocomplete');\n        var autocompleteCtrl = autocompleteElement.controller('mdAutocomplete');\n\n        element.scope().$apply(function() {\n          autocompleteCtrl.scope.searchText = 'NAME';\n          autocompleteCtrl.focus();\n          autocompleteCtrl.keydown({});\n        });\n\n        var matches = autocompleteCtrl.matches;\n        expect(matches.length).toBe(3);\n      }));\n    });\n\n    describe('custom separator keys', function() {\n      var CONTACT_CHIPS_TEMPLATE_SEPARATOR = '\\\n          <md-contact-chips\\\n              ng-model=\"contacts\"\\\n              md-contacts=\"querySearch($query)\"\\\n              md-contact-name=\"name\"\\\n              md-contact-image=\"image\"\\\n              md-contact-email=\"email\"\\\n              md-highlight-flags=\"i\"\\\n              md-separator-keys=\"keys\"\\\n              placeholder=\"To\">\\\n          </md-contact-chips>';\n\n      it('should add a chip when a separator key is pressed', inject(function($mdConstant, $timeout) {\n        scope.querySearch = jasmine.createSpy('querySearch').and.callFake(function(q) {\n          return scope.allContacts;\n        });\n\n        var element = buildChips(CONTACT_CHIPS_TEMPLATE_SEPARATOR);\n        var ctrl = element.controller('mdContactChips');\n\n        var autocompleteElement = element.find('md-autocomplete');\n        var autocompleteCtrl = autocompleteElement.controller('mdAutocomplete');\n\n        element.scope().$apply(function() {\n          autocompleteCtrl.scope.searchText = 'NAME';\n          autocompleteCtrl.keydown({});\n        });\n\n        autocompleteCtrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW));\n        ctrl.inputKeydown(keydownEvent($mdConstant.KEY_CODE.COMMA, autocompleteElement));\n        $timeout.flush();\n\n        var chips = angular.element(element[0].querySelectorAll('md-chip'));\n        expect(chips.length).toBe(1);\n        expect(chips[0].innerHTML).toContain('NAME2');\n      }));\n    });\n\n  });\n\n  // *******************************\n  // Internal helper methods\n  // *******************************\n\n  function buildChips(str) {\n    var container;\n\n    inject(function($compile, $timeout) {\n      container = $compile(str)(scope);\n      container.scope().$apply();\n      $timeout.flush();\n    });\n\n    attachedElements.push(container);\n\n    return container;\n  }\n\n  function keydownEvent(keyCode, target) {\n    return {\n      keyCode: keyCode,\n      stopPropagation: angular.noop,\n      preventDefault: angular.noop,\n      target: target\n    };\n  }\n});\n"
  },
  {
    "path": "src/components/chips/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"BasicDemoCtrl as ctrl\" layout=\"column\" ng-cloak>\n\n  <md-content class=\"md-padding\" layout=\"column\">\n    <h2 class=\"md-title\">Use the default chip template.</h2>\n    <md-chips ng-model=\"ctrl.fruitNames\" readonly=\"ctrl.readonly\" md-removable=\"ctrl.removable\">\n    </md-chips>\n    <br/>\n    <h2 class=\"md-title\">Use ng-change and add-on-blur</h2>\n    <md-chips ng-model=\"ctrl.ngChangeFruitNames\" md-add-on-blur=\"true\" readonly=\"ctrl.readonly\"\n              ng-change=\"ctrl.onModelChange(ctrl.ngChangeFruitNames)\" input-aria-label=\"Fruit names\"\n              md-removable=\"ctrl.removable\"></md-chips>\n    <br/>\n    <h2 class=\"md-title\">Make chips editable.</h2>\n    <md-chips ng-model=\"ctrl.editableFruitNames\" readonly=\"ctrl.readonly\"\n              md-removable=\"ctrl.removable\" md-enable-chip-edit=\"true\"\n              input-aria-label=\"Fruit names\"></md-chips>\n    <br/>\n    <h2 class=\"md-title\">Use a custom chip template with max chips.</h2>\n    <form name=\"fruitForm\">\n      <md-chips ng-model=\"ctrl.roFruitNames\" name=\"fruitName\" readonly=\"ctrl.readonly\"\n                md-removable=\"ctrl.removable\" md-max-chips=\"5\" placeholder=\"Ex. Peach\"\n                input-aria-label=\"Fruit names\">\n        <md-chip-template>\n          <strong>{{$chip}}</strong>\n          <em>(fruit)</em>\n        </md-chip-template>\n      </md-chips>\n\n      <div class=\"errors\" ng-messages=\"fruitForm.fruitName.$error\">\n        <div ng-message=\"md-max-chips\">Maximum number of chips reached.</div>\n      </div>\n    </form>\n    <br/>\n    <h2 class=\"md-title\">Use a long placeholder with md-input-class.</h2>\n    <md-chips ng-model=\"ctrl.fruitNames\" readonly=\"ctrl.readonly\" md-removable=\"ctrl.removable\"\n              placeholder=\"Ex. Peach, Kiwi, Watermelon, Passion Fruit, Nectarine, etc.\"\n              md-input-class=\"demo-long-fruit-input\">\n    </md-chips>\n    <br/>\n    <h2 class=\"md-title\">Use Placeholders and override hint texts.</h2>\n    <md-chips\n        ng-model=\"ctrl.tags\"\n        readonly=\"ctrl.readonly\"\n        md-removable=\"ctrl.removable\"\n        placeholder=\"Enter a tag\"\n        delete-button-label=\"Remove Tag\"\n        delete-hint=\"Press delete to remove tag\"\n        md-added-message=\"was created\"\n        md-removed-message=\"was deleted\"\n        secondary-placeholder=\"+Tag\"\n        input-aria-label=\"Tags\"\n        container-hint=\"Chips container. Press the right and left arrow keys to change tag selection.\"\n        container-empty-hint=\"Chips container. Enter the text area, start typing, and then press enter when done to add a tag.\">\n    </md-chips>\n    <br/>\n    <h2 class=\"md-title\">Display an ordered set of objects as chips (with custom template).</h2>\n    <p>Note: the variables <code>$chip</code> and <code>$index</code> are available in custom chip templates.</p>\n\n    <md-chips class=\"custom-chips\" ng-model=\"ctrl.vegObjs\" readonly=\"ctrl.readonly\"\n        md-transform-chip=\"ctrl.newVeg($chip)\" md-removable=\"ctrl.removable\"\n        input-aria-label=\"Vegetables\">\n      <md-chip-template>\n        <span>\n          <strong>[{{$index}}] {{$chip.name}}</strong>\n          <em>({{$chip.type}})</em>\n        </span>\n      </md-chip-template>\n      <button md-chip-remove class=\"demo-remove-vegetable-chip\" aria-label=\"Remove {{$chip.name}}\">\n        <md-icon md-svg-icon=\"md-close\"></md-icon>\n      </button>\n    </md-chips>\n\n    <br/>\n    <md-checkbox ng-model=\"ctrl.readonly\">Readonly</md-checkbox>\n    <md-checkbox ng-model=\"ctrl.removable\">\n      Removable (<code>{{ctrl.removable === undefined ? 'undefined' : ctrl.removable}}</code>)\n    </md-checkbox>\n    <p class=\"md-caption\">\n      <b>Note</b>: When md-removable is undefined, readonly automatically sets md-removable to false.\n    </p>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoBasicUsage/readme.html",
    "content": "<p>\n  <b>Note:</b> Version 1.1.2 drastically improves keyboard and screen reader accessibility for the\n  <code>md-chips</code> component. In order to achieve this, the behavior has changed to also select\n  and highlight the newly appended chip for <code>300ms</code> before re-focusing the text input.\n</p>\n<p>\n  Please see the <a href=\"api/directive/mdChips\">documentation</a> for more information and for\n  the new <code>md-chip-append-delay</code> option which allows you to customize this delay.\n</p>\n"
  },
  {
    "path": "src/components/chips/demoBasicUsage/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('chipsDemo', ['ngMaterial', 'ngMessages'])\n      .config(['$mdIconProvider', function($mdIconProvider) {\n        $mdIconProvider.icon('md-close', 'img/icons/ic_close_24px.svg', 24);\n      }])\n      .controller('BasicDemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q, $log) {\n    var self = this;\n\n    self.readonly = false;\n\n    // Lists of fruit names and Vegetable objects\n    self.fruitNames = ['Apple', 'Banana', 'Orange'];\n    self.ngChangeFruitNames = angular.copy(self.fruitNames);\n    self.roFruitNames = angular.copy(self.fruitNames);\n    self.editableFruitNames = angular.copy(self.fruitNames);\n\n    self.tags = [];\n    self.vegObjs = [\n      {\n        'name' : 'Broccoli',\n        'type' : 'Brassica'\n      },\n      {\n        'name' : 'Cabbage',\n        'type' : 'Brassica'\n      },\n      {\n        'name' : 'Carrot',\n        'type' : 'Umbelliferous'\n      }\n    ];\n\n    self.newVeg = function(chip) {\n      return {\n        name: chip,\n        type: 'unknown'\n      };\n    };\n\n    self.onModelChange = function(newModel) {\n      $log.log('The model has changed to ' + newModel + '.');\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoBasicUsage/style.scss",
    "content": ".errors {\n  font-size: 12px;\n  color: rgb(221,44,0);\n  margin-top: 10px;\n}\n.demo-long-fruit-input {\n  min-width: 340px;\n}\n.custom-chips {\n  md-chip {\n    position: relative;\n    padding-right: 24px;\n\n    .md-chip-remove-container {\n      position: absolute;\n      right: 4px;\n      top: 4px;\n      margin-right: 0;\n      height: 26px;\n      display: none;\n\n      button.demo-remove-vegetable-chip {\n        position: relative;\n        height: 24px;\n        width: 24px;\n        line-height: 30px;\n        background: transparent;\n        border: none;\n        padding: 0;\n\n        md-icon {\n          transform: translate(0, -3px) scale(0.75);\n          fill: rgba(0, 0, 0, 0.33);\n        }\n      }\n    }\n    &:hover:not(.md-readonly) .md-chip-remove-container {\n      display: block;\n    }\n    &.md-focused:not(.md-readonly) .md-chip-remove-container {\n      display: block;\n\n      button.demo-remove-vegetable-chip md-icon {\n        fill: rgba(255, 255, 255, 0.87);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/chips/demoContactChips/index.html",
    "content": "<div ng-controller=\"ContactChipDemoCtrl as ctrl\" layout=\"column\" ng-cloak>\n\n  <md-content class=\"md-padding autocomplete\" layout=\"column\">\n    <label id=\"toLabel\">To:</label>\n    <md-contact-chips\n        ng-model=\"ctrl.contacts\"\n        ng-change=\"ctrl.onModelChange(ctrl.contacts)\"\n        md-contacts=\"ctrl.querySearch($query)\"\n        md-contact-name=\"name\"\n        md-contact-image=\"image\"\n        md-contact-email=\"email\"\n        md-require-match=\"true\"\n        md-separator-keys=\"ctrl.keys\"\n        md-highlight-flags=\"i\"\n        placeholder=\"Type name to see matches\"\n        secondary-placeholder=\"Add another contact\"\n        input-aria-label=\"Intended Recipients\">\n    </md-contact-chips>\n\n    <md-list class=\"fixedRows\">\n      <md-subheader class=\"md-no-sticky\">Contacts</md-subheader>\n      <md-list-item class=\"md-2-line contact-item\" ng-repeat=\"(index, contact) in ctrl.allContacts\"\n          ng-if=\"ctrl.contacts.indexOf(contact) < 0\">\n        <img ng-src=\"{{contact.image}}\" class=\"md-avatar\" alt=\"{{contact.name}}\" />\n        <div class=\"md-list-item-text compact\">\n          <h3>{{contact.name}}</h3>\n          <p>{{contact.email}}</p>\n        </div>\n      </md-list-item>\n      <md-list-item class=\"md-2-line contact-item selected\"\n                    ng-repeat=\"(index, contact) in ctrl.contacts\">\n        <img ng-src=\"{{contact.image}}\" class=\"md-avatar\" alt=\"{{contact.name}}\" />\n        <div class=\"md-list-item-text compact\">\n          <h3>{{contact.name}}</h3>\n          <p>{{contact.email}}</p>\n        </div>\n      </md-list-item>\n    </md-list>\n\n    <br>\n    <h2 class=\"md-title\">Searching asynchronously.</h2>\n    <label id=\"fromLabel\">From:</label>\n    <md-contact-chips\n        ng-model=\"ctrl.asyncContacts\"\n        md-contacts=\"ctrl.delayedQuerySearch($query)\"\n        md-contact-name=\"name\"\n        md-contact-image=\"image\"\n        md-contact-email=\"email\"\n        md-require-match=\"true\"\n        md-highlight-flags=\"i\"\n        placeholder=\"Type name to see matches\"\n        secondary-placeholder=\"Add another contact\"\n        input-aria-label=\"Senders\">\n    </md-contact-chips>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoContactChips/script.js",
    "content": "(function () {\n  'use strict';\n\n  // If we do not have CryptoJS defined; import it. This works for our docs site, but not CodePen.\n  if (typeof CryptoJS === 'undefined') {\n    var cryptoSrc = 'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js';\n    var scriptTag = document.createElement('script');\n    scriptTag.setAttribute('src', cryptoSrc);\n    document.body.appendChild(scriptTag);\n  }\n\n  angular\n      .module('contactChipsDemo', ['ngMaterial'])\n      .controller('ContactChipDemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($q, $timeout, $log, $mdConstant) {\n    var self = this;\n    var pendingSearch, cancelSearch = angular.noop;\n    var lastSearch;\n\n    self.allContacts = loadContacts();\n    self.contacts = [self.allContacts[0]];\n    self.asyncContacts = [];\n    self.keys = [$mdConstant.KEY_CODE.COMMA];\n\n    self.querySearch = querySearch;\n    self.delayedQuerySearch = delayedQuerySearch;\n    self.onModelChange = onModelChange;\n\n    /**\n     * Search for contacts; use a random delay to simulate a remote call\n     */\n    function querySearch (criteria) {\n      return criteria ? self.allContacts.filter(createFilterFor(criteria)) : [];\n    }\n\n    /**\n     * Async search for contacts\n     * Also debounce the queries; since the md-contact-chips does not support this\n     */\n    function delayedQuerySearch(criteria) {\n      if (!pendingSearch || !debounceSearch())  {\n        cancelSearch();\n\n        return pendingSearch = $q(function(resolve, reject) {\n          // Simulate async search... (after debouncing)\n          cancelSearch = reject;\n          $timeout(function() {\n\n            resolve(self.querySearch(criteria));\n\n            refreshDebounce();\n          }, Math.random() * 500, true);\n        });\n      }\n\n      return pendingSearch;\n    }\n\n    function refreshDebounce() {\n      lastSearch = 0;\n      pendingSearch = null;\n      cancelSearch = angular.noop;\n    }\n\n    /**\n     * Debounce if querying faster than 300ms\n     */\n    function debounceSearch() {\n      var now = new Date().getMilliseconds();\n      lastSearch = lastSearch || now;\n\n      return ((now - lastSearch) < 300);\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(contact) {\n        return (contact._lowername.indexOf(lowercaseQuery) !== -1);\n      };\n\n    }\n\n    function onModelChange(newModel) {\n      $log.log('The model has changed to ' + JSON.stringify(newModel) + '.');\n    }\n\n    function loadContacts() {\n      var contacts = [\n        'Marina Augustine',\n        'Oddr Sarno',\n        'Nick Giannopoulos',\n        'Narayana Garner',\n        'Anita Gros',\n        'Megan Smith',\n        'Tsvetko Metzger',\n        'Hector Simek',\n        'Some-guy withalongalastaname'\n      ];\n\n      return contacts.map(function (c, index) {\n        var cParts = c.split(' ');\n        var email = cParts[0][0].toLowerCase() + '.' + cParts[1].toLowerCase() + '@example.com';\n        var hash = CryptoJS.MD5(email);\n\n        var contact = {\n          name: c,\n          email: email,\n          image: '//www.gravatar.com/avatar/' + hash + '?s=50&d=retro'\n        };\n        contact._lowername = contact.name.toLowerCase();\n        return contact;\n      });\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoContactChips/style.scss",
    "content": "md-content.autocomplete {\n  min-height: 250px;\n\n  // NOTE: Due to a bug with the virtual repeat sizing, we must manually set the width of\n  // the input so that the autocomplete popup will be properly sized. See issue #4450.\n  input {\n    min-width: 400px;\n  }\n}\n.md-item-text.compact {\n  padding-top: 8px;\n  padding-bottom: 8px;\n}\n.contact-item {\n  box-sizing: border-box;\n  &.selected {\n    background-color: #E3ECF5;\n    p {\n      color: rgba(0,0,0,0.87);\n      font-weight: 400;\n    }\n  }\n  .md-list-item-text {\n    padding: 14px 0;\n    max-width: 190px;\n    h3 {\n      margin: 0 !important;\n      padding: 0;\n      line-height: 1.2em !important;\n    }\n    h3, p {\n      text-overflow: ellipsis;\n      white-space: nowrap;\n      overflow: hidden;\n    }\n  }\n\n  @media (min-width: 960px) {\n    float: left;\n    width: 33%;\n  }\n}\n\nmd-contact-chips {\n  margin-bottom : 10px;\n}\n\n.md-chips {\n  padding: 5px 0 8px;\n}\n\n\n.fixedRows {\n  height: 250px;\n  overflow:hidden;\n}\n"
  },
  {
    "path": "src/components/chips/demoCustomInputs/index.html",
    "content": "<div ng-controller=\"CustomInputDemoCtrl as ctrl\" layout=\"column\" ng-cloak>\n\n  <md-content class=\"md-padding\" layout=\"column\">\n    <h2 id=\"chipsNoModelTitle\" class=\"md-title\">\n      Use an <code>input</code> element with no model to build an ordered set of chips.\n    </h2>\n    <md-chips ng-model=\"ctrl.numberChips\" input-aria-label=\"Numbers with no model\"\n              input-aria-describedby=\"chipsNoModelTitle\"\n              container-empty-hint=\"Chips container. Enter the text area, type a number, and then press enter to add a chip.\">\n      <input type=\"number\" placeholder=\"Enter a number\" aria-label=\"Number chips with no model\">\n    </md-chips>\n\n    <br/>\n    <h2 id=\"chipsWithModelTitle\" class=\"md-title\">\n      Use an <code>input</code> element to build an ordered set of chips.\n    </h2>\n    <md-chips ng-model=\"ctrl.numberChips2\" input-aria-label=\"Numbers with a model\"\n              input-aria-describedby=\"chipsWithModelTitle\"\n              container-empty-hint=\"Chips container. Enter the text area, type a number, and then press enter to add a chip.\">\n      <input type=\"number\" ng-model=\"ctrl.numberBuffer\" placeholder=\"Enter a number\"\n             aria-label=\"Number chips\">\n    </md-chips>\n\n    <br/>\n    <h2 id=\"autocompleteTitle\" class=\"md-title\">\n      Use <code>md-autocomplete</code> to build an ordered set of chips.\n    </h2>\n    <md-chips ng-model=\"ctrl.selectedVegetables\" md-autocomplete-snap\n              md-transform-chip=\"ctrl.transformChip($chip)\"\n              md-require-match=\"ctrl.autocompleteDemoRequireMatch\"\n              input-aria-label=\"Favorite Vegetables\">\n      <md-autocomplete\n          md-selected-item=\"ctrl.selectedItem\"\n          md-search-text=\"ctrl.searchText\"\n          md-items=\"item in ctrl.querySearch(ctrl.searchText)\"\n          md-item-text=\"item.name\"\n          input-aria-describedby=\"autocompleteTitle\"\n          placeholder=\"Search for a vegetable\">\n        <span md-highlight-text=\"ctrl.searchText\">{{item.name}} :: {{item.type}}</span>\n      </md-autocomplete>\n      <md-chip-template>\n        <span>\n          <strong>{{$chip.name}}</strong>\n          <em>({{$chip.type}})</em>\n        </span>\n      </md-chip-template>\n    </md-chips>\n\n    <p>\n      <md-checkbox ng-model=\"ctrl.autocompleteDemoRequireMatch\">\n        Tell the autocomplete to require a match (when enabled you cannot create new chips)\n      </md-checkbox>\n    </p>\n\n    <br />\n    <h2 class=\"md-title\">Vegetable Options</h2>\n\n    <md-list>\n      <md-list-item class=\"md-2-line veggie-option\" ng-repeat=\"veg in ctrl.vegetables\" layout=\"row\"\n          layout-wrap>\n        <div class=\"md-item-text md-whiteframe-z1\" flex>\n          <h3>{{veg.name}}</h3>\n          <p>{{veg.type}}</p>\n        </div>\n      </md-list-item>\n    </md-list>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoCustomInputs/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('chipsCustomInputDemo', ['ngMaterial'])\n      .controller('CustomInputDemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q) {\n    var self = this;\n\n    self.readonly = false;\n    self.selectedItem = null;\n    self.searchText = null;\n    self.querySearch = querySearch;\n    self.vegetables = loadVegetables();\n    self.selectedVegetables = [];\n    self.numberChips = [];\n    self.numberChips2 = [];\n    self.numberBuffer = '';\n    self.autocompleteDemoRequireMatch = true;\n    self.transformChip = transformChip;\n\n    /**\n     * Return the proper object when the append is called.\n     */\n    function transformChip(chip) {\n      // If it is an object, it's already a known chip\n      if (angular.isObject(chip)) {\n        return chip;\n      }\n\n      // Otherwise, create a new one\n      return { name: chip, type: 'new' };\n    }\n\n    /**\n     * Search for vegetables.\n     */\n    function querySearch (query) {\n      var results = query ? self.vegetables.filter(createFilterFor(query)) : [];\n      return results;\n    }\n\n    /**\n     * Create filter function for a query string\n     */\n    function createFilterFor(query) {\n      var lowercaseQuery = query.toLowerCase();\n\n      return function filterFn(vegetable) {\n        return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||\n            (vegetable._lowertype.indexOf(lowercaseQuery) === 0);\n      };\n\n    }\n\n    function loadVegetables() {\n      var veggies = [\n        {\n          'name': 'Broccoli',\n          'type': 'Brassica'\n        },\n        {\n          'name': 'Cabbage',\n          'type': 'Brassica'\n        },\n        {\n          'name': 'Carrot',\n          'type': 'Umbelliferous'\n        },\n        {\n          'name': 'Lettuce',\n          'type': 'Composite'\n        },\n        {\n          'name': 'Spinach',\n          'type': 'Goosefoot'\n        }\n      ];\n\n      return veggies.map(function (veg) {\n        veg._lowername = veg.name.toLowerCase();\n        veg._lowertype = veg.type.toLowerCase();\n        return veg;\n      });\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoCustomInputs/style.css",
    "content": "md-content.autocomplete {\n min-height: 200px;\n}\ninput[type=number] {\n width: 110px;\n}\n.veggie-option {\n float: left;\n width: 20%;\n box-sizing: border-box;\n padding: 0 8px;\n}\n.veggie-option .md-item-text {\n padding: 8px;\n border-radius: 3px;\n}\n.veggie-option .md-item-text h3,\n.veggie-option .md-item-text p {\n padding: 0;\n margin: 0;\n}"
  },
  {
    "path": "src/components/chips/demoCustomSeparatorKeys/index.html",
    "content": "<div ng-controller=\"CustomSeparatorCtrl as ctrl\" layout=\"column\" ng-cloak>\n  <md-content class=\"md-padding\" layout=\"column\">\n\n    <h2 class=\"md-title\">\n      Use <code>md-separator-keys</code> to customize the key codes which trigger chip creation.\n    </h2>\n    <md-subheader id=\"commaSeparatorKeyDescription\">\n      You can use either the Enter or Comma keys to trigger chip creation.\n    </md-subheader>\n    <md-chips\n      ng-model=\"ctrl.tags\" input-aria-label=\"Tags\"\n      md-separator-keys=\"ctrl.keys\"\n      placeholder=\"Ex. angularjs-material\"\n      secondary-placeholder=\"Add another tag\"\n      input-aria-describedby=\"commaSeparatorKeyDescription\">\n    </md-chips>\n    <br/>\n\n    <h2 class=\"md-title\">Add custom separator key codes such as semicolon for e-mails.</h2>\n    <md-subheader id=\"customSeparatorKeyDescription\">\n      You can use the Semicolon, Enter, or Comma keys to trigger chip creation.\n    </md-subheader>\n    <md-chips\n      ng-model=\"ctrl.contacts\" input-aria-label=\"Emails\"\n      md-separator-keys=\"ctrl.customKeys\" placeholder=\"Ex. myemail@example.com\"\n      secondary-placeholder=\"Add another email address\"\n      input-aria-describedby=\"customSeparatorKeyDescription\">\n    </md-chips>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoCustomSeparatorKeys/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('chipsCustomSeparatorDemo', ['ngMaterial'])\n      .controller('CustomSeparatorCtrl', DemoCtrl);\n\n  function DemoCtrl ($mdConstant) {\n    // Use common key codes found in $mdConstant.KEY_CODE...\n    this.keys = [$mdConstant.KEY_CODE.ENTER, $mdConstant.KEY_CODE.COMMA];\n    this.tags = [];\n\n    // Any key code can be used to create a custom separator\n    var semicolon = 186;\n    this.customKeys = [$mdConstant.KEY_CODE.ENTER, $mdConstant.KEY_CODE.COMMA, semicolon];\n    this.contacts = ['test@example.com'];\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoCustomSeparatorKeys/style.scss",
    "content": "h2 {\n  margin-bottom: 0;\n}\n"
  },
  {
    "path": "src/components/chips/demoStaticChips/index.html",
    "content": "<div ng-controller=\"DemoCtrl as ctrl\" layout=\"column\" ng-cloak>\n  <md-content class=\"md-padding\" layout=\"column\">\n    <h2 id=\"staticChipsTitle\" class=\"md-title\">Display a set of items as chips.</h2>\n\n    <md-chips input-aria-label=\"Favorite Sports\" input-aria-describedby=\"staticChipsNote\">\n      <md-chip>Baseball</md-chip>\n      <md-chip>Hockey</md-chip>\n      <md-chip>Lacrosse</md-chip>\n      <!-- Static chips are transcluded -->\n      <md-chip>{{ctrl.chipText}}</md-chip>\n    </md-chips>\n    <p id=\"staticChipsNote\" class=\"note\">\n      Static chips cannot be selected, removed or edited, and are not part of any model.<br/>\n      If no <code>ng-model</code> is provided, there are no input elements in <code>md-chips</code>.\n    </p>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoStaticChips/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('staticChipsDemo', ['ngMaterial'])\n      .controller('DemoCtrl', DemoCtrl);\n\n  function DemoCtrl ($timeout, $q) {\n    this.chipText = 'Football';\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoStaticChips/style.css",
    "content": "p.note {\n  font-size: 12px;\n}\n"
  },
  {
    "path": "src/components/chips/demoValidation/index.html",
    "content": "<div ng-controller=\"ChipsValidationCtrl as ctrl\" layout=\"column\" ng-cloak>\n  <md-content class=\"md-padding\" layout=\"column\">\n\n    <h2 class=\"md-title\">Example: Required</h2>\n    <form name=\"form\">\n      <label id=\"fruitLabel\">Favorite Fruits</label>\n      <md-chips name=\"fruits\" input-aria-labelledby=\"fruitLabel\"\n                ng-model=\"ctrl.selectedFruit\"\n                ng-required=\"true\"\n                placeholder=\"Ex. Apple\"\n                secondary-placeholder=\"Add another fruit\">\n      </md-chips>\n      <div class=\"md-chips-messages\"\n           ng-show=\"form.fruits.$touched || form.$submitted\"\n           ng-messages=\"form.fruits.$error\">\n        <div ng-message=\"required\">At least one fruit is required</div>\n      </div>\n\n      <h2 class=\"md-title\">Example: Max Chips</h2>\n      <label id=\"vegetableLabel\">Favorite Vegetables</label>\n      <md-chips name=\"vegetables\" input-aria-labelledby=\"vegetableLabel\"\n                ng-model=\"ctrl.selectedVegetables\"\n                md-max-chips=\"5\"\n                placeholder=\"Ex. Carrot\"\n                secondary-placeholder=\"Add another vegetable\">\n      </md-chips>\n      <div class=\"md-chips-messages\"\n           ng-show=\"form.vegetables.$touched || form.$submitted\"\n           ng-messages=\"form.vegetables.$error\">\n        <div ng-message=\"md-max-chips\">You reached the maximum number of vegetables</div>\n      </div>\n      <br>\n      <md-button class=\"md-primary\" type=\"submit\" ng-click=\"ctrl.onSubmit(form)\">\n        Submit Form\n      </md-button>\n    </form>\n\n    <p class=\"note\">\n      Be aware that error messages for chips are not styled by default since they are not part of\n      <code>md-input-container</code>.\n    </p>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/chips/demoValidation/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n    .module('chipsValidationDemo', ['ngMaterial', 'ngMessages'])\n    .controller('ChipsValidationCtrl', ValidationCtrl);\n\n  function ValidationCtrl ($log) {\n    this.selectedFruit = [];\n    this.selectedVegetables = [];\n    this.onSubmit = function(form) {\n      $log.log({fruits: form.fruits.$modelValue, vegetables: form.vegetables.$modelValue});\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/chips/demoValidation/style.scss",
    "content": ".md-chips-messages {\n  color: rgb(221,44,0);\n  position: relative;\n  order: 4;\n  overflow: hidden;\n}\n\n.md-chips-messages [ng-message] {\n  font-size: 12px;\n  line-height: 14px;\n  overflow: hidden;\n  margin-top: 0;\n  padding-top: 5px;\n}\n\np.note {\n  font-size: 12px;\n}\n"
  },
  {
    "path": "src/components/chips/js/chipController.js",
    "content": "angular\n  .module('material.components.chips')\n  .controller('MdChipCtrl', MdChipCtrl);\n\n/**\n * Controller for the MdChip component. Responsible for handling keyboard\n * events and editing the chip if needed.\n *\n * @param $scope\n * @param $element\n * @param $mdConstant\n * @param $timeout\n * @param $mdUtil\n * @constructor\n */\nfunction MdChipCtrl ($scope, $element, $mdConstant, $timeout, $mdUtil) {\n  /**\n   * @type {$scope}\n   */\n  this.$scope = $scope;\n\n  /**\n   * @type {$element}\n   */\n  this.$element = $element;\n\n  /**\n   * @type {$mdConstant}\n   */\n  this.$mdConstant = $mdConstant;\n\n  /**\n   * @type {$timeout}\n   */\n  this.$timeout = $timeout;\n\n  /**\n   * @type {$mdUtil}\n   */\n  this.$mdUtil = $mdUtil;\n\n  /**\n   * @type {boolean}\n   */\n  this.isEditing = false;\n\n  /**\n   * @type {MdChipsCtrl}\n   */\n  this.parentController = undefined;\n\n  /**\n   * @type {boolean}\n   */\n  this.enableChipEdit = false;\n}\n\n\n/**\n * @param {MdChipsCtrl} controller\n */\nMdChipCtrl.prototype.init = function(controller) {\n  this.parentController = controller;\n  this.enableChipEdit = this.parentController.enableChipEdit;\n\n  if (this.enableChipEdit) {\n    this.$element.on('keydown', this.chipKeyDown.bind(this));\n    this.$element.on('dblclick', this.chipMouseDoubleClick.bind(this));\n    this.getChipContent().addClass('_md-chip-content-edit-is-enabled');\n  }\n};\n\n\n/**\n * @return {Object} first element with the md-chip-content class\n */\nMdChipCtrl.prototype.getChipContent = function() {\n  var chipContents = this.$element[0].getElementsByClassName('md-chip-content');\n  return angular.element(chipContents[0]);\n};\n\n\n/**\n * When editing the chip, if the user modifies the existing contents, we'll get a span back and\n * need to ignore text elements as they only contain blank space.\n * `children()` ignores text elements.\n *\n * When editing the chip, if the user deletes the contents and then enters some new content\n * we'll only get a text element back.\n * @return {Object} jQuery object representing the content element of the chip\n */\nMdChipCtrl.prototype.getContentElement = function() {\n  var contentElement = angular.element(this.getChipContent().children()[0]);\n  if (!contentElement || contentElement.length === 0) {\n    contentElement = angular.element(this.getChipContent().contents()[0]);\n  }\n  return contentElement;\n};\n\n\n/**\n * @return {number} index of this chip\n */\nMdChipCtrl.prototype.getChipIndex = function() {\n  return parseInt(this.$element.attr('index'));\n};\n\n\n/**\n * Update the chip's contents, focus the chip if it's selected, and exit edit mode.\n * If the contents were updated to be empty, remove the chip and re-focus the input element.\n */\nMdChipCtrl.prototype.goOutOfEditMode = function() {\n  if (!this.isEditing) {\n    return;\n  }\n\n  this.isEditing = false;\n  this.$element.removeClass('_md-chip-editing');\n  this.getChipContent()[0].contentEditable = 'false';\n  var chipIndex = this.getChipIndex();\n\n  var content = this.getContentElement().text();\n  if (content) {\n    this.parentController.updateChipContents(chipIndex, content);\n\n    this.$mdUtil.nextTick(function() {\n      if (this.parentController.selectedChip === chipIndex) {\n        this.parentController.focusChip(chipIndex);\n      }\n    }.bind(this));\n  } else {\n    this.parentController.removeChipAndFocusInput(chipIndex);\n  }\n};\n\n\n/**\n * Given an HTML element. Selects contents of it.\n * @param {Element} node\n */\nMdChipCtrl.prototype.selectNodeContents = function(node) {\n  var range, selection;\n  if (document.body.createTextRange) {\n    range = document.body.createTextRange();\n    range.moveToElementText(node);\n    range.select();\n  } else if (window.getSelection) {\n    selection = window.getSelection();\n    range = document.createRange();\n    range.selectNodeContents(node);\n    selection.removeAllRanges();\n    selection.addRange(range);\n  }\n};\n\n\n/**\n * Presents an input element to edit the contents of the chip.\n */\nMdChipCtrl.prototype.goInEditMode = function() {\n  this.isEditing = true;\n  this.$element.addClass('_md-chip-editing');\n  this.getChipContent()[0].contentEditable = 'true';\n  this.getChipContent().on('blur', function() {\n    this.goOutOfEditMode();\n  }.bind(this));\n\n  this.selectNodeContents(this.getChipContent()[0]);\n};\n\n\n/**\n * Handles the keydown event on the chip element. If enable-chip-edit attribute is\n * set to true, space or enter keys can trigger going into edit mode. Enter can also\n * trigger submitting if the chip is already being edited.\n * @param {KeyboardEvent} event\n */\nMdChipCtrl.prototype.chipKeyDown = function(event) {\n  if (!this.isEditing &&\n    (event.keyCode === this.$mdConstant.KEY_CODE.ENTER ||\n      event.keyCode === this.$mdConstant.KEY_CODE.SPACE)) {\n    event.preventDefault();\n    this.goInEditMode();\n  } else if (this.isEditing && event.keyCode === this.$mdConstant.KEY_CODE.ENTER) {\n    event.preventDefault();\n    this.goOutOfEditMode();\n  }\n};\n\n\n/**\n * Enter edit mode if we're not already editing and the enable-chip-edit attribute is enabled.\n */\nMdChipCtrl.prototype.chipMouseDoubleClick = function() {\n  if (this.enableChipEdit && !this.isEditing) {\n    this.goInEditMode();\n  }\n};\n"
  },
  {
    "path": "src/components/chips/js/chipDirective.js",
    "content": "angular\n  .module('material.components.chips')\n  .directive('mdChip', MdChip);\n\n/**\n * @ngdoc directive\n * @name mdChip\n * @module material.components.chips\n *\n * @description\n * `<md-chip>` is a component used within `<md-chips>`. It is responsible for rendering an\n * individual chip.\n *\n *\n * @usage\n * <hljs lang=\"html\">\n *   <md-chips>\n *     <md-chip>{{$chip}}</md-chip>\n *   </md-chips>\n * </hljs>\n *\n */\n\n/**\n * MDChip Directive Definition\n *\n * @param $mdTheming\n * @param $mdUtil\n * @param $compile\n * @param $timeout\n * @ngInject\n */\nfunction MdChip($mdTheming, $mdUtil, $compile, $timeout) {\n  return {\n    restrict: 'E',\n    require: ['^?mdChips', 'mdChip'],\n    link: postLink,\n    controller: 'MdChipCtrl'\n  };\n\n  function postLink(scope, element, attr, ctrls) {\n    var chipsController = ctrls.shift();\n    var chipController = ctrls.shift();\n    var chipContentElement = angular.element(element[0].querySelector('.md-chip-content'));\n\n    $mdTheming(element);\n\n    if (chipsController) {\n      chipController.init(chipsController);\n\n      // When a chip is blurred, make sure to unset (or reset) the selected chip so that tabbing\n      // through elements works properly\n      chipContentElement.on('blur', function() {\n        chipsController.resetSelectedChip();\n        chipsController.$scope.$applyAsync();\n      });\n    }\n\n    // Use $timeout to ensure we run AFTER the element has been added to the DOM so we can focus it.\n    $timeout(function() {\n      if (!chipsController) {\n        return;\n      }\n\n      if (chipsController.shouldFocusLastChip) {\n        chipsController.focusLastChipThenInput();\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "src/components/chips/js/chipRemoveDirective.js",
    "content": "angular\n    .module('material.components.chips')\n    .directive('mdChipRemove', MdChipRemove);\n\n/**\n * @ngdoc directive\n * @name mdChipRemove\n * @restrict A\n * @module material.components.chips\n *\n * @description\n * Indicates that the associated element should be used as the delete button template for all chips.\n * The associated element must be a child of `md-chips`.\n *\n * The provided button template will be appended to each chip and will remove the associated chip\n * on click.\n *\n * The button is not styled or themed based on the theme set on the `md-chips` component. A theme\n * class and custom icon can be specified in your template.\n *\n * You can also specify the `type` of the button in your template.\n *\n * @usage\n * ### With Standard Chips\n * <hljs lang=\"html\">\n *   <md-chips ...>\n *     <button md-chip-remove type=\"button\" aria-label=\"Remove {{$chip}}\">\n *       <md-icon md-svg-icon=\"md-cancel\"></md-icon>\n *     </button>\n *   </md-chips>\n * </hljs>\n *\n * ### With Object Chips\n * <hljs lang=\"html\">\n *   <md-chips ...>\n *     <button md-chip-remove type=\"button\" aria-label=\"Remove {{$chip.name}}\">\n *       <md-icon md-svg-icon=\"md-cancel\"></md-icon>\n *     </button>\n *   </md-chips>\n * </hljs>\n */\n\n\n/**\n * MdChipRemove Directive Definition.\n *\n * @param $timeout\n * @returns {{restrict: string, require: string[], link: Function, scope: boolean}}\n * @constructor\n */\nfunction MdChipRemove ($timeout) {\n  return {\n    restrict: 'A',\n    require: '^mdChips',\n    scope: false,\n    link: postLink\n  };\n\n  function postLink(scope, element, attr, ctrl) {\n    element.on('click', function() {\n      scope.$apply(function() {\n        ctrl.removeChip(scope.$$replacedScope.$index);\n      });\n    });\n\n    // Child elements aren't available until after a $timeout tick as they are hidden by an\n    // `ng-if`. see http://goo.gl/zIWfuw\n    $timeout(function() {\n      element.attr({ 'tabindex': '-1', 'aria-hidden': 'true' });\n      element.find('button').attr('tabindex', '-1');\n    });\n  }\n}\n"
  },
  {
    "path": "src/components/chips/js/chipTranscludeDirective.js",
    "content": "angular\n    .module('material.components.chips')\n    .directive('mdChipTransclude', MdChipTransclude);\n\nfunction MdChipTransclude ($compile) {\n  return {\n    restrict: 'EA',\n    terminal: true,\n    link: link,\n    scope: false\n  };\n  function link (scope, element, attr) {\n    var ctrl = scope.$parent.$mdChipsCtrl,\n        newScope = ctrl.parent.$new(false, ctrl.parent);\n    newScope.$$replacedScope = scope;\n    newScope.$chip = scope.$chip;\n    newScope.$index = scope.$index;\n    newScope.$mdChipsCtrl = ctrl;\n\n    var newHtml = ctrl.$scope.$eval(attr.mdChipTransclude);\n\n    element.html(newHtml);\n    $compile(element.contents())(newScope);\n  }\n}\n"
  },
  {
    "path": "src/components/chips/js/chipsController.js",
    "content": "/**\n * The default chip append delay.\n *\n * @type {number}\n */\nvar DEFAULT_CHIP_APPEND_DELAY = 300;\n\nangular\n    .module('material.components.chips')\n    .controller('MdChipsCtrl', MdChipsCtrl);\n\n/**\n * Controller for the MdChips component. Responsible for adding to and\n * removing from the list of chips, marking chips as selected, and binding to\n * the models of various input components.\n *\n * @param $scope\n * @param $attrs\n * @param $mdConstant\n * @param $log\n * @param $element\n * @param $timeout\n * @param $mdUtil\n * @param $mdLiveAnnouncer\n * @param $exceptionHandler\n * @constructor\n */\nfunction MdChipsCtrl ($scope, $attrs, $mdConstant, $log, $element, $timeout, $mdUtil,\n                      $mdLiveAnnouncer, $exceptionHandler) {\n  /** @type {Function} **/\n  this.$timeout = $timeout;\n\n  /** @type {Object} */\n  this.$mdConstant = $mdConstant;\n\n  /** @type {angular.$scope} */\n  this.$scope = $scope;\n\n  /** @type {angular.$scope} */\n  this.parent = $scope.$parent;\n\n  /** @type {$mdUtil} */\n  this.$mdUtil = $mdUtil;\n\n  /** @type {$log} */\n  this.$log = $log;\n\n  /** @type {$mdLiveAnnouncer} */\n  this.$mdLiveAnnouncer = $mdLiveAnnouncer;\n\n  /** @type {$exceptionHandler} */\n  this.$exceptionHandler = $exceptionHandler;\n\n  /** @type {$element} */\n  this.$element = $element;\n\n  /** @type {$attrs} */\n  this.$attrs = $attrs;\n\n  /** @type {angular.NgModelController} */\n  this.ngModelCtrl = null;\n\n  /** @type {angular.NgModelController} */\n  this.userInputNgModelCtrl = null;\n\n  /** @type {MdAutocompleteCtrl} */\n  this.autocompleteCtrl = null;\n\n  /** @type {Element} */\n  this.userInputElement = null;\n\n  /** @type {Array.<Object>} */\n  this.items = [];\n\n  /** @type {number} */\n  this.selectedChip = -1;\n\n  /** @type {string} */\n  this.enableChipEdit = $mdUtil.parseAttributeBoolean($attrs.mdEnableChipEdit);\n\n  /** @type {string} */\n  this.addOnBlur = $mdUtil.parseAttributeBoolean($attrs.mdAddOnBlur);\n\n  /**\n   * The class names to apply to the autocomplete or input.\n   * @type {string}\n   */\n  this.inputClass = '';\n\n  /**\n   * The text to be used as the aria-label for the input.\n   * @type {string}\n   */\n  this.inputAriaLabel = 'Chips input.';\n\n  /**\n   * Label text to describe the chips container. Used to give context and instructions to screen\n   * reader users when the chips container is selected.\n   * @type {string}\n   */\n  this.containerHint = 'Chips container. Use arrow keys to select chips.';\n\n  /**\n   * Label text to describe the chips container when it is empty. Used to give context and\n   * instructions to screen reader users when the chips container is selected and it contains\n   * no chips.\n   * @type {string}\n   */\n  this.containerEmptyHint =\n    'Chips container. Enter the text area, then type text, and press enter to add a chip.';\n\n  /**\n   * Hidden hint text for how to delete a chip. Used to give context to screen readers.\n   * @type {string}\n   */\n  this.deleteHint = 'Press delete to remove this chip.';\n\n  /**\n   * Hidden label for the delete button. Used to give context to screen readers.\n   * @type {string}\n   */\n  this.deleteButtonLabel = 'Remove';\n\n  /**\n   * Model used by the input element.\n   * @type {string}\n   */\n  this.chipBuffer = '';\n\n  /**\n   * Whether to use the transformChip expression to transform the chip buffer\n   * before appending it to the list.\n   * @type {boolean}\n   */\n  this.useTransformChip = false;\n\n  /**\n   * Whether to use the onAdd expression to notify of chip additions.\n   * @type {boolean}\n   */\n  this.useOnAdd = false;\n\n  /**\n   * Whether to use the onRemove expression to notify of chip removals.\n   * @type {boolean}\n   */\n  this.useOnRemove = false;\n\n  /**\n   * The ID of the chips wrapper which is used to build unique IDs for the chips and the aria-owns\n   * attribute.\n   *\n   * Defaults to '_md-chips-wrapper-' plus a unique number.\n   *\n   * @type {string}\n   */\n  this.wrapperId = '';\n\n  /**\n   * Array of unique numbers which will be auto-generated any time the items change, and is used to\n   * create unique IDs for the aria-owns attribute.\n   *\n   * @type {Array<number>}\n   */\n  this.contentIds = [];\n\n  /**\n   * The index of the chip that should have it's `tabindex` property set to `0` so it is selectable\n   * via the keyboard.\n   *\n   * @type {number|null}\n   */\n  this.ariaTabIndex = null;\n\n  /**\n   * After appending a chip, the chip will be focused for this number of milliseconds before the\n   * input is refocused.\n   *\n   * **Note:** This is **required** for compatibility with certain screen readers in order for\n   * them to properly allow keyboard access.\n   *\n   * @type {number}\n   */\n  this.chipAppendDelay = DEFAULT_CHIP_APPEND_DELAY;\n\n  /**\n   * Collection of functions to call to un-register watchers\n   *\n   * @type {Array}\n   */\n  this.deRegister = [];\n\n  /**\n   * The screen reader will announce the chip content followed by this message when a chip is added.\n   * @type {string}\n   */\n  this.addedMessage = 'added';\n\n  /**\n   * The screen reader will announce the chip content followed by this message when a chip is\n   * removed.\n   * @type {string}\n   */\n  this.removedMessage = 'removed';\n\n  this.init();\n}\n\n/**\n * Initializes variables and sets up watchers\n */\nMdChipsCtrl.prototype.init = function() {\n  var ctrl = this;\n\n  // Set the wrapper ID\n  this.wrapperId = '_md-chips-wrapper-' + this.$mdUtil.nextUid();\n\n  // If we're using static chips, then we need to initialize a few things.\n  if (!this.$element.attr('ng-model')) {\n    this.setupStaticChips();\n  }\n\n  // Setup a watcher which manages the role and aria-owns attributes.\n  // This is never called for static chips since items is not defined.\n  this.deRegister.push(\n    this.$scope.$watchCollection('$mdChipsCtrl.items', function() {\n      // Make sure our input and wrapper have the correct ARIA attributes\n      ctrl.setupInputAria();\n      ctrl.setupWrapperAria();\n    })\n  );\n\n  this.deRegister.push(\n    this.$attrs.$observe('mdChipAppendDelay', function(newValue) {\n      ctrl.chipAppendDelay = parseInt(newValue) || DEFAULT_CHIP_APPEND_DELAY;\n    })\n  );\n};\n\n/**\n * Destructor for cleanup\n */\nMdChipsCtrl.prototype.$onDestroy = function $onDestroy() {\n  var $destroyFn;\n  while (($destroyFn = this.deRegister.pop())) {\n    $destroyFn.call(this);\n  }\n};\n\n/**\n * If we have an input, ensure it has the appropriate ARIA attributes.\n */\nMdChipsCtrl.prototype.setupInputAria = function() {\n  var input = this.$element.find('input');\n\n  // If we have no input, just return\n  if (!input) {\n    return;\n  }\n\n  input.attr('role', 'textbox');\n  input.attr('aria-multiline', true);\n  if (this.inputAriaDescribedBy) {\n    input.attr('aria-describedby', this.inputAriaDescribedBy);\n  }\n  if (this.inputAriaLabelledBy) {\n    input.attr('aria-labelledby', this.inputAriaLabelledBy);\n    input.removeAttr('aria-label');\n  } else {\n    input.attr('aria-label', this.inputAriaLabel);\n  }\n};\n\n/**\n * Ensure our wrapper has the appropriate ARIA attributes.\n */\nMdChipsCtrl.prototype.setupWrapperAria = function() {\n  var ctrl = this,\n      wrapper = this.$element.find('md-chips-wrap');\n\n  if (this.items && this.items.length) {\n    // Dynamically add the listbox role on every change because it must be removed when there are\n    // no items.\n    wrapper.attr('role', 'listbox');\n\n    // Generate some random (but unique) IDs for each chip\n    this.contentIds = this.items.map(function() {\n      return ctrl.wrapperId + '-chip-' + ctrl.$mdUtil.nextUid();\n    });\n\n    // Use the contentIDs above to generate the aria-owns attribute\n    wrapper.attr('aria-owns', this.contentIds.join(' '));\n    wrapper.attr('aria-label', this.containerHint);\n  } else {\n    // If we have no items, then the role and aria-owns attributes MUST be removed\n    wrapper.removeAttr('role');\n    wrapper.removeAttr('aria-owns');\n    wrapper.attr('aria-label', this.containerEmptyHint);\n  }\n};\n\n/**\n * Apply specific roles and aria attributes for static chips\n */\nMdChipsCtrl.prototype.setupStaticChips = function() {\n  var ctrl = this, i, staticChips;\n  var wrapper = this.$element.find('md-chips-wrap');\n\n  this.$timeout(function() {\n    wrapper.attr('role', 'list');\n    staticChips = wrapper[0].children;\n    for (i = 0; i < staticChips.length; i++) {\n      staticChips[i].setAttribute('role', 'listitem');\n      staticChips[i].setAttribute('aria-setsize', staticChips.length);\n    }\n    if (ctrl.inputAriaDescribedBy) {\n      wrapper.attr('aria-describedby', ctrl.inputAriaDescribedBy);\n    }\n    if (ctrl.inputAriaLabelledBy) {\n      wrapper.attr('aria-labelledby', ctrl.inputAriaLabelledBy);\n      wrapper.removeAttr('aria-label');\n    } else {\n      wrapper.attr('aria-label', ctrl.inputAriaLabel);\n    }\n  }, 10);\n};\n\n/**\n * Handles the keydown event on the input element: by default <enter> appends\n * the buffer to the chip list, while backspace removes the last chip in the\n * list if the current buffer is empty.\n * @param {jQuery.Event|KeyboardEvent} event\n */\nMdChipsCtrl.prototype.inputKeydown = function(event) {\n  var chipBuffer = this.getChipBuffer();\n\n  // If we have an autocomplete, and it handled the event, we have nothing to do\n  if (this.autocompleteCtrl && event.isDefaultPrevented && event.isDefaultPrevented()) {\n    return;\n  }\n\n  if (event.keyCode === this.$mdConstant.KEY_CODE.BACKSPACE) {\n    // Only select and focus the previous chip, if the current caret position of the\n    // input element is at the beginning.\n    if (this.getCursorPosition(event.target) !== 0) {\n      return;\n    }\n\n    event.preventDefault();\n    event.stopPropagation();\n\n    if (this.items.length) {\n      this.selectAndFocusChipSafe(this.items.length - 1);\n    }\n\n    return;\n  }\n\n  // By default <enter> appends the buffer to the chip list.\n  if (!this.separatorKeys || this.separatorKeys.length < 1) {\n    this.separatorKeys = [this.$mdConstant.KEY_CODE.ENTER];\n  }\n\n  // Support additional separator key codes in an array of `md-separator-keys`.\n  if (this.separatorKeys.indexOf(event.keyCode) !== -1) {\n    if ((this.autocompleteCtrl && this.requireMatch) || !chipBuffer) return;\n    event.preventDefault();\n\n    // Only append the chip and reset the chip buffer if the max chips limit isn't reached.\n    if (this.hasMaxChipsReached()) return;\n\n    this.appendChip(chipBuffer.trim());\n    this.resetChipBuffer();\n\n    return false;\n  }\n};\n\n/**\n * Returns the cursor position of the specified input element.\n * @param {HTMLInputElement} element relevant input element\n * @returns {Number} Cursor Position of the input.\n */\nMdChipsCtrl.prototype.getCursorPosition = function(element) {\n  /*\n   * Figure out whether the current input for the chips buffer is valid for using\n   * the selectionStart / end property to retrieve the cursor position.\n   * Some browsers do not allow the use of those attributes, on different input types.\n   */\n  try {\n    if (element.selectionStart === element.selectionEnd) {\n      return element.selectionStart;\n    }\n  } catch (e) {\n    if (!element.value) {\n      return 0;\n    }\n  }\n};\n\n\n/**\n * Updates the content of the chip at given index\n * @param {number} chipIndex\n * @param {string} chipContents\n */\nMdChipsCtrl.prototype.updateChipContents = function(chipIndex, chipContents) {\n  if (chipIndex >= 0 && chipIndex < this.items.length) {\n    this.items[chipIndex] = chipContents;\n    this.updateNgModel(true);\n  }\n};\n\n\n/**\n * @return {boolean} true if a chip is currently being edited. False otherwise.\n */\nMdChipsCtrl.prototype.isEditingChip = function() {\n  return !!this.$element[0].querySelector('._md-chip-editing');\n};\n\n/**\n * @param {string|Object} chip contents of a single chip\n * @returns {boolean} true if the chip is an Object, false otherwise.\n * @private\n */\nMdChipsCtrl.prototype._isChipObject = function(chip) {\n  return angular.isObject(chip);\n};\n\n/**\n * @returns {boolean} true if chips can be removed, false otherwise.\n */\nMdChipsCtrl.prototype.isRemovable = function() {\n  // Return false if we have static chips\n  if (!this.ngModelCtrl) {\n    return false;\n  }\n\n  return this.readonly ? this.removable :\n         angular.isDefined(this.removable) ? this.removable : true;\n};\n\n/**\n * Handles the keydown event on the chip elements: backspace removes the selected chip, arrow\n * keys switch which chip is active.\n * @param {KeyboardEvent} event\n */\nMdChipsCtrl.prototype.chipKeydown = function (event) {\n  if (this.getChipBuffer()) return;\n  if (this.isEditingChip()) return;\n\n  switch (event.keyCode) {\n    case this.$mdConstant.KEY_CODE.BACKSPACE:\n    case this.$mdConstant.KEY_CODE.DELETE:\n      if (this.selectedChip < 0) return;\n      event.preventDefault();\n      // Cancel the delete action only after the event cancel. Otherwise the page will go back.\n      if (!this.isRemovable()) return;\n      this.removeAndSelectAdjacentChip(this.selectedChip, event);\n      break;\n    case this.$mdConstant.KEY_CODE.LEFT_ARROW:\n      event.preventDefault();\n      // By default, allow selection of -1 which will focus the input; if we're readonly, don't go\n      // below 0.\n      if (this.selectedChip < 0 || (this.readonly && this.selectedChip === 0)) {\n        this.selectedChip = this.items.length;\n      }\n      if (this.items.length) this.selectAndFocusChipSafe(this.selectedChip - 1);\n      break;\n    case this.$mdConstant.KEY_CODE.RIGHT_ARROW:\n      event.preventDefault();\n      this.selectAndFocusChipSafe(this.selectedChip + 1);\n      break;\n    case this.$mdConstant.KEY_CODE.ESCAPE:\n    case this.$mdConstant.KEY_CODE.TAB:\n      if (this.selectedChip < 0) return;\n      event.preventDefault();\n      this.onFocus();\n      break;\n  }\n};\n\n/**\n * Get the input's placeholder - uses `placeholder` when list is empty and `secondary-placeholder`\n * when the list is non-empty. If `secondary-placeholder` is not provided, `placeholder` is used\n * always.\n * @returns {string}\n */\nMdChipsCtrl.prototype.getPlaceholder = function() {\n  // Allow `secondary-placeholder` to be blank.\n  var useSecondary = (this.items && this.items.length &&\n      (this.secondaryPlaceholder === '' || this.secondaryPlaceholder));\n  return useSecondary ? this.secondaryPlaceholder : this.placeholder;\n};\n\n/**\n * Removes chip at {@code index} and selects the adjacent chip.\n * @param {number} index adjacent chip to select\n * @param {Event=} event\n */\nMdChipsCtrl.prototype.removeAndSelectAdjacentChip = function(index, event) {\n  var self = this;\n  var selIndex = self.getAdjacentChipIndex(index);\n  var wrap = this.$element[0].querySelector('md-chips-wrap');\n  var chip = this.$element[0].querySelector('md-chip[index=\"' + index + '\"]');\n\n  self.removeChip(index, event);\n\n  // The double-timeout is currently necessary to ensure that the DOM has finalized and the select()\n  // will find the proper chip since the selection is index-based.\n  //\n  // TODO: Investigate calling from within chip $scope.$on('$destroy') to reduce/remove timeouts\n  self.$timeout(function() {\n    self.$timeout(function() {\n      self.selectAndFocusChipSafe(selIndex);\n    });\n  });\n};\n\n/**\n * Sets the selected chip index to -1.\n */\nMdChipsCtrl.prototype.resetSelectedChip = function() {\n  this.selectedChip = -1;\n  this.ariaTabIndex = null;\n};\n\n/**\n * Gets the index of an adjacent chip to select after deletion. Adjacency is\n * determined as the next chip in the list, unless the target chip is the\n * last in the list, then it is the chip immediately preceding the target. If\n * there is only one item in the list, -1 is returned (select none).\n * The number returned is the index to select AFTER the target has been removed.\n * If the current chip is not selected, then -1 is returned to select none.\n * @param {number} index\n * @returns {number}\n */\nMdChipsCtrl.prototype.getAdjacentChipIndex = function(index) {\n  var len = this.items.length - 1;\n  return (len === 0) ? -1 :\n      (index === len) ? index - 1 : index;\n};\n\n/**\n * Append the contents of the buffer to the chip list. This method will first\n * call out to the md-transform-chip method, if provided.\n * @param {string} newChip chip buffer contents that will be used to create the new chip\n */\nMdChipsCtrl.prototype.appendChip = function(newChip) {\n  this.shouldFocusLastChip = !this.addOnBlur;\n  if (this.useTransformChip && this.transformChip) {\n    var transformedChip = this.transformChip({'$chip': newChip});\n\n    // Check to make sure the chip is defined before assigning it, otherwise, we'll just assume\n    // they want the string version.\n    if (angular.isDefined(transformedChip)) {\n      newChip = transformedChip;\n    }\n  }\n\n  // If items contains an identical object to newChip, do not append\n  if (angular.isObject(newChip)) {\n    var identical = this.items.some(function(item) {\n      return angular.equals(newChip, item);\n    });\n    if (identical) return;\n  }\n\n  // Check for a null (but not undefined), or existing chip and cancel appending\n  if (newChip == null || this.items.indexOf(newChip) + 1) return;\n\n  // Append the new chip onto our list\n  var length = this.items.push(newChip);\n  var index = length - 1;\n\n  this.updateNgModel();\n\n  // Tell screen reader users that the chip was successfully added.\n  // TODO add a way for developers to specify which field of the object should be announced here.\n  var chipContent = angular.isObject(newChip) ? '' : newChip;\n  this.$mdLiveAnnouncer.announce(chipContent + ' ' + this.addedMessage, 'assertive');\n\n  // If the md-on-add attribute is specified, send a chip addition event\n  if (this.useOnAdd && this.onAdd) {\n    this.onAdd({ '$chip': newChip, '$index': index });\n  }\n};\n\n/**\n * Sets whether to use the md-transform-chip expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code transformChip}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useTransformChipExpression = function() {\n  this.useTransformChip = true;\n};\n\n/**\n * Sets whether to use the md-on-add expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onAdd}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnAddExpression = function() {\n  this.useOnAdd = true;\n};\n\n/**\n * Sets whether to use the md-on-remove expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onRemove}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnRemoveExpression = function() {\n  this.useOnRemove = true;\n};\n\n/**\n * Sets whether to use the md-on-select expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onSelect}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnSelectExpression = function() {\n  this.useOnSelect = true;\n};\n\n/**\n * Gets the input buffer. The input buffer can be the model bound to the\n * default input item {@code this.chipBuffer}, the {@code selectedItem}\n * model of an {@code md-autocomplete}, or, through some magic, the model\n * bound to any input or text area element found within a\n * {@code md-input-container} element.\n * @return {string} the input buffer\n */\nMdChipsCtrl.prototype.getChipBuffer = function() {\n  var chipBuffer =  !this.userInputElement ? this.chipBuffer :\n                     this.userInputNgModelCtrl ? this.userInputNgModelCtrl.$viewValue :\n                     this.userInputElement[0].value;\n\n  // Ensure that the chip buffer is always a string. For example, the input element buffer\n  // might be falsy.\n  return angular.isString(chipBuffer) ? chipBuffer : '';\n};\n\n/**\n * Resets the input buffer for either the internal input or user provided input element.\n */\nMdChipsCtrl.prototype.resetChipBuffer = function() {\n  if (this.userInputElement) {\n    if (this.userInputNgModelCtrl) {\n      this.userInputNgModelCtrl.$setViewValue('');\n      this.userInputNgModelCtrl.$render();\n    } else {\n      this.userInputElement[0].value = '';\n    }\n  } else {\n    this.chipBuffer = '';\n  }\n};\n\n/**\n * @returns {boolean} true if the max chips limit has been reached, false otherwise.\n */\nMdChipsCtrl.prototype.hasMaxChipsReached = function() {\n  if (angular.isString(this.maxChips)) {\n    this.maxChips = parseInt(this.maxChips, 10) || 0;\n  }\n\n  return this.maxChips > 0 && this.items.length >= this.maxChips;\n};\n\n/**\n * Updates the validity properties for the ngModel.\n *\n * TODO add the md-max-chips validator to this.ngModelCtrl.validators so that the validation will\n * be performed automatically.\n */\nMdChipsCtrl.prototype.validateModel = function() {\n  this.ngModelCtrl.$setValidity('md-max-chips', !this.hasMaxChipsReached());\n  this.ngModelCtrl.$validate(); // rerun any registered validators\n};\n\n/**\n * Function to handle updating the model, validation, and change notification when a chip\n * is added, removed, or changed.\n * @param {boolean=} skipValidation true to skip calling validateModel()\n */\nMdChipsCtrl.prototype.updateNgModel = function(skipValidation) {\n  if (!skipValidation) {\n    this.validateModel();\n  }\n  // This will trigger ng-change to fire, even in cases where $setViewValue() would not.\n  angular.forEach(this.ngModelCtrl.$viewChangeListeners, function(listener) {\n    try {\n      listener();\n    } catch (e) {\n      this.$exceptionHandler(e);\n    }\n  });\n};\n\n/**\n * Removes the chip at the given index.\n * @param {number} index of chip to remove\n * @param {Event=} event optionally passed to the onRemove callback\n */\nMdChipsCtrl.prototype.removeChip = function(index, event) {\n  var removed = this.items.splice(index, 1);\n\n  this.updateNgModel();\n  this.ngModelCtrl.$setDirty();\n\n  // Tell screen reader users that the chip was successfully removed.\n  // TODO add a way for developers to specify which field of the object should be announced here.\n  var chipContent = angular.isObject(removed[0]) ? '' : removed[0];\n  this.$mdLiveAnnouncer.announce(chipContent + ' ' + this.removedMessage, 'assertive');\n\n  if (removed && removed.length && this.useOnRemove && this.onRemove) {\n    this.onRemove({ '$chip': removed[0], '$index': index, '$event': event });\n  }\n};\n\n/**\n * @param {number} index location of chip to remove\n * @param {Event=} $event\n */\nMdChipsCtrl.prototype.removeChipAndFocusInput = function (index, $event) {\n  this.removeChip(index, $event);\n\n  if (this.autocompleteCtrl) {\n    // Always hide the autocomplete dropdown before focusing the autocomplete input.\n    // Wait for the input to move horizontally, because the chip was removed.\n    // This can lead to an incorrect dropdown position.\n    this.autocompleteCtrl.hidden = true;\n    this.$mdUtil.nextTick(this.onFocus.bind(this));\n  } else {\n    this.onFocus();\n  }\n\n};\n/**\n * Selects the chip at `index`,\n * @param {number} index location of chip to select and focus\n */\nMdChipsCtrl.prototype.selectAndFocusChipSafe = function(index) {\n  // If we have no chips, or are asked to select a chip before the first, just focus the input\n  if (!this.items.length || index === -1) {\n    return this.focusInput();\n  }\n\n  // If we are asked to select a chip greater than the number of chips...\n  if (index >= this.items.length) {\n    if (this.readonly) {\n      // If we are readonly, jump back to the start (because we have no input)\n      index = 0;\n    } else {\n      // If we are not readonly, we should attempt to focus the input\n      return this.onFocus();\n    }\n  }\n\n  index = Math.max(index, 0);\n  index = Math.min(index, this.items.length - 1);\n\n  this.selectChip(index);\n  this.focusChip(index);\n};\n\n/**\n * Focus last chip, then focus the input. This is needed for screen reader support.\n */\nMdChipsCtrl.prototype.focusLastChipThenInput = function() {\n  var ctrl = this;\n\n  ctrl.shouldFocusLastChip = false;\n\n  ctrl.focusChip(this.items.length - 1);\n\n  ctrl.$timeout(function() {\n    ctrl.focusInput();\n  }, ctrl.chipAppendDelay);\n};\n\n/**\n * Focus the input element.\n */\nMdChipsCtrl.prototype.focusInput = function() {\n  this.selectChip(-1);\n  this.onFocus();\n};\n\n/**\n * Marks the chip at the given index as selected.\n * @param {number} index location of chip to select\n */\nMdChipsCtrl.prototype.selectChip = function(index) {\n  if (index >= -1 && index <= this.items.length) {\n    this.selectedChip = index;\n\n    // Fire the onSelect if provided\n    if (this.useOnSelect && this.onSelect) {\n      this.onSelect({'$chip': this.items[index] });\n    }\n  } else {\n    this.$log.warn('Selected Chip index out of bounds; ignoring.');\n  }\n};\n\n/**\n * Call {@code focus()} on the chip at {@code index}\n * @param {number} index location of chip to focus\n */\nMdChipsCtrl.prototype.focusChip = function(index) {\n  var chipContent = this.$element[0].querySelector(\n    'md-chip[index=\"' + index + '\"] .md-chip-content'\n  );\n\n  this.ariaTabIndex = index;\n\n  chipContent.focus();\n};\n\n/**\n * Configures the required interactions with the ngModel Controller.\n * Specifically, set {@code this.items} to the {@code NgModelController#$viewValue}.\n * @param {NgModelController} ngModelCtrl\n */\nMdChipsCtrl.prototype.configureNgModel = function(ngModelCtrl) {\n  this.ngModelCtrl = ngModelCtrl;\n\n  var self = this;\n\n  // in chips the meaning of $isEmpty changes\n  ngModelCtrl.$isEmpty = function(value) {\n    return !value || value.length === 0;\n  };\n\n  ngModelCtrl.$render = function() {\n    // model is updated. do something.\n    self.items = self.ngModelCtrl.$viewValue;\n  };\n};\n\nMdChipsCtrl.prototype.onFocus = function () {\n  var input = this.$element[0].querySelector('input');\n  input && input.focus();\n  this.resetSelectedChip();\n};\n\nMdChipsCtrl.prototype.onInputFocus = function () {\n  this.inputHasFocus = true;\n\n  // Make sure we have the appropriate ARIA attributes\n  this.setupInputAria();\n\n  // Make sure we don't have any chips selected\n  this.resetSelectedChip();\n};\n\nMdChipsCtrl.prototype.onInputBlur = function () {\n  this.inputHasFocus = false;\n\n  if (this.shouldAddOnBlur()) {\n    this.appendChip(this.getChipBuffer().trim());\n    this.resetChipBuffer();\n  }\n};\n\n/**\n * Configure event bindings on input element.\n * @param {angular.element} inputElement\n */\nMdChipsCtrl.prototype.configureInput = function configureInput(inputElement) {\n  // Find the NgModelCtrl for the input element\n  var ngModelCtrl = inputElement.controller('ngModel');\n  var ctrl = this;\n\n  if (ngModelCtrl) {\n\n    // sync touched-state from inner input to chips-element\n    this.deRegister.push(\n      this.$scope.$watch(\n        function() {\n          return ngModelCtrl.$touched;\n        },\n        function(isTouched) {\n          isTouched && ctrl.ngModelCtrl.$setTouched();\n        }\n      )\n    );\n\n    // sync dirty-state from inner input to chips-element\n    this.deRegister.push(\n      this.$scope.$watch(\n        function() {\n          return ngModelCtrl.$dirty;\n        },\n        function(isDirty) {\n          isDirty && ctrl.ngModelCtrl.$setDirty();\n        }\n      )\n    );\n  }\n};\n\n/**\n * Configure event bindings on a user-provided input element.\n * @param {angular.element} inputElement\n */\nMdChipsCtrl.prototype.configureUserInput = function(inputElement) {\n  this.userInputElement = inputElement;\n\n  // Find the NgModelCtrl for the input element\n  var ngModelCtrl = inputElement.controller('ngModel');\n  // `.controller` will look in the parent as well.\n  if (ngModelCtrl !== this.ngModelCtrl) {\n    this.userInputNgModelCtrl = ngModelCtrl;\n  }\n\n  var scope = this.$scope;\n  var ctrl = this;\n\n  // Run all of the events using evalAsync because a focus may fire a blur in the same digest loop\n  var scopeApplyFn = function(event, fn) {\n    scope.$evalAsync(angular.bind(ctrl, fn, event));\n  };\n\n  // Bind to keydown and focus events of input\n  inputElement\n      .attr({ tabindex: 0 })\n      .on('keydown', function(event) { scopeApplyFn(event, ctrl.inputKeydown); })\n      .on('focus', function(event) { scopeApplyFn(event, ctrl.onInputFocus); })\n      .on('blur', function(event) { scopeApplyFn(event, ctrl.onInputBlur); });\n};\n\n/**\n * @param {MdAutocompleteCtrl} ctrl controller from the autocomplete component\n */\nMdChipsCtrl.prototype.configureAutocomplete = function(ctrl) {\n  if (ctrl) {\n    this.autocompleteCtrl = ctrl;\n    // Update the default container empty hint when we're inside of an autocomplete.\n    if (!this.$element.attr('container-empty-hint')) {\n      this.containerEmptyHint = 'Chips container with autocompletion. Enter the text area, ' +\n        'type text to search, and then use the up and down arrow keys to select an option. ' +\n        'Press enter to add the selected option as a chip.';\n      this.setupWrapperAria();\n    }\n\n    ctrl.registerSelectedItemWatcher(angular.bind(this, function (item) {\n      if (item) {\n        // Only append the chip and reset the chip buffer if the max chips limit isn't reached.\n        if (this.hasMaxChipsReached()) return;\n\n        this.appendChip(item);\n        this.resetChipBuffer();\n      }\n    }));\n\n    this.$element.find('input')\n        .on('focus',angular.bind(this, this.onInputFocus))\n        .on('blur', angular.bind(this, this.onInputBlur));\n  }\n};\n\n/**\n * @returns {boolean} Whether the current chip buffer should be added on input blur or not.\n */\nMdChipsCtrl.prototype.shouldAddOnBlur = function() {\n\n  // Update the custom ngModel validators from the chips component.\n  this.validateModel();\n\n  var chipBuffer = this.getChipBuffer().trim();\n  // If the model value is empty and required is set on the element, then the model will be invalid.\n  // In that case, we still want to allow adding the chip. The main (but not only) case we want\n  // to disallow is adding a chip on blur when md-max-chips validation fails.\n  var isModelValid = this.ngModelCtrl.$isEmpty(this.ngModelCtrl.$modelValue) ||\n    this.ngModelCtrl.$valid;\n  var isAutocompleteShowing = this.autocompleteCtrl && !this.autocompleteCtrl.hidden;\n\n  if (this.userInputNgModelCtrl) {\n    isModelValid = isModelValid && this.userInputNgModelCtrl.$valid;\n  }\n\n  return this.addOnBlur && !this.requireMatch && chipBuffer && isModelValid &&\n    !isAutocompleteShowing;\n};\n\n/**\n * @returns {boolean} true if the input or a chip is focused. False otherwise.\n */\nMdChipsCtrl.prototype.hasFocus = function () {\n  return this.inputHasFocus || this.selectedChip >= 0;\n};\n\n/**\n * @param {number} index location of content id\n * @returns {number} unique id for the aria-owns attribute\n */\nMdChipsCtrl.prototype.contentIdFor = function(index) {\n  return this.contentIds[index];\n};\n"
  },
  {
    "path": "src/components/chips/js/chipsDirective.js",
    "content": "  angular\n      .module('material.components.chips')\n      .directive('mdChips', MdChips);\n\n  /**\n   * @ngdoc directive\n   * @name mdChips\n   * @module material.components.chips\n   *\n   * @description\n   * `<md-chips>` is an input component for building lists of strings or objects. The list items are\n   * displayed as 'chips'. This component can make use of an `<input>` element or an\n   * `<md-autocomplete>` element.\n   *\n   * ### Custom templates\n   * A custom template may be provided to render the content of each chip. This is achieved by\n   * specifying an `<md-chip-template>` element containing the custom content as a child of\n   * `<md-chips>`.\n   *\n   * Note: Any attributes on\n   * `<md-chip-template>` will be dropped as only the innerHTML is used for the chip template. The\n   * variables `$chip` and `$index` are available in the scope of `<md-chip-template>`, representing\n   * the chip object and its index in the list of chips, respectively.\n   * To override the chip delete control, include an element (ideally a button) with the attribute\n   * `md-chip-remove`. A click listener to remove the chip will be added automatically. The element\n   * is also placed as a sibling to the chip content (on which there are also click listeners) to\n   * avoid a nested ng-click situation.\n   *\n   * <!-- Note: We no longer want to include this in the site docs; but it should remain here for\n   * future developers and those looking at the documentation.\n   *\n   * <h3> Pending Features </h3>\n   * <ul style=\"padding-left:20px;\">\n   *\n   *   <ul>Style\n   *     <li>Colors for hover, press states (ripple?).</li>\n   *   </ul>\n   *\n   *   <ul>Validation\n   *     <li>allow a validation callback</li>\n   *     <li>highlighting style for invalid chips</li>\n   *   </ul>\n   *\n   *   <ul>Item mutation\n   *     <li>Support `\n   *       <md-chip-edit>` template, show/hide the edit element on tap/click? double tap/double\n   *       click?\n   *     </li>\n   *   </ul>\n   *\n   *   <ul>Truncation and Disambiguation (?)\n   *     <li>Truncate chip text where possible, but do not truncate entries such that two are\n   *     indistinguishable.</li>\n   *   </ul>\n   *\n   *   <ul>Drag and Drop\n   *     <li>Drag and drop chips between related `<md-chips>` elements.\n   *     </li>\n   *   </ul>\n   * </ul>\n   *\n   * //-->\n   *\n   * Sometimes developers want to limit the amount of possible chips.<br/>\n   * You can specify the maximum amount of chips by using the following markup.\n   *\n   * <hljs lang=\"html\">\n   *   <md-chips\n   *       ng-model=\"myItems\"\n   *       placeholder=\"Add an item\"\n   *       md-max-chips=\"5\">\n   *   </md-chips>\n   * </hljs>\n   *\n   * In some cases, you have an autocomplete inside of the `md-chips`.<br/>\n   * When the maximum amount of chips has been reached, you can also disable the autocomplete\n   * selection.<br/>\n   * Here is an example markup.\n   *\n   * <hljs lang=\"html\">\n   *   <md-chips ng-model=\"myItems\" md-max-chips=\"5\">\n   *     <md-autocomplete ng-hide=\"myItems.length > 5\" ...></md-autocomplete>\n   *   </md-chips>\n   * </hljs>\n   *\n   * ### Accessibility\n   *\n   * The `md-chips` component supports keyboard and screen reader users since Version 1.1.2. In\n   * order to achieve this, we modified the chips behavior to select newly appended chips for\n   * `300ms` before re-focusing the input and allowing the user to type.\n   *\n   * For most users, this delay is small enough that it will not be noticeable but allows certain\n   * screen readers to function properly (JAWS and NVDA in particular).\n   *\n   * We introduced a new `md-chip-append-delay` option to allow developers to better control this\n   * behavior.\n   *\n   * Please refer to the documentation of this option (below) for more information.\n   *\n   * @param {expression} ng-model Assignable AngularJS expression to be data-bound to the list of\n   *    chips. The expression should evaluate to a `string` or `Object` Array. The type of this\n   *    array should align with the return value of `md-transform-chip`.\n   * @param {expression=} ng-change AngularJS expression to be executed on chip addition, removal,\n   *    or content change.\n   * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n   * @param {string=} secondary-placeholder Placeholder text that will be forwarded to the input,\n   *    displayed when there is at least one item in the list\n   * @param {boolean=} md-removable Enables or disables the deletion of chips through the\n   *    removal icon or the Delete/Backspace key. Defaults to true.\n   * @param {boolean=} readonly Disables list manipulation (deleting or adding list items), hiding\n   *    the input and delete buttons. If no `ng-model` is provided, the chips will automatically be\n   *    marked as readonly.<br/><br/>\n   *    When `md-removable` is not defined, the `md-remove` behavior will be overwritten and\n   *    disabled.\n   * @param {boolean=} md-enable-chip-edit Set this to `\"true\"` to enable editing of chip contents.\n   *    The user can go into edit mode by pressing the `space` or `enter` keys, or by double\n   *    clicking on the chip. Chip editing is only supported for chips using the basic template.\n   *    **Note:** This attribute is only evaluated once; it is not watched.\n   * @param {boolean=} ng-required Whether ng-model is allowed to be empty or not.\n   * @param {number=} md-max-chips The maximum number of chips allowed to add through user input.\n   *    <br/><br/>The validation property `md-max-chips` can be used when the max chips\n   *    amount is reached.\n   * @param {boolean=} md-add-on-blur When set to `\"true\"`, the remaining text inside of the input\n   *    will be converted into a new chip on blur.\n   *    **Note:** This attribute is only evaluated once; it is not watched.\n   * @param {expression} md-transform-chip An expression of form `myFunction($chip)` that when\n   *    called expects one of the following return values:\n   *    - an object representing the `$chip` input string\n   *    - `undefined` to simply add the `$chip` input string, or\n   *    - `null` to prevent the chip from being appended\n   * @param {expression=} md-on-add An expression which will be called when a chip has been\n   *    added with `$chip` and `$index` available as parameters.\n   * @param {expression=} md-on-remove An expression which will be called when a chip has been\n   *    removed with `$chip`, `$index`, and `$event` available as parameters.\n   * @param {expression=} md-on-select An expression which will be called when a chip is selected.\n   * @param {boolean=} md-require-match If true, and the chips template contains an autocomplete,\n   *    only allow selection of pre-defined chips (i.e. you cannot add new ones).\n   * @param {string=} md-input-class This class will be applied to the child input for custom\n   *    styling. If you are using an `md-autocomplete`, then you need to put this attribute on the\n   *    `md-autocomplete` rather than the `md-chips`.\n   * @param {string=} input-aria-describedby A space-separated list of element IDs. This should\n   *     contain the IDs of any elements that describe this autocomplete. Screen readers will read\n   *     the content of these elements at the end of announcing that the chips input has been\n   *     selected and describing its current state. The descriptive elements do not need to be\n   *     visible on the page.\n   * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use\n   *    case is that this would contain the ID of a `<label>` element that is associated with these\n   *    chips.<br><br>\n   *    For `<label id=\"state\">US State</label>`, you would set this to\n   *    `input-aria-labelledby=\"state\"`.\n   * @param {string=} input-aria-label A string read by screen readers to identify the input.\n   *    For static chips, this will be applied to the chips container.\n   * @param {string=} container-hint A string read by screen readers informing users of how to\n   *    navigate the chips when there are chips. Only applies when `ng-model` is defined.\n   * @param {string=} container-empty-hint A string read by screen readers informing users of how to\n   *    add chips when there are no chips. You will want to use this to override the default when\n   *    in a non-English locale. Only applies when `ng-model` is defined.\n   * @param {string=} delete-hint A string read by screen readers instructing users that pressing\n   *    the delete key will remove the chip. You will want to use this to override the default when\n   *    in a non-English locale.\n   * @param {string=} delete-button-label Text for the `aria-label` of the button with the\n   *    `md-chip-remove` class. If the chip is an Object, then this will be the only text in the\n   *    label. Otherwise, this is prepended to the string representation of the chip. Defaults to\n   *    \"Remove\", which would be \"Remove Apple\" for a chip that contained the string \"Apple\".\n   *    You will want to use this to override the default when in a non-English locale.\n   * @param {string=} md-removed-message Screen readers will announce this message following the\n   *    chips contents. The default is `\"removed\"`. If a chip with the content of \"Apple\" was\n   *    removed, the screen reader would read \"Apple removed\". You will want to use this to override\n   *    the default when in a non-English locale.\n   * @param {string=} md-added-message Screen readers will announce this message following the\n   *    chips contents. The default is `\"added\"`. If a chip with the content of \"Apple\" was\n   *    created, the screen reader would read \"Apple added\". You will want to use this to override\n   *    the default when in a non-English locale.\n   * @param {expression=} md-separator-keys An array of key codes used to separate chips.\n   * @param {string=} md-chip-append-delay The number of milliseconds that the component will select\n   *    a newly appended chip before allowing a user to type into the input. This is **necessary**\n   *    for keyboard accessibility for screen readers. It defaults to 300ms and any number less than\n   *    300 can cause issues with screen readers (particularly JAWS and sometimes NVDA).\n   *\n   *    _Available since Version 1.1.2._\n   *\n   *    **Note:** You can safely set this to `0` in one of the following two instances:\n   *\n   *    1. You are targeting an iOS or Safari-only application (where users would use VoiceOver) or\n   *    only ChromeVox users.\n   *\n   *    2. If you have utilized the `md-separator-keys` to disable the `enter` keystroke in\n   *    favor of another one (such as `,` or `;`).\n   *\n   * @usage\n   * <hljs lang=\"html\">\n   *   <md-chips\n   *       ng-model=\"myItems\"\n   *       placeholder=\"Add an item\"\n   *       readonly=\"isReadOnly\">\n   *   </md-chips>\n   * </hljs>\n   *\n   * <h3>Validation</h3>\n   * When using [ngMessages](https://docs.angularjs.org/api/ngMessages), you can show errors based\n   * on our custom validators.\n   * <hljs lang=\"html\">\n   *   <form name=\"userForm\">\n   *     <md-chips\n   *       name=\"fruits\"\n   *       ng-model=\"myItems\"\n   *       placeholder=\"Add an item\"\n   *       md-max-chips=\"5\">\n   *     </md-chips>\n   *     <div ng-messages=\"userForm.fruits.$error\" ng-if=\"userForm.$dirty\">\n   *       <div ng-message=\"md-max-chips\">You reached the maximum amount of chips</div>\n   *    </div>\n   *   </form>\n   * </hljs>\n   *\n   */\n\n  // TODO add a way for developers to specify which field of the object should used in the\n  // aria-label.\n  var MD_CHIPS_TEMPLATE = '\\\n      <md-chips-wrap\\\n          id=\"{{$mdChipsCtrl.wrapperId}}\"\\\n          tabindex=\"{{$mdChipsCtrl.readonly ? 0 : -1}}\"\\\n          ng-keydown=\"$mdChipsCtrl.chipKeydown($event)\"\\\n          ng-class=\"{ \\'md-focused\\': $mdChipsCtrl.hasFocus(), \\\n                      \\'md-readonly\\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly,\\\n                      \\'md-removable\\': $mdChipsCtrl.isRemovable() }\"\\\n          class=\"md-chips\">\\\n        <md-chip ng-repeat=\"$chip in $mdChipsCtrl.items\"\\\n            index=\"{{$index}}\" \\\n            ng-class=\"{\\'md-focused\\': $mdChipsCtrl.selectedChip == $index, \\'md-readonly\\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly}\">\\\n          <div class=\"md-chip-content\"\\\n              tabindex=\"{{$mdChipsCtrl.ariaTabIndex === $index ? 0 : -1}}\"\\\n              id=\"{{$mdChipsCtrl.contentIdFor($index)}}\"\\\n              role=\"option\"\\\n              aria-selected=\"{{$mdChipsCtrl.selectedChip === $index}}\"\\\n              aria-setsize=\"{{$mdChipsCtrl.items.length}}\"\\\n              aria-posinset=\"{{$index+1}}\"\\\n              ng-click=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.focusChip($index)\"\\\n              aria-label=\"{{$mdChipsCtrl._isChipObject($chip) ? \\'\\' : $chip + \\'. \\'}}{{$mdChipsCtrl.isRemovable() ? \\'\\' + $mdChipsCtrl.deleteHint : \\'\\'}}\" \\\n              ng-focus=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.selectChip($index)\"\\\n              md-chip-transclude=\"$mdChipsCtrl.chipContentsTemplate\"></div>\\\n          <div ng-if=\"$mdChipsCtrl.isRemovable()\"\\\n               class=\"md-chip-remove-container\"\\\n               tabindex=\"-1\"\\\n               md-chip-transclude=\"$mdChipsCtrl.chipRemoveTemplate\"></div>\\\n        </md-chip>\\\n        <div class=\"md-chip-input-container\" ng-if=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.ngModelCtrl\">\\\n          <div md-chip-transclude=\"$mdChipsCtrl.chipInputTemplate\"></div>\\\n        </div>\\\n      </md-chips-wrap>';\n\n  var CHIP_INPUT_TEMPLATE = '\\\n        <input\\\n            class=\"md-input{{ $mdChipsCtrl.inputClass ? \\' \\' + $mdChipsCtrl.inputClass: \\'\\'}}\"\\\n            tabindex=\"0\"\\\n            aria-label=\"{{$mdChipsCtrl.inputAriaLabel}}\"\\\n            placeholder=\"{{$mdChipsCtrl.getPlaceholder()}}\"\\\n            ng-model=\"$mdChipsCtrl.chipBuffer\"\\\n            ng-focus=\"$mdChipsCtrl.onInputFocus()\"\\\n            ng-blur=\"$mdChipsCtrl.onInputBlur()\"\\\n            ng-keydown=\"$mdChipsCtrl.inputKeydown($event)\">';\n\n  var CHIP_DEFAULT_TEMPLATE = '\\\n      <span>{{$chip}}</span>';\n\n  var CHIP_REMOVE_TEMPLATE = '\\\n      <button\\\n          class=\"md-chip-remove\"\\\n          ng-if=\"$mdChipsCtrl.isRemovable()\"\\\n          ng-click=\"$mdChipsCtrl.removeChipAndFocusInput($$replacedScope.$index, $event)\"\\\n          type=\"button\"\\\n          tabindex=\"-1\"\\\n          aria-label=\"{{$mdChipsCtrl.deleteButtonLabel}}{{$mdChipsCtrl._isChipObject($chip) ? \\'\\' : \\' \\' + $chip}}\">\\\n        <md-icon md-svg-src=\"{{$mdChipsCtrl.mdCloseIcon}}\" aria-hidden=\"true\"></md-icon>\\\n      </button>';\n\n  /**\n   * MDChips Directive Definition\n   */\n  function MdChips ($mdTheming, $mdUtil, $compile, $log, $timeout, $$mdSvgRegistry) {\n    // Run our templates through $mdUtil.processTemplate() to allow custom start/end symbols\n    var templates = getTemplates();\n\n    return {\n      template: function(element, attrs) {\n        // Clone the element into an attribute. By prepending the attribute\n        // name with '$', AngularJS won't write it into the DOM. The cloned\n        // element propagates to the link function via the attrs argument,\n        // where various contained-elements can be consumed.\n        attrs['$mdUserTemplate'] = element.clone();\n        return templates.chips;\n      },\n      require: ['mdChips'],\n      restrict: 'E',\n      controller: 'MdChipsCtrl',\n      controllerAs: '$mdChipsCtrl',\n      bindToController: true,\n      compile: compile,\n      scope: {\n        readonly: '=?readonly',\n        removable: '=?mdRemovable',\n        placeholder: '@?',\n        secondaryPlaceholder: '@?',\n        maxChips: '@?mdMaxChips',\n        transformChip: '&mdTransformChip',\n        onAdd: '&?mdOnAdd',\n        onRemove: '&?mdOnRemove',\n        addedMessage: '@?mdAddedMessage',\n        removedMessage: '@?mdRemovedMessage',\n        onSelect: '&?mdOnSelect',\n        inputClass: '@?mdInputClass',\n        inputAriaDescribedBy: '@?inputAriaDescribedby',\n        inputAriaLabelledBy: '@?inputAriaLabelledby',\n        inputAriaLabel: '@?',\n        containerHint: '@?',\n        containerEmptyHint: '@?',\n        deleteHint: '@?',\n        deleteButtonLabel: '@?',\n        separatorKeys: '=?mdSeparatorKeys',\n        requireMatch: '=?mdRequireMatch',\n        chipAppendDelayString: '@?mdChipAppendDelay',\n        ngChange: '&?'\n      }\n    };\n\n    /**\n     * Builds the final template for `md-chips` and returns the postLink function.\n     *\n     * Building the template involves 3 key components:\n     * static chips\n     * chip template\n     * input control\n     *\n     * If no `ng-model` is provided, only the static chip work needs to be done.\n     *\n     * If no user-passed `md-chip-template` exists, the default template is used. This resulting\n     * template is appended to the chip content element.\n     *\n     * The remove button may be overridden by passing an element with an md-chip-remove attribute.\n     *\n     * If an `input` or `md-autocomplete` element is provided by the caller, it is set aside for\n     * transclusion later. The transclusion happens in `postLink` as the parent scope is required.\n     * If no user input is provided, a default one is appended to the input container node in the\n     * template.\n     *\n     * Static Chips (i.e. `md-chip` elements passed from the caller) are gathered and set aside for\n     * transclusion in the `postLink` function.\n     *\n     *\n     * @param element\n     * @param attr\n     * @returns {Function}\n     */\n    function compile(element, attr) {\n      // Grab the user template from attr and reset the attribute to null.\n      var userTemplate = attr['$mdUserTemplate'];\n      attr['$mdUserTemplate'] = null;\n\n      var chipTemplate = getTemplateByQuery('md-chips>md-chip-template');\n\n      var chipRemoveSelector = $mdUtil\n        .prefixer()\n        .buildList('md-chip-remove')\n        .map(function(attr) {\n          return 'md-chips>*[' + attr + ']';\n        })\n        .join(',');\n\n      // Set the chip remove, chip contents and chip input templates. The link function will put\n      // them on the scope for transclusion later.\n      var chipRemoveTemplate   = getTemplateByQuery(chipRemoveSelector) || templates.remove,\n          chipContentsTemplate = chipTemplate || templates.default,\n          chipInputTemplate    = getTemplateByQuery('md-chips>md-autocomplete')\n              || getTemplateByQuery('md-chips>input')\n              || templates.input,\n          staticChips = userTemplate.find('md-chip');\n\n      // Warn of malformed template. See #2545\n      if (userTemplate[0].querySelector('md-chip-template>*[md-chip-remove]')) {\n        $log.warn('invalid placement of md-chip-remove within md-chip-template.');\n      }\n\n      function getTemplateByQuery (query) {\n        if (!attr.ngModel) return;\n        var element = userTemplate[0].querySelector(query);\n        return element && element.outerHTML;\n      }\n\n      /**\n       * Configures controller and transcludes.\n       */\n      return function postLink(scope, element, attrs, controllers) {\n        $mdUtil.initOptionalProperties(scope, attr);\n\n        $mdTheming(element);\n        var mdChipsCtrl = controllers[0];\n        if (chipTemplate) {\n          // Chip editing functionality assumes we are using the default chip template.\n          mdChipsCtrl.enableChipEdit = false;\n        }\n\n        mdChipsCtrl.chipContentsTemplate = chipContentsTemplate;\n        mdChipsCtrl.chipRemoveTemplate   = chipRemoveTemplate;\n        mdChipsCtrl.chipInputTemplate    = chipInputTemplate;\n\n        mdChipsCtrl.mdCloseIcon = $$mdSvgRegistry.mdCancel;\n\n        element\n            .attr({ tabindex: -1 })\n            .on('focus', function () { mdChipsCtrl.onFocus(); })\n            .on('click', function () {\n              if (!mdChipsCtrl.readonly && mdChipsCtrl.selectedChip === -1) {\n                mdChipsCtrl.onFocus();\n              }\n            });\n\n        if (attr.ngModel) {\n          mdChipsCtrl.configureNgModel(element.controller('ngModel'));\n\n          // If an `md-transform-chip` attribute was set, tell the controller to use the expression\n          // before appending chips.\n          if (attrs.mdTransformChip) mdChipsCtrl.useTransformChipExpression();\n\n          // If an `md-on-add` attribute was set, tell the controller to use the expression\n          // when adding chips.\n          if (attrs.mdOnAdd) mdChipsCtrl.useOnAddExpression();\n\n          // If an `md-on-remove` attribute was set, tell the controller to use the expression\n          // when removing chips.\n          if (attrs.mdOnRemove) mdChipsCtrl.useOnRemoveExpression();\n\n          // If an `md-on-select` attribute was set, tell the controller to use the expression\n          // when selecting chips.\n          if (attrs.mdOnSelect) mdChipsCtrl.useOnSelectExpression();\n\n          // The md-autocomplete and input elements won't be compiled until after this directive\n          // is complete (due to their nested nature). Wait a tick before looking for them to\n          // configure the controller.\n          if (chipInputTemplate !== templates.input) {\n            // The autocomplete will not appear until the readonly attribute is not true (i.e.\n            // false or undefined), so we have to watch the readonly and then on the next tick\n            // after the chip transclusion has run, we can configure the autocomplete and user\n            // input.\n            scope.$watch('$mdChipsCtrl.readonly', function(readonly) {\n              if (!readonly) {\n\n                $mdUtil.nextTick(function(){\n\n                  if (chipInputTemplate.indexOf('<md-autocomplete') === 0) {\n                    var autocompleteEl = element.find('md-autocomplete');\n                    mdChipsCtrl.configureAutocomplete(autocompleteEl.controller('mdAutocomplete'));\n                  }\n\n                  mdChipsCtrl.configureUserInput(element.find('input'));\n                });\n              }\n            });\n          }\n\n          // At the next tick, if we find an input, make sure it has the md-input class\n          $mdUtil.nextTick(function() {\n            var input = element.find('input');\n\n            if (input) {\n              mdChipsCtrl.configureInput(input);\n              input.toggleClass('md-input', true);\n            }\n          });\n        }\n\n        // Compile with the parent's scope and prepend any static chips to the wrapper.\n        if (staticChips.length > 0) {\n          var compiledStaticChips = $compile(staticChips.clone())(scope.$parent);\n          $timeout(function() { element.find('md-chips-wrap').prepend(compiledStaticChips); });\n        }\n      };\n    }\n\n    function getTemplates() {\n      return {\n        chips: $mdUtil.processTemplate(MD_CHIPS_TEMPLATE),\n        input: $mdUtil.processTemplate(CHIP_INPUT_TEMPLATE),\n        default: $mdUtil.processTemplate(CHIP_DEFAULT_TEMPLATE),\n        remove: $mdUtil.processTemplate(CHIP_REMOVE_TEMPLATE)\n      };\n    }\n  }\n"
  },
  {
    "path": "src/components/chips/js/contactChipsController.js",
    "content": "angular\n    .module('material.components.chips')\n    .controller('MdContactChipsCtrl', MdContactChipsCtrl);\n\n/**\n * Controller for the MdContactChips component\n * @constructor\n */\nfunction MdContactChipsCtrl ($attrs, $element, $timeout) {\n  /** @type {$element} */\n  this.$element = $element;\n\n  /** @type {$attrs} */\n  this.$attrs = $attrs;\n\n  /** @type {Function} */\n  this.$timeout = $timeout;\n\n  /** @type {Object} */\n  this.selectedItem = null;\n\n  /** @type {string} */\n  this.searchText = '';\n\n  /**\n   * Collection of functions to call to un-register watchers\n   * @type {Array}\n   */\n  this.deRegister = [];\n\n  this.init();\n}\n\nMdContactChipsCtrl.prototype.init = function() {\n  var ctrl = this;\n  var deRegister = this.deRegister;\n  var element = this.$element;\n\n  // Setup a watcher which manages chips a11y messages and autocomplete aria.\n  // Timeout required to allow the child elements to be compiled.\n  this.$timeout(function() {\n    deRegister.push(\n      element.find('md-chips').controller('mdChips').$scope.$watchCollection('$mdChipsCtrl.items', function() {\n        // Make sure our input and wrapper have the correct ARIA attributes\n        ctrl.setupChipsAria();\n        ctrl.setupAutocompleteAria();\n      })\n    );\n  });\n};\n\nMdContactChipsCtrl.prototype.setupChipsAria = function() {\n  var chips = this.$element.find('md-chips');\n  var chipsCtrl = chips.controller('mdChips');\n\n  // Configure MdChipsCtrl\n  if (this.removedMessage) {\n    chipsCtrl.removedMessage = this.removedMessage;\n  }\n  if (this.containerHint) {\n    chipsCtrl.containerHint = this.containerHint;\n  }\n  if (this.containerEmptyHint) {\n    // Apply attribute to avoid the hint being overridden by MdChipsCtrl.configureAutocomplete()\n    chips.attr('container-empty-hint', this.containerEmptyHint);\n    chipsCtrl.containerEmptyHint = this.containerEmptyHint;\n  }\n  if (this.deleteHint) {\n    chipsCtrl.deleteHint = this.deleteHint;\n  }\n  if (this.inputAriaLabel) {\n    chipsCtrl.inputAriaLabel = this.inputAriaLabel;\n  }\n  if (this.inputClass) {\n    chipsCtrl.inputClass = this.inputClass;\n  }\n};\n\nMdContactChipsCtrl.prototype.setupAutocompleteAria = function() {\n  var autocompleteInput = this.$element.find('md-chips-wrap').find('md-autocomplete').find('input');\n\n  // Set attributes on the input of the md-autocomplete\n  if (this.inputAriaDescribedBy) {\n    autocompleteInput.attr('aria-describedby', this.inputAriaDescribedBy);\n  }\n  if (this.inputAriaLabelledBy) {\n    autocompleteInput.removeAttr('aria-label');\n    autocompleteInput.attr('aria-labelledby', this.inputAriaLabelledBy);\n  }\n};\n\nMdContactChipsCtrl.prototype.queryContact = function(searchText) {\n  return this.contactQuery({'$query': searchText});\n};\n\nMdContactChipsCtrl.prototype.inputKeydown = function(event) {\n  if (!this.separatorKeys || this.separatorKeys.indexOf(event.keyCode) < 0) {\n    return;\n  }\n\n  event.stopPropagation();\n  event.preventDefault();\n\n  var autocompleteCtrl = angular.element(event.target).controller('mdAutocomplete');\n  autocompleteCtrl.select(autocompleteCtrl.index);\n};\n\nMdContactChipsCtrl.prototype.itemName = function(item) {\n  return item[this.contactName];\n};\n\n/**\n * Destructor for cleanup\n */\nMdContactChipsCtrl.prototype.$onDestroy = function $onDestroy() {\n  var $destroyFn;\n  while (($destroyFn = this.deRegister.pop())) {\n    $destroyFn.call(this);\n  }\n};\n"
  },
  {
    "path": "src/components/chips/js/contactChipsDirective.js",
    "content": "angular\n  .module('material.components.chips')\n  .directive('mdContactChips', MdContactChips);\n\n/**\n * @ngdoc directive\n * @name mdContactChips\n * @module material.components.chips\n *\n * @description\n * `<md-contact-chips>` is an input component based on `md-chips` and makes use of an\n * `md-autocomplete` element. The component allows the caller to supply a query expression which\n * returns  a list of possible contacts. The user can select one of these and add it to the list of\n * chips.\n *\n * You may also use the <a ng-href=\"api/directive/mdHighlightText\">md-highlight-flags</a> attribute\n * along with its parameters to control the appearance of the matched text inside of the contacts'\n * autocomplete popup.\n *\n * @param {expression} ng-model Assignable AngularJS expression to be data-bound to the list of\n *    contact chips. The expression should evaluate to an `Object` Array.\n * @param {expression=} ng-change AngularJS expression to be executed on chip addition, removal,\n *    or content change.\n * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n * @param {string=} secondary-placeholder Placeholder text that will be forwarded to the input,\n *    displayed when there is at least on item in the list\n * @param {expression} md-contacts An expression expected to return contacts matching the search\n *    test, `$query`. If this expression involves a promise, a loading bar is displayed while\n *    waiting for it to resolve.\n * @param {string} md-contact-name The field name of the contact object representing the\n *    contact's name.\n * @param {string} md-contact-email The field name of the contact object representing the\n *    contact's email address.\n * @param {string} md-contact-image The field name of the contact object representing the\n *    contact's image.\n * @param {number=} md-max-chips The maximum number of chips allowed to add through user input.\n *    <br/><br/>The validation property `md-max-chips` can be used when the max chips\n *    amount is reached.\n * @param {number=} md-min-length Specifies the minimum length of text before autocomplete will\n *    make suggestions\n * @param {string=} md-input-class This class will be applied to the child `md-autocomplete` for\n *    custom styling.\n * @param {string=} input-aria-describedby A space-separated list of element IDs. This should\n *     contain the IDs of any elements that describe this autocomplete. Screen readers will read\n *     the content of these elements at the end of announcing that the chips input has been\n *     selected and describing its current state. The descriptive elements do not need to be\n *     visible on the page.\n * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use\n *    case is that this would contain the ID of a `<label>` element that is associated with these\n *    chips.<br><br>\n *    For `<label id=\"state\">US State</label>`, you would set this to\n *    `input-aria-labelledby=\"state\"`.\n * @param {string=} input-aria-label A string read by screen readers to identify the input.\n *    For static chips, this will be applied to the chips container.\n * @param {string=} container-hint A string read by screen readers informing users of how to\n *    navigate the chips when there are chips.\n * @param {string=} container-empty-hint A string read by screen readers informing users of how to\n *    add chips when there are no chips. You will want to use this to override the default when\n *    in a non-English locale.\n * @param {string=} delete-hint A string read by screen readers instructing users that pressing\n *    the delete key will remove the chip. You will want to use this to override the default when\n *    in a non-English locale.\n * @param {string=} md-removed-message Screen readers will announce this message following the\n *    chips contents. The default is `\"removed\"`. If a chip with the content of \"Apple\" was\n *    removed, the screen reader would read \"Apple removed\". You will want to use this to override\n *    the default when in a non-English locale.\n *\n *\n * @usage\n * <hljs lang=\"html\">\n *   <md-contact-chips\n *       ng-model=\"ctrl.contacts\"\n *       md-contacts=\"ctrl.querySearch($query)\"\n *       md-contact-name=\"name\"\n *       md-contact-image=\"image\"\n *       md-contact-email=\"email\"\n *       placeholder=\"To\">\n *   </md-contact-chips>\n * </hljs>\n *\n */\n\n\nvar MD_CONTACT_CHIPS_TEMPLATE = '\\\n      <md-chips class=\"md-contact-chips\"\\\n          ng-model=\"$mdContactChipsCtrl.contacts\"\\\n          ng-change=\"$mdContactChipsCtrl.ngChange($mdContactChipsCtrl.contacts)\"\\\n          md-require-match=\"$mdContactChipsCtrl.requireMatch\"\\\n          md-max-chips=\"{{$mdContactChipsCtrl.maxChips}}\"\\\n          md-chip-append-delay=\"{{$mdContactChipsCtrl.chipAppendDelay}}\"\\\n          md-separator-keys=\"$mdContactChipsCtrl.separatorKeys\"\\\n          md-autocomplete-snap>\\\n          <md-autocomplete\\\n              md-menu-class=\"md-contact-chips-suggestions\"\\\n              md-selected-item=\"$mdContactChipsCtrl.selectedItem\"\\\n              md-search-text=\"$mdContactChipsCtrl.searchText\"\\\n              md-items=\"item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)\"\\\n              md-item-text=\"$mdContactChipsCtrl.itemName(item)\"\\\n              md-no-cache=\"true\"\\\n              md-min-length=\"$mdContactChipsCtrl.minLength\"\\\n              md-autoselect\\\n              ng-attr-md-input-class=\"{{$mdContactChipsCtrl.inputClass}}\"\\\n              ng-keydown=\"$mdContactChipsCtrl.inputKeydown($event)\"\\\n              placeholder=\"{{$mdContactChipsCtrl.contacts.length === 0 ?\\\n                  $mdContactChipsCtrl.placeholder : $mdContactChipsCtrl.secondaryPlaceholder}}\">\\\n            <div class=\"md-contact-suggestion\">\\\n              <img \\\n                  ng-src=\"{{item[$mdContactChipsCtrl.contactImage]}}\"\\\n                  alt=\"{{item[$mdContactChipsCtrl.contactName]}}\"\\\n                  ng-if=\"item[$mdContactChipsCtrl.contactImage]\" />\\\n              <span class=\"md-contact-name\" md-highlight-text=\"$mdContactChipsCtrl.searchText\"\\\n                    md-highlight-flags=\"{{$mdContactChipsCtrl.highlightFlags}}\">\\\n                {{item[$mdContactChipsCtrl.contactName]}}\\\n              </span>\\\n              <span class=\"md-contact-email\" >{{item[$mdContactChipsCtrl.contactEmail]}}</span>\\\n            </div>\\\n          </md-autocomplete>\\\n          <md-chip-template>\\\n            <div class=\"md-contact-avatar\">\\\n              <img \\\n                  ng-src=\"{{$chip[$mdContactChipsCtrl.contactImage]}}\"\\\n                  alt=\"{{$chip[$mdContactChipsCtrl.contactName]}}\"\\\n                  ng-if=\"$chip[$mdContactChipsCtrl.contactImage]\" />\\\n            </div>\\\n            <div class=\"md-contact-name\">\\\n              {{$chip[$mdContactChipsCtrl.contactName]}}\\\n            </div>\\\n          </md-chip-template>\\\n      </md-chips>';\n\n\n/**\n * MDContactChips Directive Definition\n *\n * @param $mdTheming\n * @param $mdUtil\n * @returns {*}\n * @ngInject\n */\nfunction MdContactChips($mdTheming, $mdUtil) {\n  return {\n    template: function(element, attrs) {\n      return MD_CONTACT_CHIPS_TEMPLATE;\n    },\n    restrict: 'E',\n    controller: 'MdContactChipsCtrl',\n    controllerAs: '$mdContactChipsCtrl',\n    bindToController: true,\n    compile: compile,\n    scope: {\n      contactQuery: '&mdContacts',\n      placeholder: '@?',\n      secondaryPlaceholder: '@?',\n      contactName: '@mdContactName',\n      contactImage: '@mdContactImage',\n      contactEmail: '@mdContactEmail',\n      contacts: '=ngModel',\n      ngChange: '&?',\n      requireMatch: '=?mdRequireMatch',\n      minLength: '=?mdMinLength',\n      maxChips: '=?mdMaxChips',\n      highlightFlags: '@?mdHighlightFlags',\n      chipAppendDelay: '@?mdChipAppendDelay',\n      separatorKeys: '=?mdSeparatorKeys',\n      removedMessage: '@?mdRemovedMessage',\n      inputClass: '@?mdInputClass',\n      inputAriaDescribedBy: '@?inputAriaDescribedby',\n      inputAriaLabelledBy: '@?inputAriaLabelledby',\n      inputAriaLabel: '@?',\n      containerHint: '@?',\n      containerEmptyHint: '@?',\n      deleteHint: '@?'\n    }\n  };\n\n  function compile(element, attr) {\n    return function postLink(scope, element, attrs, controllers) {\n      var contactChipsController = controllers;\n\n      $mdUtil.initOptionalProperties(scope, attr);\n      $mdTheming(element);\n\n      element.attr('tabindex', '-1');\n\n      attrs.$observe('mdChipAppendDelay', function(newValue) {\n        contactChipsController.chipAppendDelay = newValue;\n      });\n    };\n  }\n}\n"
  },
  {
    "path": "src/components/colors/colors.js",
    "content": "(function () {\n  \"use strict\";\n\n  /**\n   *  Use a RegExp to check if the `md-colors=\"<expression>\"` is static string\n   *  or one that should be observed and dynamically interpolated.\n   */\n  var STATIC_COLOR_EXPRESSION = /^{((\\s|,)*?[\"'a-zA-Z-]+?\\s*?:\\s*?(['\"])[a-zA-Z0-9-.]*(['\"]))+\\s*}$/;\n  var colorPalettes = null;\n\n  /**\n   * @ngdoc module\n   * @name material.components.colors\n   *\n   * @description\n   * Define $mdColors service and a `md-colors=\"\"` attribute directive\n   */\n  angular\n    .module('material.components.colors', ['material.core'])\n    .directive('mdColors', MdColorsDirective)\n    .service('$mdColors', MdColorsService);\n\n  /**\n   * @ngdoc service\n   * @name $mdColors\n   * @module material.components.colors\n   *\n   * @description\n   * By default, defining a theme does not make its colors available for applying to non AngularJS\n   * Material elements. The `$mdColors` service is used by the `md-color` directive to convert a\n   * set of color expressions to RGBA values and then apply those values to the element as CSS\n   * property values.\n   *\n   * @usage\n   * Getting a color based on a theme\n   *\n   *  <hljs lang=\"js\">\n   *    angular.controller('myCtrl', function ($mdColors) {\n   *      var color = $mdColors.getThemeColor('myTheme-primary-900-0.5');\n   *      ...\n   *    });\n   *  </hljs>\n   *\n   * Applying a color from a palette to an element\n   * <hljs lang=\"js\">\n   *   app.directive('myDirective', function($mdColors) {\n   *     return {\n   *       ...\n   *       link: function (scope, elem) {\n   *         $mdColors.applyThemeColors(elem, {color: 'red-A200-0.2'});\n   *       }\n   *    }\n   *   });\n   * </hljs>\n   */\n  function MdColorsService($mdTheming, $mdUtil, $log) {\n    colorPalettes = colorPalettes || Object.keys($mdTheming.PALETTES);\n\n    // Publish service instance\n    return {\n      applyThemeColors: applyThemeColors,\n      getThemeColor: getThemeColor,\n      hasTheme: hasTheme\n    };\n\n    // ********************************************\n    // Internal Methods\n    // ********************************************\n\n    /**\n     * @ngdoc method\n     * @name $mdColors#applyThemeColors\n     *\n     * @description\n     * Lookup a set of colors by hue, theme, and palette, then apply those colors\n     * with the provided opacity (via `rgba()`) to the specified CSS property.\n     *\n     * @param {angular.element} element the element to apply the styles to\n     * @param {Object} colorExpression Keys are CSS properties and values are strings representing\n     * the `theme-palette-hue-opacity` of the desired color. For example:\n     * `{'color': 'red-A200-0.3', 'background-color': 'myTheme-primary-700-0.8'}`. Theme, hue, and\n     * opacity are optional.\n     */\n    function applyThemeColors(element, colorExpression) {\n      try {\n        if (colorExpression) {\n          // Assign the calculate RGBA color values directly as inline CSS\n          element.css(interpolateColors(colorExpression));\n        }\n      } catch (e) {\n        $log.error(e.message);\n      }\n    }\n\n    /**\n     * @ngdoc method\n     * @name $mdColors#getThemeColor\n     *\n     * @description\n     * Get a parsed RGBA color using a string representing the `theme-palette-hue-opacity` of the\n     * desired color.\n     *\n     * @param {string} expression color expression like `'red-A200-0.3'` or\n     *  `'myTheme-primary-700-0.8'`. Theme, hue, and opacity are optional.\n     * @returns {string} a CSS color value like `rgba(211, 47, 47, 0.8)`\n     */\n    function getThemeColor(expression) {\n      var color = extractColorOptions(expression);\n\n      return parseColor(color);\n    }\n\n    /**\n     * Return the parsed color\n     * @param {{hue: *, theme: any, palette: *, opacity: (*|string|number)}} color hash map of color\n     *  definitions\n     * @param {boolean=} contrast whether use contrast color for foreground. Defaults to false.\n     * @returns {string} rgba color string\n     */\n    function parseColor(color, contrast) {\n      contrast = contrast || false;\n      var rgbValues = $mdTheming.PALETTES[color.palette][color.hue];\n\n      rgbValues = contrast ? rgbValues.contrast : rgbValues.value;\n\n      return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})',\n        [rgbValues[0], rgbValues[1], rgbValues[2], rgbValues[3] || color.opacity]\n      );\n    }\n\n    /**\n     * Convert the color expression into an object with scope-interpolated values\n     * Then calculate the rgba() values based on the theme color parts\n     * @param {Object} themeColors json object, keys are css properties and values are string of\n     * the wanted color, for example: `{color: 'red-A200-0.3'}`.\n     * @return {Object} Hashmap of CSS properties with associated `rgba()` string values\n     */\n    function interpolateColors(themeColors) {\n      var rgbColors = {};\n\n      var hasColorProperty = themeColors.hasOwnProperty('color');\n\n      angular.forEach(themeColors, function (value, key) {\n        var color = extractColorOptions(value);\n        var hasBackground = key.indexOf('background') > -1;\n\n        rgbColors[key] = parseColor(color);\n        if (hasBackground && !hasColorProperty) {\n          rgbColors.color = parseColor(color, true);\n        }\n      });\n\n      return rgbColors;\n    }\n\n    /**\n     * Check if expression has defined theme\n     * For instance:\n     *   'myTheme-primary' => true\n     *   'red-800' => false\n     * @param {string} expression color expression like 'red-800', 'red-A200-0.3',\n     *   'myTheme-primary', or 'myTheme-primary-400'\n     * @return {boolean} true if the expression has a theme part, false otherwise.\n     */\n    function hasTheme(expression) {\n      return angular.isDefined($mdTheming.THEMES[expression.split('-')[0]]);\n    }\n\n    /**\n     * For the evaluated expression, extract the color parts into a hash map\n     * @param {string} expression color expression like 'red-800', 'red-A200-0.3',\n     *   'myTheme-primary', or 'myTheme-primary-400'\n     * @returns {{hue: *, theme: any, palette: *, opacity: (*|string|number)}}\n     */\n    function extractColorOptions(expression) {\n      var parts = expression.split('-');\n      var hasTheme = angular.isDefined($mdTheming.THEMES[parts[0]]);\n      var theme = hasTheme ? parts.splice(0, 1)[0] : $mdTheming.defaultTheme();\n\n      return {\n        theme: theme,\n        palette: extractPalette(parts, theme),\n        hue: extractHue(parts, theme),\n        opacity: parts[2] || 1\n      };\n    }\n\n    /**\n     * Calculate the theme palette name\n     * @param {Array} parts\n     * @param {string} theme name\n     * @return {string}\n     */\n    function extractPalette(parts, theme) {\n      // If the next section is one of the palettes we assume it's a two word palette\n      // Two word palette can be also written in camelCase, forming camelCase to dash-case\n\n      var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1;\n      var palette = parts[0].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n\n      if (isTwoWord)  palette = parts[0] + '-' + parts.splice(1, 1);\n\n      if (colorPalettes.indexOf(palette) === -1) {\n        // If the palette is not in the palette list it's one of primary/accent/warn/background\n        var scheme = $mdTheming.THEMES[theme].colors[palette];\n        if (!scheme) {\n          throw new Error($mdUtil.supplant(\n            'mdColors: couldn\\'t find \\'{palette}\\' in the palettes.',\n            {palette: palette}));\n        }\n        palette = scheme.name;\n      }\n\n      return palette;\n    }\n\n    /**\n     * @param {Array} parts\n     * @param {string} theme name\n     * @return {*}\n     */\n    function extractHue(parts, theme) {\n      var themeColors = $mdTheming.THEMES[theme].colors;\n\n      if (parts[1] === 'hue') {\n        var hueNumber = parseInt(parts.splice(2, 1)[0], 10);\n\n        if (hueNumber < 1 || hueNumber > 3) {\n          throw new Error($mdUtil.supplant(\n            'mdColors: \\'hue-{hueNumber}\\' is not a valid hue, can be only \\'hue-1\\', \\'hue-2\\' and \\'hue-3\\'',\n            {hueNumber: hueNumber}));\n        }\n        parts[1] = 'hue-' + hueNumber;\n\n        if (!(parts[0] in themeColors)) {\n          throw new Error($mdUtil.supplant(\n            'mdColors: \\'hue-x\\' can only be used with [{availableThemes}], but was used with \\'{usedTheme}\\'',\n            {\n            availableThemes: Object.keys(themeColors).join(', '),\n            usedTheme: parts[0]\n          }));\n        }\n\n        return themeColors[parts[0]].hues[parts[1]];\n      }\n\n      return parts[1] || themeColors[parts[0] in themeColors ? parts[0] : 'primary'].hues['default'];\n    }\n  }\n\n  /**\n   * @ngdoc directive\n   * @name mdColors\n   * @module material.components.colors\n   *\n   * @restrict A\n   *\n   * @description\n   * `mdColors` directive will apply the theme-based color expression as RGBA CSS style values.\n   *\n   *   The format will be similar to the colors defined in the Sass files:\n   *\n   *   ## `[?theme]-[palette]-[?hue]-[?opacity]`\n   *   - [theme]    - default value is the default theme\n   *   - [palette]  - can be either palette name or primary/accent/warn/background\n   *   - [hue]      - default is 500 (hue-x can be used with primary/accent/warn/background)\n   *   - [opacity]  - default is 1\n   *\n   *\n   *   > `?` indicates optional parameter\n   *\n   * @usage\n   * <hljs lang=\"html\">\n   *   <div md-colors=\"{background: 'myTheme-accent-900-0.43'}\">\n   *     <div md-colors=\"{color: 'red-A100', 'border-color': 'primary-600'}\">\n   *       <span>Color demo</span>\n   *     </div>\n   *   </div>\n   * </hljs>\n   *\n   * The `mdColors` directive will automatically watch for changes in the expression if it recognizes\n   * an interpolation expression or a function. For performance options, you can use `::` prefix to\n   * the `md-colors` expression to indicate a one-time data binding.\n   *\n   * <hljs lang=\"html\">\n   *   <md-card md-colors=\"::{background: '{{theme}}-primary-700'}\">\n   *   </md-card>\n   * </hljs>\n   */\n  function MdColorsDirective($mdColors, $mdUtil, $log, $parse) {\n    return {\n      restrict: 'A',\n      require: ['^?mdTheme'],\n      compile: function (tElem, tAttrs) {\n        var shouldWatch = shouldColorsWatch();\n\n        return function (scope, element, attrs, ctrl) {\n          var mdThemeController = ctrl[0];\n\n          var lastColors = {};\n\n          /**\n           * @param {string=} theme\n           * @return {Object} colors found in the specified theme\n           */\n          var parseColors = function (theme) {\n            if (typeof theme !== 'string') {\n              theme = '';\n            }\n\n            if (!attrs.mdColors) {\n              attrs.mdColors = '{}';\n            }\n\n            /**\n             * Json.parse() does not work because the keys are not quoted;\n             * use $parse to convert to a hash map\n             */\n            var colors = $parse(attrs.mdColors)(scope);\n\n            /**\n             * If mdTheme is defined higher up the DOM tree,\n             * we add mdTheme's theme to the colors which don't specify a theme.\n             *\n             * @example\n             * <hljs lang=\"html\">\n             *   <div md-theme=\"myTheme\">\n             *     <div md-colors=\"{background: 'primary-600'}\">\n             *       <span md-colors=\"{background: 'mySecondTheme-accent-200'}\">Color demo</span>\n             *     </div>\n             *   </div>\n             * </hljs>\n             *\n             * 'primary-600' will be changed to 'myTheme-primary-600',\n             * but 'mySecondTheme-accent-200' will not be changed since it has a theme defined.\n             */\n            if (mdThemeController) {\n              Object.keys(colors).forEach(function (prop) {\n                var color = colors[prop];\n                if (!$mdColors.hasTheme(color)) {\n                  colors[prop] = (theme || mdThemeController.$mdTheme) + '-' + color;\n                }\n              });\n            }\n\n            cleanElement(colors);\n\n            return colors;\n          };\n\n          /**\n           * @param {Object} colors\n           */\n          var cleanElement = function (colors) {\n            if (!angular.equals(colors, lastColors)) {\n              var keys = Object.keys(lastColors);\n\n              if (lastColors.background && !keys.color) {\n                keys.push('color');\n              }\n\n              keys.forEach(function (key) {\n                element.css(key, '');\n              });\n            }\n\n            lastColors = colors;\n          };\n\n          /**\n           * Registering for mgTheme changes and asking mdTheme controller run our callback whenever\n           * a theme changes.\n           */\n          var unregisterChanges = angular.noop;\n\n          if (mdThemeController) {\n            unregisterChanges = mdThemeController.registerChanges(function (theme) {\n              $mdColors.applyThemeColors(element, parseColors(theme));\n            });\n          }\n\n          scope.$on('$destroy', function () {\n            unregisterChanges();\n          });\n\n          try {\n            if (shouldWatch) {\n              scope.$watch(parseColors, angular.bind(this,\n                $mdColors.applyThemeColors, element\n              ), true);\n            }\n            else {\n              $mdColors.applyThemeColors(element, parseColors());\n            }\n\n          }\n          catch (e) {\n            $log.error(e.message);\n          }\n\n        };\n\n        /**\n         * @return {boolean}\n         */\n        function shouldColorsWatch() {\n          // Simulate 1x binding and mark mdColorsWatch == false\n          var rawColorExpression = tAttrs.mdColors;\n          var bindOnce = rawColorExpression.indexOf('::') > -1;\n          var isStatic = bindOnce ? true : STATIC_COLOR_EXPRESSION.test(tAttrs.mdColors);\n\n          // Remove it for the postLink...\n          tAttrs.mdColors = rawColorExpression.replace('::', '');\n\n          var hasWatchAttr = angular.isDefined(tAttrs.mdColorsWatch);\n\n          return (bindOnce || isStatic) ? false :\n            hasWatchAttr ? $mdUtil.parseAttributeBoolean(tAttrs.mdColorsWatch) : true;\n        }\n      }\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/colors/colors.spec.js",
    "content": "describe('md-colors', function () {\n  var $compile, $rootScope;\n  var $mdColorPalette, $mdTheming;\n  var supplant, scope;\n  var compiledElements = [];\n  var usesRGBA;\n\n  beforeEach(module('material.components.colors', function ($mdThemingProvider) {\n    $mdThemingProvider.theme('myTheme')\n      .primaryPalette('light-blue')\n      .accentPalette('yellow');\n  }));\n\n  beforeEach(inject(function ($injector) {\n    $compile = $injector.get('$compile');\n    $rootScope = $injector.get('$rootScope');\n    $mdColorPalette = $injector.get('$mdColorPalette');\n    $mdTheming = $injector.get('$mdTheming');\n    supplant = $injector.get('$mdUtil').supplant;\n    scope = $rootScope.$new();\n    checkColorMode();\n  }));\n\n  afterEach(function() {\n    compiledElements.forEach(function(element) {\n      element.remove();\n    });\n\n    compiledElements = [];\n  });\n\n  function buildColor(red, green, blue, opacity) {\n    if (angular.isDefined(opacity) || usesRGBA) {\n      return supplant('rgba({0}, {1}, {2}, {3})', [red, green, blue, opacity || 1]);\n    } else {\n      return supplant('rgb({0}, {1}, {2})', [red, green, blue]);\n    }\n  }\n\n  // Compiles a template and keeps track of the elements so they can be cleaned up properly.\n  function compile(template) {\n    var element = $compile(template)(scope);\n    compiledElements.push(element);\n    return element;\n  }\n\n  // Checks whether the current browser uses RGB or RGBA colors. This is\n  // necessary, because IE and Edge automatically convert RGB colors to RGBA.\n  function checkColorMode() {\n    if (angular.isUndefined(usesRGBA)) {\n      var testerElement = compile('<div md-colors=\"{background: \\'red\\'}\" >');\n      usesRGBA = testerElement[0].style.background.indexOf('rgba') === 0;\n    }\n  }\n\n  describe('directive', function () {\n\n    function createElement(scope, options) {\n      var style =  supplant(\"{theme}-{palette}-{hue}-{opacity}\", {\n        attrs   : options.attrs,\n        palette : options.palette,\n        theme   : options.theme || 'default',\n        hue     : options.hue || (options.palette === 'accent' ? 'A200' : '500'),\n        opacity : options.opacity || 1\n      });\n      var markup = supplant('<div md-colors=\"{background: \\'{0}\\'}\" {1} ></div>', [style, options.attrs]);\n      var element = compile(markup);\n\n      scope.$apply(function() {\n        angular.element(document.body).append(element);\n      });\n\n      return element;\n    }\n\n    function setup(options) {\n      var hue = options.hue = options.hue || '500';\n\n      var element = createElement(scope, {\n        palette: options.palette,\n        hue: hue,\n        opacity: options.opacity,\n        theme: options.theme\n      });\n      var color = $mdColorPalette[options.palette][options.hue];\n\n      color = options.contrast ? color.contrast : color.value;\n\n      return {\n        elementStyle: element[0].style,\n        scope: scope,\n        color: color[3] || options.opacity ?\n          buildColor(color[0], color[1], color[2], color[3] || options.opacity) :\n          buildColor(color[0], color[1], color[2])\n      }\n    }\n\n    /**\n     * <div md-colors=\"{background: 'red'}\" >\n     */\n    it('should accept color palette', function () {\n      var build = setup({ palette: 'red' });\n      expect(build.elementStyle.background).toContain(build.color);\n    });\n\n    describe('two-worded palette', function () {\n      /**\n       * <div md-colors=\"{background: 'blue-grey'}\" >\n       */\n      it('should accept palette spliced with dash', function () {\n        var build = setup({ palette: 'blue-grey' });\n        expect(build.elementStyle.background).toContain(build.color);\n      });\n\n      /**\n       * <div md-colors=\"{background: 'blueGrey-200-0.8'}\" >\n       */\n      it('should accept palette formatted as camelCase', function () {\n        var element = createElement(scope, { palette: 'blueGrey',  hue: '200',  opacity: '0.8' });\n        var color = $mdColorPalette['blue-grey']['200'].value;\n        var expectedRGBa = buildColor(color[0], color[1], color[2], 0.8);\n\n        expect(element[0].style.background).toContain(expectedRGBa);\n      });\n    });\n\n    /**\n     * <div md-colors=\"{background: 'red-200'}\" >\n     */\n    it('should accept color palette and hue', function () {\n      var build = setup({ palette: 'red', hue: '200' });\n      expect(build.elementStyle.background).toContain(build.color);\n    });\n\n    /**\n     * <div md-colors=\"{background: 'red-200-0.8'}\" >\n     */\n    it('should accept color palette, hue and opacity', function () {\n      var build = setup({ palette: 'red', hue: '200', opacity: '0.8' });\n      expect(build.elementStyle.background).toContain(build.color);\n    });\n\n    /**\n     * md-colors applies smart foreground colors (in case 'background' property is used) according the palettes from\n     * https://material.io/archive/guidelines/style/color.html#color-color-palette\n     */\n    describe('foreground color', function () {\n      /**\n       * <div md-colors=\"{background: 'red'}\" >\n       */\n      it('should set background to red-500 and foreground color white', function () {\n        var build = setup({ palette: 'red', contrast: true });\n        expect(build.elementStyle.color).toContain(build.color);\n      });\n      /**\n       * <div md-colors=\"{background: 'red-50'}\" >\n       */\n      it('should set background to red-50 and foreground color black', function () {\n        var build = setup({ palette: 'red', hue: '50', contrast: true });\n        var elColor = build.elementStyle.color.replace('0588', ''); // hack to reduce 0.870588 to 0.87\n        expect(elColor).toContain(build.color);\n      });\n\n    });\n\n    describe('themes', function () {\n      /**\n       * <div md-colors=\"{background: 'primary'}\">\n       */\n      it('should accept primary palette', function() {\n        var type = 'primary';\n        var paletteName = $mdTheming.THEMES['default'].colors[type].name;\n        var color = $mdColorPalette[paletteName]['500'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n        var element = createElement(scope, { palette: type });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n      });\n\n      /**\n       * <div md-colors=\"{background: 'accent'}\" >\n       */\n      it('should accept accent palette', function() {\n        var type = 'accent';\n        var paletteName = $mdTheming.THEMES['default'].colors[type].name;\n        var color = $mdColorPalette[paletteName]['A200'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n        var element = createElement(scope, { palette: type });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n      });\n\n      /**\n       * <div md-colors=\"{background: 'warn'}\" >\n       */\n      it('should accept warn palette', function() {\n        var type = 'warn';\n        var paletteName = $mdTheming.THEMES['default'].colors[type].name;\n        var color = $mdColorPalette[paletteName]['500'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n        var element = createElement(scope, { palette: type });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n      });\n\n      /**\n       * <div md-colors=\"{background: 'background'}\"></div>\n       */\n      it('should accept background palette', function() {\n        var type = 'background';\n        var paletteName = $mdTheming.THEMES['default'].colors[type].name;\n        var color = $mdColorPalette[paletteName]['500'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n        var element = createElement(scope, { palette: type });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n      });\n\n      describe('hues', function () {\n        /**\n         * <div md-colors=\"{background: 'primary-hue-1'}\">\n         */\n        it('should accept primary color palette with hue 1', function() {\n          var type = 'primary';\n          var hue = 'hue-1';\n          var palette = $mdTheming.THEMES['default'].colors[type];\n          var paletteName = palette.name;\n          var paletteHue = palette.hues[hue];\n          var color = $mdColorPalette[paletteName][paletteHue].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { palette: type, hue: hue });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n        });\n\n        /**\n         * <div md-colors=\"{background: 'primary-hue-2'}\">\n         */\n        it('should accept primary color palette with hue 2', function() {\n          var type = 'primary';\n          var hue = 'hue-2';\n          var palette = $mdTheming.THEMES['default'].colors[type];\n          var paletteName = palette.name;\n          var paletteHue = palette.hues[hue];\n          var color = $mdColorPalette[paletteName][paletteHue].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { palette: type, hue: hue });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n        });\n\n        /**\n         * <div md-colors=\"{background: 'primary-hue-3'}\">\n         */\n        it('should accept primary color palette with hue 3', function() {\n          var type = 'primary';\n          var hue = 'hue-3';\n          var palette = $mdTheming.THEMES['default'].colors[type];\n          var paletteName = palette.name;\n          var paletteHue = palette.hues[hue];\n          var color = $mdColorPalette[paletteName][paletteHue].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { palette: type, hue: hue });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n        });\n\n        /**\n         * <div md-colors=\"{background: 'primary-hue-1-0.2'}\">\n         */\n        it('should accept primary color palette with hue 1 and 0.2 opacity', function() {\n          var type = 'primary';\n          var hue = 'hue-1';\n          var opacity = 0.2;\n\n          var palette = $mdTheming.THEMES['default'].colors[type];\n          var paletteName = palette.name;\n          var paletteHue = palette.hues[hue];\n          var color = $mdColorPalette[paletteName][paletteHue].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2], opacity);\n          var element = createElement(scope, { palette: type, hue: hue, opacity: opacity });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n        });\n      });\n\n      describe('custom themes', function () {\n\n        /**\n         * <div md-colors=\"{background: 'myTheme-primary-500'}\" >\n         */\n        it('should accept theme, color palette, and hue', function () {\n          var type = 'primary';\n          var paletteName = $mdTheming.THEMES['myTheme'].colors[type].name;\n          var color = $mdColorPalette[paletteName]['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { theme: 'myTheme',  palette: type, hue: '500' });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n        });\n      });\n\n      describe('mdColors integration', function () {\n        /**\n         * <div md-theme=\"myTheme\">\n         *   <div md-colors=\"{background: 'primary'}\" >\n         * </div>\n         */\n        it('should automatically inject myTheme as the theme prefix', function () {\n\n          var type = 'primary';\n          var paletteName = $mdTheming.THEMES['myTheme'].colors[type].name;\n          var color = $mdColorPalette[paletteName]['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n\n          var markup = '<div md-theme=\"myTheme\"><div md-colors=\"{background: \\'primary\\'}\" ></div></div>';\n          var element = compile(markup);\n\n          expect(element.children()[0].style.background).toContain(expectedRGB);\n        });\n\n        /**\n         * <div md-theme=\"{{theme}}\">\n         *   <div md-colors=\"{background: 'primary'}\" >\n         * </div>\n         */\n        it('should register for theme changes and inject myTheme as the theme prefix', function () {\n\n          var type = 'primary';\n          var paletteName = $mdTheming.THEMES['myTheme'].colors[type].name;\n          var color = $mdColorPalette[paletteName]['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n          scope.theme = 'myTheme';\n          var markup = '<div md-theme=\"{{theme}}\"><div md-colors=\"{background: \\'primary\\'}\" ></div></div>';\n          var element = compile(markup);\n\n          expect(element.children()[0].style.background).toContain(expectedRGB);\n\n          paletteName = $mdTheming.THEMES['default'].colors[type].name;\n          color = $mdColorPalette[paletteName]['500'].value;\n          expectedRGB = buildColor(color[0], color[1], color[2]);\n\n          scope.theme = 'default';\n          scope.$apply();\n\n          expect(element.children()[0].style.background).toContain(expectedRGB);\n        });\n      })\n    });\n\n    describe('watched values', function () {\n\n      /**\n       * <div md-colors=\"{background: 'default-{{color}}' }\" >\n       */\n      it('should accept interpolated value', function() {\n        var color = $mdColorPalette['red']['500'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n        scope.color = 'red';\n        var element = createElement(scope, { palette: '{{color}}' });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n\n        scope.color = 'lightBlue-200-0.8';\n        scope.$apply();\n\n        color = $mdColorPalette['light-blue']['200'].value;\n        var expectedRGBa = buildColor(color[0], color[1], color[2], 0.8);\n\n        expect(element[0].style.background).toContain(expectedRGBa);\n      });\n\n      /**\n       * <div md-colors=\"{ background: color() }\" >\n       */\n      it('should accept function', function() {\n        var color = $mdColorPalette['light-blue']['200'].value;\n        var element = compile('<div md-colors=\"{background: color()}\"></div>');\n        var expectedRGBa = buildColor(color[0], color[1], color[2], 0.8);\n\n        scope.color = function () {\n          return 'lightBlue-200-0.8';\n        };\n        scope.$apply();\n\n        expect(element[0].style.background).toContain(expectedRGBa);\n      });\n\n      /**\n       * <div md-colors=\"{ background: test ? 'red' : 'lightBlue' }\" >\n       */\n      it('should accept ternary value', inject(function($timeout) {\n        var element = compile('<div md-colors=\"{background: \\'{{test ? \\'red\\' : \\'lightBlue\\'}}\\'}\"></div>');\n        var color = $mdColorPalette['light-blue']['500'].value;\n        var red = $mdColorPalette['red']['500'].value;\n        var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n        scope.$apply(function() {\n          scope.test = false;\n        });\n\n        expect(element[0].style.background).toContain(expectedRGB);\n\n        scope.$apply(function() {\n          scope.test = true;\n        });\n        $timeout.flush();\n\n        expectedRGB = buildColor(red[0], red[1], red[2]);\n        expect(element[0].style.background).toContain(expectedRGB);\n      }));\n\n      describe('md-colors-watch', function () {\n        it('should watch if mdColorsWatch attribute is set (without value)', function () {\n          scope.color = 'red';\n\n          var color = $mdColorPalette['red']['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { palette: '{{color}}',  attrs: 'md-colors-watch' });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n\n          scope.$apply(function() {\n            scope.color = 'lightBlue-200-0.8';\n          });\n\n          color = $mdColorPalette['light-blue']['200'].value;\n          var expectedRGBa = buildColor(color[0], color[1], color[2], 0.8);\n          expect(element[0].style.background).toContain(expectedRGBa)\n        });\n\n        it('should not watch if mdColorsWatch attribute is set to false', function () {\n          scope.color = 'red';\n\n          var color = $mdColorPalette['red']['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n          var element = createElement(scope, { palette: '{{color}}',  attrs: 'md-colors-watch=\"false\"' });\n\n          expect(element[0].style.background).toContain(expectedRGB);\n\n          scope.$apply(function() {\n            scope.color = 'lightBlue-200-0.8';\n          });\n\n          expect(element[0].style.background).toContain(expectedRGB)\n        });\n\n        it('should watch if mdColorsWatch attribute is set to true', function () {\n          scope.$apply(function() {\n            scope.color = 'red';\n          });\n\n          var color = $mdColorPalette['red']['500'].value;\n          var element = createElement(scope, {\n            palette: '{{color}}',\n            attrs: 'md-colors-watch=\"true\"'\n          });\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n\n          expect(element[0].style.background).toContain(expectedRGB);\n\n          scope.$apply(function() {\n            scope.color = 'lightBlue-200-0.8';\n          });\n\n          color = $mdColorPalette['light-blue']['200'].value;\n          var expectedRGBa = buildColor(color[0], color[1], color[2], '0.8');\n\n          expect(element[0].style.background).toContain(expectedRGBa);\n        });\n      });\n\n      describe('transition to empty object' , function () {\n        /**\n         * <div md-colors=\"{background: '{{color}}' }\" >\n         */\n        it('should delete old colors when getting an empty object', function() {\n          var element = compile('<div md-colors=\"{{color}}\"></div>');\n\n          scope.color = '{background: \\'red\\'}';\n          scope.$apply();\n\n          var color = $mdColorPalette['red']['500'].value;\n          var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n          expect(element[0].style.background).toContain(expectedRGB);\n          expect(element[0].style.color).not.toBe('');\n\n          scope.color = '{}';\n          scope.$apply();\n\n          expect(element[0].style.background).toBe('');\n\n          /**\n           * mdColors automatically sets the foreground colors according the material palette\n           * we make sure that even if the background was set (and the foreground automatically)\n           * we delete it.\n           */\n          expect(element[0].style.color).toBe('');\n\n        });\n      })\n    });\n\n    describe('empty values', function () {\n      /**\n       * <div md-colors=\"\" >\n       */\n      it('should accept empty value and not color the element', function() {\n        var element = compile('<div md-colors=\"\"></div>');\n\n        expect(element[0].style.background).toBe('');\n      });\n\n      /**\n       * <div md-colors=\"{}\" >\n       */\n      it('should accept empty object and not color the element', function() {\n        var element = compile('<div md-colors=\"{}\"></div>');\n\n        expect(element[0].style.background).toBe('');\n      });\n    });\n  });\n\n  describe('service', function () {\n    it('should apply colors on an element', inject(function ($mdColors) {\n      var element = angular.element('<div></div>');\n      var color = $mdColorPalette['red']['200'].value;\n      var expectedRGB = buildColor(color[0], color[1], color[2]);\n\n      $mdColors.applyThemeColors(element, { background: 'red-200' });\n      expect(element[0].style.background).toContain(expectedRGB);\n    }));\n\n    it('should return the parsed color', inject(function ($mdColors) {\n      var color = $mdColorPalette['red']['200'].value;\n      var expectedRGB = buildColor(color[0], color[1], color[2], 1);\n\n      var themeColor = $mdColors.getThemeColor('red-200');\n      expect(themeColor).toBe(expectedRGB);\n    }));\n\n    describe('palette hues', function () {\n      it('should throw error on hue-4', inject(function ($mdColors) {\n        expect(function () {\n          $mdColors.getThemeColor('primary-hue-4')\n        }).toThrowError();\n      }));\n\n      it('should throw error on hue-0', inject(function ($mdColors) {\n        expect(function () {\n          $mdColors.getThemeColor('primary-hue-0')\n        }).toThrowError();\n      }));\n\n      it('should throw error on usage of defined palette and hue', inject(function ($mdColors) {\n        expect(function () {\n          $mdColors.getThemeColor('red-hue-1')\n        }).toThrowError();\n      }));\n    });\n  })\n});\n"
  },
  {
    "path": "src/components/colors/demoBasicUsage/index.html",
    "content": "<div layout=\"column\" ng-cloak class=\"md-padding\">\n  <p style=\"margin-bottom: 10px;\">\n    Custom component implementations using Material elements often want to apply theme colors\n    to their custom components. Consider the custom <code>&lt;user-card&gt;</code> component below\n    where the <code>md-colors</code> attribute is used to color the background and text colors\n    using either the current or specified theme palette colors.\n  </p>\n  <!-- Example 1 -->\n  <h4 class=\"card-title\"> <code>&lt;user-card&gt;</code> without md-color features</h4>\n  <regular-card name=\"User name\" md-theme=\"default\"></regular-card>\n  <!-- Example 2 -->\n  <h4 class=\"card-title\"> <code>&lt;user-card&gt;</code> coloring using the 'default' theme</h4>\n  <user-card name=\"User name\"></user-card>\n  <!-- Example 3 -->\n  <h4 class=\"card-title\"> <code>&lt;user-card&gt;</code> coloring using the 'forest' theme</h4>\n  <user-card name=\"User name\" theme=\"forest\"></user-card>\n  <!-- Footnote -->\n  <p class=\"footnote\">\n    Note: The <code>md-colors</code> directive allows pre-defined theme colors to be applied\n    as CSS style properties. <code>md-colors</code> uses the palettes defined in the\n    <a href=\"https://material.io/archive/guidelines/style/color.html#color-color-palette\">\n      Material Design Colors</a> and the themes defined using <code>$mdThemingProvider</code>.\n    This directive is an extension of the <code>$mdTheming</code> features.\n  </p>\n</div>\n"
  },
  {
    "path": "src/components/colors/demoBasicUsage/regularCard.tmpl.html",
    "content": "<md-card>\n  <md-card-title>\n    <md-card-title-media>\n      <div class=\"md-media-sm card-media\" layout>\n        <md-icon md-svg-icon=\"social:person\" style=\"color: grey\"></md-icon>\n      </div>\n    </md-card-title-media>\n    <md-card-title-text>\n      <span class=\"md-headline\">{{name}}</span>\n      <span class=\"md-subhead description\">Ipsum lorem caveat emptor...</span>\n    </md-card-title-text>\n  </md-card-title>\n</md-card>\n"
  },
  {
    "path": "src/components/colors/demoBasicUsage/script.js",
    "content": "angular.module('colorsDemo', ['ngMaterial'])\n  .config(function ($mdThemingProvider, $mdIconProvider) {\n    $mdThemingProvider.theme('forest')\n      .primaryPalette('brown')\n      .accentPalette('green');\n\n    $mdIconProvider\n      .iconSet('social', 'img/icons/sets/social-icons.svg', 24);\n  })\n  .directive('regularCard', function () {\n    return {\n      restrict: 'E',\n      templateUrl: 'regularCard.tmpl.html',\n      scope: {\n        name: '@',\n      }\n    };\n  })\n  .directive('userCard', function () {\n    return {\n      restrict: 'E',\n      templateUrl: 'userCard.tmpl.html',\n      scope: {\n        name: '@',\n        theme: '@'\n      },\n      controller: function ($scope) {\n        $scope.theme = $scope.theme || 'default';\n      }\n    };\n  });\n"
  },
  {
    "path": "src/components/colors/demoBasicUsage/style.css",
    "content": ".card-media {\n  margin-right: 16px;\n  border-radius: 50%;\n  overflow: hidden;\n}\n\n.md-subhead.description {\n  color: rgba(255, 255, 255, 0.7);\n}\n\n.card-media md-icon {\n  width: 40px;\n  height: 40px;\n  color: rgba(255, 255, 255, 0.87);\n}\n\nh4.card-title {\n  margin: 24px 8px 0;\n}\n\ncode.css {\n  background-color: #fffcc2;\n}\n\np.footnote code {\n  font-size: 0.85em;\n}\n\np.footnote {\n  font-size: 0.85em;\n  margin: 30px 8px;\n  padding: 16px;\n  background-color: rgba(205, 205, 205, 0.45);\n}\n"
  },
  {
    "path": "src/components/colors/demoBasicUsage/userCard.tmpl.html",
    "content": "<md-card md-colors=\"::{backgroundColor: '{{theme}}-primary-700'}\">\n  <md-card-title>\n    <md-card-title-media>\n      <div class=\"md-media-sm card-media\" layout md-colors=\"::{background: '{{theme}}-accent'}\">\n        <md-icon md-svg-icon=\"social:person\"></md-icon>\n      </div>\n    </md-card-title-media>\n    <md-card-title-text>\n      <span class=\"md-headline\">{{name}}</span>\n      <span class=\"md-subhead description\">This card is colored according the {{theme}} theme</span>\n    </md-card-title-text>\n  </md-card-title>\n</md-card>\n"
  },
  {
    "path": "src/components/colors/demoThemePicker/index.html",
    "content": "<div layout=\"column\" ng-cloak ng-controller=\"ThemeDemoCtrl\" class=\"md-padding\">\n  <p>\n    Select two of the <a href=\"{{mdURL}}\">Material Palettes</a>\n    below:\n  </p>\n  <!-- Theme Options -->\n  <div layout=\"row\" layout-wrap layout-align=\"center center\">\n    <md-button ng-repeat=\"color in colors\" flex-gt-md=\"15\" flex=\"30\"\n               md-colors=\"{background: '{{color}}-400'}\" md-colors-watch=\"false\"\n               ng-disabled=\"primary === color && !isPrimary\" ng-click=\"selectTheme(color)\">\n      {{color}}\n    </md-button>\n  </div>\n  <!-- Footnote -->\n  <p style=\"padding-top: 20px;\">\n    Shown below are the colors of the custom <code>&lt;theme-preview&gt;</code> component that\n    were updated by <code>&lt;md-colors&gt;</code>\n  </p>\n  <!-- Theme Preview -->\n  <div layout=\"row\" class=\"section\" layout-align=\"center center\">\n    <div layout=\"column\" flex=\"50\">\n      <span class=\"componentTag\">&lt;theme-preview&gt;</span>\n      <theme-preview primary=\"primary\" accent=\"accent\"></theme-preview>\n    </div>\n  </div>\n  <!-- Footnote -->\n  <p class=\"footnote\">\n    Notice that the foreground colors are automatically determined (from the theme configurations)\n    based on the specified background palette selection. You can also override the foreground color,\n    if desired.\n  </p>\n\n</div>\n"
  },
  {
    "path": "src/components/colors/demoThemePicker/script.js",
    "content": "angular\n  .module('colorsThemePickerDemo', ['ngMaterial'])\n  .controller('ThemeDemoCtrl', function ($scope, $mdColorPalette) {\n    $scope.colors = Object.keys($mdColorPalette);\n\n    $scope.mdURL = 'https://material.io/archive/guidelines/style/color.html#color-color-palette';\n    $scope.primary = 'purple';\n    $scope.accent = 'green';\n\n    $scope.isPrimary = true;\n\n    $scope.selectTheme = function (color) {\n      if ($scope.isPrimary) {\n        $scope.primary = color;\n\n        $scope.isPrimary = false;\n      }\n      else {\n        $scope.accent = color;\n\n        $scope.isPrimary = true;\n      }\n    };\n  })\n  .directive('themePreview', function () {\n    return {\n      restrict: 'E',\n      templateUrl: 'themePreview.tmpl.html',\n      scope: {\n        primary: '=',\n        accent: '='\n      },\n      controller: function ($scope, $mdColors, $mdColorUtil) {\n        $scope.getColor = function (color) {\n          return $mdColorUtil.rgbaToHex($mdColors.getThemeColor(color));\n        };\n      }\n    };\n  })\n  .directive('mdJustified', function() {\n    return {\n      restrict : 'A',\n      compile : function(element, attrs)  {\n        var layoutDirection = 'layout-'+ (attrs.mdJustified || \"row\");\n\n        element.removeAttr('md-justified');\n        element.addClass(layoutDirection);\n        element.addClass(\"layout-align-space-between-stretch\");\n\n        return angular.noop;\n      }\n    };\n  });\n"
  },
  {
    "path": "src/components/colors/demoThemePicker/style.css",
    "content": ".section {\n  font-size: 12px;\n  padding: 16px;\n  font-weight: bold;\n}\n\n.line {\n  padding: 16px;\n}\n\n.primary, .accent {\n  margin: 4px 0;\n  height: 120px;\n}\n\n[md-colors] {\n  transition: all 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n}\n\np.footnote {\n  font-size: 0.85em;\n  margin: 30px 8px;\n  padding: 16px;\n  background-color: rgba(205, 205, 205, 0.45);\n}\n\n.componentTag {\n  font-weight: bolder;\n  font-size: 1.2em;\n  padding-left: 10px;\n}\n"
  },
  {
    "path": "src/components/colors/demoThemePicker/themePreview.tmpl.html",
    "content": "<div layout=\"column\">\n  <div md-colors=\"{background: '{{primary}}-500'}\"  md-justified=\"column\" class=\"primary line\">\n    <span>Primary - {{primary}}</span>\n    <div md-justified >\n      <span>500</span>\n      <span>{{getColor(primary + '-500')}}</span>\n    </div>\n  </div>\n  <div md-colors=\"{background: '{{primary}}-700'}\" md-justified class=\"line\" >\n    <span>700</span>\n    <span>{{getColor(primary + '-700')}}</span>\n  </div>\n  <div md-colors=\"{background: '{{primary}}-800'}\" md-justified class=\"line\" >\n    <span>800</span>\n    <span>{{getColor(primary + '-800')}}</span>\n  </div>\n  <div md-colors=\"{background: '{{accent}}-A200'}\" md-justified=\"column\" class=\"accent line\">\n    <span>Accent - {{accent}}</span>\n    <div md-justified>\n      <span>A200</span>\n      <span>{{getColor(accent + '-A200')}}</span>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/content/content-theme.scss",
    "content": "md-content.md-THEME_NAME-theme {\n  color: '{{foreground-1}}';\n  background-color: '{{background-default}}';\n}\n\n\n"
  },
  {
    "path": "src/components/content/content.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.content\n *\n * @description\n * Scrollable content\n */\nangular.module('material.components.content', [\n  'material.core'\n])\n  .directive('mdContent', mdContentDirective);\n\n/**\n * @ngdoc directive\n * @name mdContent\n * @module material.components.content\n *\n * @restrict E\n *\n * @description\n *\n * The `<md-content>` directive is a container element useful for scrollable content. It achieves\n * this by setting the CSS `overflow` property to `auto` so that content can properly scroll.\n *\n * In general, `<md-content>` components are not designed to be nested inside one another. If\n * possible, it is better to make them siblings. This often results in a better user experience as\n * having nested scrollbars may confuse the user.\n *\n * ## Troubleshooting\n *\n * In some cases, you may wish to apply the `md-no-momentum` class to ensure that Safari's\n * momentum scrolling is disabled. Momentum scrolling can cause flickering issues while scrolling\n * SVG icons and some other components.\n *\n * Additionally, we now also offer the `md-no-flicker` class which can be applied to any element\n * and uses a Webkit-specific filter of `blur(0px)` that forces GPU rendering of all elements\n * inside (which eliminates the flicker on iOS devices).\n *\n * _<b>Note:</b> Forcing an element to render on the GPU can have unintended side-effects, especially\n * related to the z-index of elements. Please use with caution and only on the elements needed._\n *\n * @usage\n *\n * Add the `[layout-padding]` attribute to make the content padded.\n *\n * <hljs lang=\"html\">\n *  <md-content layout-padding>\n *      Lorem ipsum dolor sit amet, ne quod novum mei.\n *  </md-content>\n * </hljs>\n */\n\nfunction mdContentDirective($mdTheming) {\n  return {\n    restrict: 'E',\n    controller: ['$scope', '$element', ContentController],\n    link: function(scope, element) {\n      element.addClass('_md');     // private md component indicator for styling\n\n      $mdTheming(element);\n      scope.$broadcast('$mdContentLoaded', element);\n\n      iosScrollFix(element[0]);\n    }\n  };\n\n  function ContentController($scope, $element) {\n    this.$scope = $scope;\n    this.$element = $element;\n  }\n}\n\nfunction iosScrollFix(node) {\n  // IOS FIX:\n  // If we scroll where there is no more room for the webview to scroll,\n  // by default the webview itself will scroll up and down, this looks really\n  // bad.  So if we are scrolling to the very top or bottom, add/subtract one\n  angular.element(node).on('$md.pressdown', function(ev) {\n    // Only touch events\n    if (ev.pointer.type !== 't') return;\n    // Don't let a child content's touchstart ruin it for us.\n    if (ev.$materialScrollFixed) return;\n    ev.$materialScrollFixed = true;\n\n    if (node.scrollTop === 0) {\n      node.scrollTop = 1;\n    } else if (node.scrollHeight === node.scrollTop + node.offsetHeight) {\n      node.scrollTop -= 1;\n    }\n  });\n}\n"
  },
  {
    "path": "src/components/content/content.scss",
    "content": "md-content {\n\n  display: block;\n  position: relative;\n  overflow: auto;\n  -webkit-overflow-scrolling: touch;\n\n  &[md-scroll-y] {\n    overflow-y: auto;\n    overflow-x: hidden;\n  }\n  &[md-scroll-x] {\n    overflow-x: auto;\n    overflow-y: hidden;\n  }\n  &[md-scroll-xy] {\n  }\n\n  @media print {\n    overflow: visible !important;\n  }\n}\n\n\n"
  },
  {
    "path": "src/components/content/content.spec.js",
    "content": "describe('mdContent directive', function() {\n\n  beforeEach(module('material.components.content'));\n\n  it('should have `._md` class indicator', inject(function($compile, $rootScope) {\n    var element = $compile('<md-content></md-content>')($rootScope.$new());\n    expect(element.hasClass('_md')).toBe(true);\n  }));\n\n});\n"
  },
  {
    "path": "src/components/content/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" ng-cloak>\n  <md-toolbar class=\"md-warn\">\n    <div class=\"md-toolbar-tools\">\n      <h2 class=\"md-flex\">Toolbar: md-warn</h2>\n    </div>\n  </md-toolbar>\n\n  <md-content flex layout-padding>\n    <p>Lorem ipsum dolor sit amet, ne quod novum mei. Sea omnium invenire mediocrem at, in lobortis conclusionemque nam. Ne deleniti appetere reprimique pro, inani labitur disputationi te sed. At vix sale omnesque, id pro labitur reformidans accommodare, cum labores honestatis eu. Nec quem lucilius in, eam praesent reformidans no. Sed laudem aliquam ne.</p>\n\n    <p>\nFacete delenit argumentum cum at. Pro rebum nostrum contentiones ad. Mel exerci tritani maiorum at, mea te audire phaedrum, mel et nibh aliquam. Malis causae equidem vel eu. Noster melius vis ea, duis alterum oporteat ea sea. Per cu vide munere fierent.\n    </p>\n\n    <p>\nAd sea dolor accusata consequuntur. Sit facete convenire reprehendunt et. Usu cu nonumy dissentiet, mei choro omnes fuisset ad. Te qui docendi accusam efficiantur, doming noster prodesset eam ei. In vel posse movet, ut convenire referrentur eum, ceteros singulis intellegam eu sit.\n    </p>\n\n    <p>\nSit saepe quaestio reprimique id, duo no congue nominati, cum id nobis facilisi. No est laoreet dissentias, idque consectetuer eam id. Clita possim assueverit cu his, solum virtute recteque et cum. Vel cu luptatum signiferumque, mel eu brute nostro senserit. Blandit euripidis consequat ex mei, atqui torquatos id cum, meliore luptatum ut usu. Cu zril perpetua gubergren pri. Accusamus rationibus instructior ei pro, eu nullam principes qui, reque justo omnes et quo.\n    </p>\n\n    <p>\nSint unum eam id. At sit fastidii theophrastus, mutat senserit repudiare et has. Atqui appareat repudiare ad nam, et ius alii incorrupte. Alii nullam libris his ei, meis aeterno at eum. Ne aeque tincidunt duo. In audire malorum mel, tamquam efficiantur has te.\n    </p>\n\n    <p>\nQui utamur tacimates quaestio ad, quod graece omnium ius ut. Pri ut vero debitis interpretaris, qui cu mentitum adipiscing disputationi. Voluptatum mediocritatem quo ut. Fabulas dolorem ei has, quem molestie persequeris et sit.\n    </p>\n\n    <p>\nEst in vivendum comprehensam conclusionemque, alia cetero iriure no usu, te cibo deterruisset pro. Ludus epicurei quo id, ex cum iudicabit intellegebat. Ex modo deseruisse quo, mel noster menandri sententiae ea, duo et tritani malorum recteque. Nullam suscipit partiendo nec id, indoctum vulputate per ex. Et has enim habemus tibique. Cu latine electram cum, ridens propriae intellegat eu mea.\n    </p>\n\n    <p>\nDuo at aliquid mnesarchum, nec ne impetus hendrerit. Ius id aeterno debitis atomorum, et sed feugait voluptua, brute tibique no vix. Eos modo esse ex, ei omittam imperdiet pro. Vel assum albucius incorrupte no. Vim viris prompta repudiare ne, vel ut viderer scripserit, dicant appetere argumentum mel ea. Eripuit feugait tincidunt pri ne, cu facilisi molestiae usu.\n    </p>\n\n    <p>\nQui utamur tacimates quaestio ad, quod graece omnium ius ut. Pri ut vero debitis interpretaris, qui cu mentitum adipiscing disputationi. Voluptatum mediocritatem quo ut. Fabulas dolorem ei has, quem molestie persequeris et sit.\n    </p>\n\n    <p>\nEst in vivendum comprehensam conclusionemque, alia cetero iriure no usu, te cibo deterruisset pro. Ludus epicurei quo id, ex cum iudicabit intellegebat. Ex modo deseruisse quo, mel noster menandri sententiae ea, duo et tritani malorum recteque. Nullam suscipit partiendo nec id, indoctum vulputate per ex. Et has enim habemus tibique. Cu latine electram cum, ridens propriae intellegat eu mea.\n    </p>\n\n    <p>\nDuo at aliquid mnesarchum, nec ne impetus hendrerit. Ius id aeterno debitis atomorum, et sed feugait voluptua, brute tibique no vix. Eos modo esse ex, ei omittam imperdiet pro. Vel assum albucius incorrupte no. Vim viris prompta repudiare ne, vel ut viderer scripserit, dicant appetere argumentum mel ea. Eripuit feugait tincidunt pri ne, cu facilisi molestiae usu.\n    </p>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/content/demoBasicUsage/script.js",
    "content": "\nangular.module('contentDemo1', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope) {\n\n});\n"
  },
  {
    "path": "src/components/content/demoBasicUsage/style.css",
    "content": "div.demo-content {\n    height: 450px;\n}\ndiv[ng-controller] {\n    height:100%;\n    padding-bottom: 15px;\n}\nmd-content {\n    padding: 24px;\n}\n"
  },
  {
    "path": "src/components/datepicker/calendar-theme.scss",
    "content": "/** Theme styles for mdCalendar. */\n.md-THEME_NAME-theme {\n  .md-calendar {\n    background: '{{background-hue-1}}';\n    color: '{{foreground-1-0.87}}';\n\n    tr:last-child td {\n      border-bottom-color: '{{background-hue-2}}';\n    }\n  }\n\n  .md-calendar-day-header {\n    background: '{{background-500-0.32}}';\n    color: '{{foreground-1-0.87}}';\n  }\n\n  .md-calendar-date.md-calendar-date-today {\n\n    .md-calendar-date-selection-indicator {\n      border: 1px solid '{{primary-500}}'; // blue-500\n    }\n\n    &.md-calendar-date-disabled {\n      color: '{{primary-500-0.6}}';\n    }\n  }\n\n  .md-calendar-date-selection-indicator {\n    .md-calendar-date.md-focus &,\n    &:hover {\n      background: '{{background-500-0.32}}';\n    }\n  }\n\n  // Selected style goes after hover and focus so that it takes priority.\n  .md-calendar-date.md-calendar-selected-date,\n  .md-calendar-date.md-focus.md-calendar-selected-date {\n    .md-calendar-date-selection-indicator {\n      background: '{{primary-500}}'; // blue-500\n      color: '{{primary-500-contrast}}'; // white\n      border-color: transparent;\n    }\n  }\n\n  .md-calendar-date-disabled,\n  .md-calendar-month-label-disabled {\n    color: '{{foreground-3}}';\n  }\n\n  .md-calendar-month-label md-icon {\n    color: '{{foreground-1}}';\n  }\n}\n"
  },
  {
    "path": "src/components/datepicker/calendar.scss",
    "content": "/** Styles for mdCalendar. */\n$md-calendar-cell-size: 44px !default;\n$md-calendar-header-height: 40px !default;\n$md-calendar-cell-emphasis-size: 40px !default;\n$md-calendar-side-padding: 16px !default;\n$md-calendar-weeks-to-show: 7 !default;\n\n$md-calendar-month-label-padding: 8px !default;\n$md-calendar-month-label-font-size: 14px !default;\n\n$md-calendar-scroll-cue-shadow-radius: 6px !default;\n\n$md-calendar-width: (7 * $md-calendar-cell-size) + (2 * $md-calendar-side-padding) !default;\n$md-calendar-height:\n    ($md-calendar-weeks-to-show * $md-calendar-cell-size) + $md-calendar-header-height !default;\n\n// Styles for date cells, including day-of-the-week header cells.\n@mixin md-calendar-cell($height: $md-calendar-cell-size) {\n  height: $height;\n  width: $md-calendar-cell-size;\n  text-align: center;\n\n  // Remove all padding and borders so we can completely\n  // control the size of the table cells.\n  padding: 0;\n  border: none;\n\n  // Prevent issues if somebody is applying box-sizing: border-box; eveywhere.\n  box-sizing: content-box;\n\n  // The left / right padding is applied to the cells instead of the wrapper\n  // because we want the header background and the month dividing border to\n  // extend the entire width of the calendar.\n  &:first-child {\n    @include rtl-prop(padding-left, padding-right, $md-calendar-side-padding, 0);\n  }\n\n  &:last-child {\n    @include rtl-prop(padding-right, padding-left, $md-calendar-side-padding, 0);\n  }\n}\n\n// Styles for tables used in mdCalendar (the day-of-the-week header and the table of dates itself).\n@mixin md-calendar-table() {\n  // Fixed table layout makes IE faster.\n  // https://msdn.microsoft.com/en-us/library/ms533020(VS.85).aspx\n  table-layout: fixed;\n  border-spacing: 0;\n  border-collapse: collapse;\n}\n\nmd-calendar {\n  font-size: 13px;\n  user-select: none;\n}\n\n// Wrap the scroll with overflow: hidden in order to hide the scrollbar.\n// The inner .md-calendar-scroll-container will using a padding-right to push the\n// scrollbar into the hidden area (done with javascript).\n.md-calendar-scroll-mask {\n  display: inline-block;\n  overflow: hidden;\n  height: $md-calendar-weeks-to-show * $md-calendar-cell-size;\n\n  // The actual scrolling element.\n  .md-virtual-repeat-scroller {\n    // These two properties are needed to get touch momentum to work.\n    // See https://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements\n    overflow-y: scroll;\n    -webkit-overflow-scrolling: touch;\n\n    &::-webkit-scrollbar {\n      display: none;\n    }\n  }\n\n  // Offsetter is the element that is translateY'ed into view of the user and contains the\n  // calendar content.\n  .md-virtual-repeat-offsetter {\n    width: 100%;\n  }\n}\n\n// Contains the scrolling element (this is the md-virtual-repeat-container).\n.md-calendar-scroll-container {\n  // Add an inset shadow to help cue users that the calendar is scrollable. Use a negative x\n  // offset to push the vertical edge shadow off to the right so that it's cut off by the edge\n  // of the calendar container.\n  box-shadow: inset -3px 3px $md-calendar-scroll-cue-shadow-radius rgba(black, 0.2);\n\n  display: inline-block;\n  height: $md-calendar-weeks-to-show * $md-calendar-cell-size;\n\n  // Add the shadow radius to the width so that the shadow os pushed off to the side and cut off.\n  width: $md-calendar-width + $md-calendar-scroll-cue-shadow-radius;\n}\n\n// A single date cell in the calendar table.\n.md-calendar-date {\n  @include md-calendar-cell();\n\n  &.md-calendar-date-disabled {\n    cursor: default;\n  }\n}\n\n// Circle element inside of every date cell used to indicate selection or focus.\n.md-calendar-date-selection-indicator {\n  transition: background-color, color $swift-ease-out-duration $swift-ease-out-timing-function;\n\n  border-radius: 50%;\n  display: inline-block;\n\n  width: $md-calendar-cell-emphasis-size;\n  height: $md-calendar-cell-emphasis-size;\n  line-height: $md-calendar-cell-emphasis-size;\n\n  .md-calendar-date:not(.md-disabled) & {\n    cursor: pointer;\n  }\n}\n\n// The label above each month (containing the month name and the year, e.g. \"Jun 2014\").\n.md-calendar-month-label {\n  height: $md-calendar-cell-size;\n  font-size: $md-calendar-month-label-font-size;\n  font-weight: 500; // Roboto Medium\n  @include rtl(padding, 0 0 0 $md-calendar-side-padding + $md-calendar-month-label-padding, rtl-value( 0 0 0 $md-calendar-side-padding + $md-calendar-month-label-padding));\n\n  &.md-calendar-label-clickable {\n    cursor: pointer;\n  }\n\n  md-icon {\n    @include rtl(transform, rotate(180deg), none);\n  }\n\n  span {\n    vertical-align: middle;\n  }\n}\n\n// Table containing the day-of-the-week header.\n.md-calendar-day-header {\n  @include md-calendar-table();\n\n  th {\n    @include md-calendar-cell($md-calendar-header-height);\n    font-weight: normal;\n  }\n}\n\n// Primary table containing all date cells. Each month is a tbody in this table.\n.md-calendar {\n  @include md-calendar-table();\n\n  // Divider between months.\n  tr:last-child td {\n    border-bottom-width: 1px;\n    border-bottom-style: solid;\n  }\n\n  // The divider between months doesn't actually change the height of the tbody in which the\n  // border appear; it changes the height of the following tbody. The causes the first-child to be\n  // 1px shorter than the other months. We fix this by adding an invisible border-top.\n  &:first-child {\n    border-top: 1px solid transparent;\n  }\n\n  // Explicitly set vertical-align to avoid conflicting with popular CSS resets. When\n  // vertical-align:baseline is set, month headers are misaligned. Also reset the box-sizing,\n  // in case the user set it to border-box.\n  // http://meyerweb.com/eric/tools/css/reset/\n  tbody, td, tr {\n    vertical-align: middle;\n    box-sizing: content-box;\n  }\n}\n"
  },
  {
    "path": "src/components/datepicker/datePicker-theme.scss",
    "content": "/** Theme styles for mdDatepicker. */\n\n.md-THEME_NAME-theme {\n\n  .md-datepicker-input {\n    @include input-placeholder-color('\\'{{foreground-3}}\\'');\n    color: '{{foreground-1}}';\n  }\n\n  .md-datepicker-input-container {\n    border-bottom-color: '{{foreground-4}}';\n\n    &.md-datepicker-focused {\n      border-bottom-color: '{{primary-color}}';\n\n      .md-accent & {\n        border-bottom-color: '{{accent-color}}';\n      }\n\n      .md-warn & {\n        border-bottom-color: '{{warn-A700}}';\n      }\n    }\n\n    &.md-datepicker-invalid {\n      border-bottom-color: '{{warn-A700}}';\n    }\n  }\n\n  .md-datepicker-calendar-pane {\n    border-color: '{{background-hue-1}}';\n  }\n\n  .md-datepicker-triangle-button {\n    .md-datepicker-expand-triangle {\n      border-top-color: '{{foreground-2}}';\n    }\n  }\n\n  // Open state for all of the elements of the picker.\n  .md-datepicker-open {\n    .md-datepicker-calendar-icon {\n      color: '{{primary-color}}';\n    }\n\n    &.md-accent, .md-accent & {\n      .md-datepicker-calendar-icon {\n        color: '{{accent-color}}';\n      }\n    }\n\n    &.md-warn, .md-warn & {\n      .md-datepicker-calendar-icon {\n        color: '{{warn-A700}}';\n      }\n    }\n  }\n\n  .md-datepicker-calendar {\n    background: '{{background-hue-1}}';\n  }\n\n  $mask-color: '{{background-hue-1}}';\n\n  // The box-shadow acts as the background for the overlay.\n  .md-datepicker-input-mask-opaque {\n    box-shadow: 0 0 0 9999px $mask-color;\n  }\n\n  .md-datepicker-open .md-datepicker-input-container {\n    background: $mask-color;\n  }\n}\n"
  },
  {
    "path": "src/components/datepicker/datePicker.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.datepicker\n * @description Module for the datepicker component.\n */\n\nangular.module('material.components.datepicker', [\n  'material.core',\n  'material.components.icon',\n  'material.components.virtualRepeat'\n]);\n"
  },
  {
    "path": "src/components/datepicker/datePicker.scss",
    "content": "/** Styles for mdDatepicker. */\n$md-datepicker-button-gap: 12px !default;  // Space between the text input and the calendar-icon button.\n$md-datepicker-border-bottom-gap: 5px !default;  // Space between input and the grey underline.\n$md-date-arrow-size: 5px !default; // Size of the triangle on the right side of the input.\n$md-datepicker-open-animation-duration: 0.2s !default;\n$md-datepicker-triangle-button-width: 36px !default;\n$md-datepicker-input-mask-height: 40px !default;\n$md-datepicker-button-padding: 8px !default;\n\n\nmd-datepicker {\n  // Don't let linebreaks happen between the open icon-button and the input.\n  white-space: nowrap;\n  overflow: hidden;\n  vertical-align: middle;\n}\n\n.md-inline-form {\n  md-datepicker {\n    margin-top: $input-container-vertical-margin - 6px;\n  }\n}\n\n// The calendar icon button used to open the calendar pane.\n.md-datepicker-button {\n  display: inline-block;\n  box-sizing: border-box;\n  background: none;\n  vertical-align: middle;\n  position: relative;\n\n  // Captures any of the click events. This is necessary, because the button has a SVG\n  // icon which doesn't propagate the focus event, causing inconsistent behaviour.\n  &:before {\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    position: absolute;\n    content: '';\n    speak: none;\n  }\n}\n\n// The input into which the user can type the date.\n.md-datepicker-input {\n  @include md-flat-input();\n  min-width: 120px;\n  max-width: $md-calendar-width - $md-datepicker-button-gap;\n  padding: 0 0 $md-datepicker-border-bottom-gap;\n}\n\n// If the datepicker is inside of a md-input-container\n._md-datepicker-floating-label {\n  > md-datepicker {\n    // Prevents the ripple on the triangle from being clipped.\n    overflow: visible;\n\n    .md-datepicker-input-container {\n      border: none;\n    }\n\n    .md-datepicker-button {\n      // Prevents the button from wrapping around, as well as it pushing\n      // down the error messages more than they should be.\n      @include rtl(float, left, right);\n      margin-top: $button-left-right-padding * -2;\n      top: $button-left-right-padding * 2 - $md-datepicker-border-bottom-gap * 0.5;\n    }\n  }\n\n  .md-input {\n    float: none;\n  }\n\n  &._md-datepicker-has-calendar-icon {\n    > label:not(.md-no-float):not(.md-container-ignore) {\n      $width-offset: $md-datepicker-triangle-button-width * 2 + $md-datepicker-button-gap;\n      $offset: $md-datepicker-triangle-button-width * 0.5;\n      @include rtl(right, $offset, auto);\n      @include rtl(left, auto, $offset);\n      width: calc(100% - #{$width-offset});\n    }\n\n    .md-input-message-animation {\n      $margin: $md-datepicker-triangle-button-width + $md-datepicker-button-padding * 2 + $md-datepicker-button-gap;\n      @include rtl-prop(margin-left, margin-right, $margin, auto);\n    }\n  }\n}\n\n._md-datepicker-has-triangle-icon {\n  // Leave room for the down-triangle button to \"overflow\" it's parent without modifying scrollLeft.\n  // This prevents the element from shifting right when opening via the triangle button.\n  @include rtl-prop(padding-right, padding-left, $md-datepicker-triangle-button-width * 0.5, 0);\n  @include rtl-prop(margin-right, margin-left, -$md-datepicker-triangle-button-width * 0.5, auto);\n}\n\n// Container for the datepicker input.\n.md-datepicker-input-container {\n  // Position relative in order to absolutely position the down-triangle button within.\n  position: relative;\n\n  border-bottom-width: 1px;\n  border-bottom-style: solid;\n\n  display: inline-block;\n  width: auto;\n\n  .md-icon-button + & {\n    @include rtl-prop(margin-left, margin-right, $md-datepicker-button-gap, auto);\n  }\n\n  &.md-datepicker-focused {\n    border-bottom-width: 2px;\n  }\n}\n\n.md-datepicker-is-showing .md-scroll-mask {\n  z-index: $z-index-calendar-pane - 1;\n}\n\n// Floating pane that contains the calendar at the bottom of the input.\n.md-datepicker-calendar-pane {\n  // On most browsers the `scale(0)` below prevents this element from\n  // overflowing it's parent, however IE and Edge seem to disregard it.\n  // The `left: -100%` pulls the element back in order to ensure that\n  // it doesn't cause an overflow.\n  position: absolute;\n  top: 0;\n  left: -100%;\n  z-index: $z-index-calendar-pane;\n  border-width: 1px;\n  border-style: solid;\n  background: transparent;\n\n  transform: scale(0);\n  transform-origin: 0 0;\n  transition: transform $md-datepicker-open-animation-duration $swift-ease-out-timing-function;\n\n  &.md-pane-open {\n    transform: scale(1);\n  }\n}\n\n// Portion of the floating panel that sits, invisibly, on top of the input.\n.md-datepicker-input-mask {\n  height: $md-datepicker-input-mask-height;\n  width: $md-calendar-width;\n  position: relative;\n  overflow: hidden;\n\n  background: transparent;\n  pointer-events: none;\n  cursor: text;\n}\n\n// The calendar portion of the floating pane (vs. the input mask).\n.md-datepicker-calendar {\n  opacity: 0;\n  // Use a modified timing function (from swift-ease-out) so that the opacity part of the\n  // animation doesn't come in as quickly so that the floating pane doesn't ever seem to\n  // cover up the trigger input.\n  transition: opacity $md-datepicker-open-animation-duration cubic-bezier(0.5, 0, 0.25, 1);\n\n  .md-pane-open & {\n    opacity: 1;\n  }\n\n  md-calendar:focus {\n    outline: none;\n  }\n}\n\n// Down triangle/arrow indicating that the datepicker can be opened.\n// We can do this entirely with CSS without needing to load an icon.\n// See https://css-tricks.com/snippets/css/css-triangle/\n.md-datepicker-expand-triangle {\n  // Center the triangle inside of the button so that the\n  // ink ripple origin looks correct.\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n\n  width: 0;\n  height: 0;\n  border-left: $md-date-arrow-size solid transparent;\n  border-right: $md-date-arrow-size solid transparent;\n  border-top: $md-date-arrow-size solid;\n}\n\n// Button containing the down \"disclosure\" triangle/arrow.\n.md-datepicker-triangle-button {\n  position: absolute;\n  @include rtl-prop(right, left, 0, auto);\n  bottom: -$md-date-arrow-size * 0.5;\n\n  // TODO(jelbourn): This position isn't great on all platforms.\n  @include rtl(transform, translateX(45%), translateX(-45%));\n}\n\n// Need crazy specificity to override .md-button.md-icon-button.\n// Only apply this high specificity to the property we need to override.\n.md-datepicker-triangle-button.md-button.md-icon-button {\n  height: $md-datepicker-triangle-button-width;\n  width: $md-datepicker-triangle-button-width;\n  position: absolute;\n  padding: $md-datepicker-button-padding;\n}\n\n// Disabled state for all elements of the picker.\nmd-datepicker[disabled] {\n  .md-datepicker-input-container {\n    border-bottom-color: transparent;\n  }\n\n  .md-datepicker-triangle-button {\n    display: none;\n  }\n}\n\n// Open state for all of the elements of the picker.\n.md-datepicker-open {\n  overflow: hidden;\n\n  .md-datepicker-input-container,\n  input.md-input {\n    border-bottom-color: transparent;\n  }\n\n  .md-datepicker-triangle-button,\n  &.md-input-has-value > label,\n  &.md-input-has-placeholder > label {\n    display: none;\n  }\n}\n\n// When the position of the floating calendar pane is adjusted to remain inside\n// of the viewport, hide the inputput mask, as the text input will no longer be\n// directly underneath it.\n.md-datepicker-pos-adjusted .md-datepicker-input-mask {\n  display: none;\n}\n\n// Animate the calendar inside of the floating calendar pane such that it appears to \"scroll\" into\n// view while the pane is opening. This is done as a cue to users that the calendar is scrollable.\n.md-datepicker-calendar-pane {\n  .md-calendar {\n    transform: translateY(-85px);\n    transition: transform 0.65s $swift-ease-out-timing-function;\n    transition-delay: 0.125s;\n  }\n\n  &.md-pane-open .md-calendar {\n    transform: translateY(0);\n  }\n}\n"
  },
  {
    "path": "src/components/datepicker/demoBasicUsage/index.html",
    "content": "<md-content ng-controller=\"AppCtrl as ctrl\" layout-padding ng-cloak>\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4 id=\"datepicker-header\">Standard date-picker</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\"\n                     input-aria-describedby=\"datepicker-description\"\n                     input-aria-labelledby=\"datepicker-header \"></md-datepicker>\n      <p style=\"display: none\" id=\"datepicker-description\">\n        You can use input-aria-describedby to have screen readers provide a more detailed\n        description of a datepicker or its interactions.\n      </p>\n    </div>\n\n    <div flex-gt-xs>\n      <h4>Disabled date-picker</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\" disabled></md-datepicker>\n    </div>\n  </div>\n\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4>Opening the calendar when the input is focused</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\" md-open-on-focus></md-datepicker>\n    </div>\n\n    <div flex-gt-xs>\n      <h4>Date-picker that goes straight to the year view</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-current-view=\"year\" md-placeholder=\"Enter date\"></md-datepicker>\n    </div>\n  </div>\n\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4>Custom calendar trigger</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\" md-is-open=\"ctrl.isOpen\"></md-datepicker>\n      <md-button class=\"md-primary md-raised\" ng-click=\"ctrl.isOpen = true\">Open</md-button>\n    </div>\n\n    <div flex-gt-xs>\n      <h4>Date-picker that only allows for the month to be selected</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\" md-mode=\"month\"></md-datepicker>\n    </div>\n  </div>\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoBasicUsage/script.js",
    "content": "angular.module('datepickerBasicUsage', ['ngMaterial', 'ngMessages']).controller('AppCtrl', function() {\n  this.myDate = new Date();\n  this.isOpen = false;\n});\n"
  },
  {
    "path": "src/components/datepicker/demoCalendar/index.html",
    "content": "<md-content ng-controller=\"AppCtrl as ctrl\" layout=\"column\" layout-gt-sm=\"row\"\n            layout-padding ng-cloak>\n  <div layout=\"column\" flex-order=\"1\" flex-order-gt-sm=\"0\">\n    <md-subheader>Start Date</md-subheader>\n    <md-calendar ng-model=\"ctrl.startDate\"></md-calendar>\n  </div>\n  <div layout=\"column\" flex-order=\"1\" flex-order-gt-sm=\"1\">\n    <md-subheader>End Date</md-subheader>\n    <md-calendar ng-model=\"ctrl.endDate\"></md-calendar>\n  </div>\n  <div layout=\"column\" flex-order=\"0\" flex-order-gt-sm=\"2\">\n    <md-subheader>Dates</md-subheader>\n    <div>\n      <label>Start</label>\n      <div>{{ctrl.startDate | date:shortDate}}</div>\n    </div>\n    <div><label>End</label>\n      <div>{{ctrl.endDate | date:shortDate}}</div>\n    </div>\n  </div>\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoCalendar/script.js",
    "content": "angular.module('calendarDemo', ['ngMaterial']).controller('AppCtrl', function() {\n  this.startDate = new Date();\n  this.endDate = new Date();\n  this.endDate.setDate(this.endDate.getDate() + 5);\n});\n"
  },
  {
    "path": "src/components/datepicker/demoCalendar/style.scss",
    "content": "/** Demo styles for mdCalendar. */\nlabel {\n  font-size: x-small;\n}\n"
  },
  {
    "path": "src/components/datepicker/demoMoment/index.html",
    "content": "<md-content ng-app=\"MyApp\" ng-controller=\"AppCtrl as ctrl\" layout-padding layout-margin>\n  <md-datepicker ng-model=\"ctrl.myDate\" ng-change=\"ctrl.onDateChanged()\"\n                 md-placeholder=\"Enter date\"></md-datepicker>\n  Date: {{ctrl.myDate | date:shortDate}}\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoMoment/script.js",
    "content": "(function () {\n  'use strict';\n\n  angular.module('datepickerMoment', ['ngMaterial']).config(function($mdDateLocaleProvider) {\n    /**\n     * @param date {Date}\n     * @returns {string} string representation of the provided date\n     */\n    $mdDateLocaleProvider.formatDate = function(date) {\n      return date ? moment(date).format('L') : '';\n    };\n\n    /**\n     * @param dateString {string} string that can be converted to a Date\n     * @returns {Date} JavaScript Date object created from the provided dateString\n     */\n    $mdDateLocaleProvider.parseDate = function(dateString) {\n      var m = moment(dateString, 'L', true);\n      return m.isValid() ? m.toDate() : new Date(NaN);\n    };\n  })\n  .controller(\"AppCtrl\", function($log) {\n    this.myDate = new Date();\n\n    this.onDateChanged = function() {\n      $log.log('Updated Date: ', this.myDate);\n    };\n  });\n})();\n"
  },
  {
    "path": "src/components/datepicker/demoMomentCustomFormat/index.html",
    "content": "<md-content ng-app=\"MyApp\" ng-controller=\"AppCtrl as ctrl\" layout-padding layout-margin>\n  <md-datepicker ng-model=\"ctrl.myDate\" ng-change=\"ctrl.onDateChanged()\"\n                 md-placeholder=\"Enter date\"></md-datepicker>\n  Date: {{ctrl.myDate | date:shortDate}}\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoMomentCustomFormat/script.js",
    "content": "(function () {\n  'use strict';\n\n  angular.module('customDatepickerMoment', ['ngMaterial']).config(function($mdDateLocaleProvider) {\n    /**\n     * @param date {Date}\n     * @returns {string} string representation of the provided date\n     */\n    $mdDateLocaleProvider.formatDate = function(date) {\n      return date ? moment(date).format('M/D') : '';\n    };\n\n    /**\n     * @param dateString {string} string that can be converted to a Date\n     * @returns {Date} JavaScript Date object created from the provided dateString\n     */\n    $mdDateLocaleProvider.parseDate = function(dateString) {\n      var m = moment(dateString, 'M/D', true);\n      return m.isValid() ? m.toDate() : new Date(NaN);\n    };\n\n    /**\n     * Check if the date string is complete enough to parse. This avoids calls to parseDate\n     * when the user has only typed in the first digit or two of the date.\n     * Allow only a day and month to be specified.\n     * @param dateString {string} date string to evaluate for parsing\n     * @returns {boolean} true if the date string is complete enough to be parsed\n     */\n    $mdDateLocaleProvider.isDateComplete = function(dateString) {\n      dateString = dateString.trim();\n      // Look for two chunks of content (either numbers or text) separated by delimiters.\n      var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-]))([a-zA-Z]{3,}|[0-9]{1,4})/;\n      return re.test(dateString);\n    };\n  })\n  .controller(\"AppCtrl\", function($log) {\n    this.myDate = new Date();\n\n    this.onDateChanged = function() {\n      $log.log('Updated Date: ', this.myDate);\n    };\n  });\n})();\n"
  },
  {
    "path": "src/components/datepicker/demoNgModelOptionsTimezone/index.html",
    "content": "<md-content ng-controller=\"AppCtrl as ctrl\" layout=\"row\" layout-padding ng-cloak>\n  <md-calendar ng-model=\"ctrl.calendarDate\" ng-model-options=\"{timezone: 'UTC'}\">\n  </md-calendar>\n\n  <div layout=\"column\" layout-padding>\n    <div>\n      <h4>Calendar Values</h4>\n      <div>\n        <strong>Date in local timezone:</strong>\n        {{ctrl.calendarDate|date:\"yyyy-MM-dd HH:mm Z\"}}\n      </div>\n      <div>\n        <strong>Date in UTC timezone:</strong>\n        {{ctrl.calendarDate|date:\"yyyy-MM-dd HH:mm Z\":\"UTC\"}}\n      </div>\n    </div>\n    <md-divider></md-divider>\n    <md-datepicker ng-model=\"ctrl.datepickerDate\" ng-model-options=\"{timezone: 'UTC'}\">\n    </md-datepicker>\n    <div>\n      <h4>Datepicker Values</h4>\n      <div>\n        <strong>Date in local timezone:</strong>\n        {{ctrl.datepickerDate|date:\"yyyy-MM-dd HH:mm Z\"}}\n      </div>\n      <div>\n        <strong>Date in UTC timezone:</strong>\n        {{ctrl.datepickerDate|date:\"yyyy-MM-dd HH:mm Z\":\"UTC\"}}\n      </div>\n    </div>\n  </div>\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoNgModelOptionsTimezone/script.js",
    "content": "angular.module('ngModelTimezoneUsage', ['ngMaterial', 'ngMessages'])\n.controller('AppCtrl', function() {\n  this.datepickerDate = new Date(0);\n  this.datepickerDate.setUTCFullYear(2020, 5, 19);\n\n  this.calendarDate = new Date(0);\n  this.calendarDate.setUTCFullYear(2020, 5, 19);\n});\n"
  },
  {
    "path": "src/components/datepicker/demoValidations/index.html",
    "content": "<md-content ng-controller=\"AppCtrl as ctrl\" layout-padding ng-cloak>\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4>Date-picker with min date and max date</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\"\n          md-min-date=\"ctrl.minDate\" md-max-date=\"ctrl.maxDate\"></md-datepicker>\n    </div>\n\n    <div flex-gt-xs>\n      <h4>Only weekends are selectable</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\"\n          md-date-filter=\"ctrl.onlyWeekendsPredicate\"></md-datepicker>\n    </div>\n  </div>\n\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4>Only weekends within given range are selectable</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\"\n          md-min-date=\"ctrl.minDate\" md-max-date=\"ctrl.maxDate\"\n          md-date-filter=\"ctrl.onlyWeekendsPredicate\"></md-datepicker>\n    </div>\n\n    <form name=\"myForm\" flex-gt-xs>\n      <h4>Inside a md-input-container</h4>\n\n      <md-input-container>\n        <label id=\"enter-date-label\">Enter date</label>\n        <md-datepicker ng-model=\"ctrl.myDate\" name=\"dateField\" md-min-date=\"ctrl.minDate\"\n          md-max-date=\"ctrl.maxDate\" input-aria-labelledby=\"enter-date-label\"></md-datepicker>\n\n        <div ng-messages=\"myForm.dateField.$error\">\n          <div ng-message=\"valid\">Use a valid date format</div>\n          <div ng-message=\"mindate\">Choose a date on or after {{ctrl.minDate | date:\"shortDate\"}}</div>\n          <div ng-message=\"maxdate\">Choose a date on or before {{ctrl.maxDate | date:\"shortDate\"}}</div>\n        </div>\n      </md-input-container>\n    </form>\n  </div>\n  <div layout-gt-xs=\"row\">\n    <div flex-gt-xs>\n      <h4>Date-picker that only allows for even months</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\" md-mode=\"month\"\n                     md-month-filter=\"ctrl.evenMonthsPredicate\"></md-datepicker>\n    </div>\n    <div flex-gt-xs>\n      <h4>Only allow even months and weekends</h4>\n      <md-datepicker ng-model=\"ctrl.myDate\" md-placeholder=\"Enter date\"\n                     md-month-filter=\"ctrl.evenMonthsPredicate\" md-current-view=\"year\"\n                     md-date-filter=\"ctrl.onlyWeekendsPredicate\"></md-datepicker>\n    </div>\n  </div>\n</md-content>\n"
  },
  {
    "path": "src/components/datepicker/demoValidations/script.js",
    "content": "angular.module('datepickerValidations', ['ngMaterial', 'ngMessages'])\n.controller('AppCtrl', function() {\n  this.myDate = new Date();\n\n  this.minDate = new Date(\n    this.myDate.getFullYear(),\n    this.myDate.getMonth() - 2,\n    this.myDate.getDate()\n  );\n\n  this.maxDate = new Date(\n    this.myDate.getFullYear(),\n    this.myDate.getMonth() + 2,\n    this.myDate.getDate()\n  );\n\n  /**\n   * @param {Date} date\n   * @returns {boolean}\n   */\n  this.onlyWeekendsPredicate = function(date) {\n    var day = date.getDay();\n    return day === 0 || day === 6;\n  };\n\n  /**\n   * @param {Date} date\n   * @returns {boolean} return false to disable all odd numbered months, true for even months\n   */\n  this.evenMonthsPredicate = function(date) {\n    return date.getMonth() % 2 !== 0;\n  };\n});\n"
  },
  {
    "path": "src/components/datepicker/js/calendar.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc directive\n   * @name mdCalendar\n   * @module material.components.datepicker\n   *\n   * @param {Date} ng-model The component's model. Should be a Date object.\n   * @param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being\n   *  updated. Also allows for a timezone to be specified.\n   *  <a href=\"https://docs.angularjs.org/api/ng/directive/ngModelOptions#usage\">Read more at the\n   *  ngModelOptions docs.</a>\n   * @param {Date=} md-min-date Expression representing the minimum date.\n   * @param {Date=} md-max-date Expression representing the maximum date.\n   * @param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a\n   *  boolean whether it can be selected in \"day\" mode or not.\n   * @param {(function(Date): boolean)=} md-month-filter Function expecting a date and returning a\n   *  boolean whether it can be selected in \"month\" mode or not.\n   * @param {String=} md-current-view Current view of the calendar. Can be either \"month\" or \"year\".\n   * @param {String=} md-mode Restricts the user to only selecting a value from a particular view.\n   *  This option can be used if the user is only supposed to choose from a certain date type\n   *  (e.g. only selecting the month). Can be either \"month\" or \"day\". **Note** that this will\n   *  overwrite the `md-current-view` value.\n   *\n   * @description\n   * `<md-calendar>` is a component that renders a calendar that can be used to select a date.\n   * It is a part of the `<md-datepicker>` pane, however it can also be used on it's own.\n   *\n   * @usage\n   *\n   * <hljs lang=\"html\">\n   *   <md-calendar ng-model=\"birthday\"></md-calendar>\n   * </hljs>\n   */\n  angular.module('material.components.datepicker')\n    .directive('mdCalendar', calendarDirective);\n\n  // TODO(jelbourn): Mac Cmd + left / right == Home / End\n  // TODO(jelbourn): Refactor month element creation to use cloneNode (performance).\n  // TODO(jelbourn): Define virtual scrolling constants (compactness) users can override.\n  // TODO(jelbourn): Animated month transition on ng-model change (virtual-repeat)\n  // TODO(jelbourn): Scroll snapping (virtual repeat)\n  // TODO(jelbourn): Remove superfluous row from short months (virtual-repeat)\n  // TODO(jelbourn): Month headers stick to top when scrolling.\n  // TODO(jelbourn): Previous month opacity is lowered when partially scrolled out of view.\n  // TODO(jelbourn): Support md-calendar standalone on a page (as a tabstop w/ aria-live\n  //     announcement and key handling).\n  // TODO Read-only calendar (not just date-picker).\n\n  function calendarDirective(inputDirective) {\n    return {\n      template: function(tElement, tAttr) {\n        // This allows the calendar to work, without a datepicker. This ensures that the virtual\n        // repeater scrolls to the proper place on load by deferring the execution until the next\n        // digest. It's necessary only if the calendar is used without a datepicker, otherwise it's\n        // already wrapped in an ngIf.\n        var extraAttrs = tAttr.hasOwnProperty('ngIf') ? '' : 'ng-if=\"calendarCtrl.isInitialized\"';\n        return '' +\n          '<div ng-switch=\"calendarCtrl.currentView\" ' + extraAttrs + '>' +\n            '<md-calendar-year ng-switch-when=\"year\"></md-calendar-year>' +\n            '<md-calendar-month ng-switch-default></md-calendar-month>' +\n          '</div>';\n      },\n      scope: {\n        minDate: '=mdMinDate',\n        maxDate: '=mdMaxDate',\n        dateFilter: '=mdDateFilter',\n        monthFilter: '=mdMonthFilter',\n\n        // These need to be prefixed, because Angular resets\n        // any changes to the value due to bindToController.\n        _mode: '@mdMode',\n        _currentView: '@mdCurrentView'\n      },\n      require: ['ngModel', 'mdCalendar'],\n      controller: CalendarCtrl,\n      controllerAs: 'calendarCtrl',\n      bindToController: true,\n      link: function(scope, element, attrs, controllers) {\n        var ngModelCtrl = controllers[0];\n        var mdCalendarCtrl = controllers[1];\n        mdCalendarCtrl.configureNgModel(ngModelCtrl, inputDirective);\n      }\n    };\n  }\n\n  /**\n   * Occasionally the hideVerticalScrollbar method might read an element's\n   * width as 0, because it hasn't been laid out yet. This value will be used\n   * as a fallback, in order to prevent scenarios where the element's width\n   * would otherwise have been set to 0. This value is the \"usual\" width of a\n   * calendar within a floating calendar pane.\n   */\n  var FALLBACK_WIDTH = 340;\n\n  /** Next identifier for calendar instance. */\n  var nextUniqueId = 0;\n\n  /** Maps the `md-mode` values to their corresponding calendar views. */\n  var MODE_MAP = {\n    day: 'month',\n    month: 'year'\n  };\n\n  /**\n   * Controller for the mdCalendar component.\n   * @ngInject @constructor\n   */\n  function CalendarCtrl($element, $scope, $$mdDateUtil, $mdUtil, $mdConstant, $mdTheming, $$rAF,\n                        $attrs, $mdDateLocale, $filter, $document) {\n    $mdTheming($element);\n\n    /**\n     * @final\n     * @type {!JQLite}\n     */\n    this.$element = $element;\n\n    /**\n     * @final\n     * @type {!angular.Scope}\n     */\n    this.$scope = $scope;\n\n    /**\n     * @final\n     * @type {!angular.$attrs} Current attributes object for the element\n     */\n    this.$attrs = $attrs;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final */\n    this.$mdUtil = $mdUtil;\n\n    /** @final */\n    this.keyCode = $mdConstant.KEY_CODE;\n\n    /** @final */\n    this.$$rAF = $$rAF;\n\n    /** @final */\n    this.$mdDateLocale = $mdDateLocale;\n\n    /** @final The built-in Angular date filter. */\n    this.ngDateFilter = $filter('date');\n\n    /**\n     * @final\n     * @type {Date}\n     */\n    this.today = this.dateUtil.createDateAtMidnight();\n\n    /** @type {!ngModel.NgModelController} */\n    this.ngModelCtrl = undefined;\n\n    /** @type {string} Class applied to the selected date cell. */\n    this.SELECTED_DATE_CLASS = 'md-calendar-selected-date';\n\n    /** @type {string} Class applied to the cell for today. */\n    this.TODAY_CLASS = 'md-calendar-date-today';\n\n    /** @type {string} Class applied to the focused cell. */\n    this.FOCUSED_DATE_CLASS = 'md-focus';\n\n    /**\n     * @final\n     * @type {number} Unique ID for this calendar instance.\n     */\n    this.id = nextUniqueId++;\n\n    /**\n     * The date that is currently focused or showing in the calendar. This will initially be set\n     * to the ng-model value if set, otherwise to today. It will be updated as the user navigates\n     * to other months. The cell corresponding to the displayDate does not necessarily always have\n     * focus in the document (such as for cases when the user is scrolling the calendar).\n     * @type {Date}\n     */\n    this.displayDate = null;\n\n    /**\n     * Allows restricting the calendar to only allow selecting a month or a day.\n     * @type {'month'|'day'|null}\n     */\n    this.mode = null;\n\n    /**\n     * The selected date. Keep track of this separately from the ng-model value so that we\n     * can know, when the ng-model value changes, what the previous value was before it's updated\n     * in the component's UI.\n     *\n     * @type {Date}\n     */\n    this.selectedDate = null;\n\n    /**\n     * The first date that can be rendered by the calendar. The default is taken\n     * from the mdDateLocale provider and is limited by the mdMinDate.\n     * @type {Date}\n     */\n    this.firstRenderableDate = null;\n\n    /**\n     * The last date that can be rendered by the calendar. The default comes\n     * from the mdDateLocale provider and is limited by the maxDate.\n     * @type {Date}\n     */\n    this.lastRenderableDate = null;\n\n    /**\n     * Used to toggle initialize the root element in the next digest.\n     * @type {boolean}\n     */\n    this.isInitialized = false;\n\n    /**\n     * Cache for the  width of the element without a scrollbar. Used to hide the scrollbar later on\n     * and to avoid extra reflows when switching between views.\n     * @type {number}\n     */\n    this.width = 0;\n\n    /**\n     * Caches the width of the scrollbar in order to be used when hiding it and to avoid extra reflows.\n     * @type {number}\n     */\n    this.scrollbarWidth = 0;\n\n    /**\n     * @type {boolean} set to true if the calendar is being used \"standalone\" (outside of a\n     *  md-datepicker).\n     */\n    this.standaloneMode = false;\n\n    // Unless the user specifies so, the calendar should not be a tab stop.\n    // This is necessary because ngAria might add a tabindex to anything with an ng-model\n    // (based on whether or not the user has turned that particular feature on/off).\n    if (!$attrs.tabindex) {\n      $element.attr('tabindex', '-1');\n    }\n\n    var boundKeyHandler = angular.bind(this, this.handleKeyEvent);\n\n    // If use the md-calendar directly in the body without datepicker,\n    // handleKeyEvent will disable other inputs on the page.\n    // So only apply the handleKeyEvent on the body when the md-calendar inside datepicker,\n    // otherwise apply on the calendar element only.\n\n    var handleKeyElement;\n    if ($element.parent().hasClass('md-datepicker-calendar')) {\n      handleKeyElement = angular.element($document[0].body);\n    } else {\n      this.standaloneMode = true;\n      handleKeyElement = $element;\n    }\n\n    // Bind the keydown handler to the body, in order to handle cases where the focused\n    // element gets removed from the DOM and stops propagating click events.\n    handleKeyElement.on('keydown', boundKeyHandler);\n\n    $scope.$on('$destroy', function() {\n      handleKeyElement.off('keydown', boundKeyHandler);\n    });\n\n    // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are pre-assigned,\n    // manually call the $onInit hook.\n    if (angular.version.major === 1 && angular.version.minor <= 4) {\n      this.$onInit();\n    }\n  }\n\n  /**\n   * AngularJS Lifecycle hook for newer AngularJS versions.\n   * Bindings are not guaranteed to have been assigned in the controller, but they are in the\n   * $onInit hook.\n   */\n  CalendarCtrl.prototype.$onInit = function() {\n    /**\n     * The currently visible calendar view. Note the prefix on the scope value,\n     * which is necessary, because the datepicker seems to reset the real one value if the\n     * calendar is open, but the `currentView` on the datepicker's scope is empty.\n     * @type {String}\n     */\n    if (this._mode && MODE_MAP.hasOwnProperty(this._mode)) {\n      this.currentView = MODE_MAP[this._mode];\n      this.mode = this._mode;\n    } else {\n      this.currentView = this._currentView || 'month';\n      this.mode = null;\n    }\n\n    if (this.minDate && this.minDate > this.$mdDateLocale.firstRenderableDate) {\n      this.firstRenderableDate = this.minDate;\n    } else {\n      this.firstRenderableDate = this.$mdDateLocale.firstRenderableDate;\n    }\n\n    if (this.maxDate && this.maxDate < this.$mdDateLocale.lastRenderableDate) {\n      this.lastRenderableDate = this.maxDate;\n    } else {\n      this.lastRenderableDate = this.$mdDateLocale.lastRenderableDate;\n    }\n  };\n\n  /**\n   * Sets up the controller's reference to ngModelController.\n   * @param {!ngModel.NgModelController} ngModelCtrl Instance of the ngModel controller.\n   * @param {Object} inputDirective Config for AngularJS's `input` directive.\n   */\n  CalendarCtrl.prototype.configureNgModel = function(ngModelCtrl, inputDirective) {\n    var self = this;\n    self.ngModelCtrl = ngModelCtrl;\n\n    // The component needs to be [type=\"date\"] in order to be picked up by AngularJS.\n    this.$attrs.$set('type', 'date');\n\n    // Invoke the `input` directive link function, adding a stub for the element.\n    // This allows us to re-use AngularJS' logic for setting the timezone via ng-model-options.\n    // It works by calling the link function directly which then adds the proper `$parsers` and\n    // `$formatters` to the NgModelController.\n    inputDirective[0].link.pre(this.$scope, {\n      on: angular.noop,\n      val: angular.noop,\n      0: {}\n    }, this.$attrs, [ngModelCtrl]);\n\n    ngModelCtrl.$render = function() {\n      var value = this.$viewValue, convertedDate;\n\n      // In the case where a conversion is needed, the $viewValue here will be a string like\n      // \"2020-05-10\" instead of a Date object.\n      if (!self.dateUtil.isValidDate(value)) {\n        convertedDate = self.dateUtil.removeLocalTzAndReparseDate(new Date(value));\n        if (self.dateUtil.isValidDate(convertedDate)) {\n          value = convertedDate;\n        }\n      }\n\n      // Notify the child scopes of any changes.\n      self.$scope.$broadcast('md-calendar-parent-changed', value);\n\n      // Set up the selectedDate if it hasn't been already.\n      if (!self.selectedDate) {\n        self.selectedDate = value;\n      }\n\n      // Also set up the displayDate.\n      if (!self.displayDate) {\n        self.displayDate = self.selectedDate || self.today;\n      }\n    };\n\n    self.$mdUtil.nextTick(function() {\n      self.isInitialized = true;\n    });\n  };\n\n  /**\n   * Sets the ng-model value for the calendar and emits a change event.\n   * @param {Date} date new value for the calendar\n   */\n  CalendarCtrl.prototype.setNgModelValue = function(date) {\n    var timezone = this.$mdUtil.getModelOption(this.ngModelCtrl, 'timezone');\n    var value = this.dateUtil.createDateAtMidnight(date);\n    this.focusDate(value);\n    this.$scope.$emit('md-calendar-change', value);\n    // Using the timezone when the offset is negative (GMT+X) causes the previous day to be\n    // selected here. This check avoids that.\n    if (timezone == null || value.getTimezoneOffset() < 0) {\n      this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd'), 'default');\n    } else {\n      this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd', timezone), 'default');\n    }\n    this.ngModelCtrl.$render();\n    return value;\n  };\n\n  /**\n   * Sets the current view that should be visible in the calendar\n   * @param {string} newView View name to be set.\n   * @param {number|Date} time Date object or a timestamp for the new display date.\n   */\n  CalendarCtrl.prototype.setCurrentView = function(newView, time) {\n    var self = this;\n\n    self.$mdUtil.nextTick(function() {\n      self.currentView = newView;\n\n      if (time) {\n        self.displayDate = angular.isDate(time) ? time : new Date(time);\n      }\n    });\n  };\n\n  /**\n   * Focus the cell corresponding to the given date.\n   * @param {Date=} date The date to be focused.\n   */\n  CalendarCtrl.prototype.focusDate = function(date) {\n    if (this.dateUtil.isValidDate(date)) {\n      var previousFocus = this.$element[0].querySelector('.' + this.FOCUSED_DATE_CLASS);\n      if (previousFocus) {\n        previousFocus.classList.remove(this.FOCUSED_DATE_CLASS);\n      }\n\n      var cellId = this.getDateId(date, this.currentView);\n      var cell = document.getElementById(cellId);\n      if (cell) {\n        cell.classList.add(this.FOCUSED_DATE_CLASS);\n        cell.focus();\n        this.displayDate = date;\n      }\n    } else {\n      var rootElement = this.$element[0].querySelector('[ng-switch]');\n\n      if (rootElement) {\n        rootElement.focus();\n      }\n    }\n  };\n\n  /**\n   * Highlights a date cell on the calendar and changes the selected date.\n   * @param {Date=} date Date to be marked as selected.\n   */\n  CalendarCtrl.prototype.changeSelectedDate = function(date) {\n    var selectedDateClass = this.SELECTED_DATE_CLASS;\n    var prevDateCell = this.$element[0].querySelector('.' + selectedDateClass);\n\n    // Remove the selected class from the previously selected date, if any.\n    if (prevDateCell) {\n      prevDateCell.classList.remove(selectedDateClass);\n      prevDateCell.setAttribute('aria-selected', 'false');\n    }\n\n    // Apply the select class to the new selected date if it is set.\n    if (date) {\n      var dateCell = document.getElementById(this.getDateId(date, this.currentView));\n      if (dateCell) {\n        dateCell.classList.add(selectedDateClass);\n        dateCell.setAttribute('aria-selected', 'true');\n      }\n    }\n\n    this.selectedDate = date;\n  };\n\n  /**\n   * Normalizes the key event into an action name. The action will be broadcast\n   * to the child controllers.\n   * @param {KeyboardEvent} event\n   * @returns {string} The action that should be taken, or null if the key\n   *  does not match a calendar shortcut.\n   */\n  CalendarCtrl.prototype.getActionFromKeyEvent = function(event) {\n    var keyCode = this.keyCode;\n\n    switch (event.which) {\n      case keyCode.ENTER: return 'select';\n\n      case keyCode.RIGHT_ARROW: return 'move-right';\n      case keyCode.LEFT_ARROW: return 'move-left';\n\n      case keyCode.DOWN_ARROW: return event.metaKey ? 'move-page-down' : 'move-row-down';\n      case keyCode.UP_ARROW: return event.metaKey ? 'move-page-up' : 'move-row-up';\n\n      case keyCode.PAGE_DOWN: return 'move-page-down';\n      case keyCode.PAGE_UP: return 'move-page-up';\n\n      case keyCode.HOME: return 'start';\n      case keyCode.END: return 'end';\n\n      default: return null;\n    }\n  };\n\n  /**\n   * Handles a key event in the calendar with the appropriate action.\n   * The action will either\n   *  - select the focused date\n   *  - navigate to focus a new date\n   *  - emit a md-calendar-close event if in a md-datepicker panel\n   *  - emit a md-calendar-parent-action\n   *  - delegate to normal tab order if the TAB key is pressed in standalone mode\n   * @param {KeyboardEvent} event\n   */\n  CalendarCtrl.prototype.handleKeyEvent = function(event) {\n    var self = this;\n\n    this.$scope.$apply(function() {\n      // Capture escape and emit back up so that a wrapping component\n      // (such as a date-picker) can decide to close.\n      if (event.which === self.keyCode.ESCAPE ||\n          (event.which === self.keyCode.TAB && !self.standaloneMode)) {\n        self.$scope.$emit('md-calendar-close');\n\n        if (event.which === self.keyCode.TAB) {\n          event.preventDefault();\n        }\n\n        return;\n      } else if (event.which === self.keyCode.TAB && self.standaloneMode) {\n        // delegate to the normal tab order if the TAB key is pressed in standalone mode\n        return;\n      }\n\n      // Broadcast the action that any child controllers should take.\n      var action = self.getActionFromKeyEvent(event);\n      if (action) {\n        event.preventDefault();\n        event.stopPropagation();\n        self.$scope.$broadcast('md-calendar-parent-action', action);\n      }\n    });\n  };\n\n  /**\n   * Hides the vertical scrollbar on the calendar scroller of a child controller by\n   * setting the width on the calendar scroller and the `overflow: hidden` wrapper\n   * around the scroller, and then setting a padding-right on the scroller equal\n   * to the width of the browser's scrollbar.\n   *\n   * This will cause a reflow.\n   *\n   * @param {object} childCtrl The child controller whose scrollbar should be hidden.\n   */\n  CalendarCtrl.prototype.hideVerticalScrollbar = function(childCtrl) {\n    var self = this;\n    var element = childCtrl.$element[0];\n    var scrollMask = element.querySelector('.md-calendar-scroll-mask');\n\n    if (self.width > 0) {\n      setWidth();\n    } else {\n      self.$$rAF(function() {\n        var scroller = childCtrl.calendarScroller;\n\n        self.scrollbarWidth = scroller.offsetWidth - scroller.clientWidth;\n        self.width = element.querySelector('table').offsetWidth;\n        setWidth();\n      });\n    }\n\n    function setWidth() {\n      var width = self.width || FALLBACK_WIDTH;\n      var scrollbarWidth = self.scrollbarWidth;\n      var scroller = childCtrl.calendarScroller;\n\n      scrollMask.style.width = width + 'px';\n      scroller.style.width = (width + scrollbarWidth) + 'px';\n      scroller.style.paddingRight = scrollbarWidth + 'px';\n    }\n  };\n\n  /**\n   * Gets an identifier for a date unique to the calendar instance for internal\n   * purposes. Not to be displayed.\n   * @param {Date} date The date for which the id is being generated\n   * @param {string} namespace Namespace for the id. (month, year etc.)\n   * @returns {string}\n   */\n  CalendarCtrl.prototype.getDateId = function(date, namespace) {\n    if (!namespace) {\n      throw new Error('A namespace for the date id has to be specified.');\n    }\n\n    return [\n      'md',\n      this.id,\n      namespace,\n      date.getFullYear(),\n      date.getMonth(),\n      date.getDate()\n    ].join('-');\n  };\n\n  /**\n   * Util to trigger an extra digest on a parent scope, in order to to ensure that\n   * any child virtual repeaters have updated. This is necessary, because the virtual\n   * repeater doesn't update the $index the first time around since the content isn't\n   * in place yet. The case, in which this is an issue, is when the repeater has less\n   * than a page of content (e.g. a month or year view has a min or max date).\n   */\n  CalendarCtrl.prototype.updateVirtualRepeat = function() {\n    var scope = this.$scope;\n    var virtualRepeatResizeListener = scope.$on('$md-resize-enable', function() {\n      if (!scope.$$phase) {\n        scope.$apply();\n      }\n\n      virtualRepeatResizeListener();\n    });\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/calendar.spec.js",
    "content": "\ndescribe('md-calendar', function() {\n  // When constructing a Date, the month is zero-based. This can be confusing, since people are\n  // used to seeing them one-based. So we create these aliases to make reading the tests easier.\n  var JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,\n      NOV = 10, DEC = 11;\n\n  var ngElement, element, scope, pageScope, calendarMonthController, calendarYearController, calendarController;\n  var $rootScope, dateLocale, $mdUtil, $material, $compile, $timeout, keyCodes, dateUtil;\n\n  // List of calendar elements added to the DOM so we can remove them after every test.\n  var attachedCalendarElements = [];\n\n  /**\n   * To apply a change in the date, a scope $apply() AND a manual triggering of animation\n   * callbacks is necessary.\n   */\n  function applyDateChange() {\n    $timeout.flush();\n    $material.flushOutstandingAnimations();\n\n    // Internally, the calendar sets scrollTop to scroll to the month for a change.\n    // The handler for that scroll won't be invoked unless we manually trigger it.\n    var activeViewController = calendarMonthController || calendarYearController;\n    if (activeViewController) {\n      angular.element(activeViewController.calendarScroller).triggerHandler('scroll');\n    }\n\n    // Need this to handle the nextTick when setting first scroll.\n    $timeout.flush();\n  }\n\n  /** Extracts text as an array (one element per cell) from a tr element. */\n  function extractRowText(tr) {\n    var cellContents = [];\n    angular.forEach(tr.children, function(tableElement) {\n      cellContents.push(tableElement.textContent);\n    });\n\n    return cellContents;\n  }\n\n  /** Finds a td given a label. */\n  function findCellByLabel(monthElement, day) {\n    var tds = monthElement.querySelectorAll('td');\n    var td;\n\n    for (var i = 0; i < tds.length; i++) {\n      td = tds[i];\n      if (td.textContent === day.toString()) {\n        return td;\n      }\n    }\n  }\n\n  /**\n   * Finds a month `tbody` in the calendar element given a date.\n   */\n  function findMonthElement(element, date) {\n    var months = element.querySelectorAll('[md-calendar-month-body]');\n    var monthHeader = dateLocale.monthHeaderFormatter(date);\n    var month;\n\n    for (var i = 0; i < months.length; i++) {\n      month = months[i];\n      if (month.querySelector('tr:first-child td:first-child').textContent === monthHeader) {\n        return month;\n      }\n    }\n    return null;\n  }\n\n  /** Find the `tbody` for a year in the calendar. */\n  function findYearElement(parent, year) {\n    var node = parent[0] || parent;\n    var years = node.querySelectorAll('[md-calendar-year-body]');\n    var yearHeader = year.toString();\n    var target;\n\n    for (var i = 0; i < years.length; i++) {\n      target = years[i];\n      if (target.querySelector('.md-calendar-month-label').textContent === yearHeader) {\n        return target;\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Gets the group label for a given date cell.\n   * @param {HTMLElement|DocumentView} cell\n   * @returns {string}\n   */\n  function getGroupLabelForDateCell(cell) {\n    return $mdUtil.getClosest(cell, 'tbody').querySelector('.md-calendar-month-label').textContent;\n  }\n\n  /** Creates and compiles an md-calendar element. */\n  function createElement(parentScope, templateOverride) {\n    var directiveScope = parentScope || $rootScope.$new();\n    var template = templateOverride || '<md-calendar md-min-date=\"minDate\" md-max-date=\"maxDate\" ' +\n        'ng-model=\"myDate\"></md-calendar>';\n    var attachedElement = angular.element(template);\n    document.body.appendChild(attachedElement[0]);\n    var newElement = $compile(attachedElement)(directiveScope);\n    attachedCalendarElements.push(newElement);\n    applyDateChange();\n    return newElement;\n  }\n\n  /**\n   * Dispatches a KeyboardEvent for the calendar.\n   * @param {number} keyCode\n   * @param {Object=} opt_modifiers\n   */\n  function dispatchKeyEvent(keyCode, opt_modifiers) {\n    var mod = opt_modifiers || {};\n\n\n    angular.element(element).triggerHandler({\n      type: 'keydown',\n      keyCode: keyCode,\n      which: keyCode,\n      ctrlKey: mod.ctrl,\n      altKey: mod.alt,\n      metaKey: mod.meta,\n      shortKey: mod.shift\n    });\n  }\n\n  function getFocusedDateElement() {\n    return element.querySelector('.md-focus');\n  }\n\n  beforeEach(module('material.components.datepicker', 'ngAnimateMock'));\n\n  beforeEach(inject(function($injector) {\n    jasmine.addMatchers({\n      toBeSameDayAs: function() {\n        return {\n          compare: function(actual, expected) {\n            var results = {\n              pass: dateUtil.isSameDay(actual, expected)\n            };\n\n            var negation = !results.pass ? '' : 'not ';\n\n            results.message = [\n              'Expected',\n              actual,\n              negation + 'to be the same day as',\n              expected\n            ].join(' ');\n\n            return results;\n          }\n        };\n      }\n    });\n\n    $material = $injector.get('$material');\n    $compile = $injector.get('$compile');\n    $rootScope = $injector.get('$rootScope');\n    $timeout = $injector.get('$timeout');\n    dateLocale = $injector.get('$mdDateLocale');\n    dateUtil = $injector.get('$$mdDateUtil');\n    $mdUtil = $injector.get('$mdUtil');\n    keyCodes = $injector.get('$mdConstant').KEY_CODE;\n\n    pageScope = $rootScope.$new();\n    pageScope.myDate = null;\n\n    ngElement = createElement(pageScope);\n    element = ngElement[0];\n    scope = ngElement.isolateScope();\n\n    calendarController = ngElement.controller('mdCalendar');\n    calendarMonthController = ngElement.find('md-calendar-month').controller('mdCalendarMonth');\n    calendarYearController = ngElement.find('md-calendar-year').controller('mdCalendarYear');\n  }));\n\n  afterEach(function() {\n    attachedCalendarElements.forEach(function(element) {\n      element.remove();\n    });\n    attachedCalendarElements = [];\n  });\n\n  describe('ngModel binding', function() {\n    it('should update the calendar based on ngModel change', function() {\n      pageScope.myDate = new Date(2014, MAY, 30);\n      applyDateChange();\n\n      var selectedDate = element.querySelector('.md-calendar-selected-date');\n\n      expect(getGroupLabelForDateCell(selectedDate)).toBe('May 2014');\n      expect(selectedDate.textContent).toBe('30');\n    });\n  });\n\n  describe('calendar construction', function() {\n    it('should be able to switch between views', function() {\n      expect(element.querySelector('md-calendar-month')).toBeTruthy();\n\n      calendarController.setCurrentView('year');\n      applyDateChange();\n\n      expect(element.querySelector('md-calendar-month')).toBeFalsy();\n      expect(element.querySelector('md-calendar-year')).toBeTruthy();\n    });\n\n    describe('month view', function() {\n      var monthCtrl;\n\n      beforeEach(function() {\n        monthCtrl = angular.element(element.querySelector('[md-calendar-month-body]'))\n            .controller('mdCalendarMonthBody');\n      });\n\n      it('should render a month correctly as a table', function() {\n        var date = new Date(2014, MAY, 30);\n        var monthElement = monthCtrl.buildCalendarForMonth(date);\n\n        var calendarRows = monthElement.querySelectorAll('tr');\n        var calendarDates = [];\n\n        angular.forEach(calendarRows, function(tr) {\n          calendarDates.push(extractRowText(tr));\n        });\n\n        var expectedDates = [\n          ['May 2014', '', '1', '2', '3'],\n          ['4', '5', '6', '7', '8', '9', '10'],\n          ['11', '12', '13', '14', '15', '16', '17'],\n          ['18', '19', '20', '21', '22', '23', '24'],\n          ['25', '26', '27', '28', '29', '30', '31'],\n          ['', '', '', '', '', '', ''],\n        ];\n        expect(calendarDates).toEqual(expectedDates);\n      });\n\n      it('should render a month correctly when the first day of the week is Monday', function() {\n        dateLocale.firstDayOfWeek = 1;\n        var date = new Date(2014, MAY, 30);\n        var monthElement = monthCtrl.buildCalendarForMonth(date);\n\n        var calendarRows = monthElement.querySelectorAll('tr');\n        var calendarDates = [];\n\n        angular.forEach(calendarRows, function(tr) {\n          calendarDates.push(extractRowText(tr));\n        });\n\n        var expectedDates = [\n          ['May 2014', '1', '2', '3', '4'],\n          ['5', '6', '7', '8', '9', '10', '11'],\n          ['12', '13', '14', '15', '16', '17', '18'],\n          ['19', '20', '21', '22', '23', '24', '25'],\n          ['26', '27', '28', '29', '30', '31', ''],\n          ['', '', '', '', '', '', ''],\n        ];\n        expect(calendarDates).toEqual(expectedDates);\n        dateLocale.firstDayOfWeek = 0;\n      });\n\n      it('should show the month on its own row if the first day is before Tuesday', function() {\n        var date = new Date(2014, JUN, 30); // 1st on Sunday\n        var monthElement = monthCtrl.buildCalendarForMonth(date);\n\n        var firstRow = monthElement.querySelector('tr');\n        expect(extractRowText(firstRow)).toEqual(['Jun 2014']);\n      });\n\n      it('should apply the locale-specific month header formatter', function() {\n        var date = new Date(2014, JUN, 30);\n        spyOn(dateLocale, 'monthHeaderFormatter').and.callFake(function(expectedDateArg) {\n          expect(expectedDateArg).toBeSameDayAs(date);\n          return 'Junz 2014';\n        });\n        var monthElement = monthCtrl.buildCalendarForMonth(date);\n\n        var monthHeader = monthElement.querySelector('tr');\n        expect(monthHeader.textContent).toEqual('Junz 2014');\n      });\n\n      it('should update the model on cell click', function() {\n        spyOn(scope, '$emit');\n        var date = new Date(2014, MAY, 30);\n        var monthElement = monthCtrl.buildCalendarForMonth(date);\n        var expectedDate = new Date(2014, MAY, 5);\n        findCellByLabel(monthElement, 5).click();\n        expect(pageScope.myDate).toBeSameDayAs(expectedDate);\n        expect(scope.$emit).toHaveBeenCalledWith('md-calendar-change', expectedDate);\n      });\n\n      it('should disable any dates outside the min/max date range', function() {\n        pageScope.minDate = new Date(2014, JUN, 10);\n        pageScope.maxDate = new Date(2014, JUN, 20);\n        pageScope.$apply();\n\n        var monthElement = monthCtrl.buildCalendarForMonth(new Date(2014, JUN, 15));\n        expect(findCellByLabel(monthElement, 5)).toHaveClass('md-calendar-date-disabled');\n        expect(findCellByLabel(monthElement, 10)).not.toHaveClass('md-calendar-date-disabled');\n        expect(findCellByLabel(monthElement, 20)).not.toHaveClass('md-calendar-date-disabled');\n        expect(findCellByLabel(monthElement, 25)).toHaveClass('md-calendar-date-disabled');\n      });\n\n      it('should not respond to disabled cell clicks', function() {\n        var initialDate = new Date(2014, JUN, 15);\n        pageScope.myDate = initialDate;\n        pageScope.minDate = new Date(2014, JUN, 10);\n        pageScope.maxDate = new Date(2014, JUN, 20);\n        pageScope.$apply();\n\n        var monthElement = monthCtrl.buildCalendarForMonth(pageScope.myDate);\n        findCellByLabel(monthElement, 5).click();\n        expect(pageScope.myDate).toBeSameDayAs(initialDate);\n      });\n\n      it('should ensure that all month elements have a height when the max ' +\n        'date is in the same month as the current date', function() {\n\n        ngElement.remove();\n        var newScope = $rootScope.$new();\n        newScope.myDate = new Date(2016, JUN, 15);\n        newScope.maxDate = new Date(2016, JUN, 20);\n        element = createElement(newScope)[0];\n        applyDateChange();\n\n        var monthWrapper = angular.element(element.querySelector('md-calendar-month'));\n        var scroller = monthWrapper.controller('mdCalendarMonth').calendarScroller;\n\n        scroller.scrollTop -= 50;\n        angular.element(scroller).triggerHandler('scroll');\n\n        var monthElements = $mdUtil.nodesToArray(\n          element.querySelectorAll('[md-calendar-month-body]')\n        );\n\n        expect(monthElements.every(function(currentMonthElement) {\n          return currentMonthElement.offsetHeight > 0;\n        })).toBe(true);\n      });\n\n      describe('weeks header', function() {\n        it('should display the weeks header in the first row', function() {\n          var header = element.querySelector('.md-calendar-day-header tr');\n          expect(extractRowText(header)).toEqual(['S', 'M', 'T', 'W', 'T', 'F' ,'S']);\n        });\n\n        it('should use $mdDateLocale.shortDays as weeks header values', function() {\n          var oldShortDays = dateLocale.shortDays;\n          dateLocale.shortDays = ['SZ', 'MZ', 'TZ', 'WZ', 'TZ', 'FZ', 'SZ'];\n\n          var newElement = createElement()[0];\n          var header = newElement.querySelector('.md-calendar-day-header tr');\n\n          expect(extractRowText(header)).toEqual(['SZ', 'MZ', 'TZ', 'WZ', 'TZ', 'FZ','SZ']);\n          dateLocale.shortDays = oldShortDays;\n        });\n\n        it('should allow changing the first day of the week to Monday', function() {\n          var oldShortDays = dateLocale.shortDays;\n          dateLocale.shortDays = ['SZ', 'MZ', 'TZ', 'WZ', 'TZ', 'FZ', 'SZ'];\n          dateLocale.firstDayOfWeek = 1;\n\n          var newElement = createElement()[0];\n          var header = newElement.querySelector('.md-calendar-day-header tr');\n\n          expect(extractRowText(header)).toEqual(['MZ', 'TZ', 'WZ', 'TZ', 'FZ','SZ', 'SZ']);\n          dateLocale.shortDays = oldShortDays;\n          dateLocale.firstDayOfWeek = 0;\n        });\n      });\n\n      it('should highlight today', function() {\n        pageScope.myDate = calendarController.today;\n        applyDateChange();\n\n        var todayElement = element.querySelector('.md-calendar-date-today');\n        expect(todayElement).not.toBeNull();\n        expect(todayElement.textContent).toBe(calendarController.today.getDate() + '');\n      });\n\n      it('should highlight the selected date', function() {\n        pageScope.myDate = calendarController.selectedDate = new Date(2014, JUN, 30);\n        applyDateChange();\n\n        var selectedElement = element.querySelector('.md-calendar-selected-date');\n        expect(selectedElement).not.toBeNull();\n        expect(selectedElement.textContent).toBe(calendarController.selectedDate.getDate() + '');\n      });\n\n      it('should block month transitions when a month transition is happening', function() {\n        var earlierDate = new Date(2014, FEB, 11);\n        var laterDate = new Date(2014, MAR, 11);\n\n        calendarMonthController.changeDisplayDate(earlierDate);\n        expect(calendarController.displayDate).toBeSameDayAs(earlierDate);\n\n        calendarMonthController.changeDisplayDate(laterDate);\n        expect(calendarController.displayDate).toBeSameDayAs(earlierDate);\n\n        $material.flushOutstandingAnimations();\n        calendarMonthController.changeDisplayDate(laterDate);\n        expect(calendarController.displayDate).toBeSameDayAs(laterDate);\n      });\n\n      it('should not render any months before the min date', function() {\n        ngElement.remove();\n        var newScope = $rootScope.$new();\n        newScope.minDate = new Date(2014, JUN, 5);\n        newScope.myDate = new Date(2014, JUN, 15);\n        newScope.$apply();\n        element = createElement(newScope)[0];\n\n        expect(findMonthElement(element, new Date(2014, JUL, 1))).not.toBeNull();\n        expect(findMonthElement(element, new Date(2014, JUN, 1))).not.toBeNull();\n        expect(findMonthElement(element, new Date(2014, MAY, 1))).toBeNull();\n      });\n    });\n\n    describe('year view', function() {\n      var yearCtrl;\n\n      beforeEach(function() {\n        calendarController.setCurrentView('year');\n        applyDateChange();\n\n        yearCtrl = angular.element(element.querySelector('[md-calendar-year-body]'))\n            .controller('mdCalendarYearBody');\n      });\n\n      it('should render a year correctly as a table', function() {\n        var date = new Date(2014, MAY, 30);\n        var yearElement = yearCtrl.buildCalendarForYear(date);\n\n        var calendarRows = yearElement.querySelectorAll('tr');\n        var calendarDates = [];\n\n        angular.forEach(calendarRows, function(tr) {\n          calendarDates.push(extractRowText(tr));\n        });\n\n        var expectedDates = [\n          ['2014', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],\n          ['', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n        ];\n\n        expect(calendarDates).toEqual(expectedDates);\n      });\n\n      it('should jump to the first day of the relevant month on cell click', function() {\n        var date = new Date(2014, MAY, 30);\n        var yearElement = yearCtrl.buildCalendarForYear(date);\n        var expectedDate = new Date(2014, DEC, 1);\n\n        findCellByLabel(yearElement, 'Dec').click();\n        applyDateChange();\n        expect(calendarController.displayDate).toBeSameDayAs(expectedDate);\n        expect(calendarController.currentView).not.toBe('year');\n      });\n\n      it('should disable any months outside the min/max date range', function() {\n        pageScope.minDate = new Date(2014, JUN, 10);\n        pageScope.maxDate = new Date(2014, SEP, 20);\n        pageScope.$apply();\n\n        var yearElement = yearCtrl.buildCalendarForYear(new Date(2014, JAN, 1));\n        var disabledClass = 'md-calendar-date-disabled';\n        expect(findCellByLabel(yearElement, 'Jan')).toHaveClass(disabledClass);\n        expect(findCellByLabel(yearElement, 'Aug')).not.toHaveClass(disabledClass);\n        expect(findCellByLabel(yearElement, 'Oct')).toHaveClass(disabledClass);\n      });\n\n      it('should not respond to disabled cell clicks', function() {\n        var initialDate = new Date(2014, JUN, 15);\n        calendarController.displayDate = initialDate;\n        pageScope.minDate = new Date(2014, FEB, 10);\n        pageScope.maxDate = new Date(2014, AUG, 20);\n        pageScope.$apply();\n\n        var yearElement = yearCtrl.buildCalendarForYear(calendarController.displayDate);\n        findCellByLabel(yearElement, 'Jan').click();\n        expect(calendarController.displayDate).toBe(initialDate);\n      });\n\n      it('should highlight the current month', function() {\n        var todayElement = element.querySelector('.md-calendar-date-today');\n        expect(todayElement).not.toBeNull();\n        expect(todayElement.textContent).toBe(dateLocale.shortMonths[calendarController.today.getMonth()]);\n      });\n\n      it('should highlight the month of the selected date', function() {\n        ngElement.remove();\n        var newScope = $rootScope.$new();\n        newScope.myDate = new Date(2014, JUN, 30);\n        element = createElement(newScope)[0];\n        angular.element(element).controller('mdCalendar').setCurrentView('year');\n        applyDateChange();\n\n        var selectedElement = element.querySelector('.md-calendar-selected-date');\n        expect(selectedElement).not.toBeNull();\n        expect(selectedElement.textContent).toBe('Jun');\n      });\n\n      it('should not render any years before the min date', function() {\n        ngElement.remove();\n        var newScope = $rootScope.$new();\n        newScope.minDate = new Date(2014, JUN, 5);\n        newScope.myDate = new Date(2014, JUL, 15);\n        element = createElement(newScope);\n        element.controller('mdCalendar').setCurrentView('year');\n        applyDateChange();\n\n        expect(findYearElement(element, 2014)).not.toBeNull();\n        expect(findYearElement(element, 2013)).toBeNull();\n      });\n\n      it('should highlight the proper cell, even when the date is not the ' +\n        'first day of the month', function() {\n        var newScope = $rootScope.$new();\n\n        newScope.myDate = new Date(2015, MAY, 1);\n        element = createElement(newScope)[0];\n        angular.element(element).controller('mdCalendar').setCurrentView('year');\n        applyDateChange();\n\n        var yearElement = findYearElement(element, 2015);\n\n        expect(findCellByLabel(yearElement, 'May')).toHaveClass('md-calendar-selected-date');\n\n        newScope.myDate = new Date(2015, JUL, 15);\n        applyDateChange();\n\n        expect(findCellByLabel(yearElement, 'Jul')).toHaveClass('md-calendar-selected-date');\n      });\n\n      it('should ensure that all year elements have a height when the ' +\n        'current date is in the same month as the max date', function() {\n\n        ngElement.remove();\n        var newScope = $rootScope.$new();\n        newScope.myDate = new Date(2016, JUN, 15);\n        newScope.maxDate = new Date(2016, JUN, 20);\n        element = createElement(newScope);\n        element.controller('mdCalendar').setCurrentView('year');\n        applyDateChange();\n\n        var yearWrapper = angular.element(element[0].querySelector('md-calendar-year'));\n        var scroller = yearWrapper.controller('mdCalendarYear').calendarScroller;\n\n        scroller.scrollTop -= 50;\n        angular.element(scroller).triggerHandler('scroll');\n\n        var yearElements = $mdUtil.nodesToArray(\n          element[0].querySelectorAll('[md-calendar-year-body]')\n        );\n\n        expect(yearElements.every(function(currentYearElement) {\n          return currentYearElement.offsetHeight > 0;\n        })).toBe(true);\n      });\n    });\n\n    it('should have ids for date elements unique to the directive instance', function() {\n      var controller = ngElement.controller('mdCalendar');\n      pageScope.myDate = calendarController.today;\n      applyDateChange();\n\n      var otherScope = $rootScope.$new();\n      var day = 15;\n\n      otherScope.myDate = calendarController.today;\n      var otherNgElement = createElement(otherScope);\n\n      var monthElement = element.querySelector('.md-calendar-month');\n      var dateElement = findCellByLabel(monthElement, day);\n\n      var otherMonthElement = otherNgElement[0].querySelector('.md-calendar-month');\n      var otherDateElement = findCellByLabel(otherMonthElement, day);\n\n      expect(dateElement.id).not.toEqual(otherDateElement.id);\n    });\n  });\n\n  describe('keyboard events', function() {\n    describe('month view', function() {\n      it('should navigate around the calendar based on key presses', function() {\n        pageScope.myDate = new Date(2014, FEB, 11);\n        applyDateChange();\n\n        var selectedDate = element.querySelector('.md-calendar-selected-date');\n        selectedDate.focus();\n\n        dispatchKeyEvent(keyCodes.LEFT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('10');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.UP_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('3');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('4');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('11');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.HOME);\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.END);\n        expect(getFocusedDateElement().textContent).toBe('28');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Mar 2014');\n\n        dispatchKeyEvent(keyCodes.PAGE_UP);\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.PAGE_DOWN);\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Mar 2014');\n\n        dispatchKeyEvent(keyCodes.UP_ARROW, {meta: true});\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW, {meta: true});\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Mar 2014');\n\n        dispatchKeyEvent(keyCodes.ENTER);\n        applyDateChange();\n        expect(calendarController.selectedDate).toBeSameDayAs(new Date(2014, MAR, 1));\n      });\n\n      it('should restrict date navigation to min/max dates', function() {\n        pageScope.minDate = new Date(2014, FEB, 5);\n        pageScope.maxDate = new Date(2014, FEB, 10);\n        pageScope.myDate = new Date(2014, FEB, 8);\n        applyDateChange();\n\n        var selectedDate = element.querySelector('.md-calendar-selected-date');\n        selectedDate.focus();\n\n        dispatchKeyEvent(keyCodes.UP_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('5');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.LEFT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('5');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('10');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('10');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.UP_ARROW, {meta: true});\n        expect(getFocusedDateElement().textContent).toBe('5');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW, {meta: true});\n        expect(getFocusedDateElement().textContent).toBe('10');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Feb 2014');\n      });\n    });\n\n    describe('year view', function() {\n      it('should navigate around the calendar based on key presses', function() {\n        pageScope.myDate = new Date(2014, JUN, 1);\n        calendarController.setCurrentView('year');\n        applyDateChange();\n\n        var selectedDate = element.querySelector('.md-calendar-selected-date');\n        selectedDate.focus();\n\n        dispatchKeyEvent(keyCodes.LEFT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('May');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n\n        dispatchKeyEvent(keyCodes.UP_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Nov');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2013');\n\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Dec');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2013');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Jun');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n\n        dispatchKeyEvent(keyCodes.ENTER);\n        applyDateChange();\n        expect(calendarController.displayDate).toBeSameDayAs(new Date(2014, JUN, 1));\n        expect(calendarController.currentView).toBe('month');\n        expect(getFocusedDateElement().textContent).toBe('1');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('Jun 2014');\n      });\n\n      it('should restrict date navigation to min/max dates', function() {\n        pageScope.minDate = new Date(2014, JAN, 30);\n        pageScope.maxDate = new Date(2014, SEP, 1);\n        pageScope.myDate = new Date(2014, JUN, 1);\n        calendarController.setCurrentView('year');\n        applyDateChange();\n\n        var selectedDate = element.querySelector('.md-calendar-selected-date');\n        selectedDate.focus();\n\n        dispatchKeyEvent(keyCodes.UP_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Jan');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n\n        dispatchKeyEvent(keyCodes.LEFT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Jan');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n\n        dispatchKeyEvent(keyCodes.DOWN_ARROW);\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Aug');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n\n        dispatchKeyEvent(keyCodes.RIGHT_ARROW);\n        expect(getFocusedDateElement().textContent).toBe('Sep');\n        expect(getGroupLabelForDateCell(getFocusedDateElement())).toBe('2014');\n      });\n    });\n\n    it('should fire an event when escape is pressed', function() {\n      var escapeHandler = jasmine.createSpy('escapeHandler');\n      pageScope.$on('md-calendar-close', escapeHandler);\n\n      pageScope.myDate = new Date(2014, FEB, 11);\n      applyDateChange();\n      var selectedDate = element.querySelector('.md-calendar-selected-date');\n      selectedDate.focus();\n\n      dispatchKeyEvent(keyCodes.ESCAPE);\n      pageScope.$apply();\n\n      expect(escapeHandler).toHaveBeenCalled();\n    });\n  });\n\n  describe('md-mode support', function() {\n    var element, controller;\n\n    function compileElement(attrs) {\n      ngElement.remove();\n      element = createElement(pageScope, '<md-calendar ng-model=\"myDate\" ' + (attrs || '') + '></md-calendar>');\n      controller = element.controller('mdCalendar');\n    }\n\n    it('should go to the corresponding view', function() {\n      compileElement('md-mode=\"month\"');\n\n      expect(element.find('md-calendar-month').length).toBe(0);\n      expect(element.find('md-calendar-year').length).toBe(1);\n      expect(controller.currentView).toBe('year');\n    });\n\n    it('should override md-current-view', function() {\n      compileElement('md-mode=\"day\" md-current-view=\"year\"');\n\n      expect(element.find('md-calendar-year').length).toBe(0);\n      expect(element.find('md-calendar-month').length).toBe(1);\n      expect(controller.currentView).toBe('month');\n    });\n\n    it('should not allow users to go to a different view', function() {\n      compileElement('md-mode=\"day\"');\n\n      expect(controller.currentView).toBe('month');\n\n      element[0].querySelector('.md-calendar-month-label').click();\n      applyDateChange();\n\n      expect(controller.currentView).toBe('month');\n    });\n\n    it('should allow users to navigate to a different view if the md-mode is not supported', function() {\n      compileElement('md-mode=\"invalid-mode\"');\n\n      expect(controller.currentView).toBe('month');\n      expect(controller.mode).toBeFalsy();\n\n      element[0].querySelector('.md-calendar-month-label').click();\n      applyDateChange();\n\n      expect(controller.currentView).toBe('year');\n    });\n\n    it('should update the model when clicking on a cell in the year view', function() {\n      pageScope.myDate = new Date(2015, MAY, 15);\n\n      compileElement('md-mode=\"month\"');\n\n      expect(controller.currentView).toBe('year');\n\n      var yearElement = findYearElement(element[0], 2015);\n      var monthCell = findCellByLabel(yearElement, 'Sep');\n      var expectedDate = new Date(2015, SEP, 1);\n\n      monthCell.click();\n      applyDateChange();\n\n      expect(pageScope.myDate).toBeSameDayAs(expectedDate);\n      expect(controller.currentView).toBe('year');\n    });\n\n    it('should update the model when clicking on a cell in the day view', function() {\n      pageScope.myDate = new Date(2015, MAY, 15);\n\n      compileElement('md-mode=\"day\"');\n\n      var monthElement = findMonthElement(element[0], pageScope.myDate);\n      var monthCell = findCellByLabel(monthElement, '28');\n      var expectedDate = new Date(2015, MAY, 28);\n\n      monthCell.click();\n      applyDateChange();\n\n      expect(pageScope.myDate).toBeSameDayAs(expectedDate);\n    });\n  });\n\n  describe('md-current-view support', function() {\n    beforeEach(function() {\n      ngElement && ngElement.remove();\n    });\n\n    it('should have a configurable default view', function() {\n      var calendar = createElement(null, '<md-calendar ng-model=\"myDate\" md-current-view=\"year\"></md-calendar>')[0];\n\n      expect(calendar.querySelector('md-calendar-month')).toBeFalsy();\n      expect(calendar.querySelector('md-calendar-year')).toBeTruthy();\n    });\n\n    it('should default to the month view if no view is supploied', function() {\n      var calendar = createElement(null, '<md-calendar ng-model=\"myDate\"></md-calendar>');\n      expect(calendar.controller('mdCalendar').currentView).toBe('month');\n    });\n  });\n\n  it('should render one single-row month of disabled cells after the max date', function() {\n    ngElement.remove();\n    var newScope = $rootScope.$new();\n    newScope.myDate = new Date(2014, APR, 15);\n    newScope.maxDate = new Date(2014, APR, 30);\n    newScope.$apply();\n    element = createElement(newScope)[0];\n\n    expect(findMonthElement(element, new Date(2014, MAR, 1))).not.toBeNull();\n    expect(findMonthElement(element, new Date(2014, APR, 1))).not.toBeNull();\n\n    // First date of May 2014 on Thursday (i.e. has 3 dates on the first row).\n    var nextMonth = findMonthElement(element, new Date(2014, MAY, 1));\n    expect(nextMonth).not.toBeNull();\n    expect(nextMonth.querySelector('.md-calendar-month-label')).toHaveClass(\n        'md-calendar-month-label-disabled');\n    expect(nextMonth.querySelectorAll('tr').length).toBe(1);\n\n    var dates = nextMonth.querySelectorAll('.md-calendar-date');\n    var date;\n    for (var i = 0; i < dates.length; i++) {\n      date = dates[i];\n      if (date.textContent) {\n        expect(date).toHaveClass('md-calendar-date-disabled');\n      }\n    }\n  });\n});\n"
  },
  {
    "path": "src/components/datepicker/js/calendarMonth.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('material.components.datepicker')\n    .directive('mdCalendarMonth', calendarDirective);\n\n  /**\n   * Height of one calendar month tbody. This must be made known to the virtual-repeat and is\n   * subsequently used for scrolling to specific months.\n   */\n  var TBODY_HEIGHT = 265;\n\n  /**\n   * Height of a calendar month with a single row. This is needed to calculate the offset for\n   * rendering an extra month in virtual-repeat that only contains one row.\n   */\n  var TBODY_SINGLE_ROW_HEIGHT = 45;\n\n  /** Private directive that represents a list of months inside the calendar. */\n  function calendarDirective() {\n    return {\n      template:\n        '<table aria-hidden=\"true\" class=\"md-calendar-day-header\"><thead></thead></table>' +\n        '<div class=\"md-calendar-scroll-mask\">' +\n        '<md-virtual-repeat-container class=\"md-calendar-scroll-container\" ' +\n              'md-offset-size=\"' + (TBODY_SINGLE_ROW_HEIGHT - TBODY_HEIGHT) + '\">' +\n            '<table role=\"grid\" tabindex=\"0\" class=\"md-calendar\" aria-readonly=\"true\">' +\n              '<tbody ' +\n                  'md-calendar-month-body ' +\n                  'role=\"rowgroup\" ' +\n                  'md-virtual-repeat=\"i in monthCtrl.items\" ' +\n                  'md-month-offset=\"$index\" ' +\n                  'class=\"md-calendar-month\" ' +\n                  'md-start-index=\"monthCtrl.getSelectedMonthIndex()\" ' +\n                  'md-item-size=\"' + TBODY_HEIGHT + '\">' +\n\n                // The <tr> ensures that the <tbody> will always have the\n                // proper height, even if it's empty. If it's content is\n                // compiled, the <tr> will be overwritten.\n                '<tr aria-hidden=\"true\" md-force-height=\"\\'' + TBODY_HEIGHT + 'px\\'\"></tr>' +\n              '</tbody>' +\n            '</table>' +\n          '</md-virtual-repeat-container>' +\n        '</div>',\n      require: ['^^mdCalendar', 'mdCalendarMonth'],\n      controller: CalendarMonthCtrl,\n      controllerAs: 'monthCtrl',\n      bindToController: true,\n      link: function(scope, element, attrs, controllers) {\n        var calendarCtrl = controllers[0];\n        var monthCtrl = controllers[1];\n        monthCtrl.initialize(calendarCtrl);\n      }\n    };\n  }\n\n  /**\n   * Controller for the calendar month component.\n   * @ngInject @constructor\n   */\n  function CalendarMonthCtrl($element, $scope, $animate, $q,\n    $$mdDateUtil, $mdDateLocale) {\n\n    /** @final {!angular.JQLite} */\n    this.$element = $element;\n\n    /** @final {!angular.Scope} */\n    this.$scope = $scope;\n\n    /** @final {!angular.$animate} */\n    this.$animate = $animate;\n\n    /** @final {!angular.$q} */\n    this.$q = $q;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final */\n    this.dateLocale = $mdDateLocale;\n\n    /** @final {HTMLElement} */\n    this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller');\n\n    /** @type {boolean} */\n    this.isInitialized = false;\n\n    /** @type {boolean} */\n    this.isMonthTransitionInProgress = false;\n\n    var self = this;\n\n    /**\n     * Handles a click event on a date cell.\n     * Created here so that every cell can use the same function instance.\n     * @this {HTMLTableCellElement} The cell that was clicked.\n     */\n    this.cellClickHandler = function() {\n      var timestamp = $$mdDateUtil.getTimestampFromNode(this);\n      self.$scope.$apply(function() {\n        // The timestamp has to be converted to a valid date.\n        self.calendarCtrl.setNgModelValue(new Date(timestamp));\n      });\n    };\n\n    /**\n     * Handles click events on the month headers. Switches\n     * the calendar to the year view.\n     * @this {HTMLTableCellElement} The cell that was clicked.\n     */\n    this.headerClickHandler = function() {\n      self.calendarCtrl.setCurrentView('year', $$mdDateUtil.getTimestampFromNode(this));\n    };\n  }\n\n  /** Initialization **/\n\n  /**\n   * Initialize the controller by saving a reference to the calendar and\n   * setting up the object that will be iterated by the virtual repeater.\n   */\n  CalendarMonthCtrl.prototype.initialize = function(calendarCtrl) {\n    /**\n     * Dummy array-like object for virtual-repeat to iterate over. The length is the total\n     * number of months that can be viewed. We add 2 months: one to include the current month\n     * and one for the last dummy month.\n     *\n     * This is shorter than ideal because of a (potential) Firefox bug\n     * https://bugzilla.mozilla.org/show_bug.cgi?id=1181658.\n     */\n\n    this.items = {\n      length: this.dateUtil.getMonthDistance(\n        calendarCtrl.firstRenderableDate,\n        calendarCtrl.lastRenderableDate\n      ) + 2\n    };\n\n    this.calendarCtrl = calendarCtrl;\n    this.attachScopeListeners();\n    calendarCtrl.updateVirtualRepeat();\n\n    // Fire the initial render, since we might have missed it the first time it fired.\n    calendarCtrl.ngModelCtrl && calendarCtrl.ngModelCtrl.$render();\n  };\n\n  /**\n   * Gets the \"index\" of the currently selected date as it would be in the virtual-repeat.\n   * @returns {number} the \"index\" of the currently selected date\n   */\n  CalendarMonthCtrl.prototype.getSelectedMonthIndex = function() {\n    var calendarCtrl = this.calendarCtrl;\n\n    return this.dateUtil.getMonthDistance(\n      calendarCtrl.firstRenderableDate,\n      calendarCtrl.displayDate || calendarCtrl.selectedDate || calendarCtrl.today\n    );\n  };\n\n  /**\n   * Change the date that is being shown in the calendar. If the given date is in a different\n   * month, the displayed month will be transitioned.\n   * @param {Date} date\n   */\n  CalendarMonthCtrl.prototype.changeDisplayDate = function(date) {\n    // Initialization is deferred until this function is called because we want to reflect\n    // the starting value of ngModel.\n    if (!this.isInitialized) {\n      this.buildWeekHeader();\n      this.calendarCtrl.hideVerticalScrollbar(this);\n      this.isInitialized = true;\n      return this.$q.when();\n    }\n\n    // If trying to show an invalid date or a transition is in progress, do nothing.\n    if (!this.dateUtil.isValidDate(date) || this.isMonthTransitionInProgress) {\n      return this.$q.when();\n    }\n\n    this.isMonthTransitionInProgress = true;\n    var animationPromise = this.animateDateChange(date);\n\n    this.calendarCtrl.displayDate = date;\n\n    var self = this;\n    animationPromise.then(function() {\n      self.isMonthTransitionInProgress = false;\n    });\n\n    return animationPromise;\n  };\n\n  /**\n   * Animates the transition from the calendar's current month to the given month.\n   * @param {Date} date\n   * @returns {angular.$q.Promise} The animation promise.\n   */\n  CalendarMonthCtrl.prototype.animateDateChange = function(date) {\n    if (this.dateUtil.isValidDate(date)) {\n      var monthDistance = this.dateUtil.getMonthDistance(this.calendarCtrl.firstRenderableDate, date);\n      this.calendarScroller.scrollTop = monthDistance * TBODY_HEIGHT;\n    }\n\n    return this.$q.when();\n  };\n\n  /**\n   * Builds and appends a day-of-the-week header to the calendar.\n   * This should only need to be called once during initialization.\n   */\n  CalendarMonthCtrl.prototype.buildWeekHeader = function() {\n    var firstDayOfWeek = this.dateLocale.firstDayOfWeek;\n    var shortDays = this.dateLocale.shortDays;\n\n    var row = document.createElement('tr');\n    for (var i = 0; i < 7; i++) {\n      var th = document.createElement('th');\n      th.textContent = shortDays[(i + firstDayOfWeek) % 7];\n      row.appendChild(th);\n    }\n\n    this.$element.find('thead').append(row);\n  };\n\n  /**\n   * Attaches listeners for the scope events that are broadcast by the calendar.\n   */\n  CalendarMonthCtrl.prototype.attachScopeListeners = function() {\n    var self = this;\n\n    self.$scope.$on('md-calendar-parent-changed', function(event, value) {\n      self.calendarCtrl.changeSelectedDate(value);\n      self.changeDisplayDate(value);\n    });\n\n    self.$scope.$on('md-calendar-parent-action', angular.bind(this, this.handleKeyEvent));\n  };\n\n  /**\n   * Handles the month-specific keyboard interactions.\n   * @param {Object} event Scope event object passed by the calendar.\n   * @param {String} action Action, corresponding to the key that was pressed.\n   */\n  CalendarMonthCtrl.prototype.handleKeyEvent = function(event, action) {\n    var calendarCtrl = this.calendarCtrl;\n    var displayDate = calendarCtrl.displayDate;\n\n    if (action === 'select') {\n      calendarCtrl.setNgModelValue(displayDate);\n    } else {\n      var date = null;\n      var dateUtil = this.dateUtil;\n\n      switch (action) {\n        case 'move-right': date = dateUtil.incrementDays(displayDate, 1); break;\n        case 'move-left': date = dateUtil.incrementDays(displayDate, -1); break;\n\n        case 'move-page-down': date = dateUtil.incrementMonths(displayDate, 1); break;\n        case 'move-page-up': date = dateUtil.incrementMonths(displayDate, -1); break;\n\n        case 'move-row-down': date = dateUtil.incrementDays(displayDate, 7); break;\n        case 'move-row-up': date = dateUtil.incrementDays(displayDate, -7); break;\n\n        case 'start': date = dateUtil.getFirstDateOfMonth(displayDate); break;\n        case 'end': date = dateUtil.getLastDateOfMonth(displayDate); break;\n      }\n\n      if (date) {\n        date = this.dateUtil.clampDate(date, calendarCtrl.minDate, calendarCtrl.maxDate);\n\n        this.changeDisplayDate(date).then(function() {\n          calendarCtrl.focusDate(date);\n        });\n      }\n    }\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/calendarMonthBody.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('material.components.datepicker')\n      .directive('mdCalendarMonthBody', mdCalendarMonthBodyDirective);\n\n  /**\n   * Private directive consumed by md-calendar-month. Having this directive lets the calender use\n   * md-virtual-repeat and also cleanly separates the month DOM construction functions from\n   * the rest of the calendar controller logic.\n   * @ngInject\n   */\n  function mdCalendarMonthBodyDirective($compile, $$mdSvgRegistry) {\n    var ARROW_ICON = $compile('<md-icon md-svg-src=\"' +\n      $$mdSvgRegistry.mdTabsArrow + '\"></md-icon>')({})[0];\n\n    return {\n      require: ['^^mdCalendar', '^^mdCalendarMonth', 'mdCalendarMonthBody'],\n      scope: { offset: '=mdMonthOffset' },\n      controller: CalendarMonthBodyCtrl,\n      controllerAs: 'mdMonthBodyCtrl',\n      bindToController: true,\n      link: function(scope, element, attrs, controllers) {\n        var calendarCtrl = controllers[0];\n        var monthCtrl = controllers[1];\n        var monthBodyCtrl = controllers[2];\n\n        monthBodyCtrl.calendarCtrl = calendarCtrl;\n        monthBodyCtrl.monthCtrl = monthCtrl;\n        monthBodyCtrl.arrowIcon = ARROW_ICON.cloneNode(true);\n\n        // The virtual-repeat re-uses the same DOM elements, so there are only a limited number\n        // of repeated items that are linked, and then those elements have their bindings updated.\n        // Since the months are not generated by bindings, we simply regenerate the entire thing\n        // when the binding (offset) changes.\n        scope.$watch(function() { return monthBodyCtrl.offset; }, function(offset) {\n          if (angular.isNumber(offset)) {\n            monthBodyCtrl.generateContent();\n          }\n        });\n      }\n    };\n  }\n\n  /**\n   * Controller for a single calendar month.\n   * @ngInject @constructor\n   */\n  function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {\n    /**\n     * @final\n     * @type {!JQLite}\n     */\n    this.$element = $element;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final */\n    this.dateLocale = $mdDateLocale;\n\n    /** @type {Object} Reference to the month view. */\n    this.monthCtrl = null;\n\n    /** @type {Object} Reference to the calendar. */\n    this.calendarCtrl = null;\n\n    /**\n     * Number of months from the start of the month \"items\" that the currently rendered month\n     * occurs. Set via angular data binding.\n     * @type {number|null}\n     */\n    this.offset = null;\n\n    /**\n     * Date cell to focus after appending the month to the document.\n     * @type {HTMLElement}\n     */\n    this.focusAfterAppend = null;\n  }\n\n  /** Generate and append the content for this month to the directive element. */\n  CalendarMonthBodyCtrl.prototype.generateContent = function() {\n    var date = this.dateUtil.incrementMonths(this.calendarCtrl.firstRenderableDate, this.offset);\n\n    this.$element\n      .empty()\n      .append(this.buildCalendarForMonth(date));\n\n    if (this.focusAfterAppend) {\n      this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS);\n      this.focusAfterAppend = null;\n    }\n  };\n\n  /**\n   * Creates a single cell to contain a date in the calendar with all appropriate\n   * attributes and classes added. If a date is given, the cell content will be set\n   * based on the date.\n   * @param {Date=} opt_date\n   * @returns {HTMLElement}\n   */\n  CalendarMonthBodyCtrl.prototype.buildDateCell = function(opt_date) {\n    var monthCtrl = this.monthCtrl;\n    var calendarCtrl = this.calendarCtrl;\n\n    // TODO(jelbourn): cloneNode is likely a faster way of doing this.\n    var cell = document.createElement('td');\n    cell.tabIndex = -1;\n    cell.classList.add('md-calendar-date');\n    cell.setAttribute('role', 'gridcell');\n\n    if (opt_date) {\n      cell.setAttribute('tabindex', '-1');\n      cell.setAttribute('aria-label', this.dateLocale.longDateFormatter(opt_date));\n      cell.id = calendarCtrl.getDateId(opt_date, 'month');\n\n      // Use `data-timestamp` attribute because IE10 does not support the `dataset` property.\n      cell.setAttribute('data-timestamp', opt_date.getTime());\n\n      // TODO(jelourn): Doing these comparisons for class addition during generation might be slow.\n      // It may be better to finish the construction and then query the node and add the class.\n      if (this.dateUtil.isSameDay(opt_date, calendarCtrl.today)) {\n        cell.classList.add(calendarCtrl.TODAY_CLASS);\n      }\n\n      if (this.dateUtil.isValidDate(calendarCtrl.selectedDate) &&\n          this.dateUtil.isSameDay(opt_date, calendarCtrl.selectedDate)) {\n        cell.classList.add(calendarCtrl.SELECTED_DATE_CLASS);\n        cell.setAttribute('aria-selected', 'true');\n      }\n\n      var cellText = this.dateLocale.dates[opt_date.getDate()];\n\n      if (this.isDateEnabled(opt_date)) {\n        // Add a indicator for select, hover, and focus states.\n        var selectionIndicator = document.createElement('span');\n        selectionIndicator.classList.add('md-calendar-date-selection-indicator');\n        selectionIndicator.textContent = cellText;\n        cell.appendChild(selectionIndicator);\n        cell.addEventListener('click', monthCtrl.cellClickHandler);\n\n        if (calendarCtrl.displayDate && this.dateUtil.isSameDay(opt_date, calendarCtrl.displayDate)) {\n          this.focusAfterAppend = cell;\n        }\n      } else {\n        cell.classList.add('md-calendar-date-disabled');\n        cell.textContent = cellText;\n      }\n    }\n\n    return cell;\n  };\n\n  /**\n   * Check whether date is in range and enabled\n   * @param {Date=} opt_date\n   * @return {boolean} Whether the date is enabled.\n   */\n  CalendarMonthBodyCtrl.prototype.isDateEnabled = function(opt_date) {\n    return this.dateUtil.isDateWithinRange(opt_date,\n          this.calendarCtrl.minDate, this.calendarCtrl.maxDate) &&\n          (!angular.isFunction(this.calendarCtrl.dateFilter)\n           || this.calendarCtrl.dateFilter(opt_date));\n  };\n\n  /**\n   * Builds a `tr` element for the calendar grid.\n   * @param rowNumber The week number within the month.\n   * @returns {HTMLElement}\n   */\n  CalendarMonthBodyCtrl.prototype.buildDateRow = function(rowNumber) {\n    var row = document.createElement('tr');\n    row.setAttribute('role', 'row');\n\n    // Because of an NVDA bug (with Firefox), the row needs an aria-label in order\n    // to prevent the entire row being read aloud when the user moves between rows.\n    // See http://community.nvda-project.org/ticket/4643.\n    row.setAttribute('aria-label', this.dateLocale.weekNumberFormatter(rowNumber));\n\n    return row;\n  };\n\n  /**\n   * Builds the <tbody> content for the given date's month.\n   * @param {Date=} opt_dateInMonth\n   * @returns {DocumentFragment} A document fragment containing the <tr> elements.\n   */\n  CalendarMonthBodyCtrl.prototype.buildCalendarForMonth = function(opt_dateInMonth) {\n    var date = this.dateUtil.isValidDate(opt_dateInMonth) ? opt_dateInMonth : new Date();\n\n    var firstDayOfMonth = this.dateUtil.getFirstDateOfMonth(date);\n    var firstDayOfTheWeek = this.getLocaleDay_(firstDayOfMonth);\n    var numberOfDaysInMonth = this.dateUtil.getNumberOfDaysInMonth(date);\n\n    // Store rows for the month in a document fragment so that we can append them all at once.\n    var monthBody = document.createDocumentFragment();\n\n    var rowNumber = 1;\n    var row = this.buildDateRow(rowNumber);\n    monthBody.appendChild(row);\n\n    // If this is the final month in the list of items, only the first week should render,\n    // so we should return immediately after the first row is complete and has been\n    // attached to the body.\n    var isFinalMonth = this.offset === this.monthCtrl.items.length - 1;\n\n    // Add a label for the month. If the month starts on a Sun/Mon/Tues, the month label\n    // goes on a row above the first of the month. Otherwise, the month label takes up the first\n    // two cells of the first row.\n    var blankCellOffset = 0;\n    var monthLabelCell = document.createElement('td');\n    var monthLabelCellContent = document.createElement('span');\n    var calendarCtrl = this.calendarCtrl;\n\n    monthLabelCellContent.textContent = this.dateLocale.monthHeaderFormatter(date);\n    monthLabelCell.appendChild(monthLabelCellContent);\n    monthLabelCell.classList.add('md-calendar-month-label');\n    // If the entire month is after the max date, render the label as a disabled state.\n    if (calendarCtrl.maxDate && firstDayOfMonth > calendarCtrl.maxDate) {\n      monthLabelCell.classList.add('md-calendar-month-label-disabled');\n    // If the user isn't supposed to be able to change views, render the\n    // label as usual, but disable the clicking functionality.\n    } else if (!calendarCtrl.mode) {\n      monthLabelCell.addEventListener('click', this.monthCtrl.headerClickHandler);\n      monthLabelCell.setAttribute('data-timestamp', firstDayOfMonth.getTime());\n      monthLabelCell.setAttribute('aria-label', this.dateLocale.monthFormatter(date));\n      monthLabelCell.classList.add('md-calendar-label-clickable');\n      monthLabelCell.appendChild(this.arrowIcon.cloneNode(true));\n    }\n\n    if (firstDayOfTheWeek <= 2) {\n      monthLabelCell.setAttribute('colspan', '7');\n\n      var monthLabelRow = this.buildDateRow();\n      monthLabelRow.appendChild(monthLabelCell);\n      monthBody.insertBefore(monthLabelRow, row);\n\n      if (isFinalMonth) {\n        return monthBody;\n      }\n    } else {\n      blankCellOffset = 3;\n      monthLabelCell.setAttribute('colspan', '3');\n      row.appendChild(monthLabelCell);\n    }\n\n    // Add a blank cell for each day of the week that occurs before the first of the month.\n    // For example, if the first day of the month is a Tuesday, add blank cells for Sun and Mon.\n    // The blankCellOffset is needed in cases where the first N cells are used by the month label.\n    for (var i = blankCellOffset; i < firstDayOfTheWeek; i++) {\n      row.appendChild(this.buildDateCell());\n    }\n\n    // Add a cell for each day of the month, keeping track of the day of the week so that\n    // we know when to start a new row.\n    var dayOfWeek = firstDayOfTheWeek;\n    var iterationDate = firstDayOfMonth;\n    for (var d = 1; d <= numberOfDaysInMonth; d++) {\n      // If we've reached the end of the week, start a new row.\n      if (dayOfWeek === 7) {\n        // We've finished the first row, so we're done if this is the final month.\n        if (isFinalMonth) {\n          return monthBody;\n        }\n        dayOfWeek = 0;\n        rowNumber++;\n        row = this.buildDateRow(rowNumber);\n        monthBody.appendChild(row);\n      }\n\n      iterationDate.setDate(d);\n      var cell = this.buildDateCell(iterationDate);\n      row.appendChild(cell);\n\n      dayOfWeek++;\n    }\n\n    // Ensure that the last row of the month has 7 cells.\n    while (row.childNodes.length < 7) {\n      row.appendChild(this.buildDateCell());\n    }\n\n    // Ensure that all months have 6 rows. This is necessary for now because the virtual-repeat\n    // requires that all items have exactly the same height.\n    while (monthBody.childNodes.length < 6) {\n      var whitespaceRow = this.buildDateRow();\n      for (var j = 0; j < 7; j++) {\n        whitespaceRow.appendChild(this.buildDateCell());\n      }\n      monthBody.appendChild(whitespaceRow);\n    }\n\n    return monthBody;\n  };\n\n  /**\n   * Gets the day-of-the-week index for a date for the current locale.\n   * @private\n   * @param {Date} date\n   * @returns {number} The column index of the date in the calendar.\n   */\n  CalendarMonthBodyCtrl.prototype.getLocaleDay_ = function(date) {\n    return (date.getDay() + (7 - this.dateLocale.firstDayOfWeek)) % 7;\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/calendarYear.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('material.components.datepicker')\n    .directive('mdCalendarYear', calendarDirective);\n\n  /**\n   * Height of one calendar year tbody. This must be made known to the virtual-repeat and is\n   * subsequently used for scrolling to specific years.\n   */\n  var TBODY_HEIGHT = 88;\n\n  /** Private component, representing a list of years in the calendar. */\n  function calendarDirective() {\n    return {\n      template:\n        '<div class=\"md-calendar-scroll-mask\">' +\n          '<md-virtual-repeat-container class=\"md-calendar-scroll-container\">' +\n            '<table role=\"grid\" tabindex=\"0\" class=\"md-calendar\" aria-readonly=\"true\">' +\n              '<tbody ' +\n                  'md-calendar-year-body ' +\n                  'role=\"rowgroup\" ' +\n                  'md-virtual-repeat=\"i in yearCtrl.items\" ' +\n                  'md-year-offset=\"$index\" class=\"md-calendar-year\" ' +\n                  'md-start-index=\"yearCtrl.getFocusedYearIndex()\" ' +\n                  'md-item-size=\"' + TBODY_HEIGHT + '\">' +\n                // The <tr> ensures that the <tbody> will have the proper\n                // height, even though it may be empty.\n                '<tr aria-hidden=\"true\" md-force-height=\"\\'' + TBODY_HEIGHT + 'px\\'\"></tr>' +\n              '</tbody>' +\n            '</table>' +\n          '</md-virtual-repeat-container>' +\n        '</div>',\n      require: ['^^mdCalendar', 'mdCalendarYear'],\n      controller: CalendarYearCtrl,\n      controllerAs: 'yearCtrl',\n      bindToController: true,\n      link: function(scope, element, attrs, controllers) {\n        var calendarCtrl = controllers[0];\n        var yearCtrl = controllers[1];\n        yearCtrl.initialize(calendarCtrl);\n      }\n    };\n  }\n\n  /**\n   * Controller for the mdCalendar component.\n   * @ngInject @constructor\n   */\n  function CalendarYearCtrl($element, $scope, $animate, $q, $$mdDateUtil, $mdUtil) {\n\n    /** @final {!angular.JQLite} */\n    this.$element = $element;\n\n    /** @final {!angular.Scope} */\n    this.$scope = $scope;\n\n    /** @final {!angular.$animate} */\n    this.$animate = $animate;\n\n    /** @final {!angular.$q} */\n    this.$q = $q;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final {HTMLElement} */\n    this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller');\n\n    /** @type {boolean} */\n    this.isInitialized = false;\n\n    /** @type {boolean} */\n    this.isMonthTransitionInProgress = false;\n\n    /** @final */\n    this.$mdUtil = $mdUtil;\n\n    var self = this;\n\n    /**\n     * Handles a click event on a date cell.\n     * Created here so that every cell can use the same function instance.\n     * @this {HTMLTableCellElement} The cell that was clicked.\n     */\n    this.cellClickHandler = function() {\n      self.onTimestampSelected($$mdDateUtil.getTimestampFromNode(this));\n    };\n  }\n\n  /**\n   * Initialize the controller by saving a reference to the calendar and\n   * setting up the object that will be iterated by the virtual repeater.\n   */\n  CalendarYearCtrl.prototype.initialize = function(calendarCtrl) {\n    /**\n     * Dummy array-like object for virtual-repeat to iterate over. The length is the total\n     * number of years that can be viewed. We add 1 extra in order to include the current year.\n     */\n\n    this.items = {\n      length: this.dateUtil.getYearDistance(\n        calendarCtrl.firstRenderableDate,\n        calendarCtrl.lastRenderableDate\n      ) + 1\n    };\n\n    this.calendarCtrl = calendarCtrl;\n    this.attachScopeListeners();\n    calendarCtrl.updateVirtualRepeat();\n\n    // Fire the initial render, since we might have missed it the first time it fired.\n    calendarCtrl.ngModelCtrl && calendarCtrl.ngModelCtrl.$render();\n  };\n\n  /**\n   * Gets the \"index\" of the currently selected date as it would be in the virtual-repeat.\n   * @returns {number}\n   */\n  CalendarYearCtrl.prototype.getFocusedYearIndex = function() {\n    var calendarCtrl = this.calendarCtrl;\n\n    return this.dateUtil.getYearDistance(\n      calendarCtrl.firstRenderableDate,\n      calendarCtrl.displayDate || calendarCtrl.selectedDate || calendarCtrl.today\n    );\n  };\n\n  /**\n   * Change the date that is highlighted in the calendar.\n   * @param {Date} date\n   */\n  CalendarYearCtrl.prototype.changeDate = function(date) {\n    // Initialization is deferred until this function is called because we want to reflect\n    // the starting value of ngModel.\n    if (!this.isInitialized) {\n      this.calendarCtrl.hideVerticalScrollbar(this);\n      this.isInitialized = true;\n      return this.$q.when();\n    } else if (this.dateUtil.isValidDate(date) && !this.isMonthTransitionInProgress) {\n      var self = this;\n      var animationPromise = this.animateDateChange(date);\n\n      self.isMonthTransitionInProgress = true;\n      self.calendarCtrl.displayDate = date;\n\n      return animationPromise.then(function() {\n        self.isMonthTransitionInProgress = false;\n      });\n    }\n  };\n\n  /**\n   * Animates the transition from the calendar's current month to the given month.\n   * @param {Date} date\n   * @returns {angular.$q.Promise} The animation promise.\n   */\n  CalendarYearCtrl.prototype.animateDateChange = function(date) {\n    if (this.dateUtil.isValidDate(date)) {\n      var monthDistance = this.dateUtil.getYearDistance(this.calendarCtrl.firstRenderableDate, date);\n      this.calendarScroller.scrollTop = monthDistance * TBODY_HEIGHT;\n    }\n\n    return this.$q.when();\n  };\n\n  /**\n   * Handles the year-view-specific keyboard interactions.\n   * @param {Object} event Scope event object passed by the calendar.\n   * @param {String} action Action, corresponding to the key that was pressed.\n   */\n  CalendarYearCtrl.prototype.handleKeyEvent = function(event, action) {\n    var self = this;\n    var calendarCtrl = self.calendarCtrl;\n    var displayDate = calendarCtrl.displayDate;\n\n    if (action === 'select') {\n      self.changeDate(displayDate).then(function() {\n        self.onTimestampSelected(displayDate);\n      });\n    } else {\n      var date = null;\n      var dateUtil = self.dateUtil;\n\n      switch (action) {\n        case 'move-right': date = dateUtil.incrementMonths(displayDate, 1); break;\n        case 'move-left': date = dateUtil.incrementMonths(displayDate, -1); break;\n\n        case 'move-row-down': date = dateUtil.incrementMonths(displayDate, 6); break;\n        case 'move-row-up': date = dateUtil.incrementMonths(displayDate, -6); break;\n      }\n\n      if (date) {\n        var min = calendarCtrl.minDate ? dateUtil.getFirstDateOfMonth(calendarCtrl.minDate) : null;\n        var max = calendarCtrl.maxDate ? dateUtil.getFirstDateOfMonth(calendarCtrl.maxDate) : null;\n        date = dateUtil.getFirstDateOfMonth(self.dateUtil.clampDate(date, min, max));\n\n        self.changeDate(date).then(function() {\n          calendarCtrl.focusDate(date);\n        });\n      }\n    }\n  };\n\n  /**\n   * Attaches listeners for the scope events that are broadcast by the calendar.\n   */\n  CalendarYearCtrl.prototype.attachScopeListeners = function() {\n    var self = this;\n\n    self.$scope.$on('md-calendar-parent-changed', function(event, value) {\n      self.calendarCtrl.changeSelectedDate(value ? self.dateUtil.getFirstDateOfMonth(value) : value);\n      self.changeDate(value);\n    });\n\n    self.$scope.$on('md-calendar-parent-action', angular.bind(self, self.handleKeyEvent));\n  };\n\n  /**\n   * Handles the behavior when a date is selected. Depending on the `mode`\n   * of the calendar, this can either switch back to the calendar view or\n   * set the model value.\n   * @param {number} timestamp The selected timestamp.\n   */\n  CalendarYearCtrl.prototype.onTimestampSelected = function(timestamp) {\n    var calendarCtrl = this.calendarCtrl;\n\n    if (calendarCtrl.mode) {\n      this.$mdUtil.nextTick(function() {\n        // The timestamp has to be converted to a valid date.\n        calendarCtrl.setNgModelValue(new Date(timestamp));\n      });\n    } else {\n      calendarCtrl.setCurrentView('month', timestamp);\n    }\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/calendarYearBody.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('material.components.datepicker')\n      .directive('mdCalendarYearBody', mdCalendarYearDirective);\n\n  /**\n   * Private component, consumed by the md-calendar-year, which separates the DOM construction logic\n   * and allows for the year view to use md-virtual-repeat.\n   */\n  function mdCalendarYearDirective() {\n    return {\n      require: ['^^mdCalendar', '^^mdCalendarYear', 'mdCalendarYearBody'],\n      scope: { offset: '=mdYearOffset' },\n      controller: CalendarYearBodyCtrl,\n      controllerAs: 'mdYearBodyCtrl',\n      bindToController: true,\n      link: function(scope, element, attrs, controllers) {\n        var calendarCtrl = controllers[0];\n        var yearCtrl = controllers[1];\n        var yearBodyCtrl = controllers[2];\n\n        yearBodyCtrl.calendarCtrl = calendarCtrl;\n        yearBodyCtrl.yearCtrl = yearCtrl;\n\n        scope.$watch(function() { return yearBodyCtrl.offset; }, function(offset) {\n          if (angular.isNumber(offset)) {\n            yearBodyCtrl.generateContent();\n          }\n        });\n      }\n    };\n  }\n\n  /**\n   * Controller for a single year.\n   * @ngInject @constructor\n   */\n  function CalendarYearBodyCtrl($element, $$mdDateUtil, $mdDateLocale) {\n    /**\n     * @final\n     * @type {!JQLite}\n     */\n    this.$element = $element;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final */\n    this.dateLocale = $mdDateLocale;\n\n    /** @type {Object} Reference to the calendar. */\n    this.calendarCtrl = null;\n\n    /** @type {Object} Reference to the year view. */\n    this.yearCtrl = null;\n\n    /**\n     * Number of months from the start of the month \"items\" that the currently rendered month\n     * occurs. Set via angular data binding.\n     * @type {number|null}\n     */\n    this.offset = null;\n\n    /**\n     * Date cell to focus after appending the month to the document.\n     * @type {HTMLElement}\n     */\n    this.focusAfterAppend = null;\n  }\n\n  /** Generate and append the content for this year to the directive element. */\n  CalendarYearBodyCtrl.prototype.generateContent = function() {\n    var date = this.dateUtil.incrementYears(this.calendarCtrl.firstRenderableDate, this.offset);\n\n    this.$element\n      .empty()\n      .append(this.buildCalendarForYear(date));\n\n    if (this.focusAfterAppend) {\n      this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS);\n      this.focusAfterAppend = null;\n    }\n  };\n\n  /**\n   * Creates a single cell to contain a year in the calendar.\n   * @param {number} year Four-digit year.\n   * @param {number} month Zero-indexed month.\n   * @returns {HTMLElement}\n   */\n  CalendarYearBodyCtrl.prototype.buildMonthCell = function(year, month) {\n    var calendarCtrl = this.calendarCtrl;\n    var yearCtrl = this.yearCtrl;\n    var cell = this.buildBlankCell();\n\n    // Represent this month/year as a date.\n    var firstOfMonth = new Date(year, month, 1);\n    cell.setAttribute('aria-label', this.dateLocale.monthFormatter(firstOfMonth));\n    cell.id = calendarCtrl.getDateId(firstOfMonth, 'year');\n\n    // Use `data-timestamp` attribute because IE10 does not support the `dataset` property.\n    cell.setAttribute('data-timestamp', String(firstOfMonth.getTime()));\n\n    if (this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.today)) {\n      cell.classList.add(calendarCtrl.TODAY_CLASS);\n    }\n\n    if (this.dateUtil.isValidDate(calendarCtrl.selectedDate) &&\n        this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.selectedDate)) {\n      cell.classList.add(calendarCtrl.SELECTED_DATE_CLASS);\n      cell.setAttribute('aria-selected', 'true');\n    }\n\n    var cellText = this.dateLocale.shortMonths[month];\n\n    if (this.dateUtil.isMonthWithinRange(\n          firstOfMonth, calendarCtrl.minDate, calendarCtrl.maxDate) &&\n      (!angular.isFunction(calendarCtrl.monthFilter) ||\n        calendarCtrl.monthFilter(firstOfMonth))) {\n      var selectionIndicator = document.createElement('span');\n      selectionIndicator.classList.add('md-calendar-date-selection-indicator');\n      selectionIndicator.textContent = cellText;\n      cell.appendChild(selectionIndicator);\n      cell.addEventListener('click', yearCtrl.cellClickHandler);\n\n      if (calendarCtrl.displayDate &&\n          this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.displayDate)) {\n        this.focusAfterAppend = cell;\n      }\n    } else {\n      cell.classList.add('md-calendar-date-disabled');\n      cell.textContent = cellText;\n    }\n\n    return cell;\n  };\n\n  /**\n   * Builds a blank cell.\n   * @return {HTMLElement}\n   */\n  CalendarYearBodyCtrl.prototype.buildBlankCell = function() {\n    var cell = document.createElement('td');\n    cell.tabIndex = -1;\n    cell.classList.add('md-calendar-date');\n    cell.setAttribute('role', 'gridcell');\n\n    cell.setAttribute('tabindex', '-1');\n    return cell;\n  };\n\n  /**\n   * Builds the <tbody> content for the given year.\n   * @param {Date} date Date for which the content should be built.\n   * @returns {DocumentFragment} A document fragment containing the months within the year.\n   */\n  CalendarYearBodyCtrl.prototype.buildCalendarForYear = function(date) {\n    // Store rows for the month in a document fragment so that we can append them all at once.\n    var year = date.getFullYear();\n    var yearBody = document.createDocumentFragment();\n\n    var monthCell, i;\n    // First row contains label and Jan-Jun.\n    var firstRow = document.createElement('tr');\n    var labelCell = document.createElement('td');\n    labelCell.className = 'md-calendar-month-label';\n    labelCell.textContent = String(year);\n    firstRow.appendChild(labelCell);\n\n    for (i = 0; i < 6; i++) {\n      firstRow.appendChild(this.buildMonthCell(year, i));\n    }\n    yearBody.appendChild(firstRow);\n\n    // Second row contains a blank cell and Jul-Dec.\n    var secondRow = document.createElement('tr');\n    secondRow.appendChild(this.buildBlankCell());\n    for (i = 6; i < 12; i++) {\n      secondRow.appendChild(this.buildMonthCell(year, i));\n    }\n    yearBody.appendChild(secondRow);\n\n    return yearBody;\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/dateLocale.spec.js",
    "content": "describe('$mdDateLocale', function() {\n  var dateLocale, dateUtil;\n\n  // Fake $locale with made-up days and months.\n  var $localeFake = {\n    DATETIME_FORMATS: {\n      DAY: ['Sundog', 'Mondog', 'Tuesdog', 'Wednesdog', 'Thursdog', 'Fridog', 'Saturdog'],\n      SHORTDAY: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n      MONTH: ['JanZ', 'FebZ', 'MarZ', 'AprZ', 'MayZ', 'JunZ', 'JulZ', 'AugZ', 'SeptZ',\n          'OctZ', 'NovZ', 'DecZ'],\n      SHORTMONTH: ['JZ', 'FZ', 'MZ', 'AZ', 'MZ', 'JZ', 'JZ', 'AZ', 'SZ', 'OZ', 'NZ', 'DZ']\n    }\n  };\n\n  beforeEach(module('material.components.datepicker'));\n\n  describe('with default values', function() {\n    beforeEach(module(function($provide) {\n      $provide.value('$locale', $localeFake);\n    }));\n\n    beforeEach(inject(function($mdDateLocale, $$mdDateUtil) {\n      dateLocale = $mdDateLocale;\n      dateUtil = $$mdDateUtil;\n    }));\n\n    it('should expose default days, months, and dates', function() {\n      var expected = [undefined, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,\n                15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\n\n      expect(dateLocale.months).toEqual($localeFake.DATETIME_FORMATS.MONTH);\n      expect(dateLocale.shortMonths).toEqual($localeFake.DATETIME_FORMATS.SHORTMONTH);\n      expect(dateLocale.days).toEqual($localeFake.DATETIME_FORMATS.DAY);\n      expect(dateLocale.shortDays).toEqual(['S', 'M', 'T', 'W', 'T', 'F', 'S']);\n      expect(dateLocale.dates.length).toEqual(expected.length);\n    });\n\n    it('should have a default date formatter', function() {\n      var date = new Date(2014, 2, 25);\n      var dateStr = dateLocale.formatDate(date);\n      expect(dateStr).toEqual(jasmine.any(String));\n      expect(dateStr).toBeTruthy();\n    });\n\n    it('should have a default date parser', function() {\n      var dateStr = '2014-03-25';\n      expect(dateLocale.parseDate(dateStr)).toEqual(jasmine.any(Date));\n    });\n\n    it('should default to the US date formatting', function() {\n      var date = new Date(2014, 2, 25);\n      var dateStr = dateLocale.formatDate(date);\n      expect(dateStr).toBe('3/25/2014');\n    });\n\n    it('should have default date completion detection', function() {\n      // Valid dates.\n      expect(dateLocale.isDateComplete('04/05/15')).toBe(true);\n      expect(dateLocale.isDateComplete('04/05/2015')).toBe(true);\n      expect(dateLocale.isDateComplete('4/5/2015')).toBe(true);\n      expect(dateLocale.isDateComplete('2015 04 05')).toBe(true);\n      expect(dateLocale.isDateComplete('2015-04-05')).toBe(true);\n      expect(dateLocale.isDateComplete('2015,04,05')).toBe(true);\n      expect(dateLocale.isDateComplete('2015.04.05')).toBe(true);\n      expect(dateLocale.isDateComplete('April 5, 2015')).toBe(true);\n      expect(dateLocale.isDateComplete('April 5 2015')).toBe(true);\n      expect(dateLocale.isDateComplete('Apr 5, 2015')).toBe(true);\n      expect(dateLocale.isDateComplete('Apr 5 2015')).toBe(true);\n      expect(dateLocale.isDateComplete('2015 Apr 5')).toBe(true);\n\n      // Invalid dates.\n      expect(dateLocale.isDateComplete('5')).toBe(false);\n      expect(dateLocale.isDateComplete('4/5')).toBe(false);\n      expect(dateLocale.isDateComplete('04/05')).toBe(false);\n      expect(dateLocale.isDateComplete('Apr 5')).toBe(false);\n      expect(dateLocale.isDateComplete('April 5')).toBe(false);\n      expect(dateLocale.isDateComplete('April 5 200000')).toBe(false);\n    });\n  });\n\n  describe('with custom values', function() {\n    var fakeMonths = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'];\n    var fakeShortMonths = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'j', 'l'];\n    var fakeDays = ['D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'];\n    var fakeShortDays = ['1', '2', '3', '4', '5', '6', '7'];\n    var fakeDates = [undefined, 'X1', 'X2', 'X3', 'X4', 'X5', 'X6', 'X7', 'X8', 'X9', 'X10', 'X11',\n        'X12', 'X13', 'X14', 'X15', 'X16', 'X17', 'X18', 'X19', 'X20', 'X21', 'X22', 'X23', 'X24',\n        'X25', 'X26', 'X27', 'X28', 'X29', 'X30', 'X31'];\n\n    beforeEach(module(function($mdDateLocaleProvider) {\n      $mdDateLocaleProvider.months = fakeMonths;\n      $mdDateLocaleProvider.shortMonths = fakeShortMonths;\n      $mdDateLocaleProvider.days = fakeDays;\n      $mdDateLocaleProvider.shortDays = fakeShortDays;\n      $mdDateLocaleProvider.dates = fakeDates;\n      $mdDateLocaleProvider.formatDate = function() {\n        return 'Your birthday!';\n      };\n      $mdDateLocaleProvider.parseDate = function() {\n        return new Date(1969, 6, 16);\n      };\n      $mdDateLocaleProvider.isDateComplete = function(dateString) {\n        return dateString === 'The One True Date';\n      };\n    }));\n\n\n    beforeEach(inject(function($mdDateLocale, $$mdDateUtil) {\n      dateLocale = $mdDateLocale;\n      dateUtil = $$mdDateUtil;\n    }));\n\n    it('should expose custom settings', function() {\n      expect(dateLocale.months).toEqual(fakeMonths);\n      expect(dateLocale.shortMonths).toEqual(fakeShortMonths);\n      expect(dateLocale.days).toEqual(fakeDays);\n      expect(dateLocale.shortDays).toEqual(fakeShortDays);\n      expect(dateLocale.dates).toEqual(fakeDates);\n      expect(dateLocale.formatDate(new Date())).toEqual('Your birthday!');\n      expect(dateLocale.parseDate('2020-01-20')).toEqual(new Date(1969, 6, 16));\n      expect(dateLocale.parseDate('2020-01-20')).toEqual(new Date(1969, 6, 16));\n      expect(dateLocale.isDateComplete('The One True Date')).toBe(true);\n      expect(dateLocale.isDateComplete('Anything Else')).toBe(false);\n    });\n  });\n\n  describe('with MomentJS custom formatting', function() {\n    beforeEach(module(function($mdDateLocaleProvider) {\n      $mdDateLocaleProvider.formatDate = function(date) {\n        return date ? moment(date).format('M/D') : '';\n      };\n      $mdDateLocaleProvider.parseDate = function(dateString) {\n        var m = moment(dateString, 'M/D', true);\n        return m.isValid() ? m.toDate() : new Date(NaN);\n      };\n      $mdDateLocaleProvider.isDateComplete = function(dateString) {\n        dateString = dateString.trim();\n        // Look for two chunks of content (either numbers or text) separated by delimiters.\n        var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-]))([a-zA-Z]{3,}|[0-9]{1,4})/;\n        return re.test(dateString);\n      };\n    }));\n\n    beforeEach(inject(function($mdDateLocale, $$mdDateUtil) {\n      dateLocale = $mdDateLocale;\n      dateUtil = $$mdDateUtil;\n    }));\n\n    it('should respect custom formatting', function() {\n      var now = new Date();\n      expect(dateLocale.formatDate(new Date('2020-08-31T00:00:00-04:00'))).toEqual('8/31');\n      expect(dateLocale.parseDate('8/31')).toEqual(new Date(now.getFullYear(), 7, 31));\n      expect(dateLocale.parseDate('1/1')).toEqual(new Date(now.getFullYear(), 0, 1));\n      expect(dateLocale.isDateComplete('8/31')).toBe(true);\n      expect(dateLocale.isDateComplete('8-31')).toBe(true);\n      expect(dateLocale.isDateComplete('August_31st')).toBe(false);\n      expect(dateLocale.isDateComplete('2020')).toBe(false);\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/datepicker/js/dateLocaleProvider.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc service\n   * @name $mdDateLocaleProvider\n   * @module material.components.datepicker\n   *\n   * @description\n   * The `$mdDateLocaleProvider` is the provider that creates the `$mdDateLocale` service.\n   * This provider that allows the user to specify messages, formatters, and parsers for date\n   * internationalization. The `$mdDateLocale` service itself is consumed by AngularJS Material\n   * components that deal with dates\n   * (i.e. <a ng-href=\"api/directive/mdDatepicker\">mdDatepicker</a>).\n   *\n   * @property {Array<string>} months Array of month names (in order).\n   * @property {Array<string>} shortMonths Array of abbreviated month names.\n   * @property {Array<string>} days Array of the days of the week (in order).\n   * @property {Array<string>} shortDays Array of abbreviated days of the week.\n   * @property {Array<string>} dates Array of dates of the month. Only necessary for locales\n   *  using a numeral system other than [1, 2, 3...].\n   * @property {Array<string>} firstDayOfWeek The first day of the week. Sunday = 0, Monday = 1,\n   *  etc.\n   * @property {function(string): Date} parseDate Function that converts a date string to a Date\n   *  object (the date portion).\n   * @property {function(Date, string): string} formatDate Function to format a date object to a\n   *  string. The datepicker directive also provides the time zone, if it was specified.\n   * @property {function(Date): string} monthHeaderFormatter Function that returns the label for\n   *  a month given a date.\n   * @property {function(Date): string} monthFormatter Function that returns the full name of a month\n   *  for a given date.\n   * @property {function(number): string} weekNumberFormatter Function that returns a label for\n   *  a week given the week number.\n   * @property {function(Date): string} longDateFormatter Function that formats a date into a long\n   *  `aria-label` that is read by the screen reader when the focused date changes.\n   * @property {string} msgCalendar Translation of the label \"Calendar\" for the current locale.\n   * @property {string} msgOpenCalendar Translation of the button label \"Open calendar\" for the\n   *  current locale.\n   * @property {Date} firstRenderableDate The date from which the datepicker calendar will begin\n   *  rendering. Note that this will be ignored if a minimum date is set.\n   *  Defaults to January 1st 1880.\n   * @property {Date} lastRenderableDate The last date that will be rendered by the datepicker\n   *  calendar. Note that this will be ignored if a maximum date is set.\n   *  Defaults to January 1st 2130.\n   * @property {function(string): boolean} isDateComplete Function to determine whether a string\n   *  makes sense to be parsed to a `Date` object. Returns `true` if the date appears to be complete\n   *  and parsing should occur. By default, this checks for 3 groups of text or numbers separated\n   *  by delimiters. This means that by default, date strings must include a month, day, and year\n   *  to be parsed and for the model to be updated.\n   *\n   * @usage\n   * <hljs lang=\"js\">\n   * myAppModule.config(function($mdDateLocaleProvider) {\n   *\n   *     // Example of a French localization.\n   *     $mdDateLocaleProvider.months = ['janvier', 'février', 'mars', ...];\n   *     $mdDateLocaleProvider.shortMonths = ['janv', 'févr', 'mars', ...];\n   *     $mdDateLocaleProvider.days = ['dimanche', 'lundi', 'mardi', ...];\n   *     $mdDateLocaleProvider.shortDays = ['Di', 'Lu', 'Ma', ...];\n   *\n   *     // Can change week display to start on Monday.\n   *     $mdDateLocaleProvider.firstDayOfWeek = 1;\n   *\n   *     // Optional.\n   *     $mdDateLocaleProvider.dates = [1, 2, 3, 4, 5, 6, ...];\n   *\n   *     // Example uses moment.js to parse and format dates.\n   *     $mdDateLocaleProvider.parseDate = function(dateString) {\n   *       var m = moment(dateString, 'L', true);\n   *       return m.isValid() ? m.toDate() : new Date(NaN);\n   *     };\n   *\n   *     $mdDateLocaleProvider.formatDate = function(date) {\n   *       var m = moment(date);\n   *       return m.isValid() ? m.format('L') : '';\n   *     };\n   *\n   *     // Allow only a day and month to be specified.\n   *     // This is required if using the 'M/D' format with moment.js.\n   *     $mdDateLocaleProvider.isDateComplete = function(dateString) {\n   *       dateString = dateString.trim();\n   *\n   *       // Look for two chunks of content (either numbers or text) separated by delimiters.\n   *       var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-]))([a-zA-Z]{3,}|[0-9]{1,4})/;\n   *       return re.test(dateString);\n   *     };\n   *\n   *     $mdDateLocaleProvider.monthHeaderFormatter = function(date) {\n   *       return myShortMonths[date.getMonth()] + ' ' + date.getFullYear();\n   *     };\n   *\n   *     // In addition to date display, date components also need localized messages\n   *     // for aria-labels for screen-reader users.\n   *\n   *     $mdDateLocaleProvider.weekNumberFormatter = function(weekNumber) {\n   *       return 'Semaine ' + weekNumber;\n   *     };\n   *\n   *     $mdDateLocaleProvider.msgCalendar = 'Calendrier';\n   *     $mdDateLocaleProvider.msgOpenCalendar = 'Ouvrir le calendrier';\n   *\n   *     // You can also set when your calendar begins and ends.\n   *     $mdDateLocaleProvider.firstRenderableDate = new Date(1776, 6, 4);\n   *     $mdDateLocaleProvider.lastRenderableDate = new Date(2012, 11, 21);\n   * });\n   * </hljs>\n   *\n   */\n  angular.module('material.components.datepicker').config(function($provide) {\n    // TODO(jelbourn): Assert provided values are correctly formatted. Need assertions.\n\n    /** @constructor */\n    function DateLocaleProvider() {\n      /** Array of full month names. E.g., ['January', 'February', ...] */\n      this.months = null;\n\n      /** Array of abbreviated month names. E.g., ['Jan', 'Feb', ...] */\n      this.shortMonths = null;\n\n      /** Array of full day of the week names. E.g., ['Monday', 'Tuesday', ...] */\n      this.days = null;\n\n      /** Array of abbreviated dat of the week names. E.g., ['M', 'T', ...] */\n      this.shortDays = null;\n\n      /** Array of dates of a month (1 - 31). Characters might be different in some locales. */\n      this.dates = null;\n\n      /** Index of the first day of the week. 0 = Sunday, 1 = Monday, etc. */\n      this.firstDayOfWeek = 0;\n\n      /**\n       * Function that converts the date portion of a Date to a string.\n       * @type {(function(Date): string)}\n       */\n      this.formatDate = null;\n\n      /**\n       * Function that converts a date string to a Date object (the date portion)\n       * @type {function(string): Date}\n       */\n      this.parseDate = null;\n\n      /**\n       * Function that formats a Date into a month header string.\n       * @type {function(Date): string}\n       */\n      this.monthHeaderFormatter = null;\n\n      /**\n       * Function that formats a week number into a label for the week.\n       * @type {function(number): string}\n       */\n      this.weekNumberFormatter = null;\n\n      /**\n       * Function that formats a date into a long aria-label that is read\n       * when the focused date changes.\n       * @type {function(Date): string}\n       */\n      this.longDateFormatter = null;\n\n      /**\n       * Function to determine whether a string makes sense to be\n       * parsed to a Date object.\n       * @type {function(string): boolean}\n       */\n      this.isDateComplete = null;\n\n      /**\n       * ARIA label for the calendar \"dialog\" used in the datepicker.\n       * @type {string}\n       */\n      this.msgCalendar = '';\n\n      /**\n       * ARIA label for the datepicker's \"Open calendar\" buttons.\n       * @type {string}\n       */\n      this.msgOpenCalendar = '';\n    }\n\n    /**\n     * Factory function that returns an instance of the dateLocale service.\n     * @ngInject\n     * @param $locale\n     * @param $filter\n     * @returns {DateLocale}\n     */\n    DateLocaleProvider.prototype.$get = function($locale, $filter) {\n      /**\n       * Default date-to-string formatting function.\n       * @param {!Date} date\n       * @param {string=} timezone\n       * @returns {string}\n       */\n      function defaultFormatDate(date, timezone) {\n        if (!date) {\n          return '';\n        }\n\n        // All of the dates created through ng-material *should* be set to midnight.\n        // If we encounter a date where the localeTime shows at 11pm instead of midnight,\n        // we have run into an issue with DST where we need to increment the hour by one:\n        // var d = new Date(1992, 9, 8, 0, 0, 0);\n        // d.toLocaleString(); // == \"10/7/1992, 11:00:00 PM\"\n        var localeTime = date.toLocaleTimeString();\n        var formatDate = date;\n        if (date.getHours() === 0 &&\n            (localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) {\n          formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0);\n        }\n\n        return $filter('date')(formatDate, 'M/d/yyyy', timezone);\n      }\n\n      /**\n       * Default string-to-date parsing function.\n       * @param {string|number} dateString\n       * @returns {!Date}\n       */\n      function defaultParseDate(dateString) {\n        return new Date(dateString);\n      }\n\n      /**\n       * Default function to determine whether a string makes sense to be\n       * parsed to a Date object.\n       *\n       * This is very permissive and is just a basic check to ensure that\n       * things like single integers aren't able to be parsed into dates.\n       * @param {string} dateString\n       * @returns {boolean}\n       */\n      function defaultIsDateComplete(dateString) {\n        dateString = dateString.trim();\n\n        // Looks for three chunks of content (either numbers or text) separated\n        // by delimiters.\n        var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-])){2}([a-zA-Z]{3,}|[0-9]{1,4})$/;\n        return re.test(dateString);\n      }\n\n      /**\n       * Default date-to-string formatter to get a month header.\n       * @param {!Date} date\n       * @returns {string}\n       */\n      function defaultMonthHeaderFormatter(date) {\n        return service.shortMonths[date.getMonth()] + ' ' + date.getFullYear();\n      }\n\n      /**\n       * Default formatter for a month.\n       * @param {!Date} date\n       * @returns {string}\n       */\n      function defaultMonthFormatter(date) {\n        return service.months[date.getMonth()] + ' ' + date.getFullYear();\n      }\n\n      /**\n       * Default week number formatter.\n       * @param number\n       * @returns {string}\n       */\n      function defaultWeekNumberFormatter(number) {\n        return 'Week ' + number;\n      }\n\n      /**\n       * Default formatter for date cell aria-labels.\n       * @param {!Date} date\n       * @returns {string}\n       */\n      function defaultLongDateFormatter(date) {\n        // Example: 'Thursday June 18 2015'\n        return [\n          service.days[date.getDay()],\n          service.months[date.getMonth()],\n          service.dates[date.getDate()],\n          date.getFullYear()\n        ].join(' ');\n      }\n\n      // The default \"short\" day strings are the first character of each day,\n      // e.g., \"Monday\" => \"M\".\n      var defaultShortDays = $locale.DATETIME_FORMATS.SHORTDAY.map(function(day) {\n        return day.substring(0, 1);\n      });\n\n      // The default dates are simply the numbers 1 through 31.\n      var defaultDates = Array(32);\n      for (var i = 1; i <= 31; i++) {\n        defaultDates[i] = i;\n      }\n\n      // Default ARIA messages are in English (US).\n      var defaultMsgCalendar = 'Calendar';\n      var defaultMsgOpenCalendar = 'Open calendar';\n\n      // Default start/end dates that are rendered in the calendar.\n      var defaultFirstRenderableDate = new Date(1880, 0, 1);\n      var defaultLastRendereableDate = new Date(defaultFirstRenderableDate.getFullYear() + 250, 0, 1);\n\n      var service = {\n        months: this.months || $locale.DATETIME_FORMATS.MONTH,\n        shortMonths: this.shortMonths || $locale.DATETIME_FORMATS.SHORTMONTH,\n        days: this.days || $locale.DATETIME_FORMATS.DAY,\n        shortDays: this.shortDays || defaultShortDays,\n        dates: this.dates || defaultDates,\n        firstDayOfWeek: this.firstDayOfWeek || 0,\n        formatDate: this.formatDate || defaultFormatDate,\n        parseDate: this.parseDate || defaultParseDate,\n        isDateComplete: this.isDateComplete || defaultIsDateComplete,\n        monthHeaderFormatter: this.monthHeaderFormatter || defaultMonthHeaderFormatter,\n        monthFormatter: this.monthFormatter || defaultMonthFormatter,\n        weekNumberFormatter: this.weekNumberFormatter || defaultWeekNumberFormatter,\n        longDateFormatter: this.longDateFormatter || defaultLongDateFormatter,\n        msgCalendar: this.msgCalendar || defaultMsgCalendar,\n        msgOpenCalendar: this.msgOpenCalendar || defaultMsgOpenCalendar,\n        firstRenderableDate: this.firstRenderableDate || defaultFirstRenderableDate,\n        lastRenderableDate: this.lastRenderableDate || defaultLastRendereableDate\n      };\n\n      return service;\n    };\n\n    $provide.provider('$mdDateLocale', new DateLocaleProvider());\n  });\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/dateUtil.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * Utility for performing date calculations to facilitate operation of the calendar and\n   * datepicker.\n   */\n  angular.module('material.components.datepicker').factory('$$mdDateUtil', function($mdDateLocale) {\n    return {\n      getFirstDateOfMonth: getFirstDateOfMonth,\n      getNumberOfDaysInMonth: getNumberOfDaysInMonth,\n      getDateInNextMonth: getDateInNextMonth,\n      getDateInPreviousMonth: getDateInPreviousMonth,\n      isInNextMonth: isInNextMonth,\n      isInPreviousMonth: isInPreviousMonth,\n      getDateMidpoint: getDateMidpoint,\n      isSameMonthAndYear: isSameMonthAndYear,\n      getWeekOfMonth: getWeekOfMonth,\n      incrementDays: incrementDays,\n      incrementMonths: incrementMonths,\n      getLastDateOfMonth: getLastDateOfMonth,\n      isSameDay: isSameDay,\n      getMonthDistance: getMonthDistance,\n      isValidDate: isValidDate,\n      setDateTimeToMidnight: setDateTimeToMidnight,\n      createDateAtMidnight: createDateAtMidnight,\n      isDateWithinRange: isDateWithinRange,\n      incrementYears: incrementYears,\n      getYearDistance: getYearDistance,\n      clampDate: clampDate,\n      getTimestampFromNode: getTimestampFromNode,\n      isMonthWithinRange: isMonthWithinRange,\n      removeLocalTzAndReparseDate: removeLocalTzAndReparseDate\n    };\n\n    /**\n     * Gets the first day of the month for the given date's month.\n     * @param {Date} date\n     * @returns {Date}\n     */\n    function getFirstDateOfMonth(date) {\n      return new Date(date.getFullYear(), date.getMonth(), 1);\n    }\n\n    /**\n     * Gets the number of days in the month for the given date's month.\n     * @param date\n     * @returns {number}\n     */\n    function getNumberOfDaysInMonth(date) {\n      return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n    }\n\n    /**\n     * Get an arbitrary date in the month after the given date's month.\n     * @param date\n     * @returns {Date}\n     */\n    function getDateInNextMonth(date) {\n      return new Date(date.getFullYear(), date.getMonth() + 1, 1);\n    }\n\n    /**\n     * Get an arbitrary date in the month before the given date's month.\n     * @param date\n     * @returns {Date}\n     */\n    function getDateInPreviousMonth(date) {\n      return new Date(date.getFullYear(), date.getMonth() - 1, 1);\n    }\n\n    /**\n     * Gets whether two dates have the same month and year.\n     * @param {Date} d1\n     * @param {Date} d2\n     * @returns {boolean}\n     */\n    function isSameMonthAndYear(d1, d2) {\n      return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth();\n    }\n\n    /**\n     * Gets whether two dates are the same day (not not necessarily the same time).\n     * @param {Date} d1\n     * @param {Date} d2\n     * @returns {boolean}\n     */\n    function isSameDay(d1, d2) {\n      return d1.getDate() == d2.getDate() && isSameMonthAndYear(d1, d2);\n    }\n\n    /**\n     * Gets whether a date is in the month immediately after some date.\n     * @param {Date} startDate The date from which to compare.\n     * @param {Date} endDate The date to check.\n     * @returns {boolean}\n     */\n    function isInNextMonth(startDate, endDate) {\n      var nextMonth = getDateInNextMonth(startDate);\n      return isSameMonthAndYear(nextMonth, endDate);\n    }\n\n    /**\n     * Gets whether a date is in the month immediately before some date.\n     * @param {Date} startDate The date from which to compare.\n     * @param {Date} endDate The date to check.\n     * @returns {boolean}\n     */\n    function isInPreviousMonth(startDate, endDate) {\n      var previousMonth = getDateInPreviousMonth(startDate);\n      return isSameMonthAndYear(endDate, previousMonth);\n    }\n\n    /**\n     * Gets the midpoint between two dates.\n     * @param {Date} d1\n     * @param {Date} d2\n     * @returns {Date}\n     */\n    function getDateMidpoint(d1, d2) {\n      return createDateAtMidnight((d1.getTime() + d2.getTime()) / 2);\n    }\n\n    /**\n     * Gets the week of the month that a given date occurs in.\n     * @param {Date} date\n     * @returns {number} Index of the week of the month (zero-based).\n     */\n    function getWeekOfMonth(date) {\n      var firstDayOfMonth = getFirstDateOfMonth(date);\n      return Math.floor((firstDayOfMonth.getDay() + date.getDate() - 1) / 7);\n    }\n\n    /**\n     * Gets a new date incremented by the given number of days. Number of days can be negative.\n     * @param {Date} date\n     * @param {number} numberOfDays\n     * @returns {Date}\n     */\n    function incrementDays(date, numberOfDays) {\n      return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);\n    }\n\n    /**\n     * Gets a new date incremented by the given number of months. Number of months can be negative.\n     * If the date of the given month does not match the target month, the date will be set to the\n     * last day of the month.\n     * @param {Date} date\n     * @param {number} numberOfMonths\n     * @returns {Date}\n     */\n    function incrementMonths(date, numberOfMonths) {\n      // If the same date in the target month does not actually exist, the Date object will\n      // automatically advance *another* month by the number of missing days.\n      // For example, if you try to go from Jan. 30 to Feb. 30, you'll end up on March 2.\n      // So, we check if the month overflowed and go to the last day of the target month instead.\n      var dateInTargetMonth = new Date(date.getFullYear(), date.getMonth() + numberOfMonths, 1);\n      var numberOfDaysInMonth = getNumberOfDaysInMonth(dateInTargetMonth);\n      if (numberOfDaysInMonth < date.getDate()) {\n        dateInTargetMonth.setDate(numberOfDaysInMonth);\n      } else {\n        dateInTargetMonth.setDate(date.getDate());\n      }\n\n      return dateInTargetMonth;\n    }\n\n    /**\n     * Get the integer distance between two months. This *only* considers the month and year\n     * portion of the Date instances.\n     *\n     * @param {Date} start\n     * @param {Date} end\n     * @returns {number} Number of months between `start` and `end`. If `end` is before `start`\n     *     chronologically, this number will be negative.\n     */\n    function getMonthDistance(start, end) {\n      return (12 * (end.getFullYear() - start.getFullYear())) + (end.getMonth() - start.getMonth());\n    }\n\n    /**\n     * Gets the last day of the month for the given date.\n     * @param {Date} date\n     * @returns {Date}\n     */\n    function getLastDateOfMonth(date) {\n      return new Date(date.getFullYear(), date.getMonth(), getNumberOfDaysInMonth(date));\n    }\n\n    /**\n     * Checks whether a date is valid.\n     * @param {Date} date\n     * @return {boolean} Whether the date is a valid Date.\n     */\n    function isValidDate(date) {\n      return date && date.getTime && !isNaN(date.getTime());\n    }\n\n    /**\n     * Sets a date's time to midnight.\n     * @param {Date} date\n     */\n    function setDateTimeToMidnight(date) {\n      if (isValidDate(date)) {\n        date.setHours(0, 0, 0, 0);\n      }\n    }\n\n    /**\n     * Creates a date with the time set to midnight.\n     * Drop-in replacement for two forms of the Date constructor via opt_value.\n     * @param {number|Date=} opt_value Leave undefined for a Date representing now. Or use a\n     *  single value representing the number of seconds since the Unix Epoch or a Date object.\n     * @return {Date} New date with time set to midnight.\n     */\n    function createDateAtMidnight(opt_value) {\n      var date;\n      if (angular.isDate(opt_value)) {\n        date = opt_value;\n      } else if (angular.isNumber(opt_value)) {\n        date = new Date(opt_value);\n      } else {\n        date = new Date();\n      }\n      setDateTimeToMidnight(date);\n      return date;\n    }\n\n     /**\n      * Checks if a date is within a min and max range, ignoring the time component.\n      * If minDate or maxDate are not dates, they are ignored.\n      * @param {Date} date\n      * @param {Date} minDate\n      * @param {Date} maxDate\n      */\n     function isDateWithinRange(date, minDate, maxDate) {\n       var dateAtMidnight = createDateAtMidnight(date);\n       var minDateAtMidnight = isValidDate(minDate) ? createDateAtMidnight(minDate) : null;\n       var maxDateAtMidnight = isValidDate(maxDate) ? createDateAtMidnight(maxDate) : null;\n       return (!minDateAtMidnight || minDateAtMidnight <= dateAtMidnight) &&\n           (!maxDateAtMidnight || maxDateAtMidnight >= dateAtMidnight);\n     }\n\n    /**\n     * Gets a new date incremented by the given number of years. Number of years can be negative.\n     * See `incrementMonths` for notes on overflow for specific dates.\n     * @param {Date} date\n     * @param {number} numberOfYears\n     * @returns {Date}\n     */\n     function incrementYears(date, numberOfYears) {\n       return incrementMonths(date, numberOfYears * 12);\n     }\n\n     /**\n      * Get the integer distance between two years. This *only* considers the year portion of the\n      * Date instances.\n      *\n      * @param {Date} start\n      * @param {Date} end\n      * @returns {number} Number of months between `start` and `end`. If `end` is before `start`\n      *     chronologically, this number will be negative.\n      */\n     function getYearDistance(start, end) {\n       return end.getFullYear() - start.getFullYear();\n     }\n\n     /**\n      * Clamps a date between a minimum and a maximum date.\n      * @param {Date} date Date to be clamped\n      * @param {Date=} minDate Minimum date\n      * @param {Date=} maxDate Maximum date\n      * @return {Date}\n      */\n     function clampDate(date, minDate, maxDate) {\n       var boundDate = date;\n       if (minDate && date < minDate) {\n         boundDate = new Date(minDate.getTime());\n       }\n       if (maxDate && date > maxDate) {\n         boundDate = new Date(maxDate.getTime());\n       }\n       return boundDate;\n     }\n\n     /**\n      * Extracts and parses the timestamp from a DOM node.\n      * @param  {HTMLElement} node Node from which the timestamp will be extracted.\n      * @return {number} Time since epoch.\n      */\n     function getTimestampFromNode(node) {\n       if (node && node.hasAttribute('data-timestamp')) {\n         return Number(node.getAttribute('data-timestamp'));\n       }\n     }\n\n     /**\n      * Checks if a month is within a min and max range, ignoring the date and time components.\n      * If minDate or maxDate are not dates, they are ignored.\n      * @param {Date} date\n      * @param {Date} minDate\n      * @param {Date} maxDate\n      */\n     function isMonthWithinRange(date, minDate, maxDate) {\n       var month = date.getMonth();\n       var year = date.getFullYear();\n\n       return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) &&\n        (!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month);\n     }\n\n    /**\n     * @param {Date} value date in local timezone\n     * @return {Date} date with local timezone offset removed\n     */\n    function removeLocalTzAndReparseDate(value) {\n      var dateValue, formattedDate;\n      // Remove the local timezone offset before calling formatDate.\n      dateValue = new Date(value.getTime() + 60000 * value.getTimezoneOffset());\n      formattedDate = $mdDateLocale.formatDate(dateValue);\n      // parseDate only works with a date formatted by formatDate when using Moment validation.\n      return $mdDateLocale.parseDate(formattedDate);\n    }\n  });\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/dateUtil.spec.js",
    "content": "\ndescribe('$$mdDateUtil', function() {\n  // When constructing a Date, the month is zero-based. This can be confusing, since people are\n  // used to seeing them one-based. So we create these aliases to make reading the tests easier.\n  var JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,\n      NOV = 10, DEC = 11;\n\n  var dateUtil;\n\n  beforeEach(module('material.components.datepicker'));\n\n  beforeEach(inject(function($$mdDateUtil) {\n    dateUtil = $$mdDateUtil;\n  }));\n\n  it('should get the first day of a month', function() {\n    var first = dateUtil.getFirstDateOfMonth(new Date(1985, OCT, 26));\n\n    expect(first.getFullYear()).toBe(1985);\n    expect(first.getMonth()).toBe(9);\n    expect(first.getDate()).toBe(1);\n  });\n\n  it('should get the first day of the month from the first day of the month', function() {\n    var first = dateUtil.getFirstDateOfMonth(new Date(1985, OCT, 1));\n\n    expect(first.getFullYear()).toBe(1985);\n    expect(first.getMonth()).toBe(9);\n    expect(first.getDate()).toBe(1);\n  });\n\n  it('should get the number of days in a month', function() {\n    // Month with 31 days.\n    expect(dateUtil.getNumberOfDaysInMonth(new Date(2015, JAN, 1))).toBe(31);\n\n    // Month with 30 days.\n    expect(dateUtil.getNumberOfDaysInMonth(new Date(2015, APR, 1))).toBe(30);\n\n    // Month with 28 days\n    expect(dateUtil.getNumberOfDaysInMonth(new Date(2015, FEB, 1))).toBe(28);\n\n    // Month with 29 days.\n    expect(dateUtil.getNumberOfDaysInMonth(new Date(2012, FEB, 1))).toBe(29);\n  });\n\n  it('should get an arbitrary day in the next month', function() {\n    // Next month in the same year.\n    var next = dateUtil.getDateInNextMonth(new Date(2015, JAN, 1));\n    expect(next.getMonth()).toBe(1);\n    expect(next.getFullYear()).toBe(2015);\n\n    // Next month in the following year.\n    next = dateUtil.getDateInNextMonth(new Date(2015, DEC, 1));\n    expect(next.getMonth()).toBe(0);\n    expect(next.getFullYear()).toBe(2016);\n  });\n\n  it('should get an arbitrary day in the previous month', function() {\n    // Previous month in the same year.\n    var next = dateUtil.getDateInPreviousMonth(new Date(2015, JUL, 1));\n    expect(next.getMonth()).toBe(5);\n    expect(next.getFullYear()).toBe(2015);\n\n    // Previous month in the past year.\n    next = dateUtil.getDateInPreviousMonth(new Date(2015, JAN, 1));\n    expect(next.getMonth()).toBe(11);\n    expect(next.getFullYear()).toBe(2014);\n  });\n\n  it('should check whether two dates are in the same month and year', function() {\n    // Same month and year.\n    var first = new Date(2015, APR, 30);\n    var second = new Date(2015, APR, 1);\n    expect(dateUtil.isSameMonthAndYear(first, second)).toBe(true);\n\n    // Same exact day.\n    first = new Date(2015, APR, 1);\n    second = new Date(2015, APR, 1);\n    expect(dateUtil.isSameMonthAndYear(first, second)).toBe(true);\n\n    // Same month, different year.\n    first = new Date(2015, APR, 30);\n    second = new Date(2005, APR, 1);\n    expect(dateUtil.isSameMonthAndYear(first, second)).toBe(false);\n\n    // Same year, different month.\n    first = new Date(2015, APR, 30);\n    second = new Date(2015, JUL, 1);\n    expect(dateUtil.isSameMonthAndYear(first, second)).toBe(false);\n\n    // Different month and year.\n    first = new Date(2012, APR, 30);\n    second = new Date(2015, JUL, 1);\n    expect(dateUtil.isSameMonthAndYear(first, second)).toBe(false);\n  });\n\n  it('should check whether two dates are the same day', function() {\n    // Same exact day and time.\n    var first = new Date(2015, APR, 1);\n    var second = new Date(2015, APR, 1);\n    expect(dateUtil.isSameDay(first, second)).toBe(true);\n\n    // Same day, different time.\n    first = new Date(2015, APR, 30, 3);\n    second = new Date(2015, APR, 30, 4);\n    expect(dateUtil.isSameDay(first, second)).toBe(true);\n\n    // Same month and year, different day.\n    first = new Date(2015, APR, 30);\n    second = new Date(2015, APR, 1);\n    expect(dateUtil.isSameDay(first, second)).toBe(false);\n\n    // Same month, different year.\n    first = new Date(2015, APR, 30);\n    second = new Date(2005, APR, 30);\n    expect(dateUtil.isSameDay(first, second)).toBe(false);\n\n    // Same year, different month.\n    first = new Date(2015, APR, 30);\n    second = new Date(2015, JUL, 30);\n    expect(dateUtil.isSameDay(first, second)).toBe(false);\n\n    // Different month and year.\n    first = new Date(2012, APR, 30);\n    second = new Date(2015, JUL, 30);\n    expect(dateUtil.isSameDay(first, second)).toBe(false);\n  });\n\n  it('should check whether a date is in the next month', function() {\n    // Next month within the same year.\n    var first = new Date(2015, JUL, 15);\n    var second = new Date(2015, AUG, 25);\n    expect(dateUtil.isInNextMonth(first, second)).toBe(true);\n\n    // Next month across years.\n    first = new Date(2015, DEC, 15);\n    second = new Date(2016, JAN, 25);\n    expect(dateUtil.isInNextMonth(first, second)).toBe(true);\n\n    // Not in the next month (past, same year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2015, APR, 25);\n    expect(dateUtil.isInNextMonth(first, second)).toBe(false);\n\n    // Not in the next month (future, same year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2015, AUG, 25);\n    expect(dateUtil.isInNextMonth(first, second)).toBe(false);\n\n    // Not in the next month (month + 1 in different year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2016, JUL, 25);\n    expect(dateUtil.isInNextMonth(first, second)).toBe(false);\n  });\n\n  it('should check whether a date is in the previous month', function() {\n    // Previous month within the same year.\n    var first = new Date(2015, AUG, 15);\n    var second = new Date(2015, JUL, 25);\n    expect(dateUtil.isInPreviousMonth(first, second)).toBe(true);\n\n    // Previous month across years.\n    first = new Date(2015, JAN, 15);\n    second = new Date(2014, DEC, 25);\n    expect(dateUtil.isInPreviousMonth(first, second)).toBe(true);\n\n    // Not in the previous month (past, same year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2015, APR, 25);\n    expect(dateUtil.isInPreviousMonth(first, second)).toBe(false);\n\n    // Not in the previous month (future, same year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2015, AUG, 25);\n    expect(dateUtil.isInPreviousMonth(first, second)).toBe(false);\n\n    // Not in the previous month (month - 1 in different year).\n    first = new Date(2015, JUN, 15);\n    second = new Date(2016, MAY, 25);\n    expect(dateUtil.isInPreviousMonth(first, second)).toBe(false);\n  });\n\n  it('should get the midpoint between two dates', function() {\n    var start = new Date(2010, MAR, 10);\n    var end = new Date(2010, MAR, 20);\n    var midpoint = dateUtil.getDateMidpoint(start, end);\n\n    expect(midpoint.getTime()).toEqual(new Date(2010, MAR, 15).getTime());\n  });\n\n  it('should get the week of the month in which a given date appears', function() {\n    // May 2015 spans 6 weeks.\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 1))).toBe(0);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 8))).toBe(1);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 15))).toBe(2);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 22))).toBe(3);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 29))).toBe(4);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, MAY, 31))).toBe(5);\n\n    // Feb 2015 spans 4 weeks. Check both the first and last day of each week.\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 1))).toBe(0);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 7))).toBe(0);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 8))).toBe(1);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 14))).toBe(1);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 15))).toBe(2);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 21))).toBe(2);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 22))).toBe(3);\n    expect(dateUtil.getWeekOfMonth(new Date(2015, FEB, 28))).toBe(3);\n  });\n\n  it('should increment a date by a number of days', function() {\n    // Increment by one.\n    var start = new Date(2015, MAY, 15);\n    var end = new Date(2015, MAY, 16);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, 1), end)).toBe(true);\n\n    // Negative by negative one.\n    start = new Date(2015, MAY, 15);\n    end = new Date(2015, MAY, 14);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, -1), end)).toBe(true);\n\n    // Into next month.\n    start = new Date(2015, MAY, 31);\n    end = new Date(2015, JUN, 1);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, 1), end)).toBe(true);\n\n    // Into previous month.\n    start = new Date(2015, MAY, 1);\n    end = new Date(2015, APR, 30);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, -1), end)).toBe(true);\n\n    // Into next year.\n    start = new Date(2015, DEC, 31);\n    end = new Date(2016, JAN, 1);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, 1), end)).toBe(true);\n\n    // Into last year.\n    start = new Date(2015, JAN, 1);\n    end = new Date(2014, DEC, 31);\n    expect(dateUtil.isSameDay(dateUtil.incrementDays(start, -1), end)).toBe(true);\n  });\n\n  it('should increment a date by a number of months', function() {\n    // Increment by one.\n    var start = new Date(2015, MAY, 15);\n    var end = new Date(2015, JUN, 15);\n    expect(dateUtil.isSameDay(dateUtil.incrementMonths(start, 1), end)).toBe(true);\n\n    // Negative by negative one.\n    start = new Date(2015, MAY, 15);\n    end = new Date(2015, APR, 15);\n    expect(dateUtil.isSameDay(dateUtil.incrementMonths(start, -1), end)).toBe(true);\n\n    // Next month has fewer days.\n    start = new Date(2015, JAN, 30);\n    end = new Date(2015, FEB, 28);\n    expect(dateUtil.isSameDay(dateUtil.incrementMonths(start, 1), end)).toBe(true);\n\n    // Previous month has fewer days.\n    start = new Date(2015, MAY, 31);\n    end = new Date(2015, APR, 30);\n    expect(dateUtil.isSameDay(dateUtil.incrementMonths(start, -1), end)).toBe(true);\n  });\n\n  it('should get the last date of a month', function() {\n    // Normal February\n    var date = new Date(2015, FEB, 1);\n    var lastOfMonth = new Date(2015, FEB, 28);\n    expect(dateUtil.isSameDay(dateUtil.getLastDateOfMonth(date), lastOfMonth)).toBe(true);\n\n    // Leap year February\n    date = new Date(2012, FEB, 1);\n    lastOfMonth = new Date(2012, FEB, 29);\n    expect(dateUtil.isSameDay(dateUtil.getLastDateOfMonth(date), lastOfMonth)).toBe(true);\n\n    // Month with 31 days.\n    date = new Date(2015, DEC, 12);\n    lastOfMonth = new Date(2015, DEC, 31);\n    expect(dateUtil.isSameDay(dateUtil.getLastDateOfMonth(date), lastOfMonth)).toBe(true);\n\n    // Month with 30 days.\n    date = new Date(2015, APR, 3);\n    lastOfMonth = new Date(2015, APR, 30);\n    expect(dateUtil.isSameDay(dateUtil.getLastDateOfMonth(date), lastOfMonth)).toBe(true);\n  });\n\n  it('should create a date at midnight today', function() {\n    var today = new Date();\n    var todayAtMidnight = dateUtil.createDateAtMidnight();\n    expect(dateUtil.isSameDay(todayAtMidnight, today)).toBe(true);\n    expect(todayAtMidnight.getHours()).toBe(0);\n    expect(todayAtMidnight.getMinutes()).toBe(0);\n    expect(todayAtMidnight.getSeconds()).toBe(0);\n    expect(todayAtMidnight.getMilliseconds()).toBe(0);\n  });\n\n  it('should create a date at midnight the day of a timestamp', function() {\n    var day = new Date(2015, JUN, 1, 12, 30);\n    var dayAtMidnight = dateUtil.createDateAtMidnight(day.getTime());\n    expect(dateUtil.isSameDay(dayAtMidnight, day)).toBe(true);\n    expect(dayAtMidnight.getHours()).toBe(0);\n    expect(dayAtMidnight.getMinutes()).toBe(0);\n    expect(dayAtMidnight.getSeconds()).toBe(0);\n    expect(dayAtMidnight.getMilliseconds()).toBe(0);\n  });\n\n  it('should not error when trying to set an invalid date to midnight', function() {\n    dateUtil.setDateTimeToMidnight(new Date(NaN));\n    dateUtil.setDateTimeToMidnight(null);\n    dateUtil.setDateTimeToMidnight(undefined);\n  });\n\n  it('should determine whether dates are valid', function() {\n    expect(dateUtil.isValidDate(null)).toBeFalsy();\n    expect(dateUtil.isValidDate(undefined)).toBeFalsy();\n    expect(dateUtil.isValidDate('')).toBeFalsy();\n    expect(dateUtil.isValidDate(0)).toBeFalsy();\n    expect(dateUtil.isValidDate(NaN)).toBeFalsy();\n    expect(dateUtil.isValidDate(123456789)).toBeFalsy();\n    expect(dateUtil.isValidDate('123456789')).toBeFalsy();\n    expect(dateUtil.isValidDate(new Date(''))).toBeFalsy();\n    expect(dateUtil.isValidDate(new Date('Banjo'))).toBeFalsy();\n    expect(dateUtil.isValidDate(new Date(NaN))).toBeFalsy();\n\n    expect(dateUtil.isValidDate(new Date())).toBe(true);\n  });\n\n  it('should return true when a date is in range', function() {\n    var date = new Date(2015, JUN, 2);\n    var minDate = new Date(2015, JUN, 1);\n    var maxDate = new Date(2015, JUN, 3);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeTruthy();\n  });\n\n  it('should return false when a date is before the range', function() {\n    var date = new Date(2015, MAY, 29);\n    var minDate = new Date(2015, JUN, 1);\n    var maxDate = new Date(2015, JUN, 3);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeFalsy();\n  });\n\n  it('should return false when a date is after the range', function() {\n    var date = new Date(2015, JUN, 5);\n    var minDate = new Date(2015, JUN, 1);\n    var maxDate = new Date(2015, JUN, 3);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeFalsy();\n  });\n\n  it('should set the time to midnight before checking the min date', function() {\n    var date = new Date(2015, JUN, 1, 11, 0, 0);\n    var minDate = new Date(2015, JUN, 1, 0, 0, 0);\n    var maxDate = new Date(2015, JUN, 3);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeTruthy();\n  });\n\n  it('should set the time to midnight before checking the max date', function() {\n    var date = new Date(2015, JUN, 3, 13, 0, 0);\n    var minDate = new Date(2015, 5, 1);\n    var maxDate = new Date(2015, JUN, 3, 12, 0, 0);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeTruthy();\n  });\n\n  it('should ignore an invalid minDate when checking if the date is in range', function() {\n    var date = new Date(2015, JUN, 2);\n    var minDate = null;\n    var maxDate = new Date(2015, JUN, 3);\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeTruthy();\n  });\n\n  it('should ignore an invalid maxDate when checking if the date is in range', function() {\n    var date = new Date(2015, JUN, 2);\n    var minDate = new Date(2015, JUN, 1);\n    var maxDate = null;\n    expect(dateUtil.isDateWithinRange(date, minDate, maxDate)).toBeTruthy();\n  });\n\n  it('should increment a date by a number of years', function() {\n    // Increment by one.\n    var start = new Date(2015, MAY, 15);\n    var end = new Date(2016, MAY, 15);\n    expect(dateUtil.isSameDay(dateUtil.incrementYears(start, 1), end)).toBe(true);\n\n    // Negative by negative one.\n    start = new Date(2015, MAY, 15);\n    end = new Date(2014, MAY, 15);\n    expect(dateUtil.isSameDay(dateUtil.incrementYears(start, -1), end)).toBe(true);\n  });\n\n  it('should get the distance between years', function() {\n    // In the future\n    var start = new Date(2016, JAN, 15);\n    var end = new Date(2017, JUN, 15);\n    expect(dateUtil.getYearDistance(start, end)).toBe(1);\n\n    // In the past\n    start = new Date(2016, JAN, 15);\n    end = new Date(2014, JUN, 15);\n    expect(dateUtil.getYearDistance(start, end)).toBe(-2);\n  });\n\n  it('should limit a date between a minimum and a maximum', function() {\n    var min = new Date(2016, MAY, 1);\n    var max = new Date(2016, JUN, 1);\n\n    // Before the minimum\n    var target = new Date(2016, APR, 1);\n    expect(dateUtil.isSameDay(dateUtil.clampDate(target, min, max), min)).toBe(true);\n\n    // After the maximum\n    target = new Date(2016, AUG, 1);\n    expect(dateUtil.isSameDay(dateUtil.clampDate(target, min, max), max)).toBe(true);\n\n    // Within range\n    target = new Date(2016, MAY, 15);\n    expect(dateUtil.clampDate(target, min, max)).toBe(target);\n  });\n\n  it('should parse the timestamp from a DOM node', function() {\n    var node = document.createElement('td');\n\n    // With no arguments\n    expect(function() {\n      dateUtil.getTimestampFromNode();\n    }).not.toThrow();\n\n    // Without a timestamp\n    expect(dateUtil.getTimestampFromNode(node)).toBeFalsy();\n\n    // With a timestamp\n    var time = new Date().getTime();\n    node.setAttribute('data-timestamp', time);\n    var result = dateUtil.getTimestampFromNode(node);\n\n    expect(angular.isNumber(result)).toBe(true);\n    expect(result).toBe(time);\n\n    node = null;\n  });\n\n  describe('isMonthWithinRange method', function() {\n    it('should return true when a month is in range', function() {\n      var date = new Date(2015, JUN, 1);\n      var minDate = new Date(2015, MAY, 1);\n      var maxDate = new Date(2015, JUL, 1);\n      expect(dateUtil.isMonthWithinRange(date, minDate, maxDate)).toBeTruthy();\n    });\n\n    it('should return false when a month is before the range', function() {\n      var date = new Date(2015, MAY, 1);\n      var minDate = new Date(2015, JUN, 1);\n      var maxDate = new Date(2015, JUL, 1);\n      expect(dateUtil.isMonthWithinRange(date, minDate, maxDate)).toBeFalsy();\n    });\n\n    it('should return false when a month is after the range', function() {\n      var date = new Date(2015, AUG, 1);\n      var minDate = new Date(2015, JUN, 1);\n      var maxDate = new Date(2015, JUL, 1);\n      expect(dateUtil.isMonthWithinRange(date, minDate, maxDate)).toBeFalsy();\n    });\n\n    it('should ignore an invalid minDate when checking if the month is in range', function() {\n      var date = new Date(2015, JUN, 1);\n      var minDate = null;\n      var maxDate = new Date(2015, JUL, 1);\n      expect(dateUtil.isMonthWithinRange(date, minDate, maxDate)).toBeTruthy();\n    });\n\n    it('should ignore an invalid maxDate when checking if the month is in range', function() {\n      var date = new Date(2015, JUN, 1);\n      var minDate = new Date(2015, JUN, 1);\n      var maxDate = null;\n      expect(dateUtil.isMonthWithinRange(date, minDate, maxDate)).toBeTruthy();\n    });\n\n    it('should take the year into account when comparing with the min date', function() {\n      var date = new Date(2015, MAR, 1);\n      var minDate = new Date(2014, JUN, 1);\n      expect(dateUtil.isMonthWithinRange(date, minDate)).toBeTruthy();\n    });\n\n    it('should take the year into account when comparing with the max date', function() {\n      var date = new Date(2015, JUL, 1);\n      var maxDate = new Date(2016, FEB, 1);\n      expect(dateUtil.isMonthWithinRange(date, null, maxDate)).toBeTruthy();\n    });\n\n    it('should return true, even though parts of the month are before the minDate', function() {\n      var date = new Date(2015, MAY, 1);\n      var minDate = new Date(2015, MAY, 20);\n      expect(dateUtil.isMonthWithinRange(date, minDate)).toBeTruthy();\n    });\n\n    it('should return true, even though parts of the month are after the maxDate', function() {\n      var date = new Date(2015, JUN, 20);\n      var maxDate = new Date(2015, JUN, 1);\n      expect(dateUtil.isMonthWithinRange(date, null, maxDate)).toBeTruthy();\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/datepicker/js/datepickerDirective.js",
    "content": "(function() {\n  'use strict';\n\n  // TODO(jelbourn): forward more attributes to the internal input (required, autofocus, etc.)\n  // TODO(jelbourn): something better for mobile (calendar panel takes up entire screen?)\n  // TODO(jelbourn): input behavior (masking? auto-complete?)\n\n  angular.module('material.components.datepicker')\n      .directive('mdDatepicker', datePickerDirective);\n\n  /**\n   * @ngdoc directive\n   * @name mdDatepicker\n   * @module material.components.datepicker\n   *\n   * @param {Date} ng-model The component's model. Expects either a JavaScript Date object or a\n   *  value that can be parsed into one (e.g. a ISO 8601 string).\n   * @param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being\n   *  updated. Also allows for a timezone to be specified.\n   *  <a href=\"https://docs.angularjs.org/api/ng/directive/ngModelOptions#usage\">\n   *    Read more at the ngModelOptions docs.</a>\n   * @param {expression=} ng-change Expression evaluated when the model value changes.\n   * @param {expression=} ng-focus Expression evaluated when the input is focused or the calendar\n   *  is opened.\n   * @param {expression=} ng-blur Expression evaluated when focus is removed from the input or the\n   *  calendar is closed.\n   * @param {boolean=} ng-disabled Whether the datepicker is disabled.\n   * @param {boolean=} ng-required Whether a value is required for the datepicker.\n   * @param {Date=} md-min-date Expression representing a min date (inclusive).\n   * @param {Date=} md-max-date Expression representing a max date (inclusive).\n   * @param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a\n   *  boolean whether it can be selected in \"day\" mode or not. Returning false will also trigger a\n   *  `filtered` model validation error.\n   * @param {(function(Date): boolean)=} md-month-filter Function expecting a date and returning a\n   *  boolean whether it can be selected in \"month\" mode or not. Returning false will also trigger a\n   *  `filtered` model validation error.\n   * @param {string=} md-placeholder The date input placeholder value.\n   * @param {string=} md-open-on-focus When present, the calendar will be opened when the input\n   *  is focused.\n   * @param {Boolean=} md-is-open Expression that can be used to open the datepicker's calendar\n   *  on-demand.\n   * @param {string=} md-current-view Default open view of the calendar pane. Can be either\n   *  \"month\" or \"year\".\n   * @param {string=} md-mode Restricts the user to only selecting a value from a particular view.\n   *  This option can be used if the user is only supposed to choose from a certain date type\n   *  (e.g. only selecting the month).\n   * Can be either \"month\" or \"day\". **Note** that this will overwrite the `md-current-view` value.\n   * @param {string=} md-hide-icons Determines which datepicker icons should be hidden. Note that\n   *  this may cause the datepicker to not align properly with other components.\n   *  **Use at your own risk.** Possible values are:\n   * * `\"all\"` - Hides all icons.\n   * * `\"calendar\"` - Only hides the calendar icon.\n   * * `\"triangle\"` - Only hides the triangle icon.\n   * @param {Object=} md-date-locale Allows for the values from the `$mdDateLocaleProvider` to be\n   * overwritten on a per-element basis (e.g. `msgOpenCalendar` can be overwritten with\n   * `md-date-locale=\"{ msgOpenCalendar: 'Open a special calendar' }\"`).\n   * @param {string=} input-aria-describedby A space-separated list of element IDs. This should\n   *  contain the IDs of any elements that describe this datepicker. Screen readers will read the\n   *  content of these elements at the end of announcing that the datepicker has been selected\n   *  and describing its current state. The descriptive elements do not need to be visible on the\n   *  page.\n   * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use\n   *  case is that this would contain the ID of a `<label>` element should be associated with this\n   *  datepicker. This is necessary when using `md-datepicker` inside of an `md-input-container`\n   *  with a `<label>`.<br><br>\n   *  For `<label id=\"start-date\">Start Date</label>`, you would set this to\n   *  `input-aria-labelledby=\"start-date\"`.\n   *\n   * @description\n   * `<md-datepicker>` is a component used to select a single date.\n   * For information on how to configure internationalization for the date picker,\n   * see <a ng-href=\"api/service/$mdDateLocaleProvider\">$mdDateLocaleProvider</a>.\n   *\n   * This component supports\n   * [ngMessages](https://docs.angularjs.org/api/ngMessages/directive/ngMessages).\n   * Supported attributes are:\n   * * `required`: whether a required date is not set.\n   * * `mindate`: whether the selected date is before the minimum allowed date.\n   * * `maxdate`: whether the selected date is after the maximum allowed date.\n   * * `debounceInterval`: ms to delay input processing (since last debounce reset);\n   *    default value 500ms\n   *\n   * @usage\n   * <hljs lang=\"html\">\n   *   <md-datepicker ng-model=\"birthday\"></md-datepicker>\n   * </hljs>\n   *\n   */\n\n  function datePickerDirective($$mdSvgRegistry, $mdUtil, $mdAria, inputDirective) {\n    return {\n      template: function(tElement, tAttrs) {\n        // Buttons are not in the tab order because users can open the calendar via keyboard\n        // interaction on the text input, and multiple tab stops for one component (picker)\n        // may be confusing.\n        var hiddenIcons = tAttrs.mdHideIcons;\n        var inputAriaDescribedby = tAttrs.inputAriaDescribedby;\n        var inputAriaLabelledby = tAttrs.inputAriaLabelledby;\n        var ariaLabelValue = tAttrs.ariaLabel || tAttrs.mdPlaceholder;\n        var ngModelOptions = tAttrs.ngModelOptions;\n\n        var calendarButton = (hiddenIcons === 'all' || hiddenIcons === 'calendar') ? '' :\n          '<md-button class=\"md-datepicker-button md-icon-button\" type=\"button\" ' +\n              'tabindex=\"-1\" aria-hidden=\"true\" ' +\n              'ng-click=\"ctrl.openCalendarPane($event)\">' +\n            '<md-icon class=\"md-datepicker-calendar-icon\" aria-label=\"md-calendar\" ' +\n                     'md-svg-src=\"' + $$mdSvgRegistry.mdCalendar + '\"></md-icon>' +\n          '</md-button>';\n\n        var triangleButton = '';\n\n        if (hiddenIcons !== 'all' && hiddenIcons !== 'triangle') {\n          triangleButton = '' +\n            '<md-button type=\"button\" md-no-ink ' +\n              'class=\"md-datepicker-triangle-button md-icon-button\" ' +\n              'ng-click=\"ctrl.openCalendarPane($event)\" ' +\n              'aria-label=\"{{::ctrl.locale.msgOpenCalendar}}\">' +\n            '<div class=\"md-datepicker-expand-triangle\"></div>' +\n          '</md-button>';\n\n          tElement.addClass(HAS_TRIANGLE_ICON_CLASS);\n        }\n\n        return calendarButton +\n        '<div class=\"md-datepicker-input-container\" ng-class=\"{\\'md-datepicker-focused\\': ctrl.isFocused}\">' +\n          '<input ' +\n            (ariaLabelValue ? 'aria-label=\"' + ariaLabelValue + '\" ' : '') +\n            (inputAriaDescribedby ? 'aria-describedby=\"' + inputAriaDescribedby + '\" ' : '') +\n            (inputAriaLabelledby ? 'aria-labelledby=\"' + inputAriaLabelledby + '\" ' : '') +\n            'class=\"md-datepicker-input\" ' +\n            'aria-haspopup=\"dialog\" ' +\n            'ng-focus=\"ctrl.setFocused(true)\" ' +\n            'ng-blur=\"ctrl.setFocused(false)\"> ' +\n            triangleButton +\n        '</div>' +\n\n        // This pane will be detached from here and re-attached to the document body.\n        '<div class=\"md-datepicker-calendar-pane md-whiteframe-z1\" id=\"{{::ctrl.calendarPaneId}}\">' +\n          '<div class=\"md-datepicker-input-mask\">' +\n            '<div class=\"md-datepicker-input-mask-opaque\"></div>' +\n          '</div>' +\n          '<div class=\"md-datepicker-calendar\">' +\n            '<md-calendar role=\"dialog\" aria-label=\"{{::ctrl.locale.msgCalendar}}\" ' +\n                'md-current-view=\"{{::ctrl.currentView}}\" ' +\n                'md-mode=\"{{::ctrl.mode}}\" ' +\n                'md-min-date=\"ctrl.minDate\" ' +\n                'md-max-date=\"ctrl.maxDate\" ' +\n                'md-date-filter=\"ctrl.dateFilter\" ' +\n                'md-month-filter=\"ctrl.monthFilter\" ' +\n                (ngModelOptions ? 'ng-model-options=\"' + ngModelOptions + '\" ' : '') +\n                'ng-model=\"ctrl.date\" ng-if=\"ctrl.isCalendarOpen\">' +\n            '</md-calendar>' +\n          '</div>' +\n        '</div>';\n      },\n      require: ['ngModel', 'mdDatepicker', '?^mdInputContainer', '?^form'],\n      scope: {\n        minDate: '=mdMinDate',\n        maxDate: '=mdMaxDate',\n        placeholder: '@mdPlaceholder',\n        currentView: '@mdCurrentView',\n        mode: '@mdMode',\n        dateFilter: '=mdDateFilter',\n        monthFilter: '=mdMonthFilter',\n        isOpen: '=?mdIsOpen',\n        debounceInterval: '=mdDebounceInterval',\n        dateLocale: '=mdDateLocale'\n      },\n      controller: DatePickerCtrl,\n      controllerAs: 'ctrl',\n      bindToController: true,\n      link: function(scope, element, attr, controllers) {\n        var ngModelCtrl = controllers[0];\n        var mdDatePickerCtrl = controllers[1];\n        var mdInputContainer = controllers[2];\n        var parentForm = controllers[3];\n        var mdNoAsterisk = $mdUtil.parseAttributeBoolean(attr.mdNoAsterisk);\n\n        mdDatePickerCtrl.configureNgModel(ngModelCtrl, mdInputContainer, inputDirective);\n\n        if (mdInputContainer) {\n          // We need to move the spacer after the datepicker itself,\n          // because md-input-container adds it after the\n          // md-datepicker-input by default. The spacer gets wrapped in a\n          // div, because it floats and gets aligned next to the datepicker.\n          // There are easier ways of working around this with CSS (making the\n          // datepicker 100% wide, change the `display` etc.), however they\n          // break the alignment with any other form controls.\n          var spacer = element[0].querySelector('.md-errors-spacer');\n\n          if (spacer) {\n            element.after(angular.element('<div>').append(spacer));\n          }\n\n          mdInputContainer.setHasPlaceholder(attr.mdPlaceholder);\n          mdInputContainer.input = element;\n          mdInputContainer.element\n            .addClass(INPUT_CONTAINER_CLASS)\n            .toggleClass(HAS_CALENDAR_ICON_CLASS,\n              attr.mdHideIcons !== 'calendar' && attr.mdHideIcons !== 'all');\n\n          if (!mdInputContainer.label) {\n            $mdAria.expect(element, 'aria-label', attr.mdPlaceholder);\n          } else if (!mdNoAsterisk) {\n            attr.$observe('required', function(value) {\n              mdInputContainer.label.toggleClass('md-required', !!value);\n            });\n          }\n\n          scope.$watch(mdInputContainer.isErrorGetter || function() {\n            return ngModelCtrl.$invalid && (ngModelCtrl.$touched ||\n              (parentForm && parentForm.$submitted));\n          }, mdInputContainer.setInvalid);\n        } else if (parentForm) {\n          // If invalid, highlights the input when the parent form is submitted.\n          var parentSubmittedWatcher = scope.$watch(function() {\n            return parentForm.$submitted;\n          }, function(isSubmitted) {\n            if (isSubmitted) {\n              mdDatePickerCtrl.updateErrorState();\n              parentSubmittedWatcher();\n            }\n          });\n        }\n      }\n    };\n  }\n\n  /** Additional offset for the input's `size` attribute, which is updated based on its content. */\n  var EXTRA_INPUT_SIZE = 3;\n\n  /** Class applied to the container if the date is invalid. */\n  var INVALID_CLASS = 'md-datepicker-invalid';\n\n  /** Class applied to the datepicker when it's open. */\n  var OPEN_CLASS = 'md-datepicker-open';\n\n  /** Class applied to the md-input-container, if a datepicker is placed inside it */\n  var INPUT_CONTAINER_CLASS = '_md-datepicker-floating-label';\n\n  /** Class to be applied when the calendar icon is enabled. */\n  var HAS_CALENDAR_ICON_CLASS = '_md-datepicker-has-calendar-icon';\n\n  /** Class to be applied when the triangle icon is enabled. */\n  var HAS_TRIANGLE_ICON_CLASS = '_md-datepicker-has-triangle-icon';\n\n  /** Default time in ms to debounce input event by. */\n  var DEFAULT_DEBOUNCE_INTERVAL = 500;\n\n  /**\n   * Height of the calendar pane used to check if the pane is going outside the boundary of\n   * the viewport. See calendar.scss for how $md-calendar-height is computed; an extra 20px is\n   * also added to space the pane away from the exact edge of the screen.\n   *\n   *  This is computed statically now, but can be changed to be measured if the circumstances\n   *  of calendar sizing are changed.\n   */\n  var CALENDAR_PANE_HEIGHT = 368;\n\n  /**\n   * Width of the calendar pane used to check if the pane is going outside the boundary of\n   * the viewport. See calendar.scss for how $md-calendar-width is computed; an extra 20px is\n   * also added to space the pane away from the exact edge of the screen.\n   *\n   *  This is computed statically now, but can be changed to be measured if the circumstances\n   *  of calendar sizing are changed.\n   */\n  var CALENDAR_PANE_WIDTH = 360;\n\n  /** Used for checking whether the current user agent is on iOS or Android. */\n  var IS_MOBILE_REGEX = /ipad|iphone|ipod|android/i;\n\n  /**\n   * Controller for md-datepicker.\n   *\n   * @ngInject @constructor\n   */\n  function DatePickerCtrl($scope, $element, $attrs, $window, $mdConstant, $mdTheming, $mdUtil,\n                          $mdDateLocale, $$mdDateUtil, $$rAF, $filter, $timeout) {\n\n    /** @final */\n    this.$window = $window;\n\n    /** @final */\n    this.dateUtil = $$mdDateUtil;\n\n    /** @final */\n    this.$mdConstant = $mdConstant;\n\n    /** @final */\n    this.$mdUtil = $mdUtil;\n\n    /** @final */\n    this.$$rAF = $$rAF;\n\n    /** @final */\n    this.$mdDateLocale = $mdDateLocale;\n\n    /** @final */\n    this.$timeout = $timeout;\n\n    /**\n     * The root document element. This is used for attaching a top-level click handler to\n     * close the calendar panel when a click outside said panel occurs. We use `documentElement`\n     * instead of body because, when scrolling is disabled, some browsers consider the body element\n     * to be completely off the screen and propagate events directly to the html element.\n     * @type {!JQLite}\n     */\n    this.documentElement = angular.element(document.documentElement);\n\n    /** @type {!ngModel.NgModelController} */\n    this.ngModelCtrl = null;\n\n    /** @type {HTMLInputElement} */\n    this.inputElement = $element[0].querySelector('input');\n\n    /**\n     * @final\n     * @type {!JQLite}\n     */\n    this.ngInputElement = angular.element(this.inputElement);\n\n    /** @type {HTMLElement} */\n    this.inputContainer = $element[0].querySelector('.md-datepicker-input-container');\n\n    /** @type {HTMLElement} Floating calendar pane. */\n    this.calendarPane = $element[0].querySelector('.md-datepicker-calendar-pane');\n\n    /** @type {HTMLElement} Calendar icon button. */\n    this.calendarButton = $element[0].querySelector('.md-datepicker-button');\n\n    /**\n     * Element covering everything but the input in the top of the floating calendar pane.\n     * @type {!JQLite}\n     */\n    this.inputMask = angular.element($element[0].querySelector('.md-datepicker-input-mask-opaque'));\n\n    /**\n     * @final\n     * @type {!JQLite}\n     */\n    this.$element = $element;\n\n    /**\n     * @final\n     * @type {!angular.Attributes}\n     */\n    this.$attrs = $attrs;\n\n    /**\n     * @final\n     * @type {!angular.Scope}\n     */\n    this.$scope = $scope;\n\n    /**\n     * This holds the model that will be used by the calendar.\n     * @type {Date|null|undefined}\n     */\n    this.date = null;\n\n    /** @type {boolean} */\n    this.isFocused = false;\n\n    /** @type {boolean} */\n    this.isDisabled = undefined;\n    this.setDisabled($element[0].disabled || angular.isString($attrs.disabled));\n\n    /** @type {boolean} Whether the date-picker's calendar pane is open. */\n    this.isCalendarOpen = false;\n\n    /** @type {boolean} Whether the calendar should open when the input is focused. */\n    this.openOnFocus = $attrs.hasOwnProperty('mdOpenOnFocus');\n\n    /** @type {Object} Instance of the mdInputContainer controller */\n    this.mdInputContainer = null;\n\n    /**\n     * Element from which the calendar pane was opened. Keep track of this so that we can return\n     * focus to it when the pane is closed.\n     * @type {HTMLElement}\n     */\n    this.calendarPaneOpenedFrom = null;\n\n    /** @type {String} Unique id for the calendar pane. */\n    this.calendarPaneId = 'md-date-pane-' + $mdUtil.nextUid();\n\n    /** Pre-bound click handler is saved so that the event listener can be removed. */\n    this.bodyClickHandler = angular.bind(this, this.handleBodyClick);\n\n    /**\n     * Name of the event that will trigger a close. Necessary to sniff the browser, because\n     * the resize event doesn't make sense on mobile and can have a negative impact since it\n     * triggers whenever the browser zooms in on a focused input.\n     */\n    this.windowEventName = IS_MOBILE_REGEX.test(\n      navigator.userAgent || navigator.vendor || window.opera\n    ) ? 'orientationchange' : 'resize';\n\n    /** Pre-bound close handler so that the event listener can be removed. */\n    this.windowEventHandler = $mdUtil.debounce(angular.bind(this, this.closeCalendarPane), 100);\n\n    /** Pre-bound handler for the window blur event. Allows for it to be removed later. */\n    this.windowBlurHandler = angular.bind(this, this.handleWindowBlur);\n\n    /** The built-in AngularJS date filter. */\n    this.ngDateFilter = $filter('date');\n\n    /** @type {Number} Extra margin for the left side of the floating calendar pane. */\n    this.leftMargin = 20;\n\n    /** @type {Number} Extra margin for the top of the floating calendar. Gets determined on the first open. */\n    this.topMargin = null;\n\n    // Unless the user specifies so, the datepicker should not be a tab stop.\n    // This is necessary because ngAria might add a tabindex to anything with an ng-model\n    // (based on whether or not the user has turned that particular feature on/off).\n    if ($attrs.tabindex) {\n      this.ngInputElement.attr('tabindex', $attrs.tabindex);\n      $attrs.$set('tabindex', null);\n    } else {\n      $attrs.$set('tabindex', '-1');\n    }\n\n    $attrs.$set('aria-owns', this.calendarPaneId);\n\n    $mdTheming($element);\n    $mdTheming(angular.element(this.calendarPane));\n\n    var self = this;\n\n    $scope.$on('$destroy', function() {\n      self.detachCalendarPane();\n    });\n\n    if ($attrs.mdIsOpen) {\n      $scope.$watch('ctrl.isOpen', function(shouldBeOpen) {\n        if (shouldBeOpen) {\n          self.openCalendarPane({\n            target: self.inputElement\n          });\n        } else {\n          self.closeCalendarPane();\n        }\n      });\n    }\n\n    // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are\n    // pre-assigned, manually call the $onInit hook.\n    if (angular.version.major === 1 && angular.version.minor <= 4) {\n      this.$onInit();\n    }\n  }\n\n  /**\n   * AngularJS Lifecycle hook for newer AngularJS versions.\n   * Bindings are not guaranteed to have been assigned in the controller, but they are in the\n   * $onInit hook.\n   */\n  DatePickerCtrl.prototype.$onInit = function() {\n\n    /**\n     * Holds locale-specific formatters, parsers, labels etc. Allows\n     * the user to override specific ones from the $mdDateLocale provider.\n     * @type {!Object}\n     */\n    this.locale = this.dateLocale ? angular.extend({}, this.$mdDateLocale, this.dateLocale)\n      : this.$mdDateLocale;\n\n    this.installPropertyInterceptors();\n    this.attachChangeListeners();\n    this.attachInteractionListeners();\n  };\n\n  /**\n   * Sets up the controller's reference to ngModelController and\n   * applies AngularJS's `input[type=\"date\"]` directive.\n   * @param {!angular.NgModelController} ngModelCtrl Instance of the ngModel controller.\n   * @param {Object} mdInputContainer Instance of the mdInputContainer controller.\n   * @param {Object} inputDirective Config for AngularJS's `input` directive.\n   */\n  DatePickerCtrl.prototype.configureNgModel = function(ngModelCtrl, mdInputContainer, inputDirective) {\n    this.ngModelCtrl = ngModelCtrl;\n    this.mdInputContainer = mdInputContainer;\n\n    // The input needs to be [type=\"date\"] in order to be picked up by AngularJS.\n    this.$attrs.$set('type', 'date');\n\n    // Invoke the `input` directive link function, adding a stub for the element.\n    // This allows us to re-use AngularJS's logic for setting the timezone via ng-model-options.\n    // It works by calling the link function directly which then adds the proper `$parsers` and\n    // `$formatters` to the ngModel controller.\n    inputDirective[0].link.pre(this.$scope, {\n      on: angular.noop,\n      val: angular.noop,\n      0: {}\n    }, this.$attrs, [ngModelCtrl]);\n\n    var self = this;\n\n    // Responds to external changes to the model value.\n    self.ngModelCtrl.$formatters.push(function(value) {\n      var parsedValue = angular.isDefined(value) ? value : null;\n\n      if (!(value instanceof Date)) {\n        parsedValue = Date.parse(value);\n\n        // `parsedValue` is the time since epoch if valid or `NaN` if invalid.\n        if (!isNaN(parsedValue) && angular.isNumber(parsedValue)) {\n          value = new Date(parsedValue);\n        }\n\n        if (value && !(value instanceof Date)) {\n          throw Error(\n            'The ng-model for md-datepicker must be a Date instance or a value ' +\n              'that can be parsed into a date. Currently the model is of type: ' + typeof value\n          );\n        }\n      }\n\n      self.onExternalChange(value);\n\n      return value;\n    });\n\n    // Responds to external error state changes (e.g. ng-required based on another input).\n    ngModelCtrl.$viewChangeListeners.unshift(angular.bind(this, this.updateErrorState));\n\n    // Forwards any events from the input to the root element. This is necessary to get `updateOn`\n    // working for events that don't bubble (e.g. 'blur') since AngularJS binds the handlers to\n    // the `<md-datepicker>`.\n    var updateOn = self.$mdUtil.getModelOption(ngModelCtrl, 'updateOn');\n\n    if (updateOn) {\n      this.ngInputElement.on(\n        updateOn,\n        angular.bind(this.$element, this.$element.triggerHandler, updateOn)\n      );\n    }\n  };\n\n  /**\n   * Attach event listeners for both the text input and the md-calendar.\n   * Events are used instead of ng-model so that updates don't infinitely update the other\n   * on a change. This should also be more performant than using a $watch.\n   */\n  DatePickerCtrl.prototype.attachChangeListeners = function() {\n    var self = this;\n\n    self.$scope.$on('md-calendar-change', function(event, date) {\n      self.setModelValue(date);\n      self.onExternalChange(date);\n      self.closeCalendarPane();\n    });\n\n    self.ngInputElement.on('input', angular.bind(self, self.resizeInputElement));\n\n    var debounceInterval = angular.isDefined(this.debounceInterval) ?\n        this.debounceInterval : DEFAULT_DEBOUNCE_INTERVAL;\n    self.ngInputElement.on('input', self.$mdUtil.debounce(self.handleInputEvent,\n        debounceInterval, self));\n  };\n\n  /** Attach event listeners for user interaction. */\n  DatePickerCtrl.prototype.attachInteractionListeners = function() {\n    var self = this;\n    var $scope = this.$scope;\n    var keyCodes = this.$mdConstant.KEY_CODE;\n\n    // Add event listener through angular so that we can triggerHandler in unit tests.\n    self.ngInputElement.on('keydown', function(event) {\n      if (event.altKey && event.keyCode === keyCodes.DOWN_ARROW) {\n        self.openCalendarPane(event);\n        $scope.$digest();\n      }\n    });\n\n    if (self.openOnFocus) {\n      self.ngInputElement.on('focus', angular.bind(self, self.openCalendarPane));\n      self.ngInputElement.on('click', function(event) {\n        event.stopPropagation();\n      });\n      self.ngInputElement.on('pointerdown',function(event) {\n        if (event.target && event.target.setPointerCapture) {\n          event.target.setPointerCapture(event.pointerId);\n        }\n      });\n\n      angular.element(self.$window).on('blur', self.windowBlurHandler);\n\n      $scope.$on('$destroy', function() {\n        angular.element(self.$window).off('blur', self.windowBlurHandler);\n      });\n    }\n\n    $scope.$on('md-calendar-close', function() {\n      self.closeCalendarPane();\n    });\n  };\n\n  /**\n   * Capture properties set to the date-picker and imperatively handle internal changes.\n   * This is done to avoid setting up additional $watches.\n   */\n  DatePickerCtrl.prototype.installPropertyInterceptors = function() {\n    var self = this;\n\n    if (this.$attrs.ngDisabled) {\n      // The expression is to be evaluated against the directive element's scope and not\n      // the directive's isolate scope.\n      var scope = this.$scope.$parent;\n\n      if (scope) {\n        scope.$watch(this.$attrs.ngDisabled, function(isDisabled) {\n          self.setDisabled(isDisabled);\n        });\n      }\n    }\n\n    Object.defineProperty(this, 'placeholder', {\n      get: function() { return self.inputElement.placeholder; },\n      set: function(value) { self.inputElement.placeholder = value || ''; }\n    });\n  };\n\n  /**\n   * Sets whether the date-picker is disabled.\n   * @param {boolean} isDisabled\n   */\n  DatePickerCtrl.prototype.setDisabled = function(isDisabled) {\n    this.isDisabled = isDisabled;\n    this.inputElement.disabled = isDisabled;\n\n    if (this.calendarButton) {\n      this.calendarButton.disabled = isDisabled;\n    }\n  };\n\n  /**\n   * Sets the custom ngModel.$error flags to be consumed by ngMessages. Flags are:\n   *   - mindate: whether the selected date is before the minimum date.\n   *   - maxdate: whether the selected flag is after the maximum date.\n   *   - filtered: whether the selected date is allowed by the custom filtering function.\n   *   - valid: whether the entered text input is a valid date\n   *\n   * The 'required' flag is handled automatically by ngModel.\n   *\n   * @param {Date=} opt_date Date to check. If not given, defaults to the datepicker's model value.\n   */\n  DatePickerCtrl.prototype.updateErrorState = function(opt_date) {\n    var date;\n    if (opt_date) {\n      date = new Date(opt_date.valueOf());\n    } else {\n      if (angular.isString(this.ngModelCtrl.$modelValue)) {\n        date = new Date(this.ngModelCtrl.$modelValue);\n      } else {\n        date = angular.copy(this.ngModelCtrl.$modelValue);\n      }\n    }\n\n    // Clear any existing errors to get rid of anything that's no longer relevant.\n    this.clearErrorState();\n\n    if (this.dateUtil.isValidDate(date)) {\n      // Force all dates to midnight in order to ignore the time portion.\n      date = this.dateUtil.createDateAtMidnight(date);\n\n      if (this.dateUtil.isValidDate(this.minDate)) {\n        var minDate = this.dateUtil.createDateAtMidnight(this.minDate);\n        this.ngModelCtrl.$setValidity('mindate', date >= minDate);\n      }\n\n      if (this.dateUtil.isValidDate(this.maxDate)) {\n        var maxDate = this.dateUtil.createDateAtMidnight(this.maxDate);\n        this.ngModelCtrl.$setValidity('maxdate', date <= maxDate);\n      }\n\n      if (angular.isFunction(this.dateFilter)) {\n        this.ngModelCtrl.$setValidity('filtered', this.dateFilter(date));\n      }\n\n      if (angular.isFunction(this.monthFilter)) {\n        this.ngModelCtrl.$setValidity('filtered', this.monthFilter(date));\n      }\n    } else {\n      // The date is seen as \"not a valid date\" if there is *something* set\n      // (i.e.., not null or undefined), but that something isn't a valid date.\n      this.ngModelCtrl.$setValidity('valid', date == null);\n    }\n\n    var input = this.inputElement.value;\n    var parsedDate = this.locale.parseDate(input);\n\n    if (!this.isInputValid(input, parsedDate) && this.ngModelCtrl.$valid) {\n      this.ngModelCtrl.$setValidity('valid', date == null);\n    }\n\n    angular.element(this.inputContainer).toggleClass(INVALID_CLASS,\n      this.ngModelCtrl.$invalid && (this.ngModelCtrl.$touched || this.ngModelCtrl.$submitted));\n  };\n\n  /**\n   * Check to see if the input is valid, as the validation should fail if the model is invalid.\n   *\n   * @param {string} inputString\n   * @param {Date} parsedDate\n   * @return {boolean} Whether the input is valid\n   */\n  DatePickerCtrl.prototype.isInputValid = function (inputString, parsedDate) {\n    return inputString === '' || (\n      this.dateUtil.isValidDate(parsedDate) &&\n      this.locale.isDateComplete(inputString) &&\n      this.isDateEnabled(parsedDate)\n    );\n  };\n\n  /** Clears any error flags set by `updateErrorState`. */\n  DatePickerCtrl.prototype.clearErrorState = function() {\n    this.inputContainer.classList.remove(INVALID_CLASS);\n    ['mindate', 'maxdate', 'filtered', 'valid'].forEach(function(field) {\n      this.ngModelCtrl.$setValidity(field, true);\n    }, this);\n  };\n\n  /** Resizes the input element based on the size of its content. */\n  DatePickerCtrl.prototype.resizeInputElement = function() {\n    this.inputElement.size = this.inputElement.value.length + EXTRA_INPUT_SIZE;\n  };\n\n  /**\n   * Sets the model value if the user input is a valid date.\n   * Adds an invalid class to the input element if not.\n   */\n  DatePickerCtrl.prototype.handleInputEvent = function() {\n    var inputString = this.inputElement.value;\n    var parsedDate = inputString ? this.locale.parseDate(inputString) : null;\n    this.dateUtil.setDateTimeToMidnight(parsedDate);\n\n    // An input string is valid if it is either empty (representing no date)\n    // or if it parses to a valid date that the user is allowed to select.\n    var isValidInput = this.isInputValid(inputString, parsedDate);\n\n    // The datepicker's model is only updated when there is a valid input.\n    if (isValidInput) {\n      this.setModelValue(parsedDate);\n      this.date = parsedDate;\n    }\n\n    this.updateErrorState(parsedDate);\n  };\n\n  /**\n   * Check whether date is in range and enabled\n   * @param {Date=} opt_date\n   * @return {boolean} Whether the date is enabled.\n   */\n  DatePickerCtrl.prototype.isDateEnabled = function(opt_date) {\n    return this.dateUtil.isDateWithinRange(opt_date, this.minDate, this.maxDate) &&\n          (!angular.isFunction(this.dateFilter) || this.dateFilter(opt_date)) &&\n          (!angular.isFunction(this.monthFilter) || this.monthFilter(opt_date));\n  };\n\n  /** Position and attach the floating calendar to the document. */\n  DatePickerCtrl.prototype.attachCalendarPane = function() {\n    var calendarPane = this.calendarPane;\n    var body = document.body;\n\n    calendarPane.style.transform = '';\n    this.$element.addClass(OPEN_CLASS);\n    this.mdInputContainer && this.mdInputContainer.element.addClass(OPEN_CLASS);\n    angular.element(body).addClass('md-datepicker-is-showing');\n\n    var elementRect = this.inputContainer.getBoundingClientRect();\n    var bodyRect = body.getBoundingClientRect();\n\n    if (!this.topMargin || this.topMargin < 0) {\n      this.topMargin =\n        (this.inputMask.parent().prop('clientHeight')\n          - this.ngInputElement.prop('clientHeight')) / 2;\n    }\n\n    // Check to see if the calendar pane would go off the screen. If so, adjust position\n    // accordingly to keep it within the viewport.\n    var paneTop = elementRect.top - bodyRect.top - this.topMargin;\n    var paneLeft = elementRect.left - bodyRect.left - this.leftMargin;\n\n    // If ng-material has disabled body scrolling (for example, if a dialog is open),\n    // then it's possible that the already-scrolled body has a negative top/left. In this case,\n    // we want to treat the \"real\" top as (0 - bodyRect.top). In a normal scrolling situation,\n    // though, the top of the viewport should just be the body's scroll position.\n    var viewportTop = (bodyRect.top < 0 && document.body.scrollTop === 0) ?\n        -bodyRect.top :\n        document.body.scrollTop;\n\n    var viewportLeft = (bodyRect.left < 0 && document.body.scrollLeft === 0) ?\n        -bodyRect.left :\n        document.body.scrollLeft;\n\n    var viewportBottom = viewportTop + this.$window.innerHeight;\n    var viewportRight = viewportLeft + this.$window.innerWidth;\n\n    // Creates an overlay with a hole the same size as element. We remove a pixel or two\n    // on each end to make it overlap slightly. The overlay's background is added in\n    // the theme in the form of a box-shadow with a huge spread.\n    this.inputMask.css({\n      position: 'absolute',\n      left: this.leftMargin + 'px',\n      top: this.topMargin + 'px',\n      width: (elementRect.width - 1) + 'px',\n      height: (elementRect.height - 2) + 'px'\n    });\n\n    // If the right edge of the pane would be off the screen and shifting it left by the\n    // difference would not go past the left edge of the screen. If the calendar pane is too\n    // big to fit on the screen at all, move it to the left of the screen and scale the entire\n    // element down to fit.\n    if (paneLeft + CALENDAR_PANE_WIDTH > viewportRight) {\n      if (viewportRight - CALENDAR_PANE_WIDTH > 0) {\n        paneLeft = viewportRight - CALENDAR_PANE_WIDTH;\n      } else {\n        paneLeft = viewportLeft;\n        var scale = this.$window.innerWidth / CALENDAR_PANE_WIDTH;\n        calendarPane.style.transform = 'scale(' + scale + ')';\n      }\n\n      calendarPane.classList.add('md-datepicker-pos-adjusted');\n    }\n\n    // If the bottom edge of the pane would be off the screen and shifting it up by the\n    // difference would not go past the top edge of the screen.\n    if (paneTop + CALENDAR_PANE_HEIGHT > viewportBottom &&\n        viewportBottom - CALENDAR_PANE_HEIGHT > viewportTop) {\n      paneTop = viewportBottom - CALENDAR_PANE_HEIGHT;\n      calendarPane.classList.add('md-datepicker-pos-adjusted');\n    }\n\n    calendarPane.style.left = paneLeft + 'px';\n    calendarPane.style.top = paneTop + 'px';\n    document.body.appendChild(calendarPane);\n\n    // Add CSS class after one frame to trigger open animation.\n    this.$$rAF(function() {\n      calendarPane.classList.add('md-pane-open');\n    });\n  };\n\n  /** Detach the floating calendar pane from the document. */\n  DatePickerCtrl.prototype.detachCalendarPane = function() {\n    this.$element.removeClass(OPEN_CLASS);\n    this.mdInputContainer && this.mdInputContainer.element.removeClass(OPEN_CLASS);\n    angular.element(document.body).removeClass('md-datepicker-is-showing');\n    this.calendarPane.classList.remove('md-pane-open');\n    this.calendarPane.classList.remove('md-datepicker-pos-adjusted');\n\n    if (this.isCalendarOpen) {\n      this.$mdUtil.enableScrolling();\n    }\n\n    if (this.calendarPane.parentNode) {\n      // Use native DOM removal because we do not want any of the\n      // angular state of this element to be disposed.\n      this.calendarPane.parentNode.removeChild(this.calendarPane);\n    }\n  };\n\n  /**\n   * Open the floating calendar pane.\n   * @param {MouseEvent|KeyboardEvent|{target: HTMLInputElement}} event\n   */\n  DatePickerCtrl.prototype.openCalendarPane = function(event) {\n    if (!this.isCalendarOpen && !this.isDisabled && !this.inputFocusedOnWindowBlur) {\n      this.isCalendarOpen = this.isOpen = true;\n      this.calendarPaneOpenedFrom = event.target;\n\n      // Because the calendar pane is attached directly to the body, it is possible that the\n      // rest of the component (input, etc) is in a different scrolling container, such as\n      // an md-content. This means that, if the container is scrolled, the pane would remain\n      // stationary. To remedy this, we disable scrolling while the calendar pane is open, which\n      // also matches the native behavior for things like `<select>` on Mac and Windows.\n      this.$mdUtil.disableScrollAround(this.calendarPane);\n\n      this.attachCalendarPane();\n      this.focusCalendar();\n      this.evalAttr('ngFocus');\n\n      // Attach click listener inside of a timeout because, if this open call was triggered by a\n      // click, we don't want it to be immediately propagated up to the body and handled.\n      var self = this;\n      this.$mdUtil.nextTick(function() {\n        // Use 'touchstart` in addition to click in order to work on iOS Safari, where click\n        // events aren't propagated under most circumstances.\n        // See http://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n        self.documentElement.on('click touchstart', self.bodyClickHandler);\n      }, false);\n\n      window.addEventListener(this.windowEventName, this.windowEventHandler);\n    } else if (this.inputFocusedOnWindowBlur) {\n      this.resetInputFocused();\n    }\n  };\n\n  /** Close the floating calendar pane. */\n  DatePickerCtrl.prototype.closeCalendarPane = function() {\n    if (this.isCalendarOpen) {\n      var self = this;\n\n      self.detachCalendarPane();\n      self.ngModelCtrl.$setTouched();\n      self.evalAttr('ngBlur');\n\n      self.documentElement.off('click touchstart', self.bodyClickHandler);\n      window.removeEventListener(self.windowEventName, self.windowEventHandler);\n\n      self.calendarPaneOpenedFrom.focus();\n      self.calendarPaneOpenedFrom = null;\n\n      if (self.openOnFocus) {\n        // Ensures that all focus events have fired before resetting\n        // the calendar. Prevents the calendar from reopening immediately\n        // in IE when md-open-on-focus is set. Also it needs to trigger\n        // a digest, in order to prevent issues where the calendar wasn't\n        // showing up on the next open.\n        self.$timeout(reset);\n      } else {\n        reset();\n      }\n    }\n\n    function reset() {\n      self.isCalendarOpen = self.isOpen = false;\n    }\n  };\n\n  /** Gets the controller instance for the calendar in the floating pane. */\n  DatePickerCtrl.prototype.getCalendarCtrl = function() {\n    return angular.element(this.calendarPane.querySelector('md-calendar')).controller('mdCalendar');\n  };\n\n  /** Focus the calendar in the floating pane. */\n  DatePickerCtrl.prototype.focusCalendar = function() {\n    // Use a timeout in order to allow the calendar to be rendered, as it is gated behind an ng-if.\n    var self = this;\n    this.$mdUtil.nextTick(function() {\n      self.getCalendarCtrl().focusDate(self.date);\n    }, false);\n  };\n\n  /**\n   * Sets whether the input is currently focused.\n   * @param {boolean} isFocused\n   */\n  DatePickerCtrl.prototype.setFocused = function(isFocused) {\n    if (!isFocused) {\n      this.ngModelCtrl.$setTouched();\n    }\n\n    // The ng* expressions shouldn't be evaluated when mdOpenOnFocus is on,\n    // because they also get called when the calendar is opened/closed.\n    if (!this.openOnFocus) {\n      this.evalAttr(isFocused ? 'ngFocus' : 'ngBlur');\n    }\n\n    this.isFocused = isFocused;\n  };\n\n  /**\n   * Handles a click on the document body when the floating calendar pane is open.\n   * Closes the floating calendar pane if the click is not inside of it.\n   * @param {MouseEvent} event\n   */\n  DatePickerCtrl.prototype.handleBodyClick = function(event) {\n    if (this.isCalendarOpen) {\n      var isInCalendar = this.$mdUtil.getClosest(event.target, 'md-calendar');\n\n      if (!isInCalendar) {\n        this.closeCalendarPane();\n      }\n\n      this.$scope.$digest();\n    }\n  };\n\n  /**\n   * Handles the event when the user navigates away from the current tab. Keeps track of\n   * whether the input was focused when the event happened, in order to prevent the calendar\n   * from re-opening.\n   */\n  DatePickerCtrl.prototype.handleWindowBlur = function() {\n    this.inputFocusedOnWindowBlur = document.activeElement === this.inputElement;\n  };\n\n  /**\n   * Reset the flag inputFocusedOnWindowBlur to default state, to permit user to open calendar\n   * again when he back to tab with calendar focused.\n   */\n  DatePickerCtrl.prototype.resetInputFocused = function() {\n    this.inputFocusedOnWindowBlur = false;\n  };\n\n  /**\n   * Evaluates an attribute expression against the parent scope.\n   * @param {String} attr Name of the attribute to be evaluated.\n   */\n  DatePickerCtrl.prototype.evalAttr = function(attr) {\n    if (this.$attrs[attr]) {\n      this.$scope.$parent.$eval(this.$attrs[attr]);\n    }\n  };\n\n  /**\n   * Sets the ng-model value by first converting the date object into a string. Converting it\n   * is necessary, in order to pass AngularJS's `input[type=\"date\"]` validations. AngularJS turns\n   * the value into a Date object afterwards, before setting it on the model.\n   * @param {Date=} value Date to be set as the model value.\n   */\n  DatePickerCtrl.prototype.setModelValue = function(value) {\n    var timezone = this.$mdUtil.getModelOption(this.ngModelCtrl, 'timezone');\n    // Using the timezone when the offset is negative (GMT+X) causes the previous day to be\n    // set as the model value here. This check avoids that.\n    if (timezone == null || value == null || value.getTimezoneOffset() < 0) {\n      this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd'), 'default');\n    } else {\n      this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd', timezone), 'default');\n    }\n  };\n\n  /**\n   * Updates the datepicker when a model change occurred externally.\n   * @param {Date=} value Value that was set to the model.\n   */\n  DatePickerCtrl.prototype.onExternalChange = function(value) {\n    var self = this;\n    var timezone = this.$mdUtil.getModelOption(this.ngModelCtrl, 'timezone');\n\n    // Update the model used by the calendar.\n    if (this.dateUtil.isValidDate(value) && timezone != null && value.getTimezoneOffset() >= 0) {\n      this.date = this.dateUtil.removeLocalTzAndReparseDate(value);\n    } else {\n      this.date = value;\n    }\n    // Using the timezone when the offset is negative (GMT+X) causes the previous day to be\n    // used here. This check avoids that.\n    if (timezone == null || value == null || value.getTimezoneOffset() < 0) {\n      this.inputElement.value = this.locale.formatDate(value);\n    } else {\n      this.inputElement.value = this.locale.formatDate(value, timezone);\n    }\n    this.mdInputContainer && this.mdInputContainer.setHasValue(!!value);\n    this.resizeInputElement();\n    // This is often called from the $formatters section of the $validators pipeline.\n    // In that case, we need to delay to let $render and $validate run, so that the checks for\n    // error state are accurate.\n    this.$mdUtil.nextTick(function() {self.updateErrorState();}, false, self.$scope);\n  };\n})();\n"
  },
  {
    "path": "src/components/datepicker/js/datepickerDirective.spec.js",
    "content": "// When constructing a Date, the month is zero-based. This can be confusing, since people are\n// used to seeing them one-based. So we create these aliases to make reading the tests easier.\nvar JAN = 0, FEB = 1, MAR = 2, APR = 3, MAY = 4, JUN = 5, JUL = 6, AUG = 7, SEP = 8, OCT = 9,\n  NOV = 10, DEC = 11;\n\nvar initialDate = new Date(2015, FEB, 15);\n\nvar ngElement, element, scope, pageScope, controller;\nvar $compile, $timeout, $$rAF, $animate, $window, keyCodes, dateUtil, dateLocale;\n\nvar DATEPICKER_TEMPLATE =\n  '<md-datepicker name=\"birthday\" ' +\n  'md-max-date=\"maxDate\" ' +\n  'md-min-date=\"minDate\" ' +\n  'md-date-filter=\"dateFilter\" ' +\n  'md-month-filter=\"monthFilter\" ' +\n  'ng-model=\"myDate\" ' +\n  'ng-change=\"dateChangedHandler()\" ' +\n  'ng-focus=\"focusHandler()\" ' +\n  'ng-blur=\"blurHandler()\" ' +\n  'ng-required=\"isRequired\" ' +\n  'ng-disabled=\"isDisabled\">' +\n  '</md-datepicker>';\n\nvar DATEPICKER_FORM_TEMPLATE =\n  '<form name=\"birthdayForm\">' +\n  '  <md-datepicker name=\"birthday\" ' +\n  '    md-max-date=\"maxDate\" ' +\n  '    md-min-date=\"minDate\" ' +\n  '    md-date-filter=\"dateFilter\" ' +\n  '    md-month-filter=\"monthFilter\" ' +\n  '    ng-model=\"myDate\" ' +\n  '    ng-change=\"dateChangedHandler()\" ' +\n  '    ng-focus=\"focusHandler()\" ' +\n  '    ng-blur=\"blurHandler()\" ' +\n  '    ng-required=\"isRequired\" ' +\n  '    ng-disabled=\"isDisabled\">' +\n  '  </md-datepicker>' +\n  '</form>';\n\n/**\n * Compile and link the given template and store values for element, scope, and controller.\n * @param {string} template\n * @returns {JQLite} The root compiled element.\n */\nfunction createDatepickerInstance(template) {\n  var outputElement = $compile(template)(pageScope);\n  pageScope.$apply();\n\n  ngElement = outputElement[0].tagName === 'MD-DATEPICKER' ?\n    outputElement : outputElement.find('md-datepicker');\n  element = ngElement[0];\n  scope = ngElement.isolateScope();\n  controller = ngElement.controller('mdDatepicker');\n\n  return outputElement;\n}\n\n/** Populates the inputElement with a value and triggers the input events. */\nfunction populateInputElement(inputString) {\n  controller.ngInputElement.val(inputString).triggerHandler('input');\n  $timeout.flush();\n  pageScope.$apply();\n}\n\ndescribe('md-datepicker', function() {\n  beforeEach(module('material.components.datepicker', 'material.components.input', 'ngAnimateMock'));\n\n  beforeEach(inject(function($rootScope, $injector) {\n    $compile = $injector.get('$compile');\n    $$rAF = $injector.get('$$rAF');\n    $animate = $injector.get('$animate');\n    $window = $injector.get('$window');\n    dateUtil = $injector.get('$$mdDateUtil');\n    dateLocale = $injector.get('$mdDateLocale');\n    $timeout = $injector.get('$timeout');\n    keyCodes = $injector.get('$mdConstant').KEY_CODE;\n\n    pageScope = $rootScope.$new();\n    pageScope.myDate = initialDate;\n    pageScope.isDisabled = false;\n    pageScope.dateChangedHandler = jasmine.createSpy('ng-change handler');\n\n    createDatepickerInstance(DATEPICKER_TEMPLATE);\n    controller.closeCalendarPane();\n  }));\n\n  afterEach(function() {\n    controller.isAttached && controller.closeCalendarPane();\n    pageScope.$destroy();\n    ngElement.remove();\n  });\n\n  it('should be the same date object as the initial ng-model', function() {\n    expect(pageScope.myDate).toBe(initialDate);\n  });\n\n  it('should set initial value from ng-model', function() {\n    expect(controller.inputElement.value).toBe(dateLocale.formatDate(initialDate));\n  });\n\n  it('should set the ngModel value to null when the text input is emptied', function() {\n    controller.inputElement.value = '';\n    controller.ngInputElement.triggerHandler('input');\n    $timeout.flush();\n\n    expect(pageScope.myDate).toBeNull();\n  });\n\n  it('should disable the internal inputs based on ng-disabled binding', function() {\n    expect(controller.inputElement.disabled).toBe(false);\n    expect(controller.calendarButton.disabled).toBe(false);\n\n    pageScope.isDisabled = true;\n    pageScope.$apply();\n\n    expect(controller.inputElement.disabled).toBe(true);\n    expect(controller.calendarButton.disabled).toBe(true);\n  });\n\n  it('should update the internal input placeholder', function() {\n    expect(controller.inputElement.placeholder).toBeFalsy();\n    controller.placeholder = 'Fancy new placeholder';\n\n    expect(controller.inputElement.placeholder).toBe('Fancy new placeholder');\n  });\n\n  it('should forward the aria-label to the generated input', function() {\n    createDatepickerInstance('<md-datepicker ng-model=\"myDate\" aria-label=\"Enter a date\"></md-datepicker>');\n    expect(controller.ngInputElement.attr('aria-label')).toBe('Enter a date');\n  });\n\n  it('should throw an error when the model cannot be parsed into a date', function() {\n    expect(function() {\n      pageScope.myDate = 'Frodo Baggins';\n      pageScope.$apply();\n    }).toThrowError('The ng-model for md-datepicker must be a Date instance or a value ' +\n          'that can be parsed into a date. Currently the model is of type: string');\n  });\n\n  it('should support null, undefined and values that can be parsed into a date', function() {\n    expect(function() {\n      pageScope.myDate = null;\n      pageScope.$apply();\n\n      pageScope.myDate = undefined;\n      pageScope.$apply();\n\n      pageScope.myDate = '2016-09-08';\n      pageScope.$apply();\n    }).not.toThrow();\n  });\n\n  it('should support null, undefined, and values that can be parsed into a date in a form',\n      function() {\n        var formElement = createDatepickerInstance(DATEPICKER_FORM_TEMPLATE);\n        var datepickerInputContainer =\n            formElement[0].querySelector('md-datepicker .md-datepicker-input-container');\n\n        pageScope.myDate = null;\n        pageScope.$apply();\n        $timeout.flush();\n        expect(datepickerInputContainer.classList.contains('md-datepicker-invalid')).toBeFalsy();\n\n        pageScope.myDate = undefined;\n        pageScope.$apply();\n        $timeout.flush();\n        expect(datepickerInputContainer.classList.contains('md-datepicker-invalid')).toBeFalsy();\n\n        pageScope.myDate = '2016-09-08';\n        pageScope.$apply();\n        $timeout.flush();\n        expect(pageScope.myDate).toEqual('2016-09-08');\n        expect(datepickerInputContainer.classList.contains('md-datepicker-invalid')).toBeFalsy();\n\n        pageScope.myDate = '2021-01-20T07:00:00Z';\n        pageScope.$apply();\n        $timeout.flush();\n        expect(pageScope.myDate).toEqual('2021-01-20T07:00:00Z');\n        expect(datepickerInputContainer.classList.contains('md-datepicker-invalid')).toBeFalsy();\n      });\n\n  it('should set the element type as \"date\"', function() {\n    expect(ngElement.attr('type')).toBe('date');\n  });\n\n  it('should handle an initial ng-model that is null when timezone is specified', function() {\n    pageScope.modelOptions = {timezone: 'UTC'};\n    pageScope.myDate = null;\n    createDatepickerInstance(\n      '<md-datepicker ng-model=\"myDate\" ng-model-options=\"modelOptions\"></md-datepicker>');\n  });\n\n  it('should pass the timezone to the formatting function', function() {\n    spyOn(controller.locale, 'formatDate');\n    pageScope.modelOptions = {timezone: 'UTC'};\n\n    createDatepickerInstance(\n      '<md-datepicker ng-model=\"myDate\" ng-model-options=\"modelOptions\"></md-datepicker>');\n\n    // If running in a GMT+X timezone, formatDate will not be called with a timezone argument.\n    if (pageScope.myDate.getTimezoneOffset() < 0) {\n      expect(controller.locale.formatDate).toHaveBeenCalledWith(pageScope.myDate);\n    } else {\n      expect(controller.locale.formatDate).toHaveBeenCalledWith(pageScope.myDate, 'UTC');\n    }\n  });\n\n  it('should allow for the locale to be overwritten on a specific element', function() {\n    pageScope.myDate = new Date(2015, SEP, 1);\n\n    pageScope.customLocale = {\n      formatDate: function() {\n        return 'September First';\n      }\n    };\n\n    spyOn(pageScope.customLocale, 'formatDate').and.callThrough();\n\n    createDatepickerInstance(\n      '<md-datepicker ng-model=\"myDate\" md-date-locale=\"customLocale\"></md-datepicker>'\n    );\n\n    expect(pageScope.customLocale.formatDate).toHaveBeenCalled();\n    expect(ngElement.find('input').val()).toBe('September First');\n  });\n\n  describe('ngMessages support', function() {\n    it('should set the `required` $error flag', function() {\n      pageScope.isRequired = true;\n      populateInputElement('');\n\n      expect(controller.ngModelCtrl.$error['required']).toBe(true);\n    });\n\n    it('should set the `mindate` $error flag', function() {\n      pageScope.minDate = new Date(2015, JAN, 1);\n      populateInputElement('2014-01-01');\n      controller.ngModelCtrl.$render();\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBe(true);\n    });\n\n    it('should set the `maxdate` $error flag', function() {\n      pageScope.maxDate = new Date(2015, JAN, 1);\n      populateInputElement('2016-01-01');\n      controller.ngModelCtrl.$render();\n\n      expect(controller.ngModelCtrl.$error['maxdate']).toBe(true);\n    });\n\n    it('should ignore the time portion when comparing max-date', function() {\n      // Given that selected date is the same day as maxdate but at a later time.\n      pageScope.maxDate = new Date(2015, JAN, 1, 5, 30);\n      pageScope.myDate = new Date(2015, JAN, 1, 7, 30);\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['maxdate']).toBeFalsy();\n    });\n\n    it('should ignore the time portion when comparing min-date', function() {\n      // Given that selected date is the same day as mindate but at an earlier time.\n      pageScope.minDate = new Date(2015, JAN, 1, 5, 30);\n      pageScope.myDate = new Date(2015, JAN, 1);\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBeFalsy();\n    });\n\n    it('should allow selecting a date exactly equal to the max-date', function() {\n      pageScope.maxDate = new Date(2015, JAN, 1);\n      pageScope.myDate = new Date(2015, JAN, 1);\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['maxdate']).toBeFalsy();\n    });\n\n    it('should allow selecting a date exactly equal to the min-date', function() {\n      pageScope.minDate = new Date(2015, JAN, 1);\n      pageScope.myDate = new Date(2015, JAN, 1);\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBeFalsy();\n    });\n\n    it('should not enforce `required` when a min-date is set', function() {\n      pageScope.isRequired = false;\n      pageScope.minDate = new Date(2015, JAN, 1);\n      pageScope.myDate = null;\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBeFalsy();\n    });\n\n    it('should not enforce `required` when a max-date is set', function() {\n      pageScope.isRequired = false;\n      pageScope.maxDate = new Date(2015, JAN, 1);\n      pageScope.myDate = null;\n      pageScope.$apply();\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBeFalsy();\n    });\n\n    describe('inside of a form element', function() {\n      var formCtrl;\n\n      beforeEach(function() {\n        createDatepickerInstance('<form>' + DATEPICKER_TEMPLATE + '</form>');\n        formCtrl = ngElement.controller('form');\n      });\n\n      it('should set `required` $error flag on the form', function() {\n        pageScope.isRequired = true;\n        populateInputElement('');\n        controller.ngModelCtrl.$render();\n\n        expect(formCtrl.$error['required']).toBeTruthy();\n      });\n\n      it('should set `mindate` $error flag on the form', function() {\n        pageScope.minDate = new Date(2015, JAN, 1);\n        populateInputElement('2014-01-01');\n        controller.ngModelCtrl.$render();\n\n        expect(formCtrl.$error['mindate']).toBeTruthy();\n      });\n\n      it('should set `maxdate` $error flag on the form', function() {\n        pageScope.maxDate = new Date(2015, JAN, 1);\n        populateInputElement('2016-01-01');\n        controller.ngModelCtrl.$render();\n\n        expect(formCtrl.$error['maxdate']).toBeTruthy();\n      });\n\n      it('should set `filtered` $error flag on the form when date doesn\\'t pass filter', function() {\n        pageScope.dateFilter = function(date) {\n          return date.getDay() === 1;\n        };\n        populateInputElement('2016-01-03');\n        controller.ngModelCtrl.$render();\n\n        expect(formCtrl.$error['filtered']).toBeTruthy();\n      });\n\n      it('should set `filtered` $error flag on the form when month doesn\\'t pass filter', function() {\n        pageScope.monthFilter = function(date) {\n          return date.getMonth() === 10;\n        };\n        populateInputElement('2016-01-03');\n        controller.ngModelCtrl.$render();\n\n        expect(formCtrl.$error['filtered']).toBeTruthy();\n      });\n\n      it('should add the invalid class when the form is submitted', function() {\n        // This needs to be recompiled, in order to reproduce conditions where a form is\n        // submitted, without the datepicker having being touched (usually it has it's value\n        // set to `myDate` by default).\n        ngElement && ngElement.remove();\n        pageScope.myDate = null;\n        pageScope.isRequired = true;\n\n        createDatepickerInstance('<form>' + DATEPICKER_TEMPLATE + '</form>');\n\n        var formCtrl = ngElement.controller('form');\n        var inputContainer = ngElement.controller('mdDatepicker').inputContainer;\n\n        expect(formCtrl.$invalid).toBe(true);\n        expect(formCtrl.$submitted).toBe(false);\n        expect(inputContainer).not.toHaveClass('md-datepicker-invalid');\n\n        pageScope.$apply(function() {\n          formCtrl.$setSubmitted(true);\n        });\n\n        expect(formCtrl.$submitted).toBe(true);\n        expect(inputContainer).toHaveClass('md-datepicker-invalid');\n      });\n    });\n  });\n\n  describe('input event', function() {\n    it('should update the model value when user enters a valid date', function() {\n      var expectedDate = new Date(2015, JUN, 1);\n      populateInputElement('6/1/2015');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(expectedDate);\n    });\n\n    it('should not update the model value when user enters an invalid date', function() {\n      populateInputElement('7');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(initialDate);\n    });\n\n    it('should not update the model value when input is outside min/max bounds', function() {\n      pageScope.minDate = new Date(2014, JUN, 1);\n      pageScope.maxDate = new Date(2014, JUN, 3);\n      pageScope.$apply();\n\n      populateInputElement('5/30/2014');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(initialDate);\n\n      populateInputElement('6/4/2014');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(initialDate);\n\n      populateInputElement('6/2/2014');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(new Date(2014, JUN, 2));\n    });\n\n    it('should apply ngMessages errors when the date changes from keyboard input', function() {\n      pageScope.minDate = new Date(2014, JUN, 1);\n      pageScope.$apply();\n\n      populateInputElement('5/30/2012');\n\n      expect(controller.ngModelCtrl.$error['mindate']).toBe(true);\n    });\n\n    it('should apply ngMessages errors when the date becomes invalid from keyboard input', function() {\n      populateInputElement('5/30/2012');\n      pageScope.$apply();\n      expect(controller.ngModelCtrl.$error['valid']).toBeFalsy();\n\n      populateInputElement('5/30/2012z');\n      pageScope.$apply();\n      expect(controller.ngModelCtrl.$error['valid']).toBeTruthy();\n    });\n\n    it('should evaluate ngChange expression when date changes from keyboard input', function() {\n      populateInputElement('2/14/1976');\n\n      expect(pageScope.dateChangedHandler).toHaveBeenCalled();\n    });\n\n    it('should add and remove the invalid class', function() {\n      populateInputElement('6/1/2015');\n      expect(controller.inputContainer).not.toHaveClass('md-datepicker-invalid');\n\n      populateInputElement('cheese');\n      expect(controller.inputContainer).toHaveClass('md-datepicker-invalid');\n    });\n\n    it('should toggle the invalid class when an external value causes the error state to change', function() {\n      pageScope.isRequired = true;\n      populateInputElement('');\n      expect(controller.inputContainer).toHaveClass('md-datepicker-invalid');\n\n      pageScope.$apply(function() {\n        pageScope.isRequired = false;\n      });\n      expect(controller.inputContainer).not.toHaveClass('md-datepicker-invalid');\n    });\n\n    it('should not update the model when value is not enabled due to date filter', function() {\n      pageScope.dateFilter = function(date) {\n        return date.getDay() === 1;\n      };\n      pageScope.$apply();\n\n      populateInputElement('5/30/2014');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(initialDate);\n    });\n\n    it('should not update the model when value is not enabled due to month filter', function() {\n      pageScope.monthFilter = function(date) {\n        return date.getMonth() === 10;\n      };\n      pageScope.$apply();\n\n      populateInputElement('5/30/2014');\n      expect(controller.ngModelCtrl.$modelValue).toEqual(initialDate);\n    });\n\n    it('should become touched from blurring closing the pane', function() {\n      populateInputElement('17/1/2015');\n\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n      controller.closeCalendarPane();\n\n      expect(controller.ngModelCtrl.$touched).toBe(true);\n    });\n\n    it('should become touched from blurring the input', function() {\n      populateInputElement('17/1/2015');\n\n      var input = angular.element(controller.inputElement);\n\n      input.triggerHandler('focus');\n      input.triggerHandler('blur');\n\n      expect(controller.ngModelCtrl.$touched).toBe(true);\n    });\n\n    it('should not update the input string if not \"complete\"', function() {\n      var date = new Date(2015, DEC, 1);\n      pageScope.myDate = date;\n\n      populateInputElement('7');\n      expect(pageScope.myDate).toEqual(date);\n    });\n\n    it('should work with ngModelOptions.updateOn', function() {\n      var expectedDate = new Date(2015, JAN, 17);\n\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" ' +\n        'ng-model-options=\"{ updateOn: \\'blur\\' }\"></md-datepicker>');\n\n      populateInputElement('01/17/2015');\n      angular.element(element.querySelector('input')).triggerHandler('blur');\n\n      expect(pageScope.myDate).toEqual(expectedDate);\n    });\n  });\n\n  describe('floating calendar pane', function() {\n    it('should open and close the floating calendar pane element', function() {\n      // We can asset that the calendarPane is in the DOM by checking if it has a height.\n      expect(controller.calendarPane.offsetHeight).toBe(0);\n\n      element.querySelector('md-button').click();\n      $timeout.flush();\n\n      expect(controller.calendarPane.offsetHeight).toBeGreaterThan(0);\n      expect(controller.inputMask[0].style.left).toBeTruthy();\n\n      // Click off of the calendar.\n      document.body.click();\n      expect(controller.calendarPane.offsetHeight).toBe(0);\n    });\n\n    it('should open and close the floating calendar pane element via keyboard', function() {\n      controller.ngInputElement.triggerHandler({\n        type: 'keydown',\n        altKey: true,\n        keyCode: keyCodes.DOWN_ARROW\n      });\n      $timeout.flush();\n\n      expect(controller.calendarPane.offsetHeight).toBeGreaterThan(0);\n\n      // Fake an escape event closing the calendar.\n      pageScope.$broadcast('md-calendar-close');\n\n    });\n\n    it('should open and close the floating calendar pane element via an expression on the scope', function() {\n      pageScope.isOpen = false;\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" md-is-open=\"isOpen\"></md-datepicker>');\n\n      expect(controller.calendarPane.offsetHeight).toBe(0);\n      expect(controller.isCalendarOpen).toBe(false);\n\n      pageScope.$apply(function() {\n        pageScope.isOpen = true;\n      });\n\n      // Open the calendar externally\n      expect(controller.calendarPane.offsetHeight).toBeGreaterThan(0);\n      expect(controller.isCalendarOpen).toBe(true);\n\n      // Close the calendar via the datepicker\n      controller.$scope.$apply(function() {\n        controller.closeCalendarPane();\n      });\n      expect(pageScope.isOpen).toBe(false);\n      expect(controller.isCalendarOpen).toBe(false);\n    });\n\n    it('should adjust the position of the floating pane if it would go off-screen', function() {\n      // Absolutely position the picker near the edge of the screen.\n      var bodyRect = document.body.getBoundingClientRect();\n      element.style.position = 'absolute';\n      element.style.top = bodyRect.bottom + 'px';\n      element.style.left = bodyRect.right + 'px';\n      document.body.appendChild(element);\n\n      // Open the pane.\n      element.querySelector('md-button').click();\n      $timeout.flush();\n\n      // Expect that the whole pane is on-screen.\n      var paneRect = controller.calendarPane.getBoundingClientRect();\n      expect(paneRect.right).toBeLessThan(bodyRect.right + 1);\n      expect(paneRect.bottom).toBeLessThan(bodyRect.bottom + 1);\n      expect(paneRect.top).toBeGreaterThan(0);\n      expect(paneRect.left).toBeGreaterThan(0);\n\n      document.body.removeChild(element);\n    });\n\n    it('should adjust the pane position if it would go off-screen (w/ scrollable)', function() {\n      // Make the body super huge.\n      var superLongElement = document.createElement('div');\n      superLongElement.style.height = '10000px';\n      superLongElement.style.width = '1px';\n      document.body.appendChild(superLongElement);\n\n      // Absolutely position the picker near (say ~30px) the edge of the viewport.\n      element.style.position = 'absolute';\n      element.style.top = (window.innerHeight - 30) + 'px';\n      element.style.left = '0';\n      document.body.appendChild(element);\n\n      // Open the pane.\n      element.querySelector('md-button').click();\n      $timeout.flush();\n\n      // Expect that the pane is on-screen.\n      var paneRect = controller.calendarPane.getBoundingClientRect();\n      expect(paneRect.bottom).toBeLessThan(window.innerHeight + 1);\n\n      document.body.removeChild(element);\n      document.body.removeChild(superLongElement);\n    });\n\n    it('should keep the calendar pane in the right place with body scrolling disabled', function() {\n      // Make the body super huge and scroll down a bunch.\n      var body = document.body;\n      var superLongElement = document.createElement('div');\n      superLongElement.style.height = '10000px';\n      superLongElement.style.width = '1px';\n      body.appendChild(superLongElement);\n      body.scrollTop = 700;\n\n      // Absolutely position the picker such that the pane position doesn't need to be adjusted.\n      // (1/10 of the way down the screen).\n      element.style.position = 'absolute';\n      element.style.top = (document.body.scrollTop + (window.innerHeight * 0.10)) + 'px';\n      element.style.left = '0';\n      body.appendChild(element);\n\n      // Open the pane.\n      element.querySelector('md-button').click();\n      $timeout.flush();\n\n      // Expect that the calendar pane is in the same position as the inline datepicker.\n      var paneRect = controller.calendarPane.getBoundingClientRect();\n      var triggerRect = controller.inputContainer.getBoundingClientRect();\n\n      // We expect the offset to be close to the exact height, because on IE there are some deviations.\n      expect(controller.topMargin).toBeGreaterThan(0);\n      expect(paneRect.top).toBeCloseTo(triggerRect.top - controller.topMargin, 0.5);\n\n      // Restore body to pre-test state.\n      body.removeChild(superLongElement);\n      body.removeChild(element);\n    });\n\n    it('should shrink the calendar pane when it would otherwise not fit on the screen', function() {\n      // Fake the window being very narrow so that the calendar pane won't fit on-screen.\n      controller.$window = {innerWidth: 200, innerHeight: 800};\n\n      // Open the calendar pane.\n      controller.openCalendarPane({});\n\n      // Expect the calendarPane to be scaled by an amount between zero and one.\n      expect(controller.calendarPane.style.transform).toMatch(/scale\\(0\\.\\d+\\)/);\n    });\n\n    it('should not open the calendar pane if disabled', function() {\n      controller.setDisabled(true);\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n      scope.$apply();\n      expect(controller.isCalendarOpen).toBeFalsy();\n      expect(controller.calendarPane.offsetHeight).toBe(0);\n    });\n\n    it('should close the calendar pane on md-calendar-close', function() {\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n\n      scope.$emit('md-calendar-close');\n      scope.$apply();\n      expect(controller.calendarPaneOpenedFrom).toBe(null);\n      expect(controller.isCalendarOpen).toBe(false);\n    });\n\n    it('should re-enable scrolling probably', function() {\n      var maskLength = getMaskLength();\n\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n\n      expect(getMaskLength()).toBe(maskLength + 1);\n\n      controller.closeCalendarPane();\n\n      expect(getMaskLength()).toBe(maskLength);\n\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n\n      expect(getMaskLength()).toBe(maskLength + 1);\n\n      // Trigger a scope destruction, like when a route changes.\n      scope.$destroy();\n\n      expect(getMaskLength()).toBe(maskLength);\n\n      function getMaskLength() {\n        return document.body.querySelectorAll('.md-scroll-mask').length;\n      }\n    });\n  });\n\n  describe('md-calendar-change', function() {\n    it('should update the model value and close the calendar pane', function() {\n      var date = new Date(2015, JUN, 1);\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n      scope.$emit('md-calendar-change', date);\n      scope.$apply();\n      expect(pageScope.myDate).toEqual(date);\n      expect(controller.ngModelCtrl.$modelValue).toEqual(date);\n\n      expect(controller.inputElement.value).toEqual('6/1/2015');\n      expect(controller.calendarPaneOpenedFrom).toBe(null);\n      expect(controller.isCalendarOpen).toBe(false);\n    });\n\n    it('should remove the invalid state if present', function() {\n      populateInputElement('cheese');\n      expect(controller.inputContainer).toHaveClass('md-datepicker-invalid');\n\n      controller.openCalendarPane({\n        target: controller.inputElement\n      });\n\n      scope.$emit('md-calendar-change', new Date());\n      $timeout.flush();\n      expect(controller.inputContainer).not.toHaveClass('md-datepicker-invalid');\n    });\n  });\n\n  describe('mdOpenOnFocus attribute', function() {\n    beforeEach(function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" md-open-on-focus></md-datepicker>');\n    });\n\n    it('should be able open the calendar when the input is focused', function() {\n      controller.ngInputElement.triggerHandler('focus');\n      expect(controller.isCalendarOpen).toBe(true);\n    });\n\n    it('should not reopen a closed calendar when the window is refocused', inject(function($timeout) {\n      // Focus the input initially to open the calendar.\n      // Note that the element needs to be appended to the DOM so it can be set as the activeElement.\n      document.body.appendChild(element);\n      controller.inputElement.focus();\n      controller.ngInputElement.triggerHandler('focus');\n\n      expect(document.activeElement).toBe(controller.inputElement);\n      expect(controller.isCalendarOpen).toBe(true);\n\n      // Close the calendar, but make sure that the input is still focused.\n      controller.closeCalendarPane();\n      $timeout.flush();\n      expect(document.activeElement).toBe(controller.inputElement);\n      expect(controller.isCalendarOpen).toBe(false);\n\n      // Simulate the user tabbing away.\n      angular.element(window).triggerHandler('blur');\n      expect(controller.inputFocusedOnWindowBlur).toBe(true);\n\n      // Try opening the calendar again.\n      controller.ngInputElement.triggerHandler('focus');\n      expect(controller.isCalendarOpen).toBe(false);\n\n      // Clean up.\n      document.body.removeChild(element);\n    }));\n  });\n\n  describe('hiding the icons', function() {\n    var calendarSelector = '.md-datepicker-button .md-datepicker-calendar-icon';\n    var triangleSelector = '.md-datepicker-triangle-button';\n\n    it('should be able to hide the calendar icon', function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" md-hide-icons=\"calendar\"></md-datepicker>');\n      expect(element.querySelector(calendarSelector)).toBeNull();\n    });\n\n    it('should be able to hide the triangle icon', function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" md-hide-icons=\"triangle\"></md-datepicker>');\n      expect(element.querySelector(triangleSelector)).toBeNull();\n    });\n\n    it('should be able to hide all icons', function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" md-hide-icons=\"all\"></md-datepicker>');\n      expect(element.querySelector(calendarSelector)).toBeNull();\n      expect(element.querySelector(triangleSelector)).toBeNull();\n    });\n  });\n\n  describe('md-input-container integration', function() {\n    var element;\n\n    it('should register the element with the mdInputContainer controller', function() {\n      compileElement();\n\n      var inputContainer = element.controller('mdInputContainer');\n\n      expect(inputContainer.input[0]).toBe(element[0].querySelector('md-datepicker'));\n      expect(inputContainer.element).toHaveClass('_md-datepicker-floating-label');\n    });\n\n    it('should notify the input container that the element has a placeholder', function() {\n      compileElement('md-placeholder=\"Enter a date\"');\n      expect(element).toHaveClass('md-input-has-placeholder');\n    });\n\n    it('should add the asterisk if the element is required', function() {\n      compileElement('ng-required=\"isRequired\"');\n      var label = element.find('label');\n\n      expect(label).not.toHaveClass('md-required');\n      pageScope.$apply('isRequired = true');\n      expect(label).toHaveClass('md-required');\n    });\n\n    it('should not add the asterisk if the element has md-no-asterisk', function() {\n      compileElement('required md-no-asterisk');\n      expect(element.find('label')).not.toHaveClass('md-required');\n    });\n\n    it('should pass the error state to the input container', inject(function($material) {\n      compileElement('required');\n\n      var ngModelCtrl = element.find('md-datepicker').controller('ngModel');\n      var invalidClass = 'md-input-invalid';\n\n      expect(ngModelCtrl.$valid).toBe(true);\n      expect(element).not.toHaveClass(invalidClass);\n\n      ngModelCtrl.$setViewValue(null);\n      ngModelCtrl.$setTouched(true);\n      $material.flushOutstandingAnimations();\n\n      expect(ngModelCtrl.$valid).toBe(false);\n      expect(element).toHaveClass(invalidClass);\n    }));\n\n    afterEach(function() {\n      element.remove();\n    });\n\n    function compileElement(attrs) {\n      var template =\n        '<md-input-container>' +\n          '<label>Enter a date</label>' +\n          '<md-datepicker ng-model=\"myDate\" ' + attrs + '></md-datepicker>' +\n        '</md-input-container>';\n\n      element = $compile(template)(pageScope);\n      pageScope.$digest();\n    }\n  });\n\n  describe('ngFocus support', function() {\n    beforeEach(function() {\n      pageScope.focusHandler = jasmine.createSpy('ng-focus handler');\n    });\n\n    it('should trigger the ngFocus handler when the input is focused', function() {\n      controller.ngInputElement.triggerHandler('focus');\n      expect(pageScope.focusHandler).toHaveBeenCalled();\n    });\n\n    it('should trigger the ngFocus handler when the calendar is opened', function() {\n      controller.openCalendarPane({});\n      expect(pageScope.focusHandler).toHaveBeenCalled();\n    });\n\n    it('should only trigger once when mdOpenOnFocus is set', function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" ng-focus=\"focusHandler()\" ' +\n        'md-open-on-focus></md-datepicker>');\n\n      controller.ngInputElement.triggerHandler('focus');\n      expect(pageScope.focusHandler).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('ngBlur support', function() {\n    beforeEach(function() {\n      pageScope.blurHandler = jasmine.createSpy('ng-blur handler');\n    });\n\n    it('should trigger the ngBlur handler when the input is blurred', function() {\n      controller.ngInputElement.triggerHandler('blur');\n      expect(pageScope.blurHandler).toHaveBeenCalled();\n    });\n\n    it('should trigger the ngBlur handler when the calendar is closed', function() {\n      controller.openCalendarPane({\n        target: controller.ngInputElement\n      });\n      controller.closeCalendarPane();\n      expect(pageScope.blurHandler).toHaveBeenCalled();\n    });\n\n    it('should only trigger once when mdOpenOnFocus is set', function() {\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" ng-blur=\"blurHandler()\" ' +\n        'md-open-on-focus></md-datepicker>');\n\n      controller.ngInputElement.triggerHandler('focus');\n      controller.closeCalendarPane();\n      expect(pageScope.blurHandler).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('accessibility', function() {\n    it('should forward the aria-label to the generated input', function() {\n      ngElement && ngElement.remove();\n      createDatepickerInstance('<md-datepicker ng-model=\"myDate\" aria-label=\"Enter a date\"></md-datepicker>');\n      expect(controller.ngInputElement.attr('aria-label')).toBe('Enter a date');\n    });\n\n    it('should set the aria-owns value, corresponding to the id of the calendar pane', function() {\n      var ariaAttr = ngElement.attr('aria-owns');\n\n      expect(ariaAttr).toBeTruthy();\n      expect(controller.calendarPane.id).toBe(ariaAttr);\n    });\n\n    describe('tabindex behavior', function() {\n      beforeEach(function() {\n        ngElement && ngElement.remove();\n      });\n\n      it('should remove the datepicker from the tab order, if no tabindex is specified', function() {\n        createDatepickerInstance('<md-datepicker ng-model=\"myDate\"></md-datepicker>');\n        expect(ngElement.attr('tabindex')).toBe('-1');\n      });\n\n      it('should forward the tabindex to the input', function() {\n        createDatepickerInstance('<md-datepicker ng-model=\"myDate\" tabindex=\"1\"></md-datepicker>');\n        expect(ngElement.attr('tabindex')).toBeFalsy();\n        expect(controller.ngInputElement.attr('tabindex')).toBe('1');\n      });\n    });\n\n  });\n\n});\n\ndescribe('md-datepicker with MomentJS custom formatting', function() {\n  beforeEach(module('material.components.datepicker', 'material.components.input', 'ngAnimateMock'));\n\n  beforeEach(module(function($mdDateLocaleProvider) {\n    $mdDateLocaleProvider.formatDate = function(date) {\n      return date ? moment(date).format('M/D') : '';\n    };\n    $mdDateLocaleProvider.parseDate = function(dateString) {\n      var m = moment(dateString, 'M/D', true);\n      return m.isValid() ? m.toDate() : new Date(NaN);\n    };\n    $mdDateLocaleProvider.isDateComplete = function(dateString) {\n      dateString = dateString.trim();\n      // Look for two chunks of content (either numbers or text) separated by delimiters.\n      var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-]))([a-zA-Z]{3,}|[0-9]{1,4})/;\n      return re.test(dateString);\n    };\n  }));\n\n  beforeEach(inject(function($rootScope, $injector) {\n    $compile = $injector.get('$compile');\n    $timeout = $injector.get('$timeout');\n\n    pageScope = $rootScope.$new();\n    pageScope.myDate = initialDate;\n    pageScope.isDisabled = false;\n    pageScope.dateChangedHandler = jasmine.createSpy('ng-change handler');\n\n    createDatepickerInstance(DATEPICKER_TEMPLATE);\n    controller.closeCalendarPane();\n  }));\n\n  afterEach(function() {\n    controller.isAttached && controller.closeCalendarPane();\n    pageScope.$destroy();\n    ngElement.remove();\n  });\n\n  it('should update the model value and close the calendar pane', function() {\n    var date = new Date(2020, SEP, 1);\n    controller.openCalendarPane({\n      target: controller.inputElement\n    });\n    scope.$emit('md-calendar-change', date);\n    scope.$apply();\n    expect(pageScope.myDate).toEqual(date);\n    expect(controller.ngModelCtrl.$modelValue).toEqual(date);\n\n    expect(controller.inputElement.value).toEqual('9/1');\n    expect(controller.calendarPaneOpenedFrom).toBe(null);\n    expect(controller.isCalendarOpen).toBe(false);\n  });\n});\n"
  },
  {
    "path": "src/components/dialog/demoBasicUsage/dialog1.tmpl.html",
    "content": "<md-dialog aria-label=\"Mango (Fruit)\">\n  <form ng-cloak>\n    <md-toolbar>\n      <div class=\"md-toolbar-tools\">\n        <h2>Mango (Fruit)</h2>\n        <span flex></span>\n        <md-button class=\"md-icon-button\" ng-click=\"cancel()\">\n          <md-icon md-svg-src=\"img/icons/ic_close_24px.svg\" aria-label=\"Close dialog\"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class=\"md-dialog-content\">\n        <h2>Using .md-dialog-content class that sets the padding as the spec</h2>\n        <p>\n          The mango is a juicy stone fruit belonging to the genus Mangifera, consisting of numerous tropical fruiting trees, cultivated mostly for edible fruit. The majority of these species are found in nature as wild mangoes. They all belong to the flowering plant family Anacardiaceae. The mango is native to South and Southeast Asia, from where it has been distributed worldwide to become one of the most cultivated fruits in the tropics.\n        </p>\n\n        <img style=\"margin: auto; max-width: 100%;\" alt=\"Lush mango tree\" src=\"img/mangues.jpg\">\n\n        <p>\n          The highest concentration of Mangifera genus is in the western part of Malesia (Sumatra, Java and Borneo) and in Burma and India. While other Mangifera species (e.g. horse mango, M. foetida) are also grown on a more localized basis, Mangifera indica&mdash;the \"common mango\" or \"Indian mango\"&mdash;is the only mango tree commonly cultivated in many tropical and subtropical regions.\n        </p>\n        <p>\n          It originated in Indian subcontinent (present day India and Pakistan) and Burma. It is the national fruit of India, Pakistan, and the Philippines, and the national tree of Bangladesh. In several cultures, its fruit and leaves are ritually used as floral decorations at weddings, public celebrations, and religious ceremonies.\n        </p>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout=\"row\">\n      <md-button href=\"http://en.wikipedia.org/wiki/Mango\" target=\"_blank\" md-autofocus>\n        More on Wikipedia\n      </md-button>\n      <span flex></span>\n      <md-button ng-click=\"answer('not useful')\">\n       Not Useful\n      </md-button>\n      <md-button ng-click=\"answer('useful')\">\n        Useful\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n"
  },
  {
    "path": "src/components/dialog/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" class=\"md-padding\" id=\"popupContainer\" ng-cloak>\n  <p class=\"inset\">\n    Open a dialog over the app's content. Press escape or click outside to close the dialog and\n    send focus back to the triggering button.\n  </p>\n\n  <div class=\"dialog-demo-content\" layout=\"row\" layout-wrap layout-margin layout-align=\"center\">\n    <md-button class=\"md-primary md-raised\" ng-click=\"showAlert($event)\"   >\n      Alert Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised\" ng-click=\"showConfirm($event)\" >\n      Confirm Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised\" ng-click=\"showPrompt($event)\"  >\n      Prompt Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised\" ng-click=\"showAdvanced($event)\">\n      Custom Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised\" ng-click=\"showTabDialog($event)\" >\n      Tab Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised\" ng-if=\"listPrerenderedButton\" ng-click=\"showPrerenderedDialog($event)\">\n      Pre-Rendered Dialog\n    </md-button>\n  </div>\n  <p class=\"footer\">Note: The <b>Confirm</b> dialog does not use <code>$mdDialog.clickOutsideToClose(true)</code>.</p>\n\n  <div ng-if=\"status\" id=\"status\">\n    <b layout=\"row\" layout-align=\"center center\" class=\"md-padding\">\n      {{status}}\n    </b>\n  </div>\n\n  <div class=\"dialog-demo-prerendered\">\n    <md-checkbox ng-model=\"listPrerenderedButton\">Show Pre-Rendered Dialog</md-checkbox>\n    <p class=\"md-caption\">Sometimes you may not want to compile the dialogs template on each opening.</p>\n    <md-checkbox ng-model=\"customFullscreen\" aria-label=\"Fullscreen custom dialog\">Use full screen mode for custom dialog</md-checkbox>\n    <p class=\"md-caption\">Allows the dialog to consume all available space on small devices</p>\n  </div>\n\n\n  <div style=\"visibility: hidden\">\n    <div class=\"md-dialog-container\" id=\"myDialog\">\n      <md-dialog layout-padding>\n        <h2>Pre-Rendered Dialog</h2>\n        <p>\n          This is a pre-rendered dialog, which means that <code>$mdDialog</code> doesn't compile its\n          template on each opening.\n          <br/><br/>\n          The Dialog Element is a static element in the DOM, which is just visually hidden.<br/>\n          Once the dialog opens, we just fetch the element from the DOM into our dialog and upon close\n          we restore the element back into its old DOM position.\n        </p>\n      </md-dialog>\n    </div>\n  </div>\n\n</div>\n"
  },
  {
    "path": "src/components/dialog/demoBasicUsage/script.js",
    "content": "angular.module('dialogDemo1', ['ngMaterial'])\n.controller('AppCtrl', function($scope, $mdDialog) {\n  $scope.status = '  ';\n  $scope.customFullscreen = false;\n\n  $scope.showAlert = function (ev) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .parent(angular.element(document.querySelector('#popupContainer')))\n        .clickOutsideToClose(true)\n        .title('This is an alert title')\n        .textContent('You can specify some description text in here.')\n        .ariaLabel('Alert Dialog Demo')\n        .ok('Got it!')\n        .targetEvent(ev)\n    );\n  };\n\n  $scope.showConfirm = function(ev) {\n    var confirm = $mdDialog.confirm()\n      .title('Would you like to delete your debt?')\n      .textContent('All of the banks have agreed to forgive you your debts.')\n      .ariaLabel('Lucky day')\n      .targetEvent(ev)\n      .ok('Please do it!')\n      .cancel('Sounds like a scam');\n\n    $mdDialog.show(confirm).then(function () {\n      $scope.status = 'You decided to get rid of your debt.';\n    }, function () {\n      $scope.status = 'You decided to keep your debt.';\n    });\n  };\n\n  $scope.showPrompt = function (ev) {\n    // Appending dialog to document.body to cover sidenav in docs app\n    var confirm = $mdDialog.prompt()\n      .title('What would you name your dog?')\n      .textContent('Bowser is a common name.')\n      .placeholder('Dog name')\n      .ariaLabel('Dog name')\n      .initialValue('Buddy')\n      .targetEvent(ev)\n      .required(true)\n      .ok('Okay!')\n      .cancel('I\\'m a cat person');\n\n    $mdDialog.show(confirm).then(function (result) {\n      $scope.status = 'You decided to name your dog ' + result + '.';\n    }, function () {\n      $scope.status = 'You didn\\'t name your dog.';\n    });\n  };\n\n  $scope.showAdvanced = function (ev) {\n    $mdDialog.show({\n      controller: DialogController,\n      templateUrl: 'dialog1.tmpl.html',\n      // Appending dialog to document.body to cover sidenav in docs app\n      // Modal dialogs should fully cover application to prevent interaction outside of dialog\n      parent: angular.element(document.body),\n      targetEvent: ev,\n      clickOutsideToClose: true,\n      fullscreen: $scope.customFullscreen // Only for -xs, -sm breakpoints.\n    }).then(function (answer) {\n      $scope.status = 'You said the information was \"' + answer + '\".';\n    }, function () {\n      $scope.status = 'You cancelled the dialog.';\n    });\n  };\n\n  $scope.showTabDialog = function (ev) {\n    $mdDialog.show({\n      controller: DialogController,\n      templateUrl: 'tabDialog.tmpl.html',\n      // Appending dialog to document.body to cover sidenav in docs app\n      // Modal dialogs should fully cover application to prevent interaction outside of dialog\n      parent: angular.element(document.body),\n      targetEvent: ev,\n      clickOutsideToClose: true\n    }).then(function (answer) {\n      $scope.status = 'You said the information was \"' + answer + '\".';\n    }, function () {\n      $scope.status = 'You cancelled the dialog.';\n    });\n  };\n\n  $scope.showPrerenderedDialog = function (ev) {\n    $mdDialog.show({\n      contentElement: '#myDialog',\n      // Appending dialog to document.body to cover sidenav in docs app\n      // Modal dialogs should fully cover application to prevent interaction outside of dialog\n      parent: angular.element(document.body),\n      targetEvent: ev,\n      clickOutsideToClose: true\n    });\n  };\n\n  function DialogController($scope, $mdDialog) {\n    $scope.hide = function () {\n      $mdDialog.hide();\n    };\n\n    $scope.cancel = function () {\n      $mdDialog.cancel();\n    };\n\n    $scope.answer = function (answer) {\n      $mdDialog.hide(answer);\n    };\n  }\n});\n"
  },
  {
    "path": "src/components/dialog/demoBasicUsage/style.css",
    "content": "#popupContainer {\n  position: relative;\n}\n.footer {\n  width: 100%;\n  text-align: center;\n  margin-left: 20px;\n}\n.footer, .footer > code {\n  font-size: 0.8em;\n  margin-top: 50px;\n}\nbutton {\n  width: 200px;\n}\ndiv#status {\n  color: #c60008;\n}\n.dialog-demo-prerendered md-checkbox {\n  margin-bottom: 0;\n}\n"
  },
  {
    "path": "src/components/dialog/demoBasicUsage/tabDialog.tmpl.html",
    "content": "<md-dialog aria-label=\"Mango (Fruit)\">\n  <form>\n    <md-toolbar>\n      <div class=\"md-toolbar-tools\">\n        <h2>Mango (Fruit)</h2>\n        <span flex></span>\n        <md-button class=\"md-icon-button\" ng-click=\"cancel()\">\n          <md-icon md-svg-src=\"img/icons/ic_close_24px.svg\" aria-label=\"Close dialog\"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <md-dialog-content style=\"max-width:800px;max-height:810px; \">\n      <md-tabs md-dynamic-height md-border-bottom>\n        <md-tab label=\"one\">\n          <md-content class=\"md-padding\">\n            <h1 class=\"md-display-2\">Tab One</h1>\n            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue. Phasellus volutpat neque ac dui mattis vulputate. Etiam consequat aliquam cursus. In sodales pretium ultrices. Maecenas lectus est, sollicitudin consectetur felis nec, feugiat ultricies mi.</p>\n          </md-content>\n        </md-tab>\n        <md-tab label=\"two\">\n          <md-content class=\"md-padding\">\n            <h1 class=\"md-display-2\">Tab Two</h1>\n            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue. Phasellus volutpat neque ac dui mattis vulputate. Etiam consequat aliquam cursus. In sodales pretium ultrices. Maecenas lectus est, sollicitudin consectetur felis nec, feugiat ultricies mi. Aliquam erat volutpat. Nam placerat, tortor in ultrices porttitor, orci enim rutrum enim, vel tempor sapien arcu a tellus. Vivamus convallis sodales ante varius gravida. Curabitur a purus vel augue ultrices ultricies id a nisl. Nullam malesuada consequat diam, a facilisis tortor volutpat et. Sed urna dolor, aliquet vitae posuere vulputate, euismod ac lorem. Sed felis risus, pulvinar at interdum quis, vehicula sed odio. Phasellus in enim venenatis, iaculis tortor eu, bibendum ante. Donec ac tellus dictum neque volutpat blandit. Praesent efficitur faucibus risus, ac auctor purus porttitor vitae. Phasellus ornare dui nec orci posuere, nec luctus mauris semper.</p>\n            <p>Morbi viverra, ante vel aliquet tincidunt, leo dolor pharetra quam, at semper massa orci nec magna. Donec posuere nec sapien sed laoreet. Etiam cursus nunc in condimentum facilisis. Etiam in tempor tortor. Vivamus faucibus egestas enim, at convallis diam pulvinar vel. Cras ac orci eget nisi maximus cursus. Nunc urna libero, viverra sit amet nisl at, hendrerit tempor turpis. Maecenas facilisis convallis mi vel tempor. Nullam vitae nunc leo. Cras sed nisl consectetur, rhoncus sapien sit amet, tempus sapien.</p>\n            <p>Integer turpis erat, porttitor vitae mi faucibus, laoreet interdum tellus. Curabitur posuere molestie dictum. Morbi eget congue risus, quis rhoncus quam. Suspendisse vitae hendrerit erat, at posuere mi. Cras eu fermentum nunc. Sed id ante eu orci commodo volutpat non ac est. Praesent ligula diam, congue eu enim scelerisque, finibus commodo lectus.</p>\n          </md-content>\n        </md-tab>\n        <md-tab label=\"three\">\n          <md-content class=\"md-padding\">\n            <h1 class=\"md-display-2\">Tab Three</h1>\n            <p>Integer turpis erat, porttitor vitae mi faucibus, laoreet interdum tellus. Curabitur posuere molestie dictum. Morbi eget congue risus, quis rhoncus quam. Suspendisse vitae hendrerit erat, at posuere mi. Cras eu fermentum nunc. Sed id ante eu orci commodo volutpat non ac est. Praesent ligula diam, congue eu enim scelerisque, finibus commodo lectus.</p>\n          </md-content>\n        </md-tab>\n      </md-tabs>\n    </md-dialog-content>\n\n    <md-dialog-actions layout=\"row\">\n      <md-button href=\"http://en.wikipedia.org/wiki/Mango\" target=\"_blank\" md-autofocus>\n        More on Wikipedia\n      </md-button>\n      <span flex></span>\n      <md-button ng-click=\"answer('not useful')\" >\n        Not Useful\n      </md-button>\n      <md-button ng-click=\"answer('useful')\" style=\"margin-right:20px;\" >\n        Useful\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n"
  },
  {
    "path": "src/components/dialog/demoOpenFromCloseTo/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"row\" ng-cloak style=\"height: 300px\">\n  <style>\n      .edgePadding {\n        padding-left: 25px;\n        padding-right: 25px;\n      }\n\n  </style>\n\n  <div layout=\"column\" layout-align=\"center center\"\n       style=\"background-color: #f2f2f2\" class=\"md-padding\">\n    <span id=\"left\">left</span>\n  </div>\n\n  <div layout=\"column\" layout-align=\"center start\" layout-padding flex>\n    <p class=\"inset\">\n      A dialog can specify its origin and target with <code>openFrom</code> and\n      <code>closeTo</code> properties.\n\n      The options showFrom and closeTo can be specified as a string [where internally\n      querySelector( ) is used to perform the DOM element lookup],\n      element or an Rect object [with top, left, width, height fields].\n    </p>\n\n    <div class=\"dialog-demo-content\" layout=\"column\" layout-align=\"center center\" style=\"width:100%\">\n      <md-button class=\"md-primary md-raised edgePadding\" ng-click=\"openFromLeft()\" >\n        Open From Left - Close To Right\n      </md-button>\n      <md-button class=\"md-primary md-raised edgePadding\" ng-click=\"openOffscreen()\" >\n        Open From Top Left - Close Slide Down\n      </md-button>\n    </div>\n\n  </div>\n\n  <div layout=\"column\" layout-align=\"center center\"\n       style=\"background-color: #f2f2f2\" class=\"md-padding\">\n    <span id=\"right\">right</span>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/dialog/demoOpenFromCloseTo/script.js",
    "content": "angular.module('dialogDemo2', ['ngMaterial'])\n\n.controller('AppCtrl', function($scope, $mdDialog) {\n  $scope.openFromLeft = function() {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .clickOutsideToClose(true)\n        .title('Opening from the left')\n        .textContent('Closing to the right!')\n        .ariaLabel('Left to right demo')\n        .ok('Nice!')\n        // You can specify either sting with query selector\n        .openFrom('#left')\n        // or an element\n        .closeTo(angular.element(document.querySelector('#right')))\n    );\n  };\n\n  $scope.openOffscreen = function() {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .clickOutsideToClose(true)\n        .title('Opening from offscreen')\n        .textContent('Closing to offscreen')\n        .ariaLabel('Offscreen Demo')\n        .ok('Amazing!')\n        // Or you can specify the rect to do the transition from\n        .openFrom({\n          top: -50,\n          width: 30,\n          height: 80\n        })\n        .closeTo({\n          left: 1500\n        })\n    );\n  };\n});\n"
  },
  {
    "path": "src/components/dialog/demoThemeInheritance/dialog1.tmpl.html",
    "content": "<md-dialog aria-label=\"Mango (Fruit)\">\n  <form ng-cloak>\n    <md-toolbar>\n      <div class=\"md-toolbar-tools\">\n        <h2>Mango (Fruit)</h2>\n        <span flex></span>\n        <md-button class=\"md-icon-button\" ng-click=\"cancel()\">\n          <md-icon md-svg-src=\"img/icons/ic_close_24px.svg\" aria-label=\"Close dialog\"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n\n    <md-dialog-content>\n      <div class=\"md-dialog-content\">\n        <h2>Using .md-dialog-content class that sets the padding as the spec</h2>\n        <p>\n          The mango is a juicy stone fruit belonging to the genus Mangifera, consisting of numerous tropical fruiting trees, cultivated mostly for edible fruit. The majority of these species are found in nature as wild mangoes. They all belong to the flowering plant family Anacardiaceae. The mango is native to South and Southeast Asia, from where it has been distributed worldwide to become one of the most cultivated fruits in the tropics.\n        </p>\n\n        <img style=\"margin: auto; max-width: 100%;\" alt=\"Lush mango tree\" src=\"img/mangues.jpg\">\n\n        <p>\n          The highest concentration of Mangifera genus is in the western part of Malesia (Sumatra, Java and Borneo) and in Burma and India. While other Mangifera species (e.g. horse mango, M. foetida) are also grown on a more localized basis, Mangifera indica&mdash;the \"common mango\" or \"Indian mango\"&mdash;is the only mango tree commonly cultivated in many tropical and subtropical regions.\n        </p>\n        <p>\n          It originated in Indian subcontinent (present day India and Pakistan) and Burma. It is the national fruit of India, Pakistan, and the Philippines, and the national tree of Bangladesh. In several cultures, its fruit and leaves are ritually used as floral decorations at weddings, public celebrations, and religious ceremonies.\n        </p>\n      </div>\n    </md-dialog-content>\n\n    <md-dialog-actions layout=\"row\">\n      <md-button href=\"http://en.wikipedia.org/wiki/Mango\" target=\"_blank\" md-autofocus>\n        More on Wikipedia\n      </md-button>\n      <span flex></span>\n      <md-button ng-click=\"answer('not useful')\">\n       Not Useful\n      </md-button>\n      <md-button ng-click=\"answer('useful')\" class=\"md-primary\">\n        Useful\n      </md-button>\n    </md-dialog-actions>\n  </form>\n</md-dialog>\n"
  },
  {
    "path": "src/components/dialog/demoThemeInheritance/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak md-theme=\"{{theme}}\" class=\"container\">\n  <p class=\"inset\">\n    We have an interval that changes the color of the button from <code>red</code> to <code>blue</code> themes,\n    Open the dialog to see the theme being inherited to the dialog and any component inside\n  </p>\n  <md-button class=\"md-primary md-raised\" ng-click=\"showAdvanced($event)\">Open Dialog</md-button>\n</div>\n"
  },
  {
    "path": "src/components/dialog/demoThemeInheritance/script.js",
    "content": "angular.module('dialogDemo3', ['ngMaterial'])\n  .config(function ($mdThemingProvider) {\n    $mdThemingProvider.theme('red')\n      .primaryPalette('red');\n\n    $mdThemingProvider.theme('blue')\n      .primaryPalette('blue');\n\n  })\n.controller('AppCtrl', function($scope, $mdDialog, $interval) {\n  $scope.theme = 'red';\n\n  var isThemeRed = true;\n\n  $interval(function () {\n    $scope.theme = isThemeRed ? 'blue' : 'red';\n\n    isThemeRed = !isThemeRed;\n  }, 2000);\n\n  $scope.showAdvanced = function(ev) {\n    $mdDialog.show({\n      controller: DialogController,\n      templateUrl: 'dialog1.tmpl.html',\n      parent: angular.element(document.body),\n      targetEvent: ev,\n      clickOutsideToClose:true\n    })\n    .then(function(answer) {\n      $scope.status = 'You said the information was \"' + answer + '\".';\n    }, function() {\n      $scope.status = 'You cancelled the dialog.';\n    });\n  };\n\n  function DialogController($scope, $mdDialog) {\n    $scope.hide = function() {\n      $mdDialog.hide();\n    };\n\n    $scope.cancel = function() {\n      $mdDialog.cancel();\n    };\n\n    $scope.answer = function(answer) {\n      $mdDialog.hide(answer);\n    };\n  }\n});\n"
  },
  {
    "path": "src/components/dialog/demoThemeInheritance/style.css",
    "content": ".container {\n  text-align: center;\n}\n"
  },
  {
    "path": "src/components/dialog/dialog-theme.scss",
    "content": "$dialog-border-radius: 4px !default;\n\nmd-dialog.md-THEME_NAME-theme {\n  border-radius: $dialog-border-radius;\n\n  background-color: '{{background-hue-1}}';\n  color: '{{foreground-1}}';\n\n\n  &.md-content-overflow {\n    md-dialog-actions {\n      border-top-color: '{{foreground-4}}';\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/dialog/dialog.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.dialog\n */\nangular\n  .module('material.components.dialog', [\n    'material.core',\n    'material.components.backdrop'\n  ])\n  .directive('mdDialog', MdDialogDirective)\n  .provider('$mdDialog', MdDialogProvider);\n\n/**\n * @ngdoc directive\n * @name mdDialog\n * @module material.components.dialog\n *\n * @restrict E\n *\n * @description\n * `<md-dialog>` - The dialog's template must be inside this element.\n *\n * Inside, use an `<md-dialog-content>` element for the dialog's content, and use\n * an `<md-dialog-actions>` element for the dialog's actions.\n *\n * ## CSS\n * - `.md-dialog-content` - class that sets the padding on the content as the spec file\n *\n * ## Notes\n * - If you specify an `id` for the `<md-dialog>`, the `<md-dialog-content>` will have the same `id`\n * prefixed with `dialogContent_`.\n *\n * @usage\n * ### Dialog template\n * <hljs lang=\"html\">\n * <md-dialog aria-label=\"List dialog\">\n *   <md-dialog-content>\n *     <md-list>\n *       <md-list-item ng-repeat=\"item in items\">\n *         <p>Number {{item}}</p>\n *       </md-list-item>\n *     </md-list>\n *   </md-dialog-content>\n *   <md-dialog-actions>\n *     <md-button ng-click=\"closeDialog()\" class=\"md-primary\">Close Dialog</md-button>\n *   </md-dialog-actions>\n * </md-dialog>\n * </hljs>\n */\nfunction MdDialogDirective($$rAF, $mdTheming, $mdDialog) {\n  return {\n    restrict: 'E',\n    link: function(scope, element) {\n      element.addClass('_md');     // private md component indicator for styling\n\n      $mdTheming(element);\n      $$rAF(function() {\n        var images;\n        var content = element[0].querySelector('md-dialog-content');\n\n        if (content) {\n          images = content.getElementsByTagName('img');\n          addOverflowClass();\n          // delayed image loading may impact scroll height, check after images are loaded\n          angular.element(images).on('load', addOverflowClass);\n        }\n\n        scope.$on('$destroy', function() {\n          $mdDialog.destroy(element);\n        });\n\n        /**\n         *\n         */\n        function addOverflowClass() {\n          element.toggleClass('md-content-overflow', content.scrollHeight > content.clientHeight);\n        }\n\n\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc service\n * @name $mdDialog\n * @module material.components.dialog\n *\n * @description\n * `$mdDialog` opens a dialog over the app to inform users about critical information or require\n *  them to make decisions. There are two approaches for setup: a simple promise API\n *  and regular object syntax.\n *\n * ## Restrictions\n *\n * - The dialog is always given an isolate scope.\n * - The dialog's template must have an outer `<md-dialog>` element.\n *   Inside, use an `<md-dialog-content>` element for the dialog's content, and use\n *   an `<md-dialog-actions>` element for the dialog's actions.\n * - Dialogs must cover the entire application to keep interactions inside of them.\n * Use the `parent` option to change where dialogs are appended.\n *\n * ## Sizing\n * - Complex dialogs can be sized with `flex=\"percentage\"`, i.e. `flex=\"66\"`.\n * - Default max-width is 80% of the `rootElement` or `parent`.\n *\n * ## CSS\n * - `.md-dialog-content` - class that sets the padding on the content as the spec file\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-app=\"demoApp\" ng-controller=\"AppController as ctrl\">\n *   <div>\n *     <md-button ng-click=\"ctrl.showAlert()\" class=\"md-raised md-warn\">\n *       Basic Alert!\n *       </md-button>\n *   </div>\n *   <div>\n *     <md-button ng-click=\"ctrl.showDialog($event)\" class=\"md-raised\">\n *       Custom Dialog\n *       </md-button>\n *   </div>\n * </div>\n * </hljs>\n *\n * ### JavaScript: object syntax\n * <hljs lang=\"js\">\n * (function(angular, undefined) {\n *   \"use strict\";\n *\n *   angular\n *    .module('demoApp', ['ngMaterial'])\n *    .controller('AppCtrl', AppController);\n *\n *   function AppController($mdDialog) {\n *     var alert;\n *     var ctrl = this;\n *     ctrl.showAlert = showAlert;\n *     ctrl.showDialog = showDialog;\n *     ctrl.items = [1, 2, 3];\n *\n *     // Internal method\n *     function showAlert() {\n *       alert = $mdDialog.alert({\n *         title: 'Attention',\n *         textContent: 'This is an example of how simple dialogs can be!',\n *         ok: 'Close'\n *       });\n *\n *       $mdDialog\n *         .show( alert )\n *         .finally(function() {\n *           alert = undefined;\n *         });\n *     }\n *\n *     function showDialog($event) {\n *        var parentEl = angular.element(document.body);\n *        $mdDialog.show({\n *          parent: parentEl,\n *          targetEvent: $event,\n *          template:\n *            '<md-dialog aria-label=\"List dialog\">' +\n *            '  <md-dialog-content>'+\n *            '    <md-list>'+\n *            '      <md-list-item ng-repeat=\"item in ctrl.items\">'+\n *            '       <p>Number {{item}}</p>' +\n *            '      </md-item>'+\n *            '    </md-list>'+\n *            '  </md-dialog-content>' +\n *            '  <md-dialog-actions>' +\n *            '    <md-button ng-click=\"ctrl.closeDialog()\" class=\"md-primary\">' +\n *            '      Close Dialog' +\n *            '    </md-button>' +\n *            '  </md-dialog-actions>' +\n *            '</md-dialog>',\n *          locals: {\n *            items: ctrl.items\n *          },\n *          controller: DialogController\n *          controllerAs: 'ctrl'\n *       });\n *       function DialogController($mdDialog) {\n *         this.closeDialog = function() {\n *           $mdDialog.hide();\n *         }\n *       }\n *     }\n *   }\n * })(angular);\n * </hljs>\n *\n * ### Multiple Dialogs\n * Using the `multiple` option for the `$mdDialog` service allows developers to show multiple\n * dialogs at the same time.\n *\n * <hljs lang=\"js\">\n *   // From plain options\n *   $mdDialog.show({\n *     multiple: true\n *   });\n *\n *   // From a dialog preset\n *   $mdDialog.show(\n *     $mdDialog\n *       .alert()\n *       .multiple(true)\n *   );\n *\n * </hljs>\n *\n * ### Pre-Rendered Dialogs\n * By using the `contentElement` option, it is possible to use an already existing element in the\n * DOM.\n *\n * > Pre-rendered dialogs will be not linked to any scope and will not instantiate any new\n * > controller.<br/>\n * > You can manually link the elements to a scope or instantiate a controller from the template\n * > (using `ng-controller`).\n *\n * <hljs lang=\"js\">\n *   function showPrerenderedDialog() {\n *     $mdDialog.show({\n *       contentElement: '#myStaticDialog',\n *       parent: angular.element(document.body)\n *     });\n *   }\n * </hljs>\n *\n * When using a string as value, `$mdDialog` will automatically query the DOM for the specified CSS\n * selector.\n *\n * <hljs lang=\"html\">\n *   <div style=\"visibility: hidden\">\n *     <div class=\"md-dialog-container\" id=\"myStaticDialog\">\n *       <md-dialog>\n *         This is a pre-rendered dialog.\n *       </md-dialog>\n *     </div>\n *   </div>\n * </hljs>\n *\n * **Notice**: It is important, to use the `.md-dialog-container` as the content element, otherwise\n * the dialog will not show up.\n *\n * It also possible to use a DOM element for the `contentElement` option.\n * - `contentElement: document.querySelector('#myStaticDialog')`\n * - `contentElement: angular.element(TEMPLATE)`\n *\n * When using a `template` as content element, it will be not compiled upon open.\n * This allows you to compile the element yourself and use it each time the dialog opens.\n *\n * ### Custom Presets\n * Developers are also able to create their own preset, which can be used without repeating\n * their options each time.\n *\n * <hljs lang=\"js\">\n *   $mdDialogProvider.addPreset('testPreset', {\n *     options: function() {\n *       return {\n *         template:\n *           '<md-dialog>' +\n *             'This is a custom preset' +\n *           '</md-dialog>',\n *         controllerAs: 'dialog',\n *         bindToController: true,\n *         clickOutsideToClose: true,\n *         escapeToClose: true\n *       };\n *     }\n *   });\n * </hljs>\n *\n * After creating your preset in the `config` phase, you can access it.\n *\n * <hljs lang=\"js\">\n *   $mdDialog.show(\n *     $mdDialog.testPreset()\n *   );\n * </hljs>\n *\n * ### JavaScript: promise API syntax, custom dialog template\n *\n * <hljs lang=\"js\">\n * (function(angular, undefined) {\n *   \"use strict\";\n *\n *   angular\n *     .module('demoApp', ['ngMaterial'])\n *     .controller('EmployeeController', EmployeeController)\n *     .controller('GreetingController', GreetingController);\n *\n *   // Fictitious Employee Editor to show how to use simple and complex dialogs.\n *\n *   function EmployeeController($mdDialog) {\n *     var alert;\n *     var ctrl = this;\n *\n *     ctrl.showAlert = showAlert;\n *     ctrl.showGreeting = showCustomGreeting;\n *\n *     ctrl.hasAlert = function() { return !!alert };\n *     ctrl.userName = ctrl.userName || 'Bobby';\n *\n *     // Dialog #1 - Show simple alert dialog and cache reference to dialog instance\n *\n *     function showAlert() {\n *       alert = $mdDialog.alert()\n *         .title('Attention, ' + ctrl.userName)\n *         .textContent('This is an example of how simple dialogs can be!')\n *         .ok('Close');\n *\n *       $mdDialog\n *         .show(alert)\n *         .finally(function() {\n *           alert = undefined;\n *         });\n *     }\n *\n *     // Dialog #2 - Demonstrate more complex dialogs construction and popup.\n *\n *     function showCustomGreeting($event) {\n *       $mdDialog.show({\n *         targetEvent: $event,\n *         template:\n *           '<md-dialog>' +\n *           '  <md-dialog-content>Hello {{ ctrl.employee }}!</md-dialog-content>' +\n *           '  <md-dialog-actions>' +\n *           '    <md-button ng-click=\"ctrl.closeDialog()\" class=\"md-primary\">' +\n *           '      Close Greeting' +\n *           '    </md-button>' +\n *           '  </md-dialog-actions>' +\n *           '</md-dialog>',\n *         controller: GreetingController,\n *         controllerAs: 'ctrl',\n *         onComplete: afterShowAnimation,\n *         locals: { employee: ctrl.userName }\n *       });\n *\n *       // When the 'enter' animation finishes...\n *       function afterShowAnimation(scope, element, options) {\n *         // post-show code here: DOM element focus, etc.\n *       }\n *     }\n *   }\n *\n *   // Greeting controller used with the 'showCustomGreeting()' custom dialog\n *   function GreetingController($mdDialog, $log) {\n *     var ctrl = this;\n *     this.$log = $log;\n *\n *     ctrl.closeDialog = function() {\n *       // Hides the most recent dialog shown.\n *       // No specific dialog instance reference is needed.\n *       $mdDialog.hide();\n *     };\n *   }\n *\n *   GreetingController.prototype.$onInit = function() {\n *     // Assigned from the locals options passed to $mdDialog.show.\n *     this.$log.log('Employee Name: ', ctrl.employee);\n *   };\n *\n * })(angular);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#alert\n *\n * @description\n * Builds a preconfigured dialog with the specified message.\n *\n * @returns {Object} a dialog preset with the chainable configuration methods:\n *\n * - `title(string)` - Sets the alert title.\n * - `textContent(string)` - Sets the alert message.\n * - `htmlContent(string)` - Sets the alert message as HTML. Requires the `ngSanitize`\n *     module to be loaded. HTML is not run through AngularJS' compiler.\n * - `ok(string)` - Sets the alert \"Okay\" button text.\n * - `theme(string)` - Sets the theme of the alert dialog.\n * - `targetEvent(DOMClickEvent=)` - A click's event object. When passed in as an\n *     option, the location of the click will be used as the starting point for the opening\n *     animation of the the dialog.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#confirm\n *\n * @description\n * Builds a preconfigured dialog with the specified message. You can call show and the promise\n * returned will be resolved if the user clicks the confirm action on the dialog. The promise will\n * be rejected if the user clicks the cancel action or dismisses the dialog.\n *\n * @returns {Object} a dialog preset with the chainable configuration methods:\n *\n * Additionally, it supports the following methods:\n *\n * - `title(string)` - Sets the confirm title.\n * - `textContent(string)` - Sets the confirm message.\n * - `htmlContent(string)` - Sets the confirm message as HTML. Requires the `ngSanitize`\n *     module to be loaded. HTML is not run through AngularJS' compiler.\n * - `ok(string)` - Sets the confirm \"Okay\" button text.\n * - `cancel(string)` - Sets the confirm \"Cancel\" button text.\n * - `theme(string)` - Sets the theme of the confirm dialog.\n * - `targetEvent(DOMClickEvent=)` - A click's event object. When passed in as an\n *     option, the location of the click will be used as the starting point for the opening\n *     animation of the the dialog.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#prompt\n *\n * @description\n * Builds a preconfigured dialog with the specified message and input box. You can call show and the\n * promise returned will be resolved, if the user clicks the prompt action on the dialog, passing\n * the input value as the first argument. The promise will be rejected if the user clicks the cancel\n * action or dismisses the dialog.\n *\n * @returns {Object} a dialog preset with the chainable configuration methods:\n *\n * Additionally, it supports the following methods:\n *\n * - `title(string)` - Sets the prompt title.\n * - `textContent(string)` - Sets the prompt message.\n * - `htmlContent(string)` - Sets the prompt message as HTML. Requires the `ngSanitize`\n *     module to be loaded. HTML is not run through AngularJS' compiler.\n * - `placeholder(string)` - Sets the placeholder text for the input.\n * - `required(boolean)` - Sets the input required value.\n * - `initialValue(string)` - Sets the initial value for the prompt input.\n * - `ok(string)` - Sets the prompt \"Okay\" button text.\n * - `cancel(string)` - Sets the prompt \"Cancel\" button text.\n * - `theme(string)` - Sets the theme of the prompt dialog.\n * - `targetEvent(DOMClickEvent=)` - A click's event object. When passed in as an\n *     option, the location of the click will be used as the starting point for the opening\n *     animation of the the dialog.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#show\n *\n * @description\n * Show a dialog with the specified options.\n *\n * @param {Object} optionsOrPreset Either provide a dialog preset returned from `alert()`,\n * `prompt()`, or `confirm()`; or an options object with the following properties:\n *   - `templateUrl` - `{string=}`: The url of a template that will be used as the content\n *      of the dialog.\n *   - `template` - `{string=}`: HTML template to show in the dialog. This **must** be trusted HTML\n *      with respect to AngularJS' [$sce service](https://docs.angularjs.org/api/ng/service/$sce).\n *      This template should **never** be constructed with any kind of user input or user data.\n *   - `contentElement` - `{string|Element}`: Instead of using a template, which will be compiled\n *      each time a dialog opens, you can also use a DOM element.<br/>\n *     * When specifying an element, which is present on the DOM, `$mdDialog` will temporary fetch\n *     the element into the dialog and restores it at the old DOM position upon close.\n *     * When specifying a string, the string be used as a CSS selector, to lookup for the element\n *     in the DOM.\n *   - `autoWrap` - `{boolean=}`: Whether or not to automatically wrap the template with a\n *     `<md-dialog>` tag if one is not provided. Defaults to true. Can be disabled if you provide a\n *     custom dialog directive.\n *   - `targetEvent` - `{DOMClickEvent=}`: A click's event object. When passed in as an option,\n *     the location of the click will be used as the starting point for the opening animation\n *     of the the dialog.\n *   - `openFrom` - `{string|Element|Object}`: The query selector, DOM element or the Rect object\n *     that is used to determine the bounds (top, left, height, width) from which the Dialog will\n *     originate.\n *   - `closeTo` - `{string|Element|Object}`: The query selector, DOM element or the Rect object\n *     that is used to determine the bounds (top, left, height, width) to which the Dialog will\n *     target.\n *   - `scope` - `{Object=}`: the scope to link the template / controller to. If none is specified,\n *     it will create a new isolate scope.\n *     This scope will be destroyed when the dialog is removed unless `preserveScope` is set to\n *     true.\n *   - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed.\n *     Default is false\n *   - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the dialog is open.\n *     Default true.\n *   - `hasBackdrop` - `{boolean=}`: Whether there should be an opaque backdrop behind the dialog.\n *     Default true.\n *   - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the dialog to\n *     close it. Default false.\n *   - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the dialog.\n *     Default true.\n *   - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on open. Only disable if\n *     focusing some other way, as focus management is required for dialogs to be accessible.\n *     Defaults to true.\n *   - `controller` - `{Function|string=}`: The controller to associate with the dialog. The\n *     controller will be injected with the local `$mdDialog`, which passes along a scope for the\n *     dialog.\n *   - `locals` - `{Object=}`: An object containing key/value pairs. The keys will be used as names\n *     of values to inject into the controller. For example, `locals: {three: 3}` would inject\n *     `three` into the controller, with the value 3. If `bindToController` is true, they will be\n *     copied to the controller instead.\n *   - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n *   - `resolve` - `{Function=}`: Similar to locals, except it takes as values functions that return\n *     promises, and the dialog will not open until all of the promises resolve.\n *   - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n *   - `parent` - `{element=}`: The element to append the dialog to. Defaults to appending\n *     to the root element of the application.\n *   - `onShowing` - `Function(scope, element, options: Object=, controller: Object)=`: Callback\n *     function used to notify the show() animation is starting.\n *   - `onComplete` - `Function(scope, element, options: Object=)=`: Callback function used to\n *     notify when the show() animation is finished.\n *   - `onRemoving` - `Function(element, removePromise)`: Callback function used to announce the\n *      close/hide() action is starting. This allows developers to run custom animations\n *      in parallel with the close animations.\n *   - `fullscreen` `{boolean=}`: An option to toggle whether the dialog should show in fullscreen\n *      or not. Defaults to `false`.\n *   - `multiple` `{boolean=}`: An option to allow this dialog to display over one that's currently\n *     open.\n * @returns {Promise} A promise that can be resolved with `$mdDialog.hide()` or\n * rejected with `$mdDialog.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#hide\n *\n * @description\n * Hide an existing dialog and resolve the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the resolved promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#cancel\n *\n * @description\n * Hide an existing dialog and reject the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\nfunction MdDialogProvider($$interimElementProvider) {\n  // Elements to capture and redirect focus when the user presses tab at the dialog boundary.\n  var topFocusTrap, bottomFocusTrap;\n  var removeFocusTrap;\n\n  return $$interimElementProvider('$mdDialog')\n    .setDefaults({\n      methods: ['disableParentScroll', 'hasBackdrop', 'clickOutsideToClose', 'escapeToClose',\n          'targetEvent', 'closeTo', 'openFrom', 'parent', 'fullscreen', 'multiple'],\n      options: dialogDefaultOptions\n    })\n    .addPreset('alert', {\n      methods: ['title', 'htmlContent', 'textContent', 'ariaLabel', 'ok', 'theme',\n          'css'],\n      options: advancedDialogOptions\n    })\n    .addPreset('confirm', {\n      methods: ['title', 'htmlContent', 'textContent', 'ariaLabel', 'ok', 'cancel',\n          'theme', 'css'],\n      options: advancedDialogOptions\n    })\n    .addPreset('prompt', {\n      methods: ['title', 'htmlContent', 'textContent', 'initialValue', 'placeholder', 'ariaLabel',\n          'ok', 'cancel', 'theme', 'css', 'required'],\n      options: advancedDialogOptions\n    });\n\n  /* @ngInject */\n  function advancedDialogOptions() {\n    return {\n      template: [\n        '<md-dialog md-theme=\"{{ dialog.theme || dialog.defaultTheme }}\" aria-label=\"{{ dialog.ariaLabel }}\" ng-class=\"dialog.css\">',\n        '  <md-dialog-content class=\"md-dialog-content\" role=\"document\" tabIndex=\"-1\">',\n        '    <h2 class=\"md-title\">{{ dialog.title }}</h2>',\n        '    <div ng-if=\"::dialog.mdHtmlContent\" class=\"md-dialog-content-body\" ',\n        '        ng-bind-html=\"::dialog.mdHtmlContent\"></div>',\n        '    <div ng-if=\"::!dialog.mdHtmlContent\" class=\"md-dialog-content-body\">',\n        '      <p>{{::dialog.mdTextContent}}</p>',\n        '    </div>',\n        '    <md-input-container md-no-float ng-if=\"::dialog.$type == \\'prompt\\'\" class=\"md-prompt-input-container\">',\n        '      <input ng-keypress=\"dialog.keypress($event)\" md-autofocus ng-model=\"dialog.result\" ' +\n        '             placeholder=\"{{::dialog.placeholder}}\" ng-required=\"dialog.required\">',\n        '    </md-input-container>',\n        '  </md-dialog-content>',\n        '  <md-dialog-actions>',\n        '    <md-button ng-if=\"dialog.$type === \\'confirm\\' || dialog.$type === \\'prompt\\'\"' +\n        '               ng-click=\"dialog.abort()\" class=\"md-primary md-cancel-button\">',\n        '      {{ dialog.cancel }}',\n        '    </md-button>',\n        '    <md-button ng-click=\"dialog.hide()\" class=\"md-primary md-confirm-button\" md-autofocus=\"dialog.$type===\\'alert\\'\"' +\n        '               ng-disabled=\"dialog.required && !dialog.result\">',\n        '      {{ dialog.ok }}',\n        '    </md-button>',\n        '  </md-dialog-actions>',\n        '</md-dialog>'\n      ].join('').replace(/\\s\\s+/g, ''),\n      controller: MdDialogController,\n      controllerAs: 'dialog',\n      bindToController: true,\n    };\n  }\n\n  /**\n   * Controller for the md-dialog interim elements\n   * @ngInject\n   */\n  function MdDialogController($mdDialog, $mdConstant) {\n    // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in\n    // interimElements. The $mdCompiler simulates the $onInit hook for all versions.\n    this.$onInit = function() {\n      var isPrompt = this.$type === 'prompt';\n\n      if (isPrompt && this.initialValue) {\n        this.result = this.initialValue;\n      }\n\n      this.hide = function() {\n        $mdDialog.hide(isPrompt ? this.result : true);\n      };\n      this.abort = function() {\n        $mdDialog.cancel();\n      };\n      this.keypress = function($event) {\n        var invalidPrompt = isPrompt && this.required && !angular.isDefined(this.result);\n\n        if ($event.keyCode === $mdConstant.KEY_CODE.ENTER && !invalidPrompt) {\n          $mdDialog.hide(this.result);\n        }\n      };\n    };\n  }\n\n  /* @ngInject */\n  function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document,\n                                $window, $rootElement, $log, $injector, $mdTheming, $interpolate,\n                                $mdInteraction) {\n    return {\n      hasBackdrop: true,\n      isolateScope: true,\n      onCompiling: beforeCompile,\n      onShow: onShow,\n      onShowing: beforeShow,\n      onRemove: onRemove,\n      clickOutsideToClose: false,\n      escapeToClose: true,\n      targetEvent: null,\n      closeTo: null,\n      openFrom: null,\n      focusOnOpen: true,\n      disableParentScroll: true,\n      autoWrap: true,\n      fullscreen: false,\n      transformTemplate: function(template, options) {\n        // Make the dialog container focusable, because otherwise the focus will be always\n        // redirected to an element outside of the container, and the focus trap won't work.\n        // Also the tabindex is needed for the `escapeToClose` functionality, because\n        // the keyDown event can't be triggered when the focus is outside of the container.\n        var startSymbol = $interpolate.startSymbol();\n        var endSymbol = $interpolate.endSymbol();\n        var theme = startSymbol + (options.themeWatch ? '' : '::') + 'theme' + endSymbol;\n        var themeAttr = (options.hasTheme) ? 'md-theme=\"'+theme+'\"': '';\n        return '<div class=\"md-dialog-container\" tabindex=\"-1\" ' + themeAttr + '>' + validatedTemplate(template) + '</div>';\n\n        /**\n         * The specified template should contain a <md-dialog> wrapper element....\n         */\n        function validatedTemplate(template) {\n          if (options.autoWrap && !/<\\/md-dialog>/g.test(template)) {\n            return '<md-dialog>' + (template || '') + '</md-dialog>';\n          } else {\n            return template || '';\n          }\n        }\n      }\n    };\n\n    function beforeCompile(options) {\n      // Automatically apply the theme, if the user didn't specify a theme explicitly.\n      // Those option changes need to be done, before the compilation has started, because otherwise\n      // the option changes will be not available in the $mdCompilers locales.\n      options.defaultTheme = $mdTheming.defaultTheme();\n\n      detectTheming(options);\n    }\n\n    function beforeShow(scope, element, options, controller) {\n\n      if (controller) {\n        var mdHtmlContent = controller.htmlContent || options.htmlContent || '';\n        var mdTextContent = controller.textContent || options.textContent || '';\n\n        if (mdHtmlContent && !$injector.has('$sanitize')) {\n          throw Error('The ngSanitize module must be loaded in order to use htmlContent.');\n        }\n\n        if (mdHtmlContent && mdTextContent) {\n          throw Error('md-dialog cannot have both `htmlContent` and `textContent`');\n        }\n\n        // Only assign the content if nothing throws, otherwise it'll still be compiled.\n        controller.mdHtmlContent = mdHtmlContent;\n        controller.mdTextContent = mdTextContent;\n      }\n    }\n\n    /** Show method for dialogs */\n    function onShow(scope, element, options) {\n      angular.element($document[0].body).addClass('md-dialog-is-showing');\n\n      var dialogElement = element.find('md-dialog');\n\n      // Once a dialog has `ng-cloak` applied on his template the dialog animation will not work\n      // properly. This is a very common problem, so we have to notify the developer about this.\n      if (dialogElement.hasClass('ng-cloak')) {\n        var message =\n          '$mdDialog: using `<md-dialog ng-cloak>` will affect the dialog opening animations.';\n        $log.warn(message, element[0]);\n      }\n\n      captureParentAndFromToElements(options);\n      configureAria(dialogElement, options);\n      showBackdrop(scope, element, options);\n      activateListeners(element, options);\n\n      return dialogPopIn(element, options)\n        .then(function() {\n          lockScreenReader(element, options);\n          focusOnOpen();\n        });\n\n      /**\n       * For alerts, focus on content... otherwise focus on the close button (or equivalent)\n       */\n      function focusOnOpen() {\n        if (options.focusOnOpen) {\n          var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;\n          target.focus();\n        }\n\n        /**\n         * If no element with class dialog-close, try to find the last\n         * button child in md-dialog-actions and assume it is a close button.\n         *\n         * If we find no actions at all, log a warning to the console.\n         */\n        function findCloseButton() {\n          return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');\n        }\n      }\n    }\n\n    /**\n     * Remove function for all dialogs\n     */\n    function onRemove(scope, element, options) {\n      options.deactivateListeners();\n      options.unlockScreenReader();\n      options.hideBackdrop(options.$destroy);\n\n      // Remove the focus traps that we added earlier for keeping focus within the dialog.\n      if (removeFocusTrap) {\n        removeFocusTrap();\n        removeFocusTrap = null;\n      }\n\n      // For navigation $destroy events, do a quick, non-animated removal,\n      // but for normal closes (from clicks, etc) animate the removal\n      return options.$destroy ? detachAndClean() : animateRemoval().then(detachAndClean);\n\n      /**\n       * For normal closes, animate the removal.\n       * For forced closes (like $destroy events), skip the animations\n       */\n      function animateRemoval() {\n        return dialogPopOut(element, options);\n      }\n\n      /**\n       * Detach the element\n       */\n      function detachAndClean() {\n        angular.element($document[0].body).removeClass('md-dialog-is-showing');\n\n        // Reverse the container stretch if using a content element.\n        if (options.contentElement) {\n          options.reverseContainerStretch();\n        }\n\n        // Exposed cleanup function from the $mdCompiler.\n        options.cleanupElement();\n\n        // Restores the focus to the origin element if the last interaction upon opening was a keyboard.\n        if (!options.$destroy && options.originInteraction === 'keyboard') {\n          options.origin.focus();\n        }\n      }\n    }\n\n    function detectTheming(options) {\n      // Once the user specifies a targetEvent, we will automatically try to find the correct\n      // nested theme.\n      var targetEl;\n      if (options.targetEvent && options.targetEvent.target) {\n        targetEl = angular.element(options.targetEvent.target);\n      }\n\n      var themeCtrl = targetEl && targetEl.controller('mdTheme');\n\n      options.hasTheme = (!!themeCtrl);\n\n      if (!options.hasTheme) {\n        return;\n      }\n\n      options.themeWatch = themeCtrl.$shouldWatch;\n\n      var theme = options.theme || themeCtrl.$mdTheme;\n\n      if (theme) {\n        options.scope.theme = theme;\n      }\n\n      var unwatch = themeCtrl.registerChanges(function (newTheme) {\n        options.scope.theme = newTheme;\n\n        if (!options.themeWatch) {\n          unwatch();\n        }\n      });\n    }\n\n    /**\n     * Capture originator/trigger/from/to element information (if available)\n     * and the parent container for the dialog; defaults to the $rootElement\n     * unless overridden in the options.parent\n     */\n    function captureParentAndFromToElements(options) {\n          options.origin = angular.extend({\n            element: null,\n            bounds: null,\n            focus: angular.noop\n          }, options.origin || {});\n\n          options.parent   = getDomElement(options.parent, $rootElement);\n          options.closeTo  = getBoundingClientRect(getDomElement(options.closeTo));\n          options.openFrom = getBoundingClientRect(getDomElement(options.openFrom));\n\n          if (options.targetEvent) {\n            options.origin = getBoundingClientRect(options.targetEvent.target, options.origin);\n            options.originInteraction = $mdInteraction.getLastInteractionType();\n          }\n\n\n          /**\n           * Identify the bounding RECT for the target element\n           *\n           */\n          function getBoundingClientRect (element, orig) {\n            var source = angular.element((element || {}));\n            if (source && source.length) {\n              // Compute and save the target element's bounding rect, so that if the\n              // element is hidden when the dialog closes, we can shrink the dialog\n              // back to the same position it expanded from.\n              //\n              // Checking if the source is a rect object or a DOM element\n              var bounds = {top:0,left:0,height:0,width:0};\n              var hasFn = angular.isFunction(source[0].getBoundingClientRect);\n\n              return angular.extend(orig || {}, {\n                  element : hasFn ? source : undefined,\n                  bounds  : hasFn ? source[0].getBoundingClientRect() : angular.extend({}, bounds, source[0]),\n                  focus   : angular.bind(source, source.focus),\n              });\n            }\n          }\n\n          /**\n           * If the specifier is a simple string selector, then query for\n           * the DOM element.\n           */\n          function getDomElement(element, defaultElement) {\n            if (angular.isString(element)) {\n              element = $document[0].querySelector(element);\n            }\n\n            // If we have a reference to a raw dom element, always wrap it in jqLite\n            return angular.element(element || defaultElement);\n          }\n\n        }\n\n    /**\n     * Listen for escape keys and outside clicks to auto close\n     */\n    function activateListeners(element, options) {\n      var window = angular.element($window);\n      var onWindowResize = $mdUtil.debounce(function() {\n        stretchDialogContainerToViewport(element, options);\n      }, 60);\n\n      var removeListeners = [];\n      var smartClose = function() {\n        // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n        // cancel or fallback to hide.\n        var closeFn = (options.$type === 'alert') ? $mdDialog.hide : $mdDialog.cancel;\n        $mdUtil.nextTick(closeFn, true);\n      };\n\n      if (options.escapeToClose) {\n        var parentTarget = options.parent;\n        var keyHandlerFn = function(ev) {\n          if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n            ev.stopImmediatePropagation();\n            ev.preventDefault();\n\n            smartClose();\n          }\n        };\n\n        // Add keydown listeners\n        element.on('keydown', keyHandlerFn);\n        parentTarget.on('keydown', keyHandlerFn);\n\n        // Queue remove listeners function\n        removeListeners.push(function() {\n          element.off('keydown', keyHandlerFn);\n          parentTarget.off('keydown', keyHandlerFn);\n        });\n      }\n\n      // Register listener to update dialog on window resize\n      window.on('resize', onWindowResize);\n\n      removeListeners.push(function() {\n        window.off('resize', onWindowResize);\n      });\n\n      if (options.clickOutsideToClose) {\n        var target = element;\n        var sourceElem;\n\n        // Keep track of the element on which the mouse originally went down\n        // so that we can only close the backdrop when the 'click' started on it.\n        // A simple 'click' handler does not work,\n        // it sets the target object as the element the mouse went down on.\n        var mousedownHandler = function(ev) {\n          sourceElem = ev.target;\n        };\n\n        // We check if our original element and the target is the backdrop\n        // because if the original was the backdrop and the target was inside the dialog\n        // we don't want to dialog to close.\n        var mouseupHandler = function(ev) {\n          if (sourceElem === target[0] && ev.target === target[0]) {\n            ev.stopPropagation();\n            ev.preventDefault();\n\n            smartClose();\n          }\n        };\n\n        // Add listeners\n        target.on('mousedown', mousedownHandler);\n        target.on('mouseup', mouseupHandler);\n\n        // Queue remove listeners function\n        removeListeners.push(function() {\n          target.off('mousedown', mousedownHandler);\n          target.off('mouseup', mouseupHandler);\n        });\n      }\n\n      // Attach specific `remove` listener handler\n      options.deactivateListeners = function() {\n        removeListeners.forEach(function(removeFn) {\n          removeFn();\n        });\n        options.deactivateListeners = null;\n      };\n    }\n\n    /**\n     * Show modal backdrop element...\n     */\n    function showBackdrop(scope, element, options) {\n\n      if (options.disableParentScroll) {\n        // !! DO this before creating the backdrop; since disableScrollAround()\n        //    configures the scroll offset; which is used by mdBackDrop postLink()\n        options.restoreScroll = $mdUtil.disableScrollAround(element, options.parent);\n      }\n\n      if (options.hasBackdrop) {\n        options.backdrop = $mdUtil.createBackdrop(scope, \"md-dialog-backdrop md-opaque\");\n        $animate.enter(options.backdrop, options.parent);\n      }\n\n      /**\n       * Hide modal backdrop element...\n       */\n      options.hideBackdrop = function hideBackdrop($destroy) {\n        if (options.backdrop) {\n          if ($destroy) {\n            options.backdrop.remove();\n          } else {\n            $animate.leave(options.backdrop);\n          }\n        }\n\n        if (options.disableParentScroll) {\n          options.restoreScroll && options.restoreScroll();\n          delete options.restoreScroll;\n        }\n\n        options.hideBackdrop = null;\n      };\n    }\n\n    /**\n     * Inject ARIA-specific attributes appropriate for Dialogs\n     */\n    function configureAria(element, options) {\n\n      var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';\n      var dialogContent = element.find('md-dialog-content');\n      var existingDialogId = element.attr('id');\n      var dialogContentId = 'dialogContent_' + (existingDialogId || $mdUtil.nextUid());\n\n      element.attr({\n        'role': role,\n        'tabIndex': '-1'\n      });\n\n      if (dialogContent.length === 0) {\n        dialogContent = element;\n        // If the dialog element already had an ID, don't clobber it.\n        if (existingDialogId) {\n          dialogContentId = existingDialogId;\n        }\n      }\n\n      dialogContent.attr('id', dialogContentId);\n      element.attr('aria-describedby', dialogContentId);\n\n      if (options.ariaLabel) {\n        $mdAria.expect(element, 'aria-label', options.ariaLabel);\n      }\n      else {\n        $mdAria.expectAsync(element, 'aria-label', function() {\n          // If dialog title is specified, set aria-label with it\n          // See https://github.com/angular/material/issues/10582\n          if (options.title) {\n            return options.title;\n          } else {\n            var words = dialogContent.text().split(/\\s+/);\n            if (words.length > 3) words = words.slice(0, 3).concat('...');\n            return words.join(' ');\n          }\n        });\n      }\n\n      // Set up elements before and after the dialog content to capture focus and\n      // redirect back into the dialog.\n      topFocusTrap = document.createElement('div');\n      topFocusTrap.classList.add('md-dialog-focus-trap');\n      topFocusTrap.tabIndex = 0;\n\n      bottomFocusTrap = topFocusTrap.cloneNode(false);\n\n      /**\n       * When focus is about to move out of the end of the dialog, we intercept it and redirect it\n       * back to the md-dialog element.\n       * When focus is about to move out of the start of the dialog, we intercept it and redirect it\n       * back to the last focusable element in the md-dialog.\n       * @param {FocusEvent} event\n       */\n      var focusHandler = function(event) {\n        if (event.target && event.target.nextSibling &&\n            event.target.nextSibling.nodeName === 'MD-DIALOG') {\n          var lastFocusableElement = $mdUtil.getLastTabbableElement(element[0]);\n          if (angular.isElement(lastFocusableElement)) {\n            lastFocusableElement.focus();\n          }\n        } else {\n          element.focus();\n        }\n      };\n\n      topFocusTrap.addEventListener('focus', focusHandler);\n      bottomFocusTrap.addEventListener('focus', focusHandler);\n\n      removeFocusTrap = function () {\n        topFocusTrap.removeEventListener('focus', focusHandler);\n        bottomFocusTrap.removeEventListener('focus', focusHandler);\n\n        if (topFocusTrap && topFocusTrap.parentNode) {\n          topFocusTrap.parentNode.removeChild(topFocusTrap);\n        }\n\n        if (bottomFocusTrap && bottomFocusTrap.parentNode) {\n          bottomFocusTrap.parentNode.removeChild(bottomFocusTrap);\n        }\n      };\n\n      // The top focus trap inserted immediately before the md-dialog element (as a sibling).\n      // The bottom focus trap is inserted immediately after the md-dialog element (as a sibling).\n      element[0].parentNode.insertBefore(topFocusTrap, element[0]);\n      element.after(bottomFocusTrap);\n    }\n\n    /**\n     * Prevents screen reader interaction behind modal window on swipe interfaces.\n     */\n    function lockScreenReader(element, options) {\n      var isHidden = true;\n\n      // get raw DOM node\n      walkDOM(element[0]);\n\n      options.unlockScreenReader = function () {\n        isHidden = false;\n        walkDOM(element[0]);\n\n        options.unlockScreenReader = null;\n      };\n\n      /**\n       * Get all of an element's parent elements up the DOM tree.\n       * @param {Node & ParentNode} element the element to start from\n       * @return {Element[]} The parent elements\n       */\n      function getParents(element) {\n        var parents = [];\n        while (element.parentNode) {\n          if (element === document.body) {\n            return parents;\n          }\n          var children = element.parentNode.children;\n          for (var i = 0; i < children.length; i++) {\n            // skip over child if it is an ascendant of the dialog\n            // a script or style tag, or a live region.\n            if (element !== children[i] &&\n                !isNodeOneOf(children[i], ['SCRIPT', 'STYLE']) &&\n                !children[i].hasAttribute('aria-live')) {\n              parents.push(children[i]);\n            }\n          }\n          element = element.parentNode;\n        }\n        return parents;\n      }\n\n      /**\n       * Walk DOM to apply or remove aria-hidden on sibling nodes and parent sibling nodes.\n       * @param {Element} element the element to start from when walking up the DOM\n       * @returns {void}\n       */\n      function walkDOM(element) {\n        var elements = getParents(element);\n        for (var i = 0; i < elements.length; i++) {\n          elements[i].setAttribute('aria-hidden', isHidden);\n        }\n      }\n    }\n\n    /**\n     * Ensure the dialog container fill-stretches to the viewport.\n     * @param {JQLite} container dialog container\n     * @param {Object} options\n     * @returns {function(): void} function that reverts the modified styles\n     */\n    function stretchDialogContainerToViewport(container, options) {\n      var isFixed = $window.getComputedStyle($document[0].body).position === 'fixed';\n      var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;\n      var height = backdrop ?\n        Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10))))\n        : 0;\n\n      var previousStyles = {\n        top: container.css('top'),\n        height: container.css('height')\n      };\n\n      // If the body is fixed, determine the distance to the viewport in relative from the parent.\n      var parentTop = Math.abs(options.parent[0].getBoundingClientRect().top);\n\n      container.css({\n        top: (isFixed ? parentTop : 0) + 'px',\n        height: height ? height + 'px' : '100%'\n      });\n\n      return function() {\n        // Reverts the modified styles back to the previous values.\n        // This is needed for contentElements, which should have the same styles after close\n        // as before.\n        container.css(previousStyles);\n      };\n    }\n\n    /**\n     * Dialog open and pop-in animation.\n     * @param {JQLite} container dialog container\n     * @param {Object} options\n     * @returns {*}\n     */\n    function dialogPopIn(container, options) {\n      // Add the `md-dialog-container` to the DOM\n      options.parent.append(container);\n      options.reverseContainerStretch = stretchDialogContainerToViewport(container, options);\n\n      var dialogEl = container.find('md-dialog');\n      var animator = $mdUtil.dom.animator;\n      var buildTranslateToOrigin = animator.calculateZoomToOrigin;\n      var translateOptions = {transitionInClass: 'md-transition-in', transitionOutClass: 'md-transition-out'};\n      var from = animator.toTransformCss(buildTranslateToOrigin(dialogEl, options.openFrom || options.origin));\n      var to = animator.toTransformCss(\"\");  // defaults to center display (or parent or $rootElement)\n\n      dialogEl.toggleClass('md-dialog-fullscreen', !!options.fullscreen);\n\n      return animator\n        .translate3d(dialogEl, from, to, translateOptions)\n        .then(function(animateReversal) {\n\n          // Build a reversal translate function synced to this translation...\n          options.reverseAnimate = function() {\n            delete options.reverseAnimate;\n\n            if (options.closeTo) {\n              // Using the opposite classes to create a close animation to the closeTo element\n              translateOptions = {transitionInClass: 'md-transition-out', transitionOutClass: 'md-transition-in'};\n              from = to;\n              to = animator.toTransformCss(buildTranslateToOrigin(dialogEl, options.closeTo));\n\n              return animator\n                .translate3d(dialogEl, from, to,translateOptions);\n            }\n\n            return animateReversal(\n              to = animator.toTransformCss(\n                // in case the origin element has moved or is hidden,\n                // let's recalculate the translateCSS\n                buildTranslateToOrigin(dialogEl, options.origin)\n              )\n            );\n          };\n\n          // Function to revert the generated animation styles on the dialog element.\n          // Useful when using a contentElement instead of a template.\n          options.clearAnimate = function() {\n            delete options.clearAnimate;\n\n            // Remove the transition classes, added from $animateCSS, since those can't be removed\n            // by reversely running the animator.\n            dialogEl.removeClass([\n              translateOptions.transitionOutClass,\n              translateOptions.transitionInClass\n            ].join(' '));\n\n            // Run the animation reversely to remove the previous added animation styles.\n            return animator.translate3d(dialogEl, to, animator.toTransformCss(''), {});\n          };\n\n          return true;\n        });\n    }\n\n    /**\n     * Dialog close and pop-out animation.\n     * @param {JQLite} container dialog container\n     * @param {Object} options\n     * @returns {*}\n     */\n    function dialogPopOut(container, options) {\n      return options.reverseAnimate().then(function() {\n        if (options.contentElement) {\n          // When we use a contentElement, we want the element to be the same as before.\n          // That means, that we have to clear all the animation properties, like transform.\n          options.clearAnimate();\n        }\n      });\n    }\n\n    /**\n     * Utility function to filter out raw DOM nodes.\n     * @param {Node} elem\n     * @param {string[]} nodeTypeArray\n     * @returns {boolean}\n     */\n    function isNodeOneOf(elem, nodeTypeArray) {\n      return nodeTypeArray.indexOf(elem.nodeName) !== -1;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/dialog/dialog.scss",
    "content": "$dialog-padding: $baseline-grid * 3 !default;\n\n.md-dialog-is-showing {\n  max-height: 100%;\n}\n\n.md-dialog-container {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  z-index: $z-index-dialog;\n  overflow: hidden;\n}\n\nmd-dialog {\n\n  &.md-transition-in {\n    opacity: 1;\n    transition: $swift-ease-out;\n    transform: translate(0,0) scale(1.0);\n  }\n  &.md-transition-out {\n    opacity: 0;\n    transition: $swift-ease-out;\n    transform: translate(0,100%) scale(0.2);\n  }\n\n  opacity: 0;\n  min-width: 240px;\n  max-width: 80%;\n  max-height: 80%;\n  position: relative;\n  overflow: auto; // stop content from leaking out of dialog parent and fix IE\n\n  box-shadow: $whiteframe-shadow-13dp;\n\n  display: flex;\n  flex-direction: column;\n\n  &> form {\n    display: flex;\n    flex-direction: column;\n    overflow: auto;\n  }\n\n  .md-dialog-content {\n    padding: $dialog-padding;\n  }\n\n  md-dialog-content {\n    order: 1;\n    flex-direction: column;\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n\n    &:not([layout=row]) > *:first-child:not(.md-subheader) {\n      margin-top: 0;\n    }\n\n    &:focus {\n      outline: none;\n    }\n\n    .md-subheader {\n      margin: 0;\n    }\n\n    .md-dialog-content-body {\n      width:100%;\n    }\n\n    .md-prompt-input-container {\n      width: 100%;\n      box-sizing: border-box;\n    }\n  }\n\n  md-dialog-actions {\n    display: flex;\n    order: 2;\n    box-sizing: border-box;\n    align-items: center;\n    justify-content: flex-end;\n    margin-bottom: 0;\n    @include rtl(padding-right, $baseline-grid, $baseline-grid * 2);\n    @include rtl(padding-left, $baseline-grid * 2, $baseline-grid);\n    min-height: $baseline-grid * 6.5;\n    overflow: hidden;\n\n    .md-button {\n      margin-bottom: $baseline-grid;\n      @include rtl(margin-left, $baseline-grid, 0);\n      @include rtl(margin-right, 0, $baseline-grid);\n      margin-top: $baseline-grid;\n    }\n  }\n  &.md-content-overflow {\n    md-dialog-actions {\n      border-top-width: 1px;\n      border-top-style: solid;\n    }\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-dialog {\n    border: 1px solid #fff;\n  }\n}\n\n@media (max-width: $layout-breakpoint-sm - 1) {\n  md-dialog.md-dialog-fullscreen {\n    min-height: 100%;\n    min-width: 100%;\n    border-radius: 0;\n  }\n}\n"
  },
  {
    "path": "src/components/dialog/dialog.spec.js",
    "content": "describe('$mdDialog', function() {\n  var $mdDialog, $rootScope;\n  var runAnimation;\n\n  beforeEach(module('material.components.dialog', 'ngSanitize'));\n  beforeEach(inject(function($$q, $animate, $injector) {\n    $mdDialog = $injector.get('$mdDialog');\n    $rootScope = $injector.get('$rootScope');\n\n    // Spy on animation effects.\n    spyOn($animate, 'leave').and.callFake(function(element) {\n      element.remove();\n      return $$q.when();\n    });\n    spyOn($animate, 'enter').and.callFake(function(element, parent) {\n      parent.append(element);\n      return $$q.when();\n    });\n  }));\n\n  beforeEach(inject(function($material) {\n    runAnimation = function() {\n      $material.flushInterimElement();\n    };\n  }));\n\n  describe('md-dialog', function() {\n    it('should have `._md` class indicator', inject(function($compile, $rootScope) {\n      var element = $compile('<md-dialog></md-dialog>')($rootScope.$new());\n      expect(element.hasClass('_md')).toBe(true);\n    }));\n  });\n\n  describe('#alert()', function() {\n    hasConfigurationMethods('alert', [\n      'title', 'htmlContent', 'textContent', 'ariaLabel', 'ok', 'targetEvent', 'theme'\n    ]);\n\n    it('shows a basic confirm dialog without content', inject(function($animate, $rootScope, $mdDialog) {\n          var parent = angular.element('<div>');\n          var resolved = false;\n\n          $mdDialog.show(\n            $mdDialog\n              .confirm()\n              .parent(parent)\n              .title('')\n              .css('someClass anotherClass')\n              .ok('Next')\n              .cancel(\"Back\")\n          ).then(function() {\n              resolved = true;\n            });\n\n          $rootScope.$apply();\n          runAnimation();\n\n          var mdContainer = angular.element(parent[0].querySelector('.md-dialog-container'));\n          var mdDialog = mdContainer.find('md-dialog');\n          var mdContent = mdDialog.find('md-dialog-content');\n          var title = mdContent.find('h2');\n          var contentBody = mdContent[0].querySelector('.md-dialog-content-body');\n          var buttons = parent.find('md-button');\n          var css = mdDialog.attr('class').split(' ');\n\n          expect(title.text()).toBe('');\n          expect(contentBody.textContent).toBe('');\n          expect(css).toContain('someClass');\n          expect(css).toContain('anotherClass');\n\n          buttons.eq(0).triggerHandler('click');\n\n          $rootScope.$apply();\n          runAnimation();\n\n          expect(resolved).toBe(true);\n        }));\n\n    it('shows a basic alert dialog', inject(function($animate, $rootScope, $mdDialog) {\n      var parent = angular.element('<div>');\n      var resolved = false;\n\n      $mdDialog.show(\n        $mdDialog\n          .alert()\n          .parent(parent)\n          .title('Title')\n          .textContent('Hello world')\n          .theme('some-theme')\n          .css('someClass anotherClass')\n          .ok('Next')\n      ).then(function() {\n          resolved = true;\n        });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      var mdContainer = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var mdDialog = mdContainer.find('md-dialog');\n      var mdContent = mdDialog.find('md-dialog-content');\n      var title = mdContent.find('h2');\n      var contentBody = mdContent[0].querySelector('.md-dialog-content-body');\n      var buttons = parent.find('md-button');\n      var theme = mdDialog.attr('md-theme');\n      var css = mdDialog.attr('class').split(' ');\n\n      expect(title.text()).toBe('Title');\n      expect(contentBody.textContent).toBe('Hello world');\n      expect(buttons.length).toBe(1);\n      expect(buttons.eq(0).text()).toBe('Next');\n      expect(theme).toBe('some-theme');\n      expect(css).toContain('someClass');\n      expect(css).toContain('anotherClass');\n      expect(mdDialog.attr('role')).toBe('alertdialog');\n      expect(mdDialog.attr('aria-label')).toBe('Title');\n\n      buttons.eq(0).triggerHandler('click');\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect(resolved).toBe(true);\n    }));\n\n    it('should normally use the default theme', inject(function($animate, $rootScope, $mdDialog) {\n      var dialogParent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog\n          .alert()\n          .parent(dialogParent)\n          .title(\"Title\")\n          .textContent(\"Themed Dialog\")\n          .ok('Close')\n      );\n\n      $rootScope.$apply();\n      runAnimation();\n\n      var mdContainer = angular.element(dialogParent[0].querySelector('.md-dialog-container'));\n      var mdDialog = mdContainer.find('md-dialog');\n\n      expect(mdDialog.attr('md-theme')).toBe('default');\n    }));\n\n    it('should apply the specified theme', inject(function($animate, $rootScope, $mdDialog) {\n      var dialogParent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog\n          .alert()\n          .parent(dialogParent)\n          .title(\"Title\")\n          .theme('myTheme')\n          .textContent(\"Themed Dialog\")\n          .ok('Close')\n      );\n\n      $rootScope.$apply();\n      runAnimation();\n\n      var mdContainer = angular.element(dialogParent[0].querySelector('.md-dialog-container'));\n      var mdDialog = mdContainer.find('md-dialog');\n\n      expect(mdDialog.attr('md-theme')).toBe('myTheme');\n    }));\n\n    it('should focus `md-dialog-content` on open', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\" md-autofocus>' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation(parent.find('md-dialog'));\n\n      expect($document.activeElement).toBe(parent[0].querySelector('md-dialog-content'));\n    }));\n\n    it('should warn if the template contains a ng-cloak', inject(function($mdDialog, $rootScope, $document, $log) {\n      var parent = angular.element('<div>');\n\n      // Enable spy on $log.warn\n      spyOn($log, 'warn');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template:\n            '<md-dialog ng-cloak>' +\n              '<md-dialog-content>' +\n                '<p>Muppets are the best</p>' +\n              '</md-dialog-content>' +\n            '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation(parent.find('md-dialog'));\n\n      // The $mdDialog should throw a warning about the `ng-cloak`.\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should use the prefixed id from `md-dialog` for `md-dialog-content`', inject(function ($mdDialog) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '<md-dialog id=\"demoid\">' +\n          '<md-dialog-content>' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation();\n\n      var dialog = parent.find('md-dialog');\n      var content = parent[0].querySelector('md-dialog-content');\n\n      expect(content.id).toBe('dialogContent_' + dialog[0].id);\n    }));\n\n    it('should not clobber the id from `md-dialog` when there is no content', inject(function ($mdDialog) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '<md-dialog id=\"demoid\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation();\n\n      var dialog = parent.find('md-dialog');\n\n      expect(dialog[0].id).toBe('demoid');\n    }));\n\n    it('should apply a prefixed id for `md-dialog-content`', inject(function ($mdDialog) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '<md-dialog>' +\n          '<md-dialog-content>' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation();\n\n      var dialog = parent.find('md-dialog');\n      var content = parent[0].querySelector('md-dialog-content');\n\n      expect(content.id).toMatch(/dialogContent_[0-9]+/g);\n    }));\n\n    it('should remove `md-dialog-container` on mousedown mouseup and remove', inject(function($mdDialog, $rootScope, $timeout) {\n      jasmine.mockElementFocus(this);\n      var container, parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent,\n          clickOutsideToClose: true\n        })\n      );\n\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      container.triggerHandler({\n        type: 'mousedown',\n        target: container[0]\n      });\n      container.triggerHandler({\n        type: 'mouseup',\n        target: container[0]\n      });\n\n      $timeout.flush();\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(0);\n    }));\n\n    it('should remove `md-dialog-container` on scope.$destroy()', inject(function($mdDialog, $rootScope) {\n      var container, parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          template: '' +\n            '<md-dialog>' +\n            '  <md-dialog-content tabIndex=\"0\">' +\n            '    <p>Muppets are the best</p>' +\n            '  </md-dialog-content>' +\n            '</md-dialog>',\n          parent: parent\n        })\n      );\n\n      runAnimation(parent.find('md-dialog'));\n        $rootScope.$destroy();\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n\n      expect(container.length).toBe(0);\n    }));\n\n  });\n\n  describe('#confirm()', function() {\n    hasConfigurationMethods('confirm', [\n      'title', 'htmlContent', 'textContent', 'ariaLabel', 'ok', 'cancel', 'targetEvent', 'theme'\n    ]);\n\n    it('shows a basic confirm dialog with simple text content', inject(function($rootScope, $mdDialog) {\n      var parent = angular.element('<div>');\n      var rejected = false;\n      $mdDialog.show(\n        $mdDialog.confirm({\n          parent: parent\n        })\n          .title('Title')\n          .textContent('Hello world')\n          .ok('Next')\n          .cancel('Forget it')\n      ).catch(function() {\n          rejected = true;\n        });\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var dialog = parent.find('md-dialog');\n      var title = parent.find('h2');\n      var contentBody = parent[0].querySelector('.md-dialog-content-body');\n      var buttons = parent.find('md-button');\n\n      expect(dialog.attr('role')).toBe('dialog');\n      expect(title.text()).toBe('Title');\n      expect(contentBody.textContent).toBe('Hello world');\n      expect(buttons.length).toBe(2);\n      expect(buttons.eq(0).text()).toBe('Next');\n      expect(buttons.eq(1).text()).toBe('Forget it');\n      expect(dialog.attr('aria-label')).toBe('Title');\n\n      buttons.eq(1).triggerHandler('click');\n      runAnimation();\n\n      expect(parent.find('h2').length).toBe(0);\n      expect(rejected).toBe(true);\n    }));\n\n    it('should allow htmlContent with simple HTML tags', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          parent: parent,\n          ok: 'Next',\n          cancel: 'Back',\n          title: 'Which Way ',\n          htmlContent: '<div class=\"mine\">Choose</div>'\n        })\n      );\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var content = angular.element(container[0].querySelector('.mine'));\n\n      expect(content.text()).toBe('Choose');\n    }));\n\n    it('should NOT allow custom elements in confirm htmlContent', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          parent: parent,\n          ok: 'Next',\n          cancel: 'Back',\n          title: 'Which Way ',\n          htmlContent: '<my-content class=\"mine\">Choose</my-content> breakfast'\n        })\n      );\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var contentBody = container[0].querySelector('.md-dialog-content-body');\n\n      expect(contentBody.textContent).toBe('Choose breakfast');\n    }));\n\n    it('should NOT evaluate angular templates in confirm htmlContent', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          parent: parent,\n          ok: 'Next',\n          cancel: 'Back',\n          title: 'Which Way ',\n          htmlContent: '{{1 + 1}}'\n        })\n      );\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var contentBody = container[0].querySelector('.md-dialog-content-body');\n\n      expect(contentBody.textContent).toBe('{{1 + 1}}');\n    }));\n\n    it('should focus `md-button.dialog-close` on open', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '' +\n          '<md-dialog>' +\n          '  <md-dialog-actions>' +\n          '    <button class=\"dialog-close\">Close</button>' +\n          '  </md-dialog-actions>' +\n          '</md-dialog>',\n        parent: parent\n      });\n      runAnimation();\n\n      expect($document.activeElement).toBe(parent[0].querySelector('.dialog-close'));\n    }));\n\n    it('should remove `md-dialog-container` after mousedown mouseup outside', inject(function($mdDialog) {\n      jasmine.mockElementFocus(this);\n      var container, parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent,\n          clickOutsideToClose: true,\n          ok: 'OK',\n          cancel: 'CANCEL'\n        })\n      );\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      container.triggerHandler({\n        type: 'mousedown',\n        target: container[0]\n      });\n      container.triggerHandler({\n        type: 'mouseup',\n        target: container[0]\n      });\n\n      runAnimation();\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(0);\n    }));\n\n    it('should not remove `md-dialog-container` after mousedown outside mouseup inside', inject(function($mdDialog) {\n      jasmine.mockElementFocus(this);\n      var container, parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent,\n          clickOutsideToClose: true,\n          ok: 'OK',\n          cancel: 'CANCEL'\n        })\n      );\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var content = angular.element(parent[0].querySelector('md-dialog-content'));\n      container.triggerHandler({\n        type: 'mousedown',\n        target: container[0]\n      });\n      content.triggerHandler({\n        type: 'mouseup',\n        target: content[0]\n      });\n\n      runAnimation();\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(1);\n    }));\n\n    it('should not remove `md-dialog-container` after mousedown inside mouseup outside', inject(function($mdDialog) {\n      jasmine.mockElementFocus(this);\n      var container, parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent,\n          clickOutsideToClose: true,\n          ok: 'OK',\n          cancel: 'CANCEL'\n        })\n      );\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var content = angular.element(parent[0].querySelector('md-dialog-content'));\n      content.triggerHandler({\n        type: 'mousedown',\n        target: content[0]\n      });\n      container.triggerHandler({\n        type: 'mouseup',\n        target: container[0]\n      });\n\n      runAnimation();\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(1);\n    }));\n\n    it('should remove `md-dialog-container` after ESCAPE key', inject(function($mdDialog, $rootScope, $timeout, $mdConstant) {\n      jasmine.mockElementFocus(this);\n      var container, parent = angular.element('<div>');\n      var response;\n\n      $mdDialog.show(\n        $mdDialog.confirm({\n          template: '<md-dialog>' +\n          '<md-dialog-content tabIndex=\"0\">' +\n          '<p>Muppets are the best</p>' +\n          '</md-dialog-content>' +\n          '</md-dialog>',\n          parent: parent,\n          clickOutsideToClose: true,\n          escapeToClose: true,\n          ok: 'OK',\n          cancel: 'CANCEL'\n        })\n      ).catch(function(reason) {\n          response = reason;\n        });\n      runAnimation();\n\n      parent.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ESCAPE\n      });\n      runAnimation();\n      runAnimation();\n\n      container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(0);\n      expect(response).toBe(undefined);\n    }));\n\n    it('should only remove the top most dialog on escape', inject(function($mdDialog, $timeout, $mdConstant) {\n\n        var root = angular.element('<div></div>');\n        var parent = '<md-dialog class=\"one\"></md-dialog>';\n        var child = '<md-dialog class=\"two\"></md-dialog>';\n        var grandchild = '<md-dialog class=\"three\"></md-dialog>';\n\n        $mdDialog.show({\n            template: parent,\n            multiple: true,\n            parent: root,\n        });\n        runAnimation();\n\n        $mdDialog.show({\n            template: child,\n            multiple: true,\n            parent: root[0].querySelector('md-dialog.one'),\n        });\n        runAnimation();\n\n        $mdDialog.show({\n            template: grandchild,\n            multiple: true,\n            parent: root[0].querySelector('md-dialog.two'),\n        });\n        runAnimation();\n\n        root.triggerHandler({\n            type: 'keydown',\n            keyCode: $mdConstant.KEY_CODE.ESCAPE\n        });\n        runAnimation();\n\n        expect(root[0].querySelectorAll('md-dialog.one').length).toBe(1);\n        expect(root[0].querySelectorAll('md-dialog.two').length).toBe(1);\n        expect(root[0].querySelectorAll('md-dialog.three').length).toBe(0);\n\n    }));\n\n  });\n\n  describe('#prompt()', function() {\n    hasConfigurationMethods('prompt', ['title', 'htmlContent', 'textContent',\n      'placeholder', 'ariaLabel', 'ok', 'cancel', 'theme', 'css'\n    ]);\n\n    it('shows a basic prompt dialog', inject(function($animate, $rootScope, $mdDialog) {\n      var parent = angular.element('<div>');\n      var resolved = false;\n      var promptAnswer;\n\n      $mdDialog.show(\n        $mdDialog\n          .prompt()\n          .parent(parent)\n          .title('Title')\n          .textContent('Hello world')\n          .placeholder('placeholder text')\n          .initialValue('initial value')\n          .theme('some-theme')\n          .css('someClass anotherClass')\n          .ok('Next')\n          .cancel('Cancel')\n      ).then(function(answer) {\n          resolved = true;\n          promptAnswer = answer;\n        });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      var mdContainer = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var mdDialog = mdContainer.find('md-dialog');\n      var mdContent = mdDialog.find('md-dialog-content');\n      var title = mdContent.find('h2');\n      var contentBody = mdContent[0].querySelector('.md-dialog-content-body');\n      var inputElement = mdContent.find('input');\n      var buttons = parent.find('md-button');\n      var theme = mdDialog.attr('md-theme');\n      var css = mdDialog.attr('class').split(' ');\n\n      expect(title.text()).toBe('Title');\n      expect(contentBody.textContent).toBe('Hello world');\n      expect(inputElement[0].placeholder).toBe('placeholder text');\n      expect(inputElement.val()).toBe('initial value');\n      expect(buttons.length).toBe(2);\n      expect(buttons.eq(0).text()).toBe('Next');\n      expect(theme).toBe('some-theme');\n      expect(css).toContain('someClass');\n      expect(css).toContain('anotherClass');\n      expect(mdDialog.attr('role')).toBe('dialog');\n      expect(mdDialog.attr('aria-label')).toBe('Title');\n\n      inputElement.eq(0).text('responsetext');\n      inputElement.scope().$apply(\"dialog.result = 'responsetext'\");\n\n      buttons.eq(0).triggerHandler('click');\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect(resolved).toBe(true);\n      expect(promptAnswer).toBe('responsetext');\n    }));\n\n    it('should focus the input element on open', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog\n          .prompt()\n          .parent(parent)\n          .textContent('Hello world')\n          .placeholder('placeholder text')\n      );\n\n      runAnimation(parent.find('md-dialog'));\n\n      expect($document.activeElement).toBe(parent[0].querySelector('input'));\n    }));\n\n    it('should cancel the first dialog when opening a second', inject(function($mdDialog, $rootScope) {\n      var firstParent = angular.element('<div>');\n      var secondParent = angular.element('<div>');\n      var isCancelled = false;\n\n      $mdDialog.show(\n        $mdDialog\n          .prompt()\n          .parent(firstParent)\n          .textContent('Hello world')\n          .placeholder('placeholder text')\n      ).catch(function() {\n        isCancelled = true;\n      });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect(firstParent.find('md-dialog').length).toBe(1);\n\n      $mdDialog.show(\n        $mdDialog\n          .prompt()\n          .parent(secondParent)\n          .textContent('Hello world')\n          .placeholder('placeholder text')\n      );\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect(firstParent.find('md-dialog').length).toBe(0);\n      expect(secondParent.find('md-dialog').length).toBe(1);\n      expect(isCancelled).toBe(true);\n    }));\n\n    it('should submit after ENTER key', inject(function($mdDialog, $rootScope, $timeout, $mdConstant) {\n      jasmine.mockElementFocus(this);\n      var parent = angular.element('<div>');\n      var response;\n\n      $mdDialog.show(\n        $mdDialog\n          .prompt()\n          .parent(parent)\n          .textContent('Hello world')\n          .placeholder('placeholder text')\n      ).then(function(answer) {\n          response = answer;\n        });\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var mdDialog = container.find('md-dialog');\n      var mdContent = mdDialog.find('md-dialog-content');\n      var inputElement = mdContent.find('input');\n\n      inputElement.scope().$apply(\"dialog.result = 'responsetext'\");\n\n      inputElement.eq(0).triggerHandler({\n        type: 'keypress',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n      runAnimation();\n      runAnimation();\n\n      expect(response).toBe('responsetext');\n    }));\n\n    it('should submit after ENTER key when input is not empty and prompt is required', inject(function($mdDialog, $rootScope, $timeout, $mdConstant) {\n      spyOn($mdDialog, 'hide').and.callThrough();\n\n      jasmine.mockElementFocus(this);\n      var initialValue = 'input value';\n      var parent = angular.element('<div>');\n      var response;\n\n      var prompt = $mdDialog.prompt()\n        .parent(parent)\n        .required(true)\n        .initialValue(initialValue);\n\n      $mdDialog.show(prompt)\n        .then(function(answer) {\n          response = answer;\n        });\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      var mdDialog = container.find('md-dialog');\n      var mdContent = mdDialog.find('md-dialog-content');\n      var inputElement = mdContent.find('input');\n\n      inputElement.eq(0).triggerHandler({\n        type: 'keypress',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n      runAnimation();\n      runAnimation();\n\n      expect(response).toBe(initialValue);\n      expect($mdDialog.hide).toHaveBeenCalled();\n    }));\n\n    it('should not submit after ENTER key when input is empty and prompt is required', inject(function($mdDialog, $rootScope, $timeout, $mdConstant) {\n      spyOn($mdDialog, 'hide');\n\n      jasmine.mockElementFocus(this);\n      var parent = angular.element('<div>');\n      var response;\n      var prompt = $mdDialog.prompt().parent(parent).required(true);\n      $mdDialog.show(prompt).then(function(answer) {\n        response = answer;\n      });\n      runAnimation();\n\n      var inputElement = angular\n        .element(parent[0].querySelector('.md-dialog-container'))\n        .find('md-dialog')\n        .find('md-dialog-content')\n        .find('input');\n\n      inputElement.eq(0).triggerHandler({\n        type: 'keypress',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n      runAnimation();\n      runAnimation();\n\n      expect($mdDialog.hide).not.toHaveBeenCalled();\n    }));\n  });\n\n  describe('#build()', function() {\n    it('should support onShowing callbacks before `show()` starts', inject(function($mdDialog, $rootScope) {\n\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n      var showing = false;\n\n      $mdDialog.show({\n        template: template,\n        parent: parent,\n        onShowing: onShowing\n      });\n      $rootScope.$apply();\n\n      runAnimation();\n\n      function onShowing(scope, element, options) {\n        showing = true;\n        var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n        expect(container.length).toBe(0);\n      }\n\n      expect(showing).toBe(true);\n    }));\n\n    it('should support onComplete callbacks within `show()`', inject(function($mdDialog, $rootScope) {\n\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n      var ready = false;\n\n      $mdDialog.show({\n        template: template,\n        parent: parent,\n        onComplete: function(scope, element, options) {\n          ready = true;\n        }\n      });\n      $rootScope.$apply();\n      expect(ready).toBe(false);\n\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      expect(container.length).toBe(1);\n      expect(ready).toBe(true);\n    }));\n\n    it('should support onRemoving callbacks when `hide()` starts', inject(function($mdDialog, $rootScope, $timeout, $mdConstant) {\n\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n      var closing = false;\n\n      $mdDialog.show({\n        template: template,\n        parent: parent,\n        escapeToClose: true,\n        onRemoving: function(scope, element) {\n          expect(arguments.length).toEqual(2);\n          closing = true;\n        }\n      });\n      $rootScope.$apply();\n      expect(closing).toBe(false);\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      runAnimation();\n\n      parent.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ESCAPE\n      });\n      $timeout.flush();\n\n      expect(closing).toBe(true);\n    }));\n\n    it('should support specifying a parent using a string selector', inject(function($mdDialog, $rootScope, $document) {\n      var body = angular.element($document[0].querySelector(\"body\"));\n      var nodes = angular.element(''+\n            '<div class=\"wrapper\">' +\n            '  <md-content> </md-content>' +\n            '  <div id=\"owner\">' +\n            '  </div>' +\n            '</div>'\n      );\n\n      body.append(nodes);\n      $mdDialog.show({\n        template: '<md-dialog>Hello</md-dialog>',\n        parent: \"#owner\",\n      });\n      $rootScope.$apply();\n      runAnimation();\n\n      var owner = angular.element(body[0].querySelector('#owner'));\n      var container = angular.element(body[0].querySelector('.md-dialog-container'));\n\n      expect(container[0].parentNode === owner[0]).toBe(true);\n      nodes.remove();\n    }));\n\n    describe('when autoWrap parameter is true (default)', function() {\n\n      it('should not wrap content with existing md-dialog', inject(function($mdDialog, $rootScope) {\n\n        var template = '<md-dialog><div id=\"rawContent\">Hello</div></md-dialog>';\n        var parent = angular.element('<div>');\n\n        $mdDialog.show({\n          template: template,\n          parent: parent\n        });\n\n        $rootScope.$apply();\n\n        var container = parent[0].querySelectorAll('md-dialog');\n        expect(container.length).toBe(1);\n      }));\n\n      it('should wrap raw content with md-dialog', inject(function($mdDialog, $rootScope) {\n\n        var template = '<div id=\"rawContent\">Hello</div>';\n        var parent = angular.element('<div>');\n\n        $mdDialog.show({\n          template: template,\n          parent: parent\n        });\n\n        $rootScope.$apply();\n\n        var container = parent[0].querySelectorAll('md-dialog');\n        expect(container.length).toBe(1);\n      }));\n    });\n\n\n    describe('when autoWrap parameter is false', function() {\n\n      it('should not wrap raw content with md-dialog', inject(function($mdDialog, $rootScope) {\n\n        var template = '<md-dialog id=\"rawContent\">Hello</md-dialog>';\n        var parent = angular.element('<div>');\n\n        $mdDialog.show({\n          template: template,\n          parent: parent,\n          autoWrap: false\n        });\n\n        $rootScope.$apply();\n\n        var container = parent[0].querySelectorAll('md-dialog');\n        expect(container.length).toBe(1); // Should not have two dialogs; but one is required\n      }));\n    });\n\n    it('should append dialog within a md-dialog-container', inject(function($mdDialog, $rootScope) {\n\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n\n      $rootScope.$apply();\n\n      var container = parent[0].querySelectorAll('.md-dialog-container');\n      expect(container.length).toBe(1);\n    }));\n\n    it('should escapeToClose == true', inject(function($mdDialog, $rootScope, $rootElement, $timeout, $animate, $mdConstant) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '<md-dialog></md-dialog>',\n        parent: parent,\n        escapeToClose: true\n      });\n      $rootScope.$apply();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(1);\n\n      parent.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ESCAPE\n      });\n      $timeout.flush();\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(0);\n    }));\n\n    it('should close on escape before the animation started',\n      inject(function($mdDialog, $rootScope, $rootElement, $timeout, $animate, $mdConstant) {\n        var parent = angular.element('<div>');\n\n        $mdDialog.show({\n          template: '<md-dialog></md-dialog>',\n          parent: parent,\n          escapeToClose: true\n        });\n\n        $rootScope.$apply();\n\n        expect(parent.find('md-dialog').length).toBe(1);\n\n        parent.triggerHandler({\n          type: 'keydown',\n          keyCode: $mdConstant.KEY_CODE.ESCAPE\n        });\n        $timeout.flush();\n\n        runAnimation();\n\n        expect(parent.find('md-dialog').length).toBe(0);\n      }));\n\n    it('should escapeToClose == false', inject(function($mdDialog, $rootScope, $rootElement, $timeout, $animate, $mdConstant) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        escapeToClose: false\n      });\n      $rootScope.$apply();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      runAnimation();\n      expect(parent.find('md-dialog').length).toBe(1);\n\n      $rootElement.triggerHandler({type: 'keydown', keyCode: $mdConstant.KEY_CODE.ESCAPE});\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(1);\n    }));\n\n    it('should clickOutsideToClose == true', inject(function($mdDialog, $rootScope) {\n\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        clickOutsideToClose: true\n      });\n      $rootScope.$apply();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      runAnimation();\n      expect(parent.find('md-dialog').length).toBe(1);\n\n      container.triggerHandler({\n        type: 'mousedown',\n        target: container[0]\n      });\n      container.triggerHandler({\n        type: 'mouseup',\n        target: container[0]\n      });\n      runAnimation();\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(0);\n    }));\n\n    it('should clickOutsideToClose == false', inject(function($mdDialog, $rootScope) {\n\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        clickOutsideToClose: false\n      });\n\n      $rootScope.$apply();\n      expect(parent.find('md-dialog').length).toBe(1);\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n\n      container.triggerHandler({\n        type: 'click',\n        target: container[0]\n      });\n\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog').length).toBe(1);\n    }));\n\n    it('should disableParentScroll == true', inject(function($mdDialog, $animate, $rootScope, $mdUtil) {\n      spyOn($mdUtil, 'disableScrollAround');\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        disableParentScroll: true\n      });\n      runAnimation();\n      expect($mdUtil.disableScrollAround).toHaveBeenCalled();\n    }));\n\n    it('should hasBackdrop == true', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        hasBackdrop: true\n      });\n\n      runAnimation();\n      expect(parent.find('md-dialog').length).toBe(1);\n      expect(parent.find('md-backdrop').length).toBe(1);\n    }));\n\n    it('should hasBackdrop == false', inject(function($mdDialog, $rootScope) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '',\n        parent: parent,\n        hasBackdrop: false\n      });\n\n      $rootScope.$apply();\n      expect(parent[0].querySelectorAll('md-dialog').length).toBe(1);\n      expect(parent[0].querySelectorAll('md-backdrop').length).toBe(0);\n    }));\n\n    it('should focusOnOpen == true', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        focusOnOpen: true,\n        parent: parent,\n        template:\n          '<md-dialog>' +\n          '  <md-dialog-actions>' +\n          '    <button id=\"a\">A</md-button>' +\n          '    <button id=\"focus-target\">B</md-button>' +\n          '  </md-dialog-actions>' +\n          '</md-dialog>'\n      });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect($document.activeElement).toBe(parent[0].querySelector('#focus-target'));\n    }));\n\n    it('should restore the focus to the origin upon close', inject(function($mdDialog, $compile, $rootScope) {\n      var scope = $rootScope.$new();\n      var body = angular.element(document.body);\n      var parent = angular.element('<div>');\n      var button = $compile('<button ng-click=\"openDialog($event)\">Open</button>')(scope);\n\n      // Append the button to the body, because otherwise the dialog is not able to determine\n      // the origin rectangle.\n      document.body.appendChild(button[0]);\n\n      scope.openDialog = function($event) {\n        $mdDialog.show({\n          parent: parent,\n          template: '<md-dialog>Test</md-dialog>',\n          targetEvent: $event,\n          scope: scope.$new()\n        });\n      };\n\n      // Emit a keyboard event to fake a keyboard interaction.\n      body.triggerHandler('keydown');\n      button.triggerHandler('click');\n\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(1);\n      expect(document.activeElement).not.toBe(button[0]);\n\n\n      $mdDialog.hide();\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(0);\n      expect(document.activeElement).toBe(button[0]);\n\n      button.remove();\n    }));\n\n    it('should not restore the focus without keyboard interaction', inject(function($mdDialog, $compile, $rootScope) {\n      var scope = $rootScope.$new();\n      var body = angular.element(document.body);\n      var parent = angular.element('<div>');\n      var button = $compile('<button ng-click=\"openDialog($event)\">Open</button>')(scope);\n\n      // Append the button to the body, because otherwise the dialog is not able to determine\n      // the origin rectangle.\n      document.body.appendChild(button[0]);\n\n      scope.openDialog = function($event) {\n        $mdDialog.show({\n          parent: parent,\n          template: '<md-dialog>Test</md-dialog>',\n          targetEvent: $event,\n          scope: scope.$new()\n        });\n      };\n\n      // Emit a keyboard event to fake a mouse interaction.\n      body.triggerHandler('mousedown');\n      button.triggerHandler('click');\n\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(1);\n      expect(document.activeElement).not.toBe(button[0]);\n\n\n      $mdDialog.hide();\n      runAnimation();\n\n      expect(parent.find('md-dialog').length).toBe(0);\n      expect(document.activeElement).not.toBe(button[0]);\n\n      button.remove();\n    }));\n\n    it('should focus the dialog element if no actions are set', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n\n      $mdDialog.show({\n        parent: parent,\n        template:\n        '<md-dialog></md-dialog>'\n      });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      expect($document.activeElement).toBe(parent[0].querySelector('md-dialog'));\n\n    }));\n\n    it('should focusOnOpen == false', inject(function($mdDialog, $rootScope, $document) {\n      jasmine.mockElementFocus(this);\n\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        focusOnOpen: false,\n        parent: parent,\n        template:\n          '<md-dialog>' +\n            '<md-dialog-actions>' +\n              '<button id=\"a\">A</md-button>' +\n              '<button id=\"focus-target\">B</md-button>' +\n            '</md-dialog-actions>' +\n          '</md-dialog>',\n      });\n\n      $rootScope.$apply();\n      runAnimation();\n\n      var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n      runAnimation();\n\n      expect($document.activeElement).toBe(undefined);\n    }));\n\n    it('should focus the last `md-button` in md-dialog-actions open if no `.dialog-close`',\n      inject(function ($mdDialog, $rootScope, $document) {\n        jasmine.mockElementFocus(this);\n\n        var parent = angular.element('<div>');\n        $mdDialog.show({\n          template:\n            '<md-dialog>' +\n            '  <md-dialog-actions>' +\n            '    <button id=\"a\">A</md-button>' +\n            '    <button id=\"focus-target\">B</md-button>' +\n            '  </md-dialog-actions>' +\n            '</md-dialog>',\n          parent: parent\n        });\n\n        runAnimation();\n\n        expect($document.activeElement).toBe(parent[0].querySelector('#focus-target'));\n      }));\n\n    it('should only allow one open at a time', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '<md-dialog class=\"one\">',\n        parent: parent\n      });\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog.one').length).toBe(1);\n      expect(parent[0].querySelectorAll('md-dialog.two').length).toBe(0);\n\n      $mdDialog.show({\n        template: '<md-dialog class=\"two\">',\n        parent: parent\n      });\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog.one').length).toBe(0);\n      expect(parent[0].querySelectorAll('md-dialog.two').length).toBe(1);\n    }));\n\n    it('should hide dialog', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '<md-dialog class=\"one\">',\n        parent: parent\n      });\n      runAnimation();\n\n      $mdDialog.hide();\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog.one').length).toBe(0);\n    }));\n\n    it('should allow opening new dialog after existing without corruption', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '<md-dialog class=\"one\">',\n        parent: parent\n      });\n      runAnimation();\n      $mdDialog.hide();\n      runAnimation();\n\n      $mdDialog.show({\n        template: '<md-dialog class=\"two\">',\n        parent: parent\n      });\n      runAnimation();\n      $mdDialog.hide();\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog.one').length).toBe(0);\n      expect(parent[0].querySelectorAll('md-dialog.two').length).toBe(0);\n    }));\n\n    it('should allow opening new dialog from existing without corruption', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n      $mdDialog.show({\n        template: '<md-dialog class=\"one\">',\n        parent: parent\n      });\n      runAnimation();\n\n      $mdDialog.show({\n        template: '<md-dialog class=\"two\">',\n        parent: parent\n      });\n      // First run is for the old dialog being hidden.\n      runAnimation();\n      // Second run is for the new dialog being shown.\n      runAnimation();\n      $mdDialog.hide();\n      runAnimation();\n\n      expect(parent[0].querySelectorAll('md-dialog.one').length).toBe(0);\n      expect(parent[0].querySelectorAll('md-dialog.two').length).toBe(0);\n    }));\n\n    it('should be able to close a dialog when a child dialog fails to compile', inject(function ($mdDialog, $q) {\n\n        var root = angular.element('<div>');\n\n        var parent =  angular.element('<md-dialog class=\"one\"></md-dialog>');\n\n        var child = angular.element('<md-dialog class=\"two\"></md-dialog>');\n\n        $mdDialog.show({\n            template: parent,\n            multiple: true,\n            parent: root,\n        });\n        runAnimation();\n\n        expect(root[0].querySelectorAll('md-dialog').length).toBe(1);\n\n        $mdDialog.show({\n            template: child,\n            multiple: true,\n            parent: parent,\n            resolve: {\n                fail: function () {\n                    return $q.reject();\n                }\n            },\n        });\n        runAnimation();\n\n        expect(root[0].querySelectorAll('md-dialog').length).toBe(1);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(root[0].querySelectorAll('md-dialog').length).toBe(0);\n\n    }));\n\n    describe('contentElement', function() {\n      var $mdDialog, $rootScope, $compile, $timeout;\n\n      beforeEach(inject(function($injector) {\n        $mdDialog = $injector.get('$mdDialog');\n        $rootScope = $injector.get('$rootScope');\n        $compile = $injector.get('$compile');\n        $timeout = $injector.get('$timeout');\n      }));\n\n      it('should correctly move the contentElement', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\">' +\n            '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n\n        // Add the contentElement to the DOM.\n        document.body.appendChild(contentElement[0]);\n\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: parentEl,\n          escapeToClose: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(document.body);\n\n        document.body.removeChild(contentElement[0]);\n      });\n\n      it('should support contentElement as a preset method', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\">' +\n            '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n\n        // Add the contentElement to the DOM.\n        document.body.appendChild(contentElement[0]);\n\n        $mdDialog.show(\n          $mdDialog\n            .build()\n            .contentElement(contentElement)\n            .parent(parentEl)\n            .escapeToClose(true)\n        );\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(document.body);\n\n        document.body.removeChild(contentElement[0]);\n      });\n\n      it('should correctly query for a contentElement', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\" id=\"myId\">' +\n            '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n\n        // Add the contentElement to the DOM.\n        document.body.appendChild(contentElement[0]);\n\n        $mdDialog.show({\n          contentElement: '#myId',\n          parent: parentEl,\n          escapeToClose: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(document.body);\n\n        document.body.removeChild(contentElement[0]);\n      });\n\n      it('should also work with a virtual pre-compiled element', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\" id=\"myId\">' +\n          '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: parentEl,\n          escapeToClose: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(contentElement[0].offsetParent).toBeFalsy();\n      });\n\n      it('should properly toggle the fullscreen class', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\" id=\"myId\">' +\n            '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n        var dialogEl = contentElement.find('md-dialog');\n\n        // Show the dialog with fullscreen enabled.\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: parentEl,\n          escapeToClose: true,\n          fullscreen: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n        expect(dialogEl).toHaveClass('md-dialog-fullscreen');\n\n        // Hide the dialog to allow the second dialog to show up.\n        $mdDialog.hide();\n        runAnimation();\n\n        // Show the dialog with fullscreen disabled\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: parentEl,\n          escapeToClose: true,\n          fullscreen: false\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n        expect(dialogEl).not.toHaveClass('md-dialog-fullscreen');\n\n        // Hide the dialog to avoid issues with other tests.\n        $mdDialog.hide();\n        runAnimation();\n      });\n\n      it('should remove the transition classes', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\" id=\"myId\">' +\n            '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var parentEl = angular.element('<div>');\n        var dialogEl = contentElement.find('md-dialog');\n\n        // Show the dialog with fullscreen enabled.\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: parentEl,\n          escapeToClose: true,\n          fullscreen: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(parentEl[0]);\n        expect(dialogEl).toHaveClass('md-transition-in');\n\n        // Hide the dialog to allow the second dialog to show up.\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(dialogEl).not.toHaveClass('md-transition-in');\n        expect(dialogEl).not.toHaveClass('md-transition-out');\n      });\n\n      it('should restore the contentElement at its previous position', function() {\n        var contentElement = $compile(\n          '<div class=\"md-dialog-container\">' +\n          '<md-dialog>Dialog</md-dialog>' +\n          '</div>'\n        )($rootScope);\n\n        var dialogParent = angular.element('<div>');\n        var contentParent = angular.element(\n          '<div>' +\n          '<span>Child Element</span>' +\n          '</div>'\n        );\n\n        // Append the content parent to the document, otherwise contentElement is not able\n        // to detect it properly.\n        document.body.appendChild(contentParent[0]);\n\n        contentParent.prepend(contentElement);\n\n        $mdDialog.show({\n          contentElement: contentElement,\n          parent: dialogParent,\n          escapeToClose: true\n        });\n\n        $rootScope.$apply();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(dialogParent[0]);\n\n        $mdDialog.hide();\n        runAnimation();\n\n        expect(contentElement[0].parentNode).toBe(contentParent[0]);\n\n        var childNodes = [].slice.call(contentParent[0].children);\n        expect(childNodes.indexOf(contentElement[0])).toBe(0);\n\n        document.body.removeChild(contentParent[0]);\n      });\n\n    });\n\n    it('should have the dialog role', inject(function($mdDialog, $rootScope) {\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n\n      $rootScope.$apply();\n\n      var dialog = angular.element(parent[0].querySelectorAll('md-dialog'));\n      expect(dialog.attr('role')).toBe('dialog');\n    }));\n\n    it('should create an ARIA label if one is missing', inject(function($mdDialog) {\n      var template = '<md-dialog>Hello</md-dialog>';\n      var parent = angular.element('<div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n      runAnimation();\n\n      var dialog = angular.element(parent[0].querySelector('md-dialog'));\n      expect(dialog.attr('aria-label')).toEqual(dialog.text());\n    }));\n\n    it('should not modify an existing ARIA label', inject(function($mdDialog) {\n      var template = '<md-dialog aria-label=\"Some Other Thing\">Hello</md-dialog>';\n      var parent = angular.element('<div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n\n      runAnimation();\n\n      var dialog = angular.element(parent[0].querySelector('md-dialog'));\n      expect(dialog.attr('aria-label')).not.toEqual(dialog.text());\n      expect(dialog.attr('aria-label')).toEqual('Some Other Thing');\n    }));\n\n    it('should add an ARIA label if supplied through chaining', inject(function($mdDialog) {\n      var parent = angular.element('<div>');\n\n      $mdDialog.show(\n        $mdDialog.alert({\n          parent: parent\n        })\n          .ariaLabel('label')\n      );\n\n      runAnimation();\n\n      var dialog = angular.element(parent[0].querySelector('md-dialog'));\n      expect(dialog.attr('aria-label')).toEqual('label');\n    }));\n\n    it('should apply aria-hidden to siblings', inject(function($mdDialog) {\n\n      var template = '<md-dialog aria-label=\"Some Other Thing\">Hello</md-dialog>';\n      var parent = angular.element('<div>');\n      parent.append('<div class=\"sibling\"></div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n\n      runAnimation();\n\n      var dialog = angular.element(parent.find('md-dialog'));\n      expect(dialog.attr('aria-hidden')).toBe(undefined);\n      expect(dialog.parent().attr('aria-hidden')).toBe(undefined);\n\n      var sibling = angular.element(parent[0].querySelector('.sibling'));\n      expect(sibling.attr('aria-hidden')).toBe('true');\n    }));\n\n    it('should not apply aria-hidden to live region siblings', inject(function($mdDialog) {\n\n      var template = '<md-dialog aria-label=\"Some Other Thing\">Hello</md-dialog>';\n      var parent = angular.element('<div>');\n      parent.append('<div aria-live=\"polite\"></div>');\n\n      $mdDialog.show({\n        template: template,\n        parent: parent\n      });\n\n      runAnimation();\n\n      var liveRegion = angular.element(parent[0].querySelector('[aria-live]'));\n      expect(liveRegion.attr('aria-hidden')).toBe(undefined);\n    }));\n\n    it('should trap focus inside of the dialog', function() {\n      var template = '<md-dialog>Hello <input></md-dialog>';\n      var parent = document.createElement('div');\n\n      // Append the parent to the DOM so that we can test focus behavior.\n      document.body.appendChild(parent);\n\n      $mdDialog.show({template: template, parent: parent});\n      runAnimation();\n\n      $rootScope.$apply();\n\n      // It should add two focus traps to the document around the dialog content.\n      var focusTraps = parent.querySelectorAll('.md-dialog-focus-trap');\n      expect(focusTraps.length).toBe(2);\n\n      var topTrap = focusTraps[0];\n      var bottomTrap = focusTraps[1];\n\n      var dialog = parent.querySelector('md-dialog');\n      var isDialogFocused = false;\n      dialog.addEventListener('focus', function() {\n        isDialogFocused = true;\n      });\n\n      // Both of the focus traps should be in the normal tab order.\n      expect(topTrap.tabIndex).toBe(0);\n      expect(bottomTrap.tabIndex).toBe(0);\n\n      // TODO(jelbourn): Find a way to test that focusing the traps redirects focus to the\n      // md-dialog element. Firefox is problematic here, as calling element.focus() inside of\n      // a focus event listener seems not to immediately update the document.activeElement.\n      // This is a behavior better captured by an e2e test.\n\n      $mdDialog.hide();\n      runAnimation();\n\n      // All of the focus traps should be removed when the dialog is closed.\n      focusTraps = document.querySelectorAll('.md-dialog-focus-trap');\n      expect(focusTraps.length).toBe(0);\n\n      // Clean up our modifications to the DOM.\n      document.body.removeChild(parent);\n    });\n\n    describe('theming', function () {\n\n      it('should inherit md-theme if the child has a md-theme to inherit',\n        inject(function ($mdDialog, $mdTheming, $rootScope, $compile) {\n\n          var template = '<div id=\"rawContent\">Hello</div>';\n          var parent = angular.element('<div>');\n\n          var button = $compile(\n            '<button ng-click=\"showDialog($event)\" md-theme=\"coolTheme\">test</button>'\n          )($rootScope);\n\n          $mdTheming(button);\n\n          $rootScope.showDialog = function (ev) {\n            $mdDialog.show({\n              template: template,\n              parent: parent,\n              targetEvent: ev\n            });\n          };\n\n          button[0].click();\n\n          var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n\n          expect(container.attr('md-theme')).toEqual('coolTheme');\n        }));\n\n      it('should not set md-theme if the child does not have md-theme to inherit',\n        inject(function ($mdDialog, $mdTheming, $rootScope, $compile) {\n\n          var template = '<div id=\"rawContent\">Hello</div>';\n          var parent = angular.element('<div>');\n\n          var button = $compile('<button ng-click=\"showDialog($event)\">test</button>')($rootScope);\n\n          $mdTheming(button);\n\n          $rootScope.showDialog = function (ev) {\n            $mdDialog.show({\n              template: template,\n              parent: parent,\n              targetEvent: ev\n            });\n          };\n\n          button[0].click();\n\n          var container = angular.element(parent[0].querySelector('.md-dialog-container'));\n\n          expect(container.attr('md-theme')).toBeUndefined();\n        }));\n\n      it('should inherit targetElement theme', inject(function($mdDialog, $mdTheming, $rootScope, $compile) {\n        var template = '<div id=\"rawContent\">Hello</div>';\n        var parent = angular.element('<div>');\n\n        var button = $compile('<button ng-click=\"showDialog($event)\" md-theme=\"myTheme\">test</button>')($rootScope);\n\n        $mdTheming(button);\n\n        $rootScope.showDialog = function (ev) {\n          $mdDialog.show({\n            template: template,\n            parent: parent,\n            targetEvent: ev\n          });\n        };\n\n        button[0].click();\n\n        var container = parent[0].querySelector('.md-dialog-container');\n        var dialog = angular.element(container).find('md-dialog');\n        expect(dialog.hasClass('md-myTheme-theme')).toBeTruthy();\n      }));\n\n      it('should watch targetElement theme if it has interpolation', inject(function($mdDialog, $mdTheming, $rootScope, $compile) {\n        var template = '<div id=\"rawContent\">Hello</div>';\n        var parent = angular.element('<div>');\n\n        $rootScope.theme = 'myTheme';\n\n        var button = $compile('<button ng-click=\"showDialog($event)\" md-theme=\"{{theme}}\">test</button>')($rootScope);\n\n        $mdTheming(button);\n\n        $rootScope.showDialog = function (ev) {\n          $mdDialog.show({\n            template: template,\n            parent: parent,\n            targetEvent: ev\n          });\n        };\n\n        button[0].click();\n\n        var container = parent[0].querySelector('.md-dialog-container');\n        var dialog = angular.element(container).find('md-dialog');\n        expect(dialog.hasClass('md-myTheme-theme')).toBeTruthy();\n        $rootScope.$apply('theme = \"anotherTheme\"');\n        expect(dialog.hasClass('md-anotherTheme-theme')).toBeTruthy();\n      }));\n\n      it('should resolve targetElement theme if it\\'s a function', inject(function($mdDialog, $mdTheming, $rootScope, $compile) {\n        var template = '<div id=\"rawContent\">Hello</div>';\n        var parent = angular.element('<div>');\n\n        $rootScope.theme = function () {\n          return 'myTheme';\n        };\n\n        var button = $compile('<button ng-click=\"showDialog($event)\" md-theme=\"theme\">test</button>')($rootScope);\n\n        $mdTheming(button);\n\n        $rootScope.showDialog = function (ev) {\n          $mdDialog.show({\n            template: template,\n            parent: parent,\n            targetEvent: ev\n          });\n        };\n\n        button[0].click();\n\n        var container = parent[0].querySelector('.md-dialog-container');\n        var dialog = angular.element(container).find('md-dialog');\n        expect(dialog.hasClass('md-myTheme-theme')).toBeTruthy();\n      }));\n    });\n  });\n\n  function hasConfigurationMethods(preset, methods) {\n    angular.forEach(methods, function(method) {\n      return it('supports config method #' + method, inject(function($mdDialog) {\n        var dialog = $mdDialog[preset]();\n        expect(typeof dialog[method]).toBe('function');\n        expect(dialog[method]()).toEqual(dialog);\n      }));\n    });\n  }\n});\n\ndescribe('$mdDialog with custom interpolation symbols', function() {\n  beforeEach(module('material.components.dialog'));\n\n  beforeEach(module(function($interpolateProvider) {\n    $interpolateProvider.startSymbol('[[').endSymbol(']]');\n  }));\n\n  it('displays #alert() correctly', inject(function($mdDialog, $rootScope) {\n    var parent = angular.element('<div>');\n    var dialog = $mdDialog.\n      alert({parent: parent}).\n      ariaLabel('test alert').\n      title('Title').\n      textContent('Hello, world !').\n      ok('OK');\n\n    $mdDialog.show(dialog);\n    $rootScope.$digest();\n\n    var mdContainer = angular.element(parent[0].querySelector('.md-dialog-container'));\n    var mdDialog = mdContainer.find('md-dialog');\n    var mdContent = mdDialog.find('md-dialog-content');\n    var title = mdContent.find('h2');\n    var contentBody = mdContent[0].querySelector('.md-dialog-content-body');\n    var mdActions = angular.element(mdDialog[0].querySelector('md-dialog-actions'));\n    var buttons = mdActions.find('md-button');\n\n    expect(mdDialog.attr('aria-label')).toBe('test alert');\n    expect(title.text()).toBe('Title');\n    expect(contentBody.textContent).toBe('Hello, world !');\n    expect(buttons.eq(0).text()).toBe('OK');\n  }));\n\n  it('displays #confirm() correctly', inject(function($mdDialog, $rootScope) {\n    var parent = angular.element('<div>');\n    var dialog = $mdDialog.\n      confirm({parent: parent}).\n      ariaLabel('test alert').\n      title('Title').\n      textContent('Hello, world !').\n      cancel('CANCEL').\n      ok('OK');\n\n    $mdDialog.show(dialog);\n    $rootScope.$digest();\n\n    var mdContainer = angular.element(parent[0].querySelector('.md-dialog-container'));\n    var mdDialog = mdContainer.find('md-dialog');\n    var mdContent = mdDialog.find('md-dialog-content');\n    var title = mdContent.find('h2');\n    var contentBody = mdContent[0].querySelector('.md-dialog-content-body');\n    var mdActions = angular.element(mdDialog[0].querySelector('md-dialog-actions'));\n    var buttons = mdActions.find('md-button');\n\n    expect(mdDialog.attr('aria-label')).toBe('test alert');\n    expect(title.text()).toBe('Title');\n    expect(contentBody.textContent).toBe('Hello, world !');\n    expect(buttons.eq(0).text()).toBe('CANCEL');\n    expect(buttons.eq(1).text()).toBe('OK');\n  }));\n});\n\ndescribe('$mdDialog without ngSanitize loaded', function() {\n  var $mdDialog, $rootScope, $exceptionHandler;\n\n  beforeEach(function() {\n    module('material.components.dialog');\n\n    module(function($exceptionHandlerProvider) {\n      $exceptionHandlerProvider.mode('log');\n    });\n\n    inject(function($injector) {\n      $mdDialog = $injector.get('$mdDialog');\n      $rootScope = $injector.get('$rootScope');\n      $exceptionHandler = $injector.get('$exceptionHandler');\n    });\n  });\n\n  it('should throw an error when trying to use htmlContent', function() {\n    var parent = angular.element('<div>');\n    var dialog = $mdDialog.\n      alert({parent: parent}).\n      title('Title').\n      htmlContent('Hello, world !').\n      ok('OK');\n\n    $mdDialog.show(dialog);\n    $rootScope.$digest();\n\n    // Make sure that only our custom error was logged.\n    expect($exceptionHandler.errors.length).toBe(1);\n    expect($exceptionHandler.errors[0].message).toBe(\n      'The ngSanitize module must be loaded in order to use htmlContent.'\n    );\n  });\n});\n"
  },
  {
    "path": "src/components/divider/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n\n  <md-toolbar class=\"md-theme-light\">\n    <h2 class=\"md-toolbar-tools\">\n      <span>Full Bleed</span>\n    </h2>\n  </md-toolbar>\n\n  <md-content>\n    <md-list>\n      <md-list-item class=\"md-3-line\" ng-repeat=\"item in messages\">\n        <div class=\"md-list-item-text\">\n          <h3>{{item.what}}</h3>\n          <h4>{{item.who}}</h4>\n          <p>{{item.notes}}</p>\n        </div>\n        <md-button class=\"md-secondary\">Respond</md-button>\n        <md-divider ng-if=\"!$last\"></md-divider>\n      </md-list-item>\n    </md-list>\n  </md-content>\n\n  <md-toolbar class=\"md-theme-light\">\n    <h2 class=\"md-toolbar-tools\">\n      <span>Inset</span>\n    </h2>\n  </md-toolbar>\n\n  <md-content>\n    <md-list>\n      <md-list-item class=\"md-3-line\" ng-repeat=\"item in messages\">\n        <img ng-src=\"{{item.face}}?{{$index}}\" class=\"md-avatar\" alt=\"{{item.who}}\">\n        <div class=\"md-list-item-text\">\n          <h3>{{item.what}}</h3>\n          <h4>{{item.who}}</h4>\n          <p>{{item.notes}}</p>\n        </div>\n        <md-divider md-inset ng-if=\"!$last\"></md-divider>\n      </md-list-item>\n    </md-list>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/divider/demoBasicUsage/script.js",
    "content": "angular.module('dividerDemo1', ['ngMaterial'])\n  .controller('AppCtrl', function($scope) {\n    var imagePath = 'img/60.jpeg';\n    $scope.messages = [{\n      face : imagePath,\n      what: 'Brunch this weekend?',\n      who: 'Min Li Chan',\n      when: '3:08PM',\n      notes: \" I'll be in your neighborhood doing errands\"\n    }, {\n      face : imagePath,\n      what: 'Brunch this weekend?',\n      who: 'Min Li Chan',\n      when: '3:08PM',\n      notes: \" I'll be in your neighborhood doing errands\"\n    }, {\n      face : imagePath,\n      what: 'Brunch this weekend?',\n      who: 'Min Li Chan',\n      when: '3:08PM',\n      notes: \" I'll be in your neighborhood doing errands\"\n    }, {\n      face : imagePath,\n      what: 'Brunch this weekend?',\n      who: 'Min Li Chan',\n      when: '3:08PM',\n      notes: \" I'll be in your neighborhood doing errands\"\n    }, {\n      face : imagePath,\n      what: 'Brunch this weekend?',\n      who: 'Min Li Chan',\n      when: '3:08PM',\n      notes: \" I'll be in your neighborhood doing errands\"\n    }];\n  });\n"
  },
  {
    "path": "src/components/divider/divider-theme.scss",
    "content": "md-divider.md-THEME_NAME-theme {\n  border-color: '{{foreground-4}}';\n}"
  },
  {
    "path": "src/components/divider/divider.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.divider\n * @description Divider module!\n */\nangular.module('material.components.divider', [\n  'material.core'\n])\n  .directive('mdDivider', MdDividerDirective);\n\n/**\n * @ngdoc directive\n * @name mdDivider\n * @module material.components.divider\n * @restrict E\n *\n * @description\n * Dividers group and separate content within lists and page layouts using strong visual and spatial distinctions. This divider is a thin rule, lightweight enough to not distract the user from content.\n *\n * @param {boolean=} md-inset Add this attribute to activate the inset divider style.\n * @usage\n * <hljs lang=\"html\">\n * <md-divider></md-divider>\n *\n * <md-divider md-inset></md-divider>\n * </hljs>\n *\n */\nfunction MdDividerDirective($mdTheming) {\n  return {\n    restrict: 'E',\n    link: $mdTheming\n  };\n}\n"
  },
  {
    "path": "src/components/divider/divider.scss",
    "content": "md-divider {\n  display: block;\n  border-top-width: 1px;\n  border-top-style: solid;\n  margin: 0;\n\n  &[md-inset] {\n    @include rtl-prop(margin-left, margin-right, $baseline-grid * 10, auto);\n  }\n}\n\n@include when-layout-row(md-divider) {\n  border-top-width: 0;\n  border-right-width: 1px;\n  border-right-style: solid;\n}\n"
  },
  {
    "path": "src/components/fabActions/fabActions.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc module\n   * @name material.components.fabActions\n   */\n  angular\n    .module('material.components.fabActions', ['material.core'])\n    .directive('mdFabActions', MdFabActionsDirective);\n\n  /**\n   * @ngdoc directive\n   * @name mdFabActions\n   * @module material.components.fabActions\n   *\n   * @restrict E\n   *\n   * @description\n   * The `<md-fab-actions>` directive is used inside of a `<md-fab-speed-dial>` or\n   * `<md-fab-toolbar>` directive to mark an element (or elements) as the actions and setup the\n   * proper event listeners.\n   *\n   * @usage\n   * See the `<md-fab-speed-dial>` or `<md-fab-toolbar>` directives for example usage.\n   */\n  function MdFabActionsDirective($mdUtil) {\n    return {\n      restrict: 'E',\n\n      require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],\n\n      compile: function(element, attributes) {\n        var children = element.children();\n        var actionItemButtons;\n        var hasNgRepeat = $mdUtil.prefixer().hasAttribute(children, 'ng-repeat');\n\n        // Action item buttons should not be in the tab order when the speed dial is closed.\n        actionItemButtons = element.find('md-button');\n        angular.forEach(actionItemButtons, function(button) {\n          button.setAttribute('tabindex', -1);\n        });\n\n        // Support both ng-repeat and static content\n        if (hasNgRepeat) {\n          children.addClass('md-fab-action-item');\n        } else {\n          // Wrap every child in a new div and add a class that we can scale/fling independently\n          children.wrap('<div class=\"md-fab-action-item\">');\n        }\n      }\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/fabActions/fabActions.spec.js",
    "content": "describe('<md-fab-actions> directive', function() {\n\n  beforeEach(module('material.components.fabActions'));\n\n  var pageScope, element, controller;\n\n  function build(template) {\n    inject(function($compile, $rootScope) {\n      pageScope = $rootScope.$new();\n      element = $compile(template)(pageScope);\n      controller = element.controller('mdFabActions');\n\n      pageScope.$apply();\n    });\n  }\n\n  it('supports static children', inject(function() {\n    build(\n      '<md-fab-speed-dial>' +\n      '  <md-fab-actions>' +\n      '    <md-button>1</md-button>' +\n      '    <md-button>2</md-button>' +\n      '    <md-button>3</md-button>' +\n      '  </md-fab-actions>' +\n      '</md-fab-speed-dial>'\n    );\n\n    expect(element.find(\"md-fab-actions\").children().length).toBe(3);\n    expect(element.find(\"md-fab-actions\").children()).toHaveClass('md-fab-action-item');\n  }));\n\n  it('applies tabindex of -1 to all action item buttons', inject(function() {\n    build(\n      '<md-fab-speed-dial>' +\n      '  <md-fab-actions>' +\n      '    <md-button>1</md-button>' +\n      '    <md-button>2</md-button>' +\n      '    <md-button>3</md-button>' +\n      '  </md-fab-actions>' +\n      '</md-fab-speed-dial>'\n    );\n\n    expect(element.find(\"md-button\").length).toBe(3);\n    angular.forEach(element.find(\"md-button\"), function(button) {\n      expect(button.getAttribute('tabindex')).toEqual('-1');\n    });\n  }));\n\n  angular.forEach(['ng-repeat', 'data-ng-repeat', 'x-ng-repeat'], function(attr) {\n    it('supports actions created by ' + attr, inject(function() {\n      build(\n        '<md-fab-speed-dial ng-init=\"nums=[1,2,3]\">' +\n        '  <md-fab-actions>' +\n        '    <div ' + attr + '=\"i in nums\"><md-button>{{i}}</md-button></div>' +\n        '  </md-fab-actions>' +\n        '</md-fab-speed-dial>'\n      );\n\n      expect(element.find(\"md-fab-actions\").children().length).toBe(3);\n      expect(element.find(\"md-fab-actions\").children()).toHaveClass('md-fab-action-item');\n\n      pageScope.$apply('nums=[1,2,3,4]');\n\n      expect(element.find(\"md-fab-actions\").children().length).toBe(4);\n      expect(element.find(\"md-fab-actions\").children()).toHaveClass('md-fab-action-item');\n    }));\n  });\n\n});\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"DemoCtrl as demo\" layout=\"column\" ng-cloak>\n  <md-content class=\"md-padding\" layout=\"column\">\n    <p>\n      You may supply a direction of <code>left</code>, <code>up</code>, <code>down</code>, or\n      <code>right</code> through the <code>md-direction</code> attribute.\n    </p>\n\n    <div class=\"lock-size\" layout=\"row\" layout-align=\"center center\">\n      <md-fab-speed-dial md-open=\"demo.isOpen\" md-direction=\"{{demo.selectedDirection}}\"\n                         ng-class=\"demo.selectedMode\">\n        <md-fab-trigger>\n          <md-button aria-label=\"menu\" class=\"md-fab md-warn\">\n            <md-icon md-svg-src=\"img/icons/menu.svg\"></md-icon>\n          </md-button>\n        </md-fab-trigger>\n\n        <md-fab-actions>\n          <md-button aria-label=\"Play Demo\" class=\"md-fab md-raised md-mini\">\n            <md-icon md-svg-src=\"img/icons/ic_play_circle_fill_24px.svg\" aria-label=\"Play Demo\"></md-icon>\n          </md-button>\n          <md-button aria-label=\"Video Tutorial\" class=\"md-fab md-raised md-mini\">\n            <md-icon md-svg-src=\"img/icons/ic_ondemand_video_24px.svg\" aria-label=\"Video Tutorial\"></md-icon>\n          </md-button>\n          <md-button aria-label=\"View Code\" class=\"md-fab md-raised md-mini\">\n            <md-icon md-svg-src=\"img/icons/ic_code_24px.svg\" aria-label=\"View Code\"></md-icon>\n          </md-button>\n        </md-fab-actions>\n      </md-fab-speed-dial>\n    </div>\n\n    <div layout=\"row\" layout-align=\"space-around\">\n      <div layout=\"column\" layout-align=\"start center\">\n        <b>Direction</b>\n\n        <md-radio-group ng-model=\"demo.selectedDirection\">\n          <md-radio-button ng-repeat=\"direction in demo.availableDirections\"\n                           ng-value=\"direction\" class=\"text-capitalize\">\n            {{direction}}\n          </md-radio-button>\n        </md-radio-group>\n      </div>\n\n      <div layout=\"column\" layout-align=\"start center\">\n        <b>Open/Closed</b>\n\n        <md-checkbox ng-model=\"demo.isOpen\">\n          Open\n        </md-checkbox>\n      </div>\n\n      <div layout=\"column\" layout-align=\"start center\">\n        <b>Animation Modes</b>\n\n        <md-radio-group ng-model=\"demo.selectedMode\">\n          <md-radio-button ng-repeat=\"mode in demo.availableModes\" ng-value=\"mode\">\n            {{mode}}\n          </md-radio-button>\n        </md-radio-group>\n      </div>\n    </div>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoBasicUsage/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('fabSpeedDialDemoBasicUsage', ['ngMaterial'])\n    .controller('DemoCtrl', function() {\n      this.topDirections = ['left', 'up'];\n      this.bottomDirections = ['down', 'right'];\n\n      this.isOpen = false;\n\n      this.availableModes = ['md-fling', 'md-scale'];\n      this.selectedMode = 'md-fling';\n\n      this.availableDirections = ['up', 'down', 'left', 'right'];\n      this.selectedDirection = 'up';\n    });\n})();\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoBasicUsage/style.scss",
    "content": ".text-capitalize {\n  text-transform: capitalize;\n}\np.note {\n  font-size: 1.2rem;\n}\n.lock-size {\n  min-width: 300px;\n  min-height: 300px;\n  width: 300px;\n  height: 300px;\n  margin-left: auto;\n  margin-right: auto;\n}\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoMoreOptions/index.html",
    "content": "<div layout=\"column\" ng-controller=\"DemoCtrl as demo\" ng-cloak>\n  <md-content class=\"md-padding\" layout=\"column\">\n\n    <p class=\"intro\">\n      The speed dial supports many advanced usage scenarios. This demo shows many of them mixed\n      together... and even includes a Toolbar - SpeedDial combination.\n    </p>\n\n    <md-toolbar>\n      <h3>\n        <md-button>Test</md-button>\n        <md-button>Test</md-button>\n        <md-button hide-sm>Test</md-button>\n        <md-button hide-sm>Test</md-button>\n        <md-button hide-sm>Test</md-button>\n        <md-button hide-sm>Test</md-button>\n        <md-button hide-sm>Test</md-button>\n      </h3>\n    </md-toolbar>\n\n    <md-fab-speed-dial ng-hide=\"demo.hidden\" md-direction=\"left\" md-open=\"demo.isOpen\"\n                       class=\"md-scale md-fab-top-right\" ng-class=\"{ 'md-hover-full': demo.hover }\"\n                       ng-mouseenter=\"demo.isOpen=true\" ng-mouseleave=\"demo.isOpen=false\">\n      <md-fab-trigger>\n        <md-button aria-label=\"menu\" class=\"md-fab md-warn\">\n          <md-tooltip md-direction=\"top\" md-visible=\"tooltipVisible\">Menu</md-tooltip>\n          <md-icon md-svg-src=\"img/icons/menu.svg\" aria-label=\"menu\"></md-icon>\n        </md-button>\n      </md-fab-trigger>\n\n      <md-fab-actions>\n        <div ng-repeat=\"item in demo.items\">\n          <md-button aria-label=\"{{item.name}}\" class=\"md-fab md-raised md-mini\"\n                     ng-click=\"demo.openDialog($event, item)\">\n            <md-tooltip md-direction=\"{{item.direction}}\" md-visible=\"tooltipVisible\"\n                        md-autohide=\"false\">\n              {{item.name}}\n            </md-tooltip>\n\n            <md-icon md-svg-src=\"{{item.icon}}\" aria-label=\"{{item.name}}\"></md-icon>\n          </md-button>\n        </div>\n      </md-fab-actions>\n    </md-fab-speed-dial>\n  </md-content>\n\n  <md-content class=\"md-padding\" layout=\"row\" layout-sm=\"column\" layout-align=\"space-around\">\n    <div flex-gt-sm=\"45\">\n      <h3>Tooltips</h3>\n\n      <p>\n        Each action item supports a tooltip using the standard approach as can be seen above.\n      </p>\n\n      <h3>ngHide</h3>\n\n      <p>\n        The speed dial also supports hiding using the standard <code>ng-hide</code> attribute. View\n        the source to see how to apply the animation effect.\n\n        <md-checkbox ng-model=\"demo.hidden\">\n          Hide the speed dial.\n        </md-checkbox>\n      </p>\n\n      <h3>ngRepeat</h3>\n\n      <p>\n        You can easily use <code>ng-repeat</code> with the speed dial, but it requires a slightly\n        different HTML structure in order to support the necessary DOM changes/styling.\n      </p>\n\n      <p>\n        Simply ensure that your <code>ng-repeat</code> is on a <code>div</code> (or any other tag)\n        that wraps your items.\n      </p>\n    </div>\n\n    <div flex-gt-sm=\"45\">\n      <h3>Hovering</h3>\n\n      <p>\n        You can also easily setup the speed dial to open on hover using the\n        <code>ng-mouseenter</code> and <code>ng-mouseleave</code> attributes.\n      </p>\n\n      <p>\n        If you want the user to be able to hover over the empty area where the\n        actions will eventually appear, you must also add the\n        <code>md-hover-full</code> class to the speed dial element.\n\n        <md-checkbox ng-model=\"demo.hover\">\n          Enable \"full hover\" mode.\n        </md-checkbox>\n      </p>\n\n      <p>\n        Notice that in \"full hover\" mode, you cannot click on the last \"Test\" buttons on the toolbar\n        as they are hidden by the speed dial. See the example code and docs for more information.\n      </p>\n\n      <h3>$mdDialog</h3>\n\n      <p>\n        You can also use the buttons to open a dialog. When clicked, the buttons above will open a\n        dialog showing a message which item was clicked.\n      </p>\n    </div>\n  </md-content>\n\n  <script type=\"text/ng-template\" id=\"dialog.html\">\n    <md-dialog>\n      <md-toolbar>\n        <div class=\"md-toolbar-tools\">Cool Dialog!</div>\n      </md-toolbar>\n\n      <md-dialog-content layout-padding>\n        Hello user! you clicked {{dialog.item.name}}.\n      </md-dialog-content>\n\n      <md-dialog-actions>\n        <md-button aria-label=\"Close dialog\" ng-click=\"dialog.close()\" class=\"md-primary\">\n          Close Greeting\n        </md-button>\n\n        <md-button aria-label=\"Submit dialog\" ng-click=\"dialog.submit()\" class=\"md-primary\">\n          Submit\n        </md-button>\n      </md-dialog-actions>\n    </md-dialog>\n  </script>\n\n</div>\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoMoreOptions/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('fabSpeedDialDemoMoreOptions', ['ngMaterial'])\n    .controller('DemoCtrl', function($scope, $mdDialog, $timeout) {\n      var self = this;\n\n      self.hidden = false;\n      self.isOpen = false;\n      self.hover = false;\n\n      // On opening, add a delayed property which shows tooltips after the speed dial has opened\n      // so that they have the proper position; if closing, immediately hide the tooltips\n      $scope.$watch('demo.isOpen', function(isOpen) {\n        if (isOpen) {\n          $timeout(function() {\n            $scope.tooltipVisible = self.isOpen;\n          }, 600);\n        } else {\n          $scope.tooltipVisible = self.isOpen;\n        }\n      });\n\n      self.items = [\n        { name: \"Twitter\", icon: \"img/icons/twitter.svg\", direction: \"bottom\" },\n        { name: \"Facebook\", icon: \"img/icons/facebook.svg\", direction: \"top\" },\n        { name: \"Google Hangout\", icon: \"img/icons/hangout.svg\", direction: \"bottom\" }\n      ];\n\n      self.openDialog = function($event, item) {\n        // Show the dialog\n        $mdDialog.show({\n          clickOutsideToClose: true,\n          controller: function($mdDialog) {\n            // Save the clicked item\n            this.item = item;\n\n            // Setup some handlers\n            this.close = function() {\n              $mdDialog.cancel();\n            };\n            this.submit = function() {\n              $mdDialog.hide();\n            };\n          },\n          controllerAs: 'dialog',\n          templateUrl: 'dialog.html',\n          targetEvent: $event\n        });\n      };\n    });\n})();\n"
  },
  {
    "path": "src/components/fabSpeedDial/demoMoreOptions/style.scss",
    "content": "// Line the fab up properly on different screen sizes/layouts\n.md-fab-top-right {\n  top: 16px;\n}\n\n@media (max-device-width: 600px) {\n  .md-fab-top-right {\n    top: 9px;\n    right: 9px;\n  }\n}\n\n.md-fab.demo-fab.trigger-fab, .md-fab.demo-fab.action-fab {\n  &:hover, &.md-focused {\n    background-color: #333;\n  }\n}\n\n.md-fab.demo-fab.action-fab {\n  background-color: #aaa;\n}\n\n\nmd-content div {\n  &[flex=\"50\"] {\n    padding: 15px;\n  }\n}\n\n\nmd-fab-speed-dial {\n\n  // Offset to align with toolbar area\n  margin-top: 89px;\n\n  // Add a simple scale transition to the trigger when hiding/showing the speed dial\n  md-fab-trigger {\n    transition: all 0.3s ease-in-out;\n    transform: scale(1);\n  }\n\n  // Note: you MUST use an existing CSS class for the animation to fire properly\n  &.md-scale, &.md-fling {\n    &.ng-hide-add.ng-hide-add-active {\n      // Use !important to override ng-hide's `display: none !important`\n      display: flex !important;\n    }\n\n    &.ng-hide {\n      md-fab-trigger {\n        transform: scale(0);\n      }\n    }\n  }\n}\n\n.intro {\n  padding-left:5px;\n}\n"
  },
  {
    "path": "src/components/fabSpeedDial/fabController.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('material.components.fabShared', ['material.core'])\n    .controller('MdFabController', MdFabController);\n\n  function MdFabController($scope, $element, $animate, $mdUtil, $mdConstant, $timeout) {\n    var ctrl = this;\n    var initialAnimationAttempts = 0;\n\n    // NOTE: We use async eval(s) below to avoid conflicts with any existing digest loops\n\n    ctrl.open = function() {\n      $scope.$evalAsync(\"ctrl.isOpen = true\");\n    };\n\n    ctrl.close = function() {\n      // Async eval to avoid conflicts with existing digest loops\n      $scope.$evalAsync(\"ctrl.isOpen = false\");\n\n      // Focus the trigger when the element closes so users can still tab to the next item\n      $element.find('md-fab-trigger')[0].focus();\n    };\n\n    // Toggle the open/close state when the trigger is clicked\n    ctrl.toggle = function() {\n      $scope.$evalAsync(\"ctrl.isOpen = !ctrl.isOpen\");\n    };\n\n    /*\n     * AngularJS Lifecycle hook for newer AngularJS versions.\n     * Bindings are not guaranteed to have been assigned in the controller, but they are in the\n     * $onInit hook.\n     */\n    ctrl.$onInit = function() {\n      setupDefaults();\n      setupListeners();\n      setupWatchers();\n\n      fireInitialAnimations();\n    };\n\n    // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are pre-assigned,\n    // manually call the $onInit hook.\n    if (angular.version.major === 1 && angular.version.minor <= 4) {\n      this.$onInit();\n    }\n\n    function setupDefaults() {\n      // Set the default direction to 'down' if none is specified\n      ctrl.direction = ctrl.direction || 'down';\n\n      // Set the default to be closed\n      ctrl.isOpen = ctrl.isOpen || false;\n\n      // Start the keyboard interaction at the first action\n      resetActionIndex();\n\n      // Add an animations waiting class so we know not to run\n      $element.addClass('md-animations-waiting');\n    }\n\n    function setupListeners() {\n      var eventTypes = [\n        'click', 'focusin', 'focusout'\n      ];\n\n      // Add our listeners\n      angular.forEach(eventTypes, function(eventType) {\n        $element.on(eventType, parseEvents);\n      });\n\n      // Remove our listeners when destroyed\n      $scope.$on('$destroy', function() {\n        angular.forEach(eventTypes, function(eventType) {\n          $element.off(eventType, parseEvents);\n        });\n\n        // remove any attached keyboard handlers in case element is removed while\n        // speed dial is open\n        disableKeyboard();\n      });\n    }\n\n    var closeTimeout;\n\n    /**\n     * @param {MouseEvent} event\n     */\n    function parseEvents(event) {\n      // If the event is a click, just handle it\n      if (event.type == 'click') {\n        handleItemClick(event);\n      }\n\n      // If we focusout, set a timeout to close the element\n      if (event.type == 'focusout' && !closeTimeout) {\n        closeTimeout = $timeout(function() {\n          ctrl.close();\n        }, 100, false);\n      }\n\n      // If we see a focusin and there is a timeout about to run, cancel it so we stay open\n      if (event.type == 'focusin' && closeTimeout) {\n        $timeout.cancel(closeTimeout);\n        closeTimeout = null;\n      }\n    }\n\n    function resetActionIndex() {\n      ctrl.currentActionIndex = -1;\n    }\n\n    function setupWatchers() {\n      // Watch for changes to the direction and update classes/attributes\n      $scope.$watch('ctrl.direction', function(newDir, oldDir) {\n        // Add the appropriate classes so we can target the direction in the CSS\n        $animate.removeClass($element, 'md-' + oldDir);\n        $animate.addClass($element, 'md-' + newDir);\n\n        // Reset the action index since it may have changed\n        resetActionIndex();\n      });\n\n      var trigger, actions;\n\n      // Watch for changes to md-open\n      $scope.$watch('ctrl.isOpen', function(isOpen) {\n        // Reset the action index since it may have changed\n        resetActionIndex();\n\n        // We can't get the trigger/actions outside of the watch because the component hasn't been\n        // linked yet, so we wait until the first watch fires to cache them.\n        if (!trigger || !actions) {\n          trigger = getTriggerElement();\n          actions = getActionsElement();\n        }\n\n        if (isOpen) {\n          enableKeyboard();\n        } else {\n          disableKeyboard();\n        }\n\n        var toAdd = isOpen ? 'md-is-open' : '';\n        var toRemove = isOpen ? '' : 'md-is-open';\n\n        // Set the proper ARIA attributes\n        trigger.attr('aria-haspopup', true);\n        trigger.attr('aria-expanded', isOpen);\n        actions.attr('aria-hidden', !isOpen);\n\n        // Animate the CSS classes\n        $animate.setClass($element, toAdd, toRemove);\n      });\n    }\n\n    function fireInitialAnimations() {\n      // If the element is actually visible on the screen\n      if ($element[0].scrollHeight > 0) {\n        // Fire our animation\n        $animate.addClass($element, '_md-animations-ready').then(function() {\n          // Remove the waiting class\n          $element.removeClass('md-animations-waiting');\n        });\n      }\n\n      // Otherwise, try for up to 1 second before giving up\n      else if (initialAnimationAttempts < 10) {\n        $timeout(fireInitialAnimations, 100);\n\n        // Increment our counter\n        initialAnimationAttempts = initialAnimationAttempts + 1;\n      }\n    }\n\n    function enableKeyboard() {\n      $element.on('keydown', keyPressed);\n\n      // On the next tick, setup a check for outside clicks; we do this on the next tick to avoid\n      // clicks/touches that result in the isOpen attribute changing (e.g. a bound radio button)\n      $mdUtil.nextTick(function() {\n        angular.element(document).on('click touchend', checkForOutsideClick);\n      });\n    }\n\n    function disableKeyboard() {\n      $element.off('keydown', keyPressed);\n      angular.element(document).off('click touchend', checkForOutsideClick);\n    }\n\n    function checkForOutsideClick(event) {\n      if (event.target) {\n        var closestTrigger = $mdUtil.getClosest(event.target, 'md-fab-trigger');\n        var closestActions = $mdUtil.getClosest(event.target, 'md-fab-actions');\n\n        if (!closestTrigger && !closestActions) {\n          ctrl.close();\n        }\n      }\n    }\n\n    /**\n     * @param {KeyboardEvent} event\n     * @returns {boolean}\n     */\n    function keyPressed(event) {\n      switch (event.which) {\n        case $mdConstant.KEY_CODE.ESCAPE: ctrl.close(); event.preventDefault(); return false;\n        case $mdConstant.KEY_CODE.LEFT_ARROW: doKeyLeft(event); return false;\n        case $mdConstant.KEY_CODE.UP_ARROW: doKeyUp(event); return false;\n        case $mdConstant.KEY_CODE.RIGHT_ARROW: doKeyRight(event); return false;\n        case $mdConstant.KEY_CODE.DOWN_ARROW: doKeyDown(event); return false;\n        case $mdConstant.KEY_CODE.TAB: doShift(event); return false;\n      }\n    }\n\n    function doActionPrev(event) {\n      focusAction(event, -1);\n    }\n\n    function doActionNext(event) {\n      focusAction(event, 1);\n    }\n\n    function focusAction(event, direction) {\n      var actions = getActionsElement()[0].querySelectorAll('.md-fab-action-item');\n      var previousActionIndex = ctrl.currentActionIndex;\n\n      // Increment/decrement the counter with restrictions\n      ctrl.currentActionIndex = ctrl.currentActionIndex + direction;\n      ctrl.currentActionIndex = Math.min(actions.length - 1, ctrl.currentActionIndex);\n      ctrl.currentActionIndex = Math.max(0, ctrl.currentActionIndex);\n\n      // Let Tab and Shift+Tab escape if we're trying to move past the start/end.\n      if (event.which !== $mdConstant.KEY_CODE.TAB ||\n          previousActionIndex !== ctrl.currentActionIndex) {\n        // Focus the element\n        var focusElement = angular.element(actions[ctrl.currentActionIndex]).children()[0];\n        focusElement.focus();\n\n        // Make sure the event doesn't bubble and cause something else\n        event.preventDefault();\n        event.stopImmediatePropagation();\n      }\n    }\n\n    function doKeyLeft(event) {\n      if (ctrl.direction === 'left') {\n        doActionNext(event);\n      } else {\n        doActionPrev(event);\n      }\n    }\n\n    function doKeyUp(event) {\n      if (ctrl.direction === 'down') {\n        doActionPrev(event);\n      } else {\n        doActionNext(event);\n      }\n    }\n\n    function doKeyRight(event) {\n      if (ctrl.direction === 'left') {\n        doActionPrev(event);\n      } else {\n        doActionNext(event);\n      }\n    }\n\n    function doKeyDown(event) {\n      if (ctrl.direction === 'up') {\n        doActionPrev(event);\n      } else {\n        doActionNext(event);\n      }\n    }\n\n    function doShift(event) {\n      if (event.shiftKey) {\n        doActionPrev(event);\n      } else {\n        doActionNext(event);\n      }\n    }\n\n    /**\n     * @param {Node} element\n     * @returns {Node|null}\n     */\n    function getClosestButton(element) {\n      return $mdUtil.getClosest(element, 'button') || $mdUtil.getClosest(element, 'md-button');\n    }\n\n    /**\n     * @param {Node} element\n     * @returns {Node|null}\n     */\n    function getClosestTrigger(element) {\n      return $mdUtil.getClosest(element, 'md-fab-trigger');\n    }\n\n    /**\n     * @param {Node} element\n     * @returns {Node|null}\n     */\n    function getClosestAction(element) {\n      return $mdUtil.getClosest(element, 'md-fab-actions');\n    }\n\n    /**\n     * @param {MouseEvent|FocusEvent} event\n     */\n    function handleItemClick(event) {\n      var closestButton = event.target ? getClosestButton(event.target) : null;\n\n      // Check that the button in the trigger is not disabled\n      if (closestButton && !closestButton.disabled) {\n        if (getClosestTrigger(event.target)) {\n          ctrl.toggle();\n        }\n      }\n\n      if (getClosestAction(event.target)) {\n        ctrl.close();\n      }\n    }\n\n    function getTriggerElement() {\n      return $element.find('md-fab-trigger');\n    }\n\n    function getActionsElement() {\n      return $element.find('md-fab-actions');\n    }\n  }\n})();\n"
  },
  {
    "path": "src/components/fabSpeedDial/fabSpeedDial-theme.scss",
    "content": "md-fab-speed-dial.md-THEME_NAME-theme {\n  md-fab-trigger .md-fab.md-button[disabled] {\n    background-color: '{{foreground-4}}';\n  }\n  md-fab-actions .md-fab-action-item {\n    .md-button.md-fab.md-raised.md-mini {\n      &:hover,\n      &.md-focused {\n        background-color: '{{background-500}}';\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/fabSpeedDial/fabSpeedDial.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * The duration of the CSS animation in milliseconds.\n   *\n   * @type {number}\n   */\n  var cssAnimationDuration = 300;\n\n  /**\n   * @ngdoc module\n   * @name material.components.fabSpeedDial\n   */\n  angular\n    // Declare our module\n    .module('material.components.fabSpeedDial', [\n      'material.core',\n      'material.components.fabShared',\n      'material.components.fabActions'\n    ])\n\n    // Register our directive\n    .directive('mdFabSpeedDial', MdFabSpeedDialDirective)\n\n    // Register our custom animations\n    .animation('.md-fling', MdFabSpeedDialFlingAnimation)\n    .animation('.md-scale', MdFabSpeedDialScaleAnimation)\n\n    // Register a service for each animation so that we can easily inject them into unit tests\n    .service('mdFabSpeedDialFlingAnimation', MdFabSpeedDialFlingAnimation)\n    .service('mdFabSpeedDialScaleAnimation', MdFabSpeedDialScaleAnimation);\n\n  /**\n   * @ngdoc directive\n   * @name mdFabSpeedDial\n   * @module material.components.fabSpeedDial\n   *\n   * @restrict E\n   *\n   * @description\n   * The `<md-fab-speed-dial>` directive is used to present a series of popup elements (usually\n   * `<md-button>`s) for quick access to common actions.\n   *\n   * There are currently two animations available by applying one of the following classes to\n   * the component:\n   *\n   *  - `md-fling` - The speed dial items appear from underneath the trigger and move into their\n   *    appropriate positions.\n   *  - `md-scale` - The speed dial items appear in their proper places by scaling from 0% to 100%.\n   *\n   * You may also easily position the trigger by applying one one of the following classes to the\n   * `<md-fab-speed-dial>` element:\n   *  - `md-fab-top-left`\n   *  - `md-fab-top-right`\n   *  - `md-fab-bottom-left`\n   *  - `md-fab-bottom-right`\n   *\n   * These CSS classes use `position: absolute`, so you need to ensure that the container element\n   * also uses `position: absolute` or `position: relative` in order for them to work.\n   *\n   * Additionally, you may use the standard `ng-mouseenter` and `ng-mouseleave` directives to\n   * open or close the speed dial. However, if you wish to allow users to hover over the empty\n   * space where the actions will appear, you must also add the `md-hover-full` class to the speed\n   * dial element. Without this, the hover effect will only occur on top of the trigger.\n   *\n   * See the demos for more information.\n   *\n   * ## Troubleshooting\n   *\n   * If your speed dial shows the closing animation upon launch, you may need to use `ng-cloak` on\n   * the parent container to ensure that it is only visible once ready. We have plans to remove this\n   * necessity in the future.\n   *\n   * @usage\n   * <hljs lang=\"html\">\n   * <md-fab-speed-dial md-direction=\"up\" class=\"md-fling\">\n   *   <md-fab-trigger>\n   *     <md-button aria-label=\"Add...\"><md-icon md-svg-src=\"/img/icons/plus.svg\"></md-icon></md-button>\n   *   </md-fab-trigger>\n   *\n   *   <md-fab-actions>\n   *     <md-button aria-label=\"Add User\">\n   *       <md-icon md-svg-src=\"/img/icons/user.svg\"></md-icon>\n   *     </md-button>\n   *\n   *     <md-button aria-label=\"Add Group\">\n   *       <md-icon md-svg-src=\"/img/icons/group.svg\"></md-icon>\n   *     </md-button>\n   *   </md-fab-actions>\n   * </md-fab-speed-dial>\n   * </hljs>\n   *\n   * @param {string} md-direction From which direction you would like the speed dial to appear\n   * relative to the trigger element.\n   * @param {expression=} md-open Programmatically control whether or not the speed-dial is visible.\n   */\n  function MdFabSpeedDialDirective() {\n    return {\n      restrict: 'E',\n\n      scope: {\n        direction: '@?mdDirection',\n        isOpen: '=?mdOpen'\n      },\n\n      bindToController: true,\n      controller: 'MdFabController',\n      controllerAs: 'ctrl',\n\n      link: FabSpeedDialLink\n    };\n\n    function FabSpeedDialLink(scope, element) {\n      // Prepend an element to hold our CSS variables so we can use them in the animations below\n      element.prepend('<div class=\"_md-css-variables\"></div>');\n    }\n  }\n\n  function MdFabSpeedDialFlingAnimation($timeout) {\n    function delayDone(done) { $timeout(done, cssAnimationDuration, false); }\n\n    function runAnimation(element) {\n      // Don't run if we are still waiting and we are not ready\n      if (element.hasClass('md-animations-waiting') && !element.hasClass('_md-animations-ready')) {\n        return;\n      }\n\n      var el = element[0];\n      var ctrl = element.controller('mdFabSpeedDial');\n      var items = el.querySelectorAll('.md-fab-action-item');\n\n      // Grab our trigger element\n      var triggerElement = el.querySelector('md-fab-trigger');\n\n      // Grab our element which stores CSS variables\n      var variablesElement = el.querySelector('._md-css-variables');\n\n      // Setup JS variables based on our CSS variables\n      var startZIndex = parseInt(window.getComputedStyle(variablesElement).zIndex);\n\n      // Always reset the items to their natural position/state\n      angular.forEach(items, function(item, index) {\n        var styles = item.style;\n\n        styles.transform = styles.webkitTransform = '';\n        styles.transitionDelay = '';\n        styles.opacity = ctrl.isOpen ? 1 : 0;\n\n        // Make the items closest to the trigger have the highest z-index\n        styles.zIndex = (items.length - index) + startZIndex;\n      });\n\n      // Set the trigger to be above all of the actions so they disappear behind it.\n      triggerElement.style.zIndex = startZIndex + items.length + 1;\n\n      // If the control is closed, hide the items behind the trigger\n      if (!ctrl.isOpen) {\n        angular.forEach(items, function(item, index) {\n          var newPosition, axis;\n          var styles = item.style;\n\n          // Make sure to account for differences in the dimensions of the trigger verses the items\n          // so that we can properly center everything; this helps hide the item's shadows behind\n          // the trigger.\n          var triggerItemHeightOffset = (triggerElement.clientHeight - item.clientHeight) / 2;\n          var triggerItemWidthOffset = (triggerElement.clientWidth - item.clientWidth) / 2;\n\n          switch (ctrl.direction) {\n            case 'up':\n              newPosition = (item.scrollHeight * (index + 1) + triggerItemHeightOffset);\n              axis = 'Y';\n              break;\n            case 'down':\n              newPosition = -(item.scrollHeight * (index + 1) + triggerItemHeightOffset);\n              axis = 'Y';\n              break;\n            case 'left':\n              newPosition = (item.scrollWidth * (index + 1) + triggerItemWidthOffset);\n              axis = 'X';\n              break;\n            case 'right':\n              newPosition = -(item.scrollWidth * (index + 1) + triggerItemWidthOffset);\n              axis = 'X';\n              break;\n          }\n\n          var newTranslate = 'translate' + axis + '(' + newPosition + 'px)';\n\n          styles.transform = styles.webkitTransform = newTranslate;\n        });\n      }\n    }\n\n    return {\n      addClass: function(element, className, done) {\n        if (element.hasClass('md-fling')) {\n          runAnimation(element);\n          delayDone(done);\n        } else {\n          done();\n        }\n      },\n      removeClass: function(element, className, done) {\n        runAnimation(element);\n        delayDone(done);\n      }\n    };\n  }\n\n  function MdFabSpeedDialScaleAnimation($timeout) {\n    function delayDone(done) { $timeout(done, cssAnimationDuration, false); }\n\n    var delay = 65;\n\n    function runAnimation(element) {\n      var el = element[0];\n      var ctrl = element.controller('mdFabSpeedDial');\n      var items = el.querySelectorAll('.md-fab-action-item');\n\n      // Grab our element which stores CSS variables\n      var variablesElement = el.querySelector('._md-css-variables');\n\n      // Setup JS variables based on our CSS variables\n      var startZIndex = parseInt(window.getComputedStyle(variablesElement).zIndex);\n\n      // Always reset the items to their natural position/state\n      angular.forEach(items, function(item, index) {\n        var styles = item.style,\n          offsetDelay = index * delay;\n\n        styles.opacity = ctrl.isOpen ? 1 : 0;\n        styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';\n        styles.transitionDelay = (ctrl.isOpen ? offsetDelay : (items.length - offsetDelay)) + 'ms';\n\n        // Make the items closest to the trigger have the highest z-index\n        styles.zIndex = (items.length - index) + startZIndex;\n      });\n    }\n\n    return {\n      addClass: function(element, className, done) {\n        runAnimation(element);\n        delayDone(done);\n      },\n\n      removeClass: function(element, className, done) {\n        runAnimation(element);\n        delayDone(done);\n      }\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/fabSpeedDial/fabSpeedDial.scss",
    "content": "md-fab-speed-dial {\n  position: relative;\n  display: flex;\n  align-items: center;\n\n  // Include the top/left/bottom/right fab positions and set the z-index for absolute positioning\n  @include fab-all-positions();\n  z-index: $z-index-fab;\n\n  // Allow users to enable/disable hovering over the entire speed dial (i.e. the empty space where\n  // items will eventually appear)\n  &:not(.md-hover-full) {\n    // Turn off pointer events when closed\n    pointer-events: none;\n\n    md-fab-trigger, .md-fab-action-item {\n      // Always make the trigger and action items always have pointer events (the tooltip looks\n      // for the first parent with pointer-events, so we must set this for tooltips to work)\n      pointer-events: auto;\n    }\n\n    &.md-is-open {\n      // Turn on pointer events when open\n      pointer-events: auto;\n    }\n  }\n\n  ._md-css-variables {\n    z-index: $z-index-fab;\n  }\n\n  &.md-is-open {\n    .md-fab-action-item {\n      align-items: center;\n    }\n  }\n\n  md-fab-actions {\n    display: flex;\n\n    // Set the height so that the z-index in the JS animation works\n    height: auto;\n\n    .md-fab-action-item {\n      transition: $swift-ease-in;\n    }\n  }\n\n  &.md-down {\n    flex-direction: column;\n\n    md-fab-trigger {\n      order: 1;\n    }\n\n    md-fab-actions {\n      flex-direction: column;\n      order: 2;\n    }\n  }\n\n  &.md-up {\n    flex-direction: column;\n\n    md-fab-trigger {\n      order: 2;\n    }\n\n    md-fab-actions {\n      flex-direction: column-reverse;\n      order: 1;\n    }\n  }\n\n  &.md-left {\n    flex-direction: row;\n\n    md-fab-trigger {\n      order: 2;\n    }\n\n    md-fab-actions {\n      flex-direction: row-reverse;\n      order: 1;\n\n      .md-fab-action-item {\n        transition: $swift-ease-in;\n      }\n    }\n  }\n\n  &.md-right {\n    flex-direction: row;\n\n    md-fab-trigger {\n      order: 1;\n    }\n\n    md-fab-actions {\n      flex-direction: row;\n      order: 2;\n\n      .md-fab-action-item {\n        transition: $swift-ease-in;\n      }\n    }\n  }\n\n  /*\n   * Hide some graphics glitches if switching animation types\n   */\n  &.md-fling-remove, &.md-scale-remove {\n    .md-fab-action-item > * {\n      visibility: hidden;\n    }\n  }\n\n  /*\n   * Handle the animations\n   */\n  &.md-fling {\n    .md-fab-action-item {\n      opacity: 1;\n    }\n  }\n\n  // For the initial animation, set the duration to be instant\n  &.md-fling.md-animations-waiting {\n    .md-fab-action-item {\n      opacity: 0;\n      transition-duration: 0s;\n    }\n  }\n\n  &.md-scale {\n    .md-fab-action-item {\n      transform: scale(0);\n      transition: $swift-ease-in;\n\n      // Make the scale animation a bit faster since we are delaying each item\n      transition-duration: math.div($swift-ease-in-duration, 2.1);\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/fabSpeedDial/fabSpeedDial.spec.js",
    "content": "describe('<md-fab-speed-dial> directive', function() {\n\n  var pageScope, element, controller;\n  var $rootScope, $animate, $timeout;\n\n  beforeEach(module('material.components.fabSpeedDial'));\n  beforeEach(inject(function(_$rootScope_, _$animate_, _$timeout_) {\n    $rootScope = _$rootScope_;\n    $animate = _$animate_;\n    $timeout = _$timeout_;\n  }));\n\n  it('applies a class for each direction', inject(function() {\n    build(\n      '<md-fab-speed-dial md-direction=\"{{direction}}\"></md-fab-speed-dial>'\n    );\n\n    pageScope.$apply('direction = \"down\"');\n    expect(element.hasClass('md-down')).toBe(true);\n\n    pageScope.$apply('direction = \"up\"');\n    expect(element.hasClass('md-up')).toBe(true);\n\n    pageScope.$apply('direction = \"left\"');\n    expect(element.hasClass('md-left')).toBe(true);\n\n    pageScope.$apply('direction = \"right\"');\n    expect(element.hasClass('md-right')).toBe(true);\n  }));\n\n  it('allows programmatic opening through the md-open attribute', inject(function() {\n    build(\n      '<md-fab-speed-dial md-open=\"isOpen\">' +\n      '  <md-fab-trigger>' +\n      '    <md-button></md-button>' +\n      '  </md-fab-trigger>' +\n      '</md-fab-speed-dial>'\n    );\n\n    // By default, it should be closed\n    expect(controller.isOpen).toBe(false);\n\n    // When md-open is true, it should be open\n    pageScope.$apply('isOpen = true');\n    expect(controller.isOpen).toBe(true);\n\n    // When md-open is false, it should be closed\n    pageScope.$apply('isOpen = false');\n    expect(controller.isOpen).toBe(false);\n  }));\n\n  it('toggles the menu when the trigger clicked', inject(function() {\n    build(\n     '<md-fab-speed-dial>' +\n      '  <md-fab-trigger>' +\n      '    <md-button class=\"md-fab\"></md-button>' +\n      '  </md-fab-trigger>' +\n      '</md-fab-speed-dial>'\n    );\n\n    // Click to open\n    var clickEvent = {\n      type: 'click',\n      target: element.find('md-button')\n    };\n    element.triggerHandler(clickEvent);\n    pageScope.$digest();\n\n    expect(controller.isOpen).toBe(true);\n\n    // Make sure to flush the timeout that ignores other events\n    $timeout.flush();\n\n    // Click to close\n    element.triggerHandler(clickEvent);\n    pageScope.$digest();\n\n    expect(controller.isOpen).toBe(false);\n  }));\n\n  it('toggles the menu when the trigger icon is clicked', inject(function() {\n    build(\n      '<md-fab-speed-dial>' +\n      '  <md-fab-trigger>' +\n      '    <md-button class=\"md-fab\"><md-icon md-svg-src=\"img/icons/menu.svg\"></md-icon></md-button>' +\n      '  </md-fab-trigger>' +\n      '</md-fab-speed-dial>'\n    );\n\n    // Click to open\n    var clickEvent = {\n      type: 'click',\n      target: element.find('md-icon')\n    };\n    element.triggerHandler(clickEvent);\n    pageScope.$digest();\n\n    expect(controller.isOpen).toBe(true);\n\n    // Make sure to flush the timeout that ignores other events\n    $timeout.flush();\n\n    // Click to close\n    element.triggerHandler(clickEvent);\n    pageScope.$digest();\n\n    expect(controller.isOpen).toBe(false);\n  }));\n\n\n  it('closes the menu when an action is clicked', inject(function() {\n    build(\n      '<md-fab-speed-dial>' +\n      '  <md-fab-trigger>' +\n      '    <md-button></md-button>' +\n      '  </md-fab-trigger>' +\n      '  <md-fab-actions>' +\n      '    <md-button></md-button>' +\n      '  </md-fab-actions>' +\n      '</md-fab-speed-dial>'\n    );\n\n    var clickEvent = {\n      type: 'click',\n      target: element.find('md-fab-actions').find('md-button')\n    };\n\n    // Set the menu to be open\n    controller.isOpen = true;\n    pageScope.$digest();\n\n    // Click the action to close\n    element.triggerHandler(clickEvent);\n    pageScope.$digest();\n\n    expect(controller.isOpen).toBe(false);\n  }));\n\n  it('properly finishes the fling animation', inject(function(mdFabSpeedDialFlingAnimation, $timeout) {\n    build(\n      '<md-fab-speed-dial md-open=\"isOpen\" class=\"md-fling\">' +\n      '  <md-fab-trigger><button></button></md-fab-trigger>' +\n      '  <md-fab-actions><button></button></md-fab-actions>' +\n      '</md-fab-speed-dial>'\n    );\n\n    var addDone = jasmine.createSpy('addDone');\n    var removeDone = jasmine.createSpy('removeDone');\n\n    mdFabSpeedDialFlingAnimation.addClass(element, 'md-is-open', addDone);\n    $timeout.flush();\n    expect(addDone).toHaveBeenCalled();\n\n    mdFabSpeedDialFlingAnimation.removeClass(element, 'md-is-open', removeDone);\n    $timeout.flush();\n    expect(removeDone).toHaveBeenCalled();\n  }));\n\n  it('properly finishes the scale animation', inject(function(mdFabSpeedDialScaleAnimation) {\n    build(\n      '<md-fab-speed-dial md-open=\"isOpen\" class=\"md-fling\">' +\n      '  <md-fab-trigger><button></button></md-fab-trigger>' +\n      '  <md-fab-actions><button></button></md-fab-actions>' +\n      '</md-fab-speed-dial>'\n    );\n\n    var addDone = jasmine.createSpy('addDone');\n    var removeDone = jasmine.createSpy('removeDone');\n\n    mdFabSpeedDialScaleAnimation.addClass(element, 'md-is-open', addDone);\n    $timeout.flush();\n    expect(addDone).toHaveBeenCalled();\n\n    mdFabSpeedDialScaleAnimation.removeClass(element, 'md-is-open', removeDone);\n    $timeout.flush();\n    expect(removeDone).toHaveBeenCalled();\n  }));\n\n  function build(template) {\n    inject(function($compile) {\n      pageScope = $rootScope.$new();\n      element = $compile(template)(pageScope);\n      controller = element.controller('mdFabSpeedDial');\n\n      pageScope.$apply();\n    });\n  }\n\n});\n"
  },
  {
    "path": "src/components/fabToolbar/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <p>\n      You can use the fabToolbar with a trigger and regular toolbar.\n    </p>\n\n    <p>\n      You may use the <code>md-open</code> attribute to programmatically control whether or not the\n      control is open, and you may set the direction that the toolbar appears using the\n      <code>md-direction</code> attribute. This component currently supports the <code>left</code>\n      and <code>right</code> options.\n    </p>\n  </md-content>\n\n  <md-fab-toolbar md-open=\"demo.isOpen\" count=\"demo.count\"\n                  md-direction=\"{{demo.selectedDirection}}\">\n    <md-fab-trigger class=\"align-with-text\">\n      <md-button aria-label=\"menu\" class=\"md-fab md-primary\">\n        <md-icon md-svg-src=\"img/icons/menu.svg\"></md-icon>\n      </md-button>\n    </md-fab-trigger>\n\n    <md-toolbar>\n      <md-fab-actions class=\"md-toolbar-tools\">\n        <md-button aria-label=\"comment\" class=\"md-icon-button\">\n          <md-icon md-svg-src=\"img/icons/ic_comment_24px.svg\"></md-icon>\n        </md-button>\n        <md-button aria-label=\"label\" class=\"md-icon-button\">\n          <md-icon md-svg-src=\"img/icons/ic_label_24px.svg\"></md-icon>\n        </md-button>\n        <md-button aria-label=\"photo\" class=\"md-icon-button\">\n          <md-icon md-svg-src=\"img/icons/ic_photo_24px.svg\"></md-icon>\n        </md-button>\n      </md-fab-actions>\n    </md-toolbar>\n  </md-fab-toolbar>\n\n  <md-content class=\"md-padding\" layout=\"column\">\n    <div layout=\"row\" layout-align=\"space-around\">\n      <div layout=\"column\">\n        <b>Open/Closed</b>\n\n        <md-radio-group ng-model=\"demo.isOpen\">\n          <md-radio-button ng-value=\"true\">Open</md-radio-button>\n          <md-radio-button ng-value=\"false\">Closed</md-radio-button>\n        </md-radio-group>\n      </div>\n\n      <div layout=\"column\">\n        <b>Direction</b>\n\n        <md-radio-group ng-model=\"demo.selectedDirection\">\n          <md-radio-button ng-value=\"'left'\">Left</md-radio-button>\n          <md-radio-button ng-value=\"'right'\">Right</md-radio-button>\n        </md-radio-group>\n      </div>\n    </div>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/fabToolbar/demoBasicUsage/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('fabToolbarBasicUsageDemo', ['ngMaterial'])\n    .controller('AppCtrl', function($scope) {\n      $scope.isOpen = false;\n\n      $scope.demo = {\n        isOpen: false,\n        count: 0,\n        selectedDirection: 'left'\n      };\n    });\n})();"
  },
  {
    "path": "src/components/fabToolbar/demoBasicUsage/style.scss",
    "content": "md-fab-toolbar {\n  &.md-right {\n    md-fab-trigger.align-with-text {\n      // Make sure the FAB lines up with the text for the demo\n      left: 7px;\n    }\n  }\n}"
  },
  {
    "path": "src/components/fabToolbar/fabToolbar.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc module\n   * @name material.components.fabToolbar\n   */\n  angular\n    // Declare our module\n    .module('material.components.fabToolbar', [\n      'material.core',\n      'material.components.fabShared',\n      'material.components.fabActions'\n    ])\n\n    // Register our directive\n    .directive('mdFabToolbar', MdFabToolbarDirective)\n\n    // Register our custom animations\n    .animation('.md-fab-toolbar', MdFabToolbarAnimation)\n\n    // Register a service for the animation so that we can easily inject it into unit tests\n    .service('mdFabToolbarAnimation', MdFabToolbarAnimation);\n\n  /**\n   * @ngdoc directive\n   * @name mdFabToolbar\n   * @module material.components.fabToolbar\n   *\n   * @restrict E\n   *\n   * @description\n   *\n   * The `<md-fab-toolbar>` directive is used to present a toolbar of elements (usually `<md-button>`s)\n   * for quick access to common actions when a floating action button is activated (via click or\n   * keyboard navigation).\n   *\n   * You may also easily position the trigger by applying one one of the following classes to the\n   * `<md-fab-toolbar>` element:\n   *  - `md-fab-top-left`\n   *  - `md-fab-top-right`\n   *  - `md-fab-bottom-left`\n   *  - `md-fab-bottom-right`\n   *\n   * These CSS classes use `position: absolute`, so you need to ensure that the container element\n   * also uses `position: absolute` or `position: relative` in order for them to work.\n   *\n   * @usage\n   *\n   * <hljs lang=\"html\">\n   * <md-fab-toolbar md-direction='left'>\n   *   <md-fab-trigger>\n   *     <md-button aria-label=\"Add...\"><md-icon md-svg-src=\"/img/icons/plus.svg\"></md-icon></md-button>\n   *   </md-fab-trigger>\n   *\n   *   <md-toolbar>\n   *    <md-fab-actions>\n   *      <md-button aria-label=\"Add User\">\n   *        <md-icon md-svg-src=\"/img/icons/user.svg\"></md-icon>\n   *      </md-button>\n   *\n   *      <md-button aria-label=\"Add Group\">\n   *        <md-icon md-svg-src=\"/img/icons/group.svg\"></md-icon>\n   *      </md-button>\n   *    </md-fab-actions>\n   *   </md-toolbar>\n   * </md-fab-toolbar>\n   * </hljs>\n   *\n   * @param {string} md-direction From which direction you would like the toolbar items to appear\n   * relative to the trigger element. Supports `left` and `right` directions.\n   * @param {expression=} md-open Programmatically control whether or not the toolbar is visible.\n   */\n  function MdFabToolbarDirective() {\n    return {\n      restrict: 'E',\n      transclude: true,\n      template: '<div class=\"md-fab-toolbar-wrapper\">' +\n      '  <div class=\"md-fab-toolbar-content\" ng-transclude></div>' +\n      '</div>',\n\n      scope: {\n        direction: '@?mdDirection',\n        isOpen: '=?mdOpen'\n      },\n\n      bindToController: true,\n      controller: 'MdFabController',\n      controllerAs: 'ctrl',\n\n      link: link\n    };\n\n    function link(scope, element, attributes) {\n      // Add the base class for animations\n      element.addClass('md-fab-toolbar');\n\n      // Prepend the background element to the trigger's button\n      element.find('md-fab-trigger').find('button')\n        .prepend('<div class=\"md-fab-toolbar-background\"></div>');\n    }\n  }\n\n  function MdFabToolbarAnimation() {\n\n    function runAnimation(element, className, done) {\n      // If no className was specified, don't do anything\n      if (!className) {\n        return;\n      }\n\n      var el = element[0];\n      var ctrl = element.controller('mdFabToolbar');\n\n      // Grab the relevant child elements\n      var backgroundElement = el.querySelector('.md-fab-toolbar-background');\n      var triggerElement = el.querySelector('md-fab-trigger button');\n      var toolbarElement = el.querySelector('md-toolbar');\n      var iconElement = el.querySelector('md-fab-trigger button md-icon');\n      var actions = element.find('md-fab-actions').children();\n\n      // If we have both elements, use them to position the new background\n      if (triggerElement && backgroundElement) {\n        // Get our variables\n        var color = window.getComputedStyle(triggerElement).getPropertyValue('background-color');\n        var width = el.offsetWidth;\n        var height = el.offsetHeight;\n\n        // Make it twice as big as it should be since we scale from the center\n        var scale = 2 * (width / triggerElement.offsetWidth);\n\n        // Set some basic styles no matter what animation we're doing\n        backgroundElement.style.backgroundColor = color;\n        backgroundElement.style.borderRadius = width + 'px';\n\n        // If we're open\n        if (ctrl.isOpen) {\n          // Turn on toolbar pointer events when closed\n          toolbarElement.style.pointerEvents = 'inherit';\n\n          backgroundElement.style.width = triggerElement.offsetWidth + 'px';\n          backgroundElement.style.height = triggerElement.offsetHeight + 'px';\n          backgroundElement.style.transform = 'scale(' + scale + ')';\n\n          // Set the next close animation to have the proper delays\n          backgroundElement.style.transitionDelay = '0ms';\n          iconElement && (iconElement.style.transitionDelay = '.3s');\n\n          // Apply a transition delay to actions\n          angular.forEach(actions, function(action, index) {\n            action.style.transitionDelay = (actions.length - index) * 25 + 'ms';\n          });\n        } else {\n          // Turn off toolbar pointer events when closed\n          toolbarElement.style.pointerEvents = 'none';\n\n          // Scale it back down to the trigger's size\n          backgroundElement.style.transform = 'scale(1)';\n\n          // Reset the position\n          backgroundElement.style.top = '0';\n\n          if (element.hasClass('md-right')) {\n            backgroundElement.style.left = '0';\n            backgroundElement.style.right = null;\n          }\n\n          if (element.hasClass('md-left')) {\n            backgroundElement.style.right = '0';\n            backgroundElement.style.left = null;\n          }\n\n          // Set the next open animation to have the proper delays\n          backgroundElement.style.transitionDelay = '200ms';\n          iconElement && (iconElement.style.transitionDelay = '0ms');\n\n          // Apply a transition delay to actions\n          angular.forEach(actions, function(action, index) {\n            action.style.transitionDelay = 200 + (index * 25) + 'ms';\n          });\n        }\n      }\n    }\n\n    return {\n      addClass: function(element, className, done) {\n        runAnimation(element, className, done);\n        done();\n      },\n\n      removeClass: function(element, className, done) {\n        runAnimation(element, className, done);\n        done();\n      }\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/fabToolbar/fabToolbar.scss",
    "content": "$icon-button-margin: rem(0.600) !default;\n\nmd-fab-toolbar {\n  $icon-delay: 200ms;\n\n  // Include the top/left/bottom/right fab positions\n  @include fab-all-positions();\n\n  display: block;\n\n  /*\n   * Closed styling\n   */\n  .md-fab-toolbar-wrapper {\n    display: block;\n    position: relative;\n    overflow: hidden;\n\n    // Account for the size of the trigger plus its margin/shadow\n    height: $button-fab-width + ($icon-button-margin * 2);\n  }\n\n  md-fab-trigger {\n    position: absolute;\n    z-index: $z-index-fab;\n\n    button {\n      overflow: visible !important;\n    }\n\n    .md-fab-toolbar-background {\n      display: block;\n      position: absolute;\n      z-index: $z-index-fab + 1;\n\n      opacity: 1;\n      transition: $swift-ease-in;\n    }\n\n    md-icon {\n      position: relative;\n      z-index: $z-index-fab + 2;\n\n      opacity: 1;\n\n      // Hide the icon very quickly\n      transition: all $icon-delay ease-in;\n    }\n  }\n\n  &.md-left {\n    md-fab-trigger {\n      @include rtl-prop(right, left, 0, auto);\n    }\n\n    .md-toolbar-tools {\n      flex-direction: row-reverse;\n\n      > .md-button:first-child {\n        @include rtl-prop(margin-right, margin-left, 0.6rem, auto)\n      }\n\n      > .md-button:first-child {\n        @include rtl-prop(margin-left, margin-right, -0.8rem, auto);\n      }\n\n\n      > .md-button:last-child {\n        @include rtl-prop(margin-right, margin-left, 8px, auto);\n      }\n\n    }\n  }\n\n  &.md-right {\n    md-fab-trigger {\n      @include rtl-prop(left, right, 0, auto);\n    }\n\n    .md-toolbar-tools {\n      flex-direction: row;\n    }\n  }\n\n  md-toolbar {\n    background-color: transparent !important;\n    pointer-events: none;\n    z-index: $z-index-fab + 3;\n\n    .md-toolbar-tools {\n      // Fix some spacing issues with the icons and the trigger\n      padding: 0 20px;\n      margin-top: 3px;\n    }\n\n    .md-fab-action-item {\n      opacity: 0;\n      transform: scale(0);\n      transition: $swift-ease-in;\n\n      // Cut the action item's animation time in half since we delay it in the JS\n      transition-duration: $swift-ease-in-duration * 0.5;\n    }\n  }\n\n  /*\n   * Open styling\n   */\n  &.md-is-open {\n    md-fab-trigger > button {\n      box-shadow: none;\n\n      md-icon {\n        opacity: 0;\n      }\n    }\n\n    .md-fab-action-item {\n      opacity: 1;\n      transform: scale(1);\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/fabToolbar/fabToolbar.spec.js",
    "content": "describe('<md-fab-toolbar> directive', function() {\n\n  beforeEach(module('material.components.fabToolbar'));\n\n  var pageScope, element, controller;\n\n  function build(template) {\n    inject(function($compile, $rootScope) {\n      pageScope = $rootScope.$new();\n      element = $compile(template)(pageScope);\n      controller = element.controller('mdFabToolbar');\n\n      pageScope.$apply();\n    });\n  }\n\n  it('applies a class for each direction', inject(function() {\n    build(\n      '<md-fab-toolbar md-direction=\"{{direction}}\"></md-fab-toolbar>'\n    );\n\n    pageScope.$apply('direction = \"left\"');\n    expect(element.hasClass('md-left')).toBe(true);\n\n    pageScope.$apply('direction = \"right\"');\n    expect(element.hasClass('md-right')).toBe(true);\n  }));\n\n  it('accepts a string for md-direction', inject(function() {\n    build(\n      '<md-fab-toolbar md-direction=\"right\"></md-fab-toolbar>'\n    );\n\n    expect(element.hasClass('md-right')).toBe(true);\n  }));\n\n  it('allows programmatic opening through the md-open attribute', inject(function() {\n    build(\n      '<md-fab-toolbar md-open=\"isOpen\"></md-fab-toolbar>'\n    );\n\n    // By default, it should be closed\n    expect(controller.isOpen).toBe(false);\n\n    // When md-open is true, it should be open\n    pageScope.$apply('isOpen = true');\n    expect(controller.isOpen).toBe(true);\n\n    // When md-open is false, it should be closed\n    pageScope.$apply('isOpen = false');\n    expect(controller.isOpen).toBe(false);\n  }));\n\n  it('properly finishes the animation', inject(function(mdFabToolbarAnimation) {\n    build(\n      '<md-fab-toolbar md-open=\"isOpen\">' +\n      '  <md-fab-trigger><button></button></md-fab-trigger>' +\n      '  <md-fab-actions><md-toolbar><button></button></md-toolbar></md-fab-actions>' +\n      '</md-fab-toolbar>'\n    );\n\n    var addDone = jasmine.createSpy('addDone');\n    var removeDone = jasmine.createSpy('removeDone');\n\n    mdFabToolbarAnimation.addClass(element, 'md-is-open', addDone);\n    expect(addDone).toHaveBeenCalled();\n\n    mdFabToolbarAnimation.removeClass(element, 'md-is-open', removeDone);\n    expect(removeDone).toHaveBeenCalled();\n  }));\n\n});"
  },
  {
    "path": "src/components/gridList/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as appCtrl\" ng-cloak>\n  <md-grid-list\n        md-cols-xs=\"1\" md-cols-sm=\"2\" md-cols-md=\"4\" md-cols-gt-md=\"6\"\n        md-row-height-gt-md=\"1:1\" md-row-height=\"2:2\"\n        md-gutter=\"12px\" md-gutter-gt-sm=\"8px\" >\n\n    <md-grid-tile class=\"gray\"\n        md-rowspan=\"3\" md-colspan=\"2\" md-colspan-sm=\"1\" md-colspan-xs=\"1\">\n      <md-grid-tile-footer>\n        <h3>#1: (3r x 2c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n    <md-grid-tile class=\"green\">\n      <md-grid-tile-footer>\n        <h3>#2: (1r x 1c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n    <md-grid-tile class=\"yellow\">\n      <md-grid-tile-footer>\n        <h3>#3: (1r x 1c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n    <md-grid-tile class=\"blue\"\n        md-rowspan=\"2\">\n      <md-grid-tile-footer>\n        <h3>#4: (2r x 1c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n    <md-grid-tile class=\"red\"\n        md-rowspan=\"2\" md-colspan=\"2\" md-colspan-sm=\"1\" md-colspan-xs=\"1\">\n      <md-grid-tile-footer>\n        <h3>#5: (2r x 2c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n    <md-grid-tile class=\"green\"\n        md-rowspan=\"2\" >\n      <md-grid-tile-footer>\n        <h3>#6: (2r x 1c)</h3>\n      </md-grid-tile-footer>\n    </md-grid-tile>\n\n  </md-grid-list>\n</div>\n"
  },
  {
    "path": "src/components/gridList/demoBasicUsage/script.js",
    "content": "\nangular.module('gridListDemo1', ['ngMaterial'])\n.controller('AppCtrl', function($scope) {});\n"
  },
  {
    "path": "src/components/gridList/demoBasicUsage/styles.css",
    "content": "md-grid-list { margin: 8px; }\n.gray { background: #f5f5f5; }\n.green { background: #b9f6ca; }\n.yellow { background: #ffff8d; }\n.blue { background: #84ffff; }\n.purple { background: #b388ff; }\n.red { background: #ff8a80; }\n"
  },
  {
    "path": "src/components/gridList/demoDynamicTiles/index.html",
    "content": "<div ng-controller=\"gridListDemoCtrl as vm\" flex ng-cloak>\n  <md-grid-list\n        md-cols=\"1\" md-cols-sm=\"2\" md-cols-md=\"3\" md-cols-gt-md=\"6\"\n        md-row-height-gt-md=\"1:1\" md-row-height=\"4:3\"\n        md-gutter=\"8px\" md-gutter-gt-sm=\"4px\" >\n\n    <md-grid-tile ng-repeat=\"tile in vm.tiles\"\n                  md-rowspan=\"{{tile.span.row}}\"\n                  md-colspan=\"{{tile.span.col}}\"\n                  md-colspan-sm=\"1\"\n                  md-colspan-xs=\"1\"\n                  ng-class=\"tile.background\" >\n      <md-icon md-svg-icon=\"{{tile.icon}}\"></md-icon>\n      <md-grid-tile-footer><h3>{{tile.title}}</h3></md-grid-tile-footer>\n    </md-grid-tile>\n  </md-grid-list>\n</div>\n"
  },
  {
    "path": "src/components/gridList/demoDynamicTiles/script.js",
    "content": "\nangular\n  .module('gridListDemoApp', ['ngMaterial'])\n  .controller('gridListDemoCtrl', function($scope) {\n\n    this.tiles = buildGridModel({\n            icon : \"avatar:svg-\",\n            title: \"Svg-\",\n            background: \"\"\n          });\n\n    function buildGridModel(tileTmpl){\n      var it, results = [];\n\n      for (var j=0; j<11; j++) {\n\n        it = angular.extend({},tileTmpl);\n        it.icon  = it.icon + (j+1);\n        it.title = it.title + (j+1);\n        it.span  = { row : 1, col : 1 };\n\n        switch (j+1) {\n          case 1:\n            it.background = \"red\";\n            it.span.row = it.span.col = 2;\n            break;\n\n          case 2: it.background = \"green\";         break;\n          case 3: it.background = \"darkBlue\";      break;\n          case 4:\n            it.background = \"blue\";\n            it.span.col = 2;\n            break;\n\n          case 5:\n            it.background = \"yellow\";\n            it.span.row = it.span.col = 2;\n            break;\n\n          case 6: it.background = \"pink\";          break;\n          case 7: it.background = \"darkBlue\";      break;\n          case 8: it.background = \"purple\";        break;\n          case 9: it.background = \"deepBlue\";      break;\n          case 10: it.background = \"lightPurple\";  break;\n          case 11: it.background = \"yellow\";       break;\n        }\n\n        results.push(it);\n      }\n      return results;\n    }\n  })\n  .config(function($mdIconProvider){\n    $mdIconProvider.iconSet(\"avatar\", 'icons/avatar-icons.svg', 128);\n  });\n"
  },
  {
    "path": "src/components/gridList/demoDynamicTiles/style.scss",
    "content": "md-icon {\n  width: 50%;\n  height: 30%;\n}\n\nmd-icon svg {\n  -webkit-border-radius: 50%;\n    -moz-border-radius: 50%;\n    border-radius: 50%;\n}\n\n.s64 {\n  font-size:64px;\n}\n\n.s32 {\n  font-size:48px;\n}\n\nmd-icon.fa {\n  display:block;\n  padding-left: 0;\n}\n\nmd-icon.s32 span {\n  padding-left:8px;\n}\n\nmd-grid-list {\n  margin: 8px; }\n.gray {\n  background: #f5f5f5; }\n.green {\n  background: #b9f6ca; }\n.yellow {\n  background: #ffff8d; }\n.blue {\n  background: #84ffff; }\n.darkBlue {\n  background: #80d8ff; }\n.deepBlue {\n  background: #448aff; }\n.purple {\n  background: #b388ff; }\n.lightPurple {\n  background: #8c9eff; }\n.red {\n  background: #ff8a80; }\n.pink {\n  background: #ff80ab; }\n\n\nmd-grid-tile md-icon {\n  padding-bottom: 32px;\n}\n\nmd-grid-tile md-grid-tile-footer {\n  background:  rgba(0,0,0,.68);\n  height: 36px;\n  \n}\n\nmd-grid-tile-footer figcaption  {\n  width:100%;\n}\n\nmd-grid-tile-footer figcaption h3 {\n  margin: 0;\n  font-weight:700;\n  width:100%;\n  text-align:center;\n}\n"
  },
  {
    "path": "src/components/gridList/demoResponsiveUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as appCtrl\" ng-cloak>\n  <md-content layout-padding>\n    <md-grid-list\n        md-cols-gt-md=\"12\" md-cols=\"3\" md-cols-md=\"8\"\n        md-row-height-gt-md=\"1:1\" md-row-height=\"4:3\"\n        md-gutter-gt-md=\"16px\" md-gutter-md=\"8px\" md-gutter=\"4px\">\n      <md-grid-tile\n          ng-repeat=\"tile in appCtrl.colorTiles\"\n          ng-style=\"{\n            'background': tile.color\n          }\"\n          md-colspan-gt-sm=\"{{tile.colspan}}\"\n          md-rowspan-gt-sm=\"{{tile.rowspan}}\">\n      </md-grid-tile>\n    </md-grid-list>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/gridList/demoResponsiveUsage/script.js",
    "content": "\nangular.module('gridListDemo1', ['ngMaterial'])\n.controller('AppCtrl', function($scope) {\n  var COLORS = ['#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#e53935', '#d32f2f', '#c62828', '#b71c1c', '#ff8a80', '#ff5252', '#ff1744', '#d50000', '#f8bbd0', '#f48fb1', '#f06292', '#ec407a', '#e91e63', '#d81b60', '#c2185b', '#ad1457', '#880e4f', '#ff80ab', '#ff4081', '#f50057', '#c51162', '#e1bee7', '#ce93d8', '#ba68c8', '#ab47bc', '#9c27b0', '#8e24aa', '#7b1fa2', '#4a148c', '#ea80fc', '#e040fb', '#d500f9', '#aa00ff', '#ede7f6', '#d1c4e9', '#b39ddb', '#9575cd', '#7e57c2', '#673ab7', '#5e35b1', '#4527a0', '#311b92', '#b388ff', '#7c4dff', '#651fff', '#6200ea', '#c5cae9', '#9fa8da', '#7986cb', '#5c6bc0', '#3f51b5', '#3949ab', '#303f9f', '#283593', '#1a237e', '#8c9eff', '#536dfe', '#3d5afe', '#304ffe', '#e3f2fd', '#bbdefb', '#90caf9', '#64b5f6', '#42a5f5', '#2196f3', '#1e88e5', '#1976d2', '#1565c0', '#0d47a1', '#82b1ff', '#448aff', '#2979ff', '#2962ff', '#b3e5fc', '#81d4fa', '#4fc3f7', '#29b6f6', '#03a9f4', '#039be5', '#0288d1', '#0277bd', '#01579b', '#80d8ff', '#40c4ff', '#00b0ff', '#0091ea', '#e0f7fa', '#b2ebf2', '#80deea', '#4dd0e1', '#26c6da', '#00bcd4', '#00acc1', '#0097a7', '#00838f', '#006064', '#84ffff', '#18ffff', '#00e5ff', '#00b8d4', '#e0f2f1', '#b2dfdb', '#80cbc4', '#4db6ac', '#26a69a', '#009688', '#00897b', '#00796b', '#00695c', '#a7ffeb', '#64ffda', '#1de9b6', '#00bfa5', '#e8f5e9', '#c8e6c9', '#a5d6a7', '#81c784', '#66bb6a', '#4caf50', '#43a047', '#388e3c', '#2e7d32', '#1b5e20', '#b9f6ca', '#69f0ae', '#00e676', '#00c853', '#f1f8e9', '#dcedc8', '#c5e1a5', '#aed581', '#9ccc65', '#8bc34a', '#7cb342', '#689f38', '#558b2f', '#33691e', '#ccff90', '#b2ff59', '#76ff03', '#64dd17', '#f9fbe7', '#f0f4c3', '#e6ee9c', '#dce775', '#d4e157', '#cddc39', '#c0ca33', '#afb42b', '#9e9d24', '#827717', '#f4ff81', '#eeff41', '#c6ff00', '#aeea00', '#fffde7', '#fff9c4', '#fff59d', '#fff176', '#ffee58', '#ffeb3b', '#fdd835', '#fbc02d', '#f9a825', '#f57f17', '#ffff8d', '#ffff00', '#ffea00', '#ffd600', '#fff8e1', '#ffecb3', '#ffe082', '#ffd54f', '#ffca28', '#ffc107', '#ffb300', '#ffa000', '#ff8f00', '#ff6f00', '#ffe57f', '#ffd740', '#ffc400', '#ffab00', '#fff3e0', '#ffe0b2', '#ffcc80', '#ffb74d', '#ffa726', '#ff9800', '#fb8c00', '#f57c00', '#ef6c00', '#e65100', '#ffd180', '#ffab40', '#ff9100', '#ff6d00', '#fbe9e7', '#ffccbc', '#ffab91', '#ff8a65', '#ff7043', '#ff5722', '#f4511e', '#e64a19', '#d84315', '#bf360c', '#ff9e80', '#ff6e40', '#ff3d00', '#dd2c00', '#d7ccc8', '#bcaaa4', '#795548', '#d7ccc8', '#bcaaa4', '#8d6e63', '#eceff1', '#cfd8dc', '#b0bec5', '#90a4ae', '#78909c', '#607d8b', '#546e7a', '#cfd8dc', '#b0bec5', '#78909c'];\n\n  this.colorTiles = (function() {\n    var tiles = [];\n    for (var i = 0; i < 46; i++) {\n      tiles.push({\n        color: randomColor(),\n        colspan: randomSpan(),\n        rowspan: randomSpan()\n      });\n    }\n    return tiles;\n  })();\n\n\n  function randomColor() {\n    return COLORS[Math.floor(Math.random() * COLORS.length)];\n  }\n\n  function randomSpan() {\n    var r = Math.random();\n    if (r < 0.8) {\n      return 1;\n    } else if (r < 0.9) {\n      return 2;\n    } else {\n      return 3;\n    }\n  }\n});\n"
  },
  {
    "path": "src/components/gridList/grid-list.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.gridList\n */\nangular.module('material.components.gridList', ['material.core'])\n       .directive('mdGridList', GridListDirective)\n       .directive('mdGridTile', GridTileDirective)\n       .directive('mdGridTileFooter', GridTileCaptionDirective)\n       .directive('mdGridTileHeader', GridTileCaptionDirective)\n       .factory('$mdGridLayout', GridLayoutFactory);\n\n/**\n * @ngdoc directive\n * @name mdGridList\n * @module material.components.gridList\n * @restrict E\n * @description\n * Grid lists are an alternative to standard list views. Grid lists are distinct\n * from grids used for layouts and other visual presentations.\n *\n * A grid list is best suited to presenting a homogenous data type, typically\n * images, and is optimized for visual comprehension and differentiating between\n * like data types.\n *\n * A grid list is a continuous element consisting of tessellated, regular\n * subdivisions called cells that contain tiles (`md-grid-tile`).\n *\n * <img src=\"//material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0Bx4BSt6jniD7OVlEaXZ5YmU1Xzg/components_grids_usage2.png\"\n *    style=\"width: 300px; height: auto; margin-right: 16px;\" alt=\"Concept of grid explained visually\">\n * <img src=\"//material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0Bx4BSt6jniD7VGhsOE5idWlJWXM/components_grids_usage3.png\"\n *    style=\"width: 300px; height: auto;\" alt=\"Grid concepts legend\">\n *\n * Cells are arrayed vertically and horizontally within the grid.\n *\n * Tiles hold content and can span one or more cells vertically or horizontally.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-list` directive supports \"responsive\" attributes, which allow\n * different `md-cols`, `md-gutter` and `md-row-height` values depending on the\n * currently matching media query.\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-cols-lg=\"8\"`)\n *\n * @param {number} md-cols Number of columns in the grid.\n * @param {string} md-row-height One of\n * <ul>\n *   <li>CSS length - Fixed height rows (eg. `8px` or `1rem`)</li>\n *   <li>`{width}:{height}` - Ratio of width to height (eg.\n *   `md-row-height=\"16:9\"`)</li>\n *   <li>`\"fit\"` - Height will be determined by subdividing the available\n *   height by the number of rows</li>\n * </ul>\n * @param {string=} md-gutter The amount of space between tiles in CSS units\n *     (default 1px)\n * @param {expression=} md-on-layout Expression to evaluate after layout. Event\n *     object is available as `$event`, and contains performance information.\n *\n * @usage\n * Basic:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"5\" md-gutter=\"1em\" md-row-height=\"4:3\">\n *   <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Fixed-height rows:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"4\" md-row-height=\"200px\" ...>\n *   <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Fit rows:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"4\" md-row-height=\"fit\" style=\"height: 400px;\" ...>\n *   <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Using responsive attributes:\n * <hljs lang=\"html\">\n * <md-grid-list\n *     md-cols-sm=\"2\"\n *     md-cols-md=\"4\"\n *     md-cols-lg=\"8\"\n *     md-cols-gt-lg=\"12\"\n *     ...>\n *   <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n */\nfunction GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia, $mdUtil) {\n  return {\n    restrict: 'E',\n    controller: GridListController,\n    scope: {\n      mdOnLayout: '&'\n    },\n    link: postLink\n  };\n\n  function postLink(scope, element, attrs, ctrl) {\n    element.addClass('_md');     // private md component indicator for styling\n\n    // Apply semantics\n    element.attr('role', 'list');\n\n    // Provide the controller with a way to trigger layouts.\n    ctrl.layoutDelegate = layoutDelegate;\n\n    var invalidateLayout = angular.bind(ctrl, ctrl.invalidateLayout),\n        unwatchAttrs = watchMedia();\n      scope.$on('$destroy', unwatchMedia);\n\n    /**\n     * Watches for changes in media, invalidating layout as necessary.\n     */\n    function watchMedia() {\n      for (var mediaName in $mdConstant.MEDIA) {\n        $mdMedia(mediaName); // initialize\n        $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n            .addListener(invalidateLayout);\n      }\n      return $mdMedia.watchResponsiveAttributes(\n          ['md-cols', 'md-row-height', 'md-gutter'], attrs, layoutIfMediaMatch);\n    }\n\n    function unwatchMedia() {\n      ctrl.layoutDelegate = angular.noop;\n\n      unwatchAttrs();\n      for (var mediaName in $mdConstant.MEDIA) {\n        $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n            .removeListener(invalidateLayout);\n      }\n    }\n\n    /**\n     * Performs grid layout if the provided mediaName matches the currently\n     * active media type.\n     */\n    function layoutIfMediaMatch(mediaName) {\n      if (mediaName == null) {\n        // TODO(shyndman): It would be nice to only layout if we have\n        // instances of attributes using this media type\n        ctrl.invalidateLayout();\n      } else if ($mdMedia(mediaName)) {\n        ctrl.invalidateLayout();\n      }\n    }\n\n    var lastLayoutProps;\n\n    /**\n     * Invokes the layout engine, and uses its results to lay out our\n     * tile elements.\n     *\n     * @param {boolean} tilesInvalidated Whether tiles have been\n     *    added/removed/moved since the last layout. This is to avoid situations\n     *    where tiles are replaced with properties identical to their removed\n     *    counterparts.\n     */\n    function layoutDelegate(tilesInvalidated) {\n      var tiles = getTileElements();\n      var props = {\n        tileSpans: getTileSpans(tiles),\n        colCount: getColumnCount(),\n        rowMode: getRowMode(),\n        rowHeight: getRowHeight(),\n        gutter: getGutter()\n      };\n\n      if (!tilesInvalidated && angular.equals(props, lastLayoutProps)) {\n        return;\n      }\n\n      var performance =\n        $mdGridLayout(props.colCount, props.tileSpans, tiles)\n          .map(function(tilePositions, rowCount) {\n            return {\n              grid: {\n                element: element,\n                style: getGridStyle(props.colCount, rowCount,\n                    props.gutter, props.rowMode, props.rowHeight)\n              },\n              tiles: tilePositions.map(function(ps, i) {\n                return {\n                  element: angular.element(tiles[i]),\n                  style: getTileStyle(ps.position, ps.spans,\n                      props.colCount, rowCount,\n                      props.gutter, props.rowMode, props.rowHeight)\n                };\n              })\n            };\n          })\n          .reflow()\n          .performance();\n\n      // Report layout\n      scope.mdOnLayout({\n        $event: {\n          performance: performance\n        }\n      });\n\n      lastLayoutProps = props;\n    }\n\n    // Use $interpolate to do some simple string interpolation as a convenience.\n\n    var startSymbol = $interpolate.startSymbol();\n    var endSymbol = $interpolate.endSymbol();\n\n    // Returns an expression wrapped in the interpolator's start and end symbols.\n    function expr(exprStr) {\n      return startSymbol + exprStr + endSymbol;\n    }\n\n    // The amount of space a single 1x1 tile would take up (either width or height), used as\n    // a basis for other calculations. This consists of taking the base size percent (as would be\n    // if evenly dividing the size between cells), and then subtracting the size of one gutter.\n    // However, since there are no gutters on the edges, each tile only uses a fration\n    // (gutterShare = numGutters / numCells) of the gutter size. (Imagine having one gutter per\n    // tile, and then breaking up the extra gutter on the edge evenly among the cells).\n    var UNIT = $interpolate(expr('share') + '% - (' + expr('gutter') + ' * ' + expr('gutterShare') + ')');\n\n    // The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.\n    // The position comes the size of a 1x1 tile plus gutter for each previous tile in the\n    // row/column (offset).\n    var POSITION  = $interpolate('calc((' + expr('unit') + ' + ' + expr('gutter') + ') * ' + expr('offset') + ')');\n\n    // The actual size of a tile, e.g., width or height, taking rowSpan or colSpan into account.\n    // This is computed by multiplying the base unit by the rowSpan/colSpan, and then adding back\n    // in the space that the gutter would normally have used (which was already accounted for in\n    // the base unit calculation).\n    var DIMENSION = $interpolate('calc((' + expr('unit') + ') * ' + expr('span') + ' + (' + expr('span') + ' - 1) * ' + expr('gutter') + ')');\n\n    /**\n     * Gets the styles applied to a tile element described by the given parameters.\n     * @param {{row: number, col: number}} position The row and column indices of the tile.\n     * @param {{row: number, col: number}} spans The rowSpan and colSpan of the tile.\n     * @param {number} colCount The number of columns.\n     * @param {number} rowCount The number of rows.\n     * @param {string} gutter The amount of space between tiles. This will be something like\n     *     '5px' or '2em'.\n     * @param {string} rowMode The row height mode. Can be one of:\n     *     'fixed': all rows have a fixed size, given by rowHeight,\n     *     'ratio': row height defined as a ratio to width, or\n     *     'fit': fit to the grid-list element height, divinding evenly among rows.\n     * @param {string|number} rowHeight The height of a row. This is only used for 'fixed' mode and\n     *     for 'ratio' mode. For 'ratio' mode, this is the *ratio* of width-to-height (e.g., 0.75).\n     * @returns {Object} Map of CSS properties to be applied to the style element. Will define\n     *     values for top, left, width, height, marginTop, and paddingTop.\n     */\n    function getTileStyle(position, spans, colCount, rowCount, gutter, rowMode, rowHeight) {\n      // TODO(shyndman): There are style caching opportunities here.\n\n      // Percent of the available horizontal space that one column takes up.\n      var hShare = (1 / colCount) * 100;\n\n      // Fraction of the gutter size that each column takes up.\n      var hGutterShare = (colCount - 1) / colCount;\n\n      // Base horizontal size of a column.\n      var hUnit = UNIT({share: hShare, gutterShare: hGutterShare, gutter: gutter});\n\n      // The width and horizontal position of each tile is always calculated the same way, but the\n      // height and vertical position depends on the rowMode.\n      var style = (!$mdUtil.isRtl(attrs)) ? {\n          left: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),\n          width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),\n          // resets\n          paddingTop: '',\n          marginTop: '',\n          top: '',\n          height: ''\n        } : {\n        right: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),\n        width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),\n        // resets\n        paddingTop: '',\n        marginTop: '',\n        top: '',\n        height: ''\n      };\n\n      switch (rowMode) {\n        case 'fixed':\n          // In fixed mode, simply use the given rowHeight.\n          style.top = POSITION({ unit: rowHeight, offset: position.row, gutter: gutter });\n          style.height = DIMENSION({ unit: rowHeight, span: spans.row, gutter: gutter });\n          break;\n\n        case 'ratio':\n          // Percent of the available vertical space that one row takes up. Here, rowHeight holds\n          // the ratio value. For example, if the width:height ratio is 4:3, rowHeight = 1.333.\n          var vShare = hShare / rowHeight;\n\n          // Base veritcal size of a row.\n          var vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n          // padidngTop and marginTop are used to maintain the given aspect ratio, as\n          // a percentage-based value for these properties is applied to the *width* of the\n          // containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties\n          style.paddingTop = DIMENSION({ unit: vUnit, span: spans.row, gutter: gutter});\n          style.marginTop = POSITION({ unit: vUnit, offset: position.row, gutter: gutter });\n          break;\n\n        case 'fit':\n          // Fraction of the gutter size that each column takes up.\n          var vGutterShare = (rowCount - 1) / rowCount;\n\n          // Percent of the available vertical space that one row takes up.\n          vShare = (1 / rowCount) * 100;\n\n          // Base vertical size of a row.\n          vUnit = UNIT({share: vShare, gutterShare: vGutterShare, gutter: gutter});\n\n          style.top = POSITION({unit: vUnit, offset: position.row, gutter: gutter});\n          style.height = DIMENSION({unit: vUnit, span: spans.row, gutter: gutter});\n          break;\n      }\n\n      return style;\n    }\n\n    function getGridStyle(colCount, rowCount, gutter, rowMode, rowHeight) {\n      var style = {};\n\n      switch (rowMode) {\n        case 'fixed':\n          style.height = DIMENSION({ unit: rowHeight, span: rowCount, gutter: gutter });\n          style.paddingBottom = '';\n          break;\n\n        case 'ratio':\n          // rowHeight is width / height\n          var hGutterShare = colCount === 1 ? 0 : (colCount - 1) / colCount,\n              hShare = (1 / colCount) * 100,\n              vShare = hShare * (1 / rowHeight),\n              vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n          style.height = '';\n          style.paddingBottom = DIMENSION({ unit: vUnit, span: rowCount, gutter: gutter});\n          break;\n\n        case 'fit':\n          // noop, as the height is user set\n          break;\n      }\n\n      return style;\n    }\n\n    function getTileElements() {\n      return [].filter.call(element.children(), function(ele) {\n        return ele.tagName == 'MD-GRID-TILE' && !ele.$$mdDestroyed;\n      });\n    }\n\n    /**\n     * Gets an array of objects containing the rowspan and colspan for each tile.\n     * @returns {Array<{row: number, col: number}>}\n     */\n    function getTileSpans(tileElements) {\n      return [].map.call(tileElements, function(ele) {\n        var ctrl = angular.element(ele).controller('mdGridTile');\n        return {\n          row: parseInt(\n              $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-rowspan'), 10) || 1,\n          col: parseInt(\n              $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-colspan'), 10) || 1\n        };\n      });\n    }\n\n    function getColumnCount() {\n      var colCount = parseInt($mdMedia.getResponsiveAttribute(attrs, 'md-cols'), 10);\n      if (isNaN(colCount)) {\n        throw 'md-grid-list: md-cols attribute was not found, or contained a non-numeric value';\n      }\n      return colCount;\n    }\n\n    function getGutter() {\n      return applyDefaultUnit($mdMedia.getResponsiveAttribute(attrs, 'md-gutter') || 1);\n    }\n\n    function getRowHeight() {\n      var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n      if (!rowHeight) {\n        throw 'md-grid-list: md-row-height attribute was not found';\n      }\n\n      switch (getRowMode()) {\n        case 'fixed':\n          return applyDefaultUnit(rowHeight);\n        case 'ratio':\n          var whRatio = rowHeight.split(':');\n          return parseFloat(whRatio[0]) / parseFloat(whRatio[1]);\n        case 'fit':\n          return 0; // N/A\n      }\n    }\n\n    function getRowMode() {\n      var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n      if (!rowHeight) {\n        throw 'md-grid-list: md-row-height attribute was not found';\n      }\n\n      if (rowHeight == 'fit') {\n        return 'fit';\n      } else if (rowHeight.indexOf(':') !== -1) {\n        return 'ratio';\n      } else {\n        return 'fixed';\n      }\n    }\n\n    function applyDefaultUnit(val) {\n      return /\\D$/.test(val) ? val : val + 'px';\n    }\n  }\n}\n\n/* @ngInject */\nfunction GridListController($mdUtil) {\n  this.layoutInvalidated = false;\n  this.tilesInvalidated = false;\n  this.$timeout_ = $mdUtil.nextTick;\n  this.layoutDelegate = angular.noop;\n}\n\nGridListController.prototype = {\n  invalidateTiles: function() {\n    this.tilesInvalidated = true;\n    this.invalidateLayout();\n  },\n\n  invalidateLayout: function() {\n    if (this.layoutInvalidated) {\n      return;\n    }\n    this.layoutInvalidated = true;\n    this.$timeout_(angular.bind(this, this.layout));\n  },\n\n  layout: function() {\n    try {\n      this.layoutDelegate(this.tilesInvalidated);\n    } finally {\n      this.layoutInvalidated = false;\n      this.tilesInvalidated = false;\n    }\n  }\n};\n\n\n/* @ngInject */\nfunction GridLayoutFactory($mdUtil) {\n  var defaultAnimator = GridTileAnimator;\n\n  /**\n   * Set the reflow animator callback\n   */\n  GridLayout.animateWith = function(customAnimator) {\n    defaultAnimator = !angular.isFunction(customAnimator) ? GridTileAnimator : customAnimator;\n  };\n\n  return GridLayout;\n\n  /**\n   * Publish layout function\n   */\n  function GridLayout(colCount, tileSpans) {\n      var self, layoutInfo, gridStyles, layoutTime, mapTime, reflowTime;\n\n      layoutTime = $mdUtil.time(function() {\n        layoutInfo = calculateGridFor(colCount, tileSpans);\n      });\n\n      return self = {\n\n        /**\n         * An array of objects describing each tile's position in the grid.\n         */\n        layoutInfo: function() {\n          return layoutInfo;\n        },\n\n        /**\n         * Maps grid positioning to an element and a set of styles using the\n         * provided updateFn.\n         */\n        map: function(updateFn) {\n          mapTime = $mdUtil.time(function() {\n            var info = self.layoutInfo();\n            gridStyles = updateFn(info.positioning, info.rowCount);\n          });\n          return self;\n        },\n\n        /**\n         * Default animator simply sets the element.css( <styles> ). An alternate\n         * animator can be provided as an argument. The function has the following\n         * signature:\n         *\n         *    function({grid: {element: JQLite, style: Object}, tiles: Array<{element: JQLite, style: Object}>)\n         */\n        reflow: function(animatorFn) {\n          reflowTime = $mdUtil.time(function() {\n            var animator = animatorFn || defaultAnimator;\n            animator(gridStyles.grid, gridStyles.tiles);\n          });\n          return self;\n        },\n\n        /**\n         * Timing for the most recent layout run.\n         */\n        performance: function() {\n          return {\n            tileCount: tileSpans.length,\n            layoutTime: layoutTime,\n            mapTime: mapTime,\n            reflowTime: reflowTime,\n            totalTime: layoutTime + mapTime + reflowTime\n          };\n        }\n      };\n    }\n\n  /**\n   * Default Gridlist animator simple sets the css for each element;\n   * NOTE: any transitions effects must be manually set in the CSS.\n   * e.g.\n   *\n   *  md-grid-tile {\n   *    transition: all 700ms ease-out 50ms;\n   *  }\n   *\n   */\n  function GridTileAnimator(grid, tiles) {\n    grid.element.css(grid.style);\n    tiles.forEach(function(t) {\n      t.element.css(t.style);\n    });\n  }\n\n  /**\n   * Calculates the positions of tiles.\n   *\n   * The algorithm works as follows:\n   *    An Array<Number> with length colCount (spaceTracker) keeps track of\n   *    available tiling positions, where elements of value 0 represents an\n   *    empty position. Space for a tile is reserved by finding a sequence of\n   *    0s with length <= than the tile's colspan. When such a space has been\n   *    found, the occupied tile positions are incremented by the tile's\n   *    rowspan value, as these positions have become unavailable for that\n   *    many rows.\n   *\n   *    If the end of a row has been reached without finding space for the\n   *    tile, spaceTracker's elements are each decremented by 1 to a minimum\n   *    of 0. Rows are searched in this fashion until space is found.\n   */\n  function calculateGridFor(colCount, tileSpans) {\n    var curCol = 0,\n        curRow = 0,\n        spaceTracker = newSpaceTracker();\n\n    return {\n      positioning: tileSpans.map(function(spans, i) {\n        return {\n          spans: spans,\n          position: reserveSpace(spans, i)\n        };\n      }),\n      rowCount: curRow + Math.max.apply(Math, spaceTracker)\n    };\n\n    function reserveSpace(spans, i) {\n      if (spans.col > colCount) {\n        throw 'md-grid-list: Tile at position ' + i + ' has a colspan ' +\n            '(' + spans.col + ') that exceeds the column count ' +\n            '(' + colCount + ')';\n      }\n\n      var start = 0,\n          end = 0;\n\n      // TODO(shyndman): This loop isn't strictly necessary if you can\n      // determine the minimum number of rows before a space opens up. To do\n      // this, recognize that you've iterated across an entire row looking for\n      // space, and if so fast-forward by the minimum rowSpan count. Repeat\n      // until the required space opens up.\n      while (end - start < spans.col) {\n        if (curCol >= colCount) {\n          nextRow();\n          continue;\n        }\n\n        start = spaceTracker.indexOf(0, curCol);\n        if (start === -1 || (end = findEnd(start + 1)) === -1) {\n          start = end = 0;\n          nextRow();\n          continue;\n        }\n\n        curCol = end + 1;\n      }\n\n      adjustRow(start, spans.col, spans.row);\n      curCol = start + spans.col;\n\n      return {\n        col: start,\n        row: curRow\n      };\n    }\n\n    function nextRow() {\n      curCol = 0;\n      curRow++;\n      adjustRow(0, colCount, -1); // Decrement row spans by one\n    }\n\n    function adjustRow(from, cols, by) {\n      for (var i = from; i < from + cols; i++) {\n        spaceTracker[i] = Math.max(spaceTracker[i] + by, 0);\n      }\n    }\n\n    function findEnd(start) {\n      var i;\n      for (i = start; i < spaceTracker.length; i++) {\n        if (spaceTracker[i] !== 0) {\n          return i;\n        }\n      }\n\n      if (i === spaceTracker.length) {\n        return i;\n      }\n    }\n\n    function newSpaceTracker() {\n      var tracker = [];\n      for (var i = 0; i < colCount; i++) {\n        tracker.push(0);\n      }\n      return tracker;\n    }\n  }\n}\n\n/**\n * @ngdoc directive\n * @name mdGridTile\n * @module material.components.gridList\n * @restrict E\n * @description\n * Tiles contain the content of an `md-grid-list`. They span one or more grid\n * cells vertically or horizontally, and use `md-grid-tile-{footer,header}` to\n * display secondary content.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-tile` directive supports \"responsive\" attributes, which allow\n * different `md-rowspan` and `md-colspan` values depending on the currently\n * matching media query.\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-colspan-sm=\"4\"`)\n *\n * @param {number=} md-colspan The number of columns to span (default 1). Cannot\n *    exceed the number of columns in the grid. Supports interpolation.\n * @param {number=} md-rowspan The number of rows to span (default 1). Supports\n *     interpolation.\n *\n * @usage\n * With header:\n * <hljs lang=\"html\">\n * <md-grid-tile>\n *   <md-grid-tile-header>\n *     <h3>This is a header</h3>\n *   </md-grid-tile-header>\n * </md-grid-tile>\n * </hljs>\n *\n * With footer:\n * <hljs lang=\"html\">\n * <md-grid-tile>\n *   <md-grid-tile-footer>\n *     <h3>This is a footer</h3>\n *   </md-grid-tile-footer>\n * </md-grid-tile>\n * </hljs>\n *\n * Spanning multiple rows/columns:\n * <hljs lang=\"html\">\n * <md-grid-tile md-colspan=\"2\" md-rowspan=\"3\">\n * </md-grid-tile>\n * </hljs>\n *\n * Responsive attributes:\n * <hljs lang=\"html\">\n * <md-grid-tile md-colspan=\"1\" md-colspan-sm=\"3\" md-colspan-md=\"5\">\n * </md-grid-tile>\n * </hljs>\n */\nfunction GridTileDirective($mdMedia) {\n  return {\n    restrict: 'E',\n    require: '^mdGridList',\n    template: '<figure ng-transclude></figure>',\n    transclude: true,\n    scope: {},\n    // Simple controller that exposes attributes to the grid directive\n    controller: function($attrs) {\n      this.$attrs = $attrs;\n    },\n    link: postLink\n  };\n\n  function postLink(scope, element, attrs, gridCtrl) {\n    // Apply semantics\n    element.attr('role', 'listitem');\n\n    // If our colspan or rowspan changes, trigger a layout\n    var unwatchAttrs = $mdMedia.watchResponsiveAttributes(['md-colspan', 'md-rowspan'],\n        attrs, angular.bind(gridCtrl, gridCtrl.invalidateLayout));\n\n    // Tile registration/deregistration\n    gridCtrl.invalidateTiles();\n    scope.$on('$destroy', function() {\n      // Mark the tile as destroyed so it is no longer considered in layout,\n      // even if the DOM element sticks around (like during a leave animation)\n      element[0].$$mdDestroyed = true;\n      unwatchAttrs();\n      gridCtrl.invalidateLayout();\n    });\n\n    if (angular.isDefined(scope.$parent.$index)) {\n      scope.$watch(function() { return scope.$parent.$index; },\n        function indexChanged(newIdx, oldIdx) {\n          if (newIdx === oldIdx) {\n            return;\n          }\n          gridCtrl.invalidateTiles();\n        });\n    }\n  }\n}\n\n\nfunction GridTileCaptionDirective() {\n  return {\n    template: '<figcaption ng-transclude></figcaption>',\n    transclude: true\n  };\n}\n"
  },
  {
    "path": "src/components/gridList/grid-list.scss",
    "content": "md-grid-list {\n  box-sizing: border-box;\n  display: block;\n  position: relative;\n\n  md-grid-tile,\n  md-grid-tile > figure,\n  md-grid-tile-header,\n  md-grid-tile-footer {\n    box-sizing: border-box;\n  }\n\n  md-grid-tile {\n    display: block;\n    position: absolute;\n\n    figure {\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      height: 100%;\n      position: absolute;\n      top: 0;\n      right: 0;\n      bottom: 0;\n      left: 0;\n      padding: 0;\n      margin: 0;\n    }\n\n    // Headers & footers\n    md-grid-tile-header,\n    md-grid-tile-footer {\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      height: 48px;\n      color: #fff;\n      background: rgba(0, 0, 0, 0.18);\n      overflow: hidden;\n\n      // Positioning\n      position: absolute;\n      left: 0;\n      right: 0;\n\n      h3,\n      h4 {\n        font-weight: 400;\n        margin: 0 0 0 16px;\n      }\n\n      h3 {\n        font-size: 14px;\n      }\n\n      h4 {\n        font-size: 12px;\n      }\n    }\n\n    md-grid-tile-header {\n      top: 0;\n    }\n\n    md-grid-tile-footer {\n      bottom: 0;\n    }\n  }\n\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-grid-tile {\n    border: 1px solid #fff;\n  }\n  md-grid-tile-footer {\n    border-top: 1px solid #fff;\n  }\n}\n\n"
  },
  {
    "path": "src/components/gridList/grid-list.spec.js",
    "content": "describe('md-grid-list', function() {\n\n  // Need to mock the $mdMedia service as otherwise tests would fail on minified source through PhantomJS2\n  var $mdMediaMock = function() {};\n  $mdMediaMock.getQuery = function() {\n    return {\n      addListener: angular.noop,\n      removeListener: angular.noop\n    };\n  };\n  $mdMediaMock.getResponsiveAttribute = function() {\n    return [];\n  };\n  $mdMediaMock.watchResponsiveAttributes = function () {\n    return angular.noop;\n  };\n\n  beforeEach(module(function($provide) {\n    $provide.value('$mdMedia', $mdMediaMock);\n  }));\n\n  beforeEach(module('material.components.gridList'));\n\n  it('should have `._md` class indicator', inject(function($compile, $rootScope) {\n    var element = $compile('<md-grid-list></md-grid-list>')($rootScope.$new());\n    expect(element.hasClass('_md')).toBe(true);\n  }));\n\n});\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithClassnames/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" ng-cloak >\n  <p>Display 5 font-icons, each with different sizes and colors</p>\n  <!-- Display font icons from Icomoon.io: -->\n  <div class=\"glyph\" ng-repeat=\"font in fonts\" layout=\"row\">\n    <div ng-repeat=\"it in sizes\" flex layout-align=\"center center\" style=\"text-align: center;\" layout=\"column\">\n      <div flex></div>\n      <div class=\"preview-glyphs\">\n        <md-icon md-font-icon=\"{{ font.name }}\"\n            ng-style=\"{color: !font.theme && font.color, 'font-size': it.size + 'px', height: it.size + 'px'}\"\n            ng-class=\"font.theme\"\n            aria-label=\"{{ font.name + '-' + it.size }}\"\n            class=\"step\"></md-icon>\n      </div>\n      <div class=\"preview-scale\">\n        <span class=\"step\" style=\"{{ 'padding-left: ' + it.padding + 'px'}}\">{{ it.size }}px</span>\n      </div>\n    </div>\n  </div>\n\n  <!-- For this demo, include the font-faces needed by mdIcon above -->\n  <style>\n    @font-face {\n      font-family: \"icomoon\";\n      src: url(\"https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.eot\");\n      font-weight: normal;\n      font-style: normal;\n    }\n\n    @font-face {\n      font-family: 'icomoon';\n      src: url('https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.eot?-cmq1um');\n      src: url('https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.eot?#iefix-cmq1um') format('embedded-opentype'),\n      url('https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.woff?-cmq1um') format('woff'),\n      url('https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.ttf?-cmq1um') format('truetype'),\n      url('https://cdn.rawgit.com/angular/material/master/docs/app/fonts/icomoon.svg?-cmq1um#icomoon') format('svg');\n      font-weight: normal;\n      font-style: normal;\n    }\n  </style>\n</div>\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithClassnames/script.js",
    "content": "\nangular\n  .module('appDemoFontIconsWithClassnames', ['ngMaterial'])\n  .controller('DemoCtrl', function($scope) {\n      // Create list of font-icon names with color overrides\n      var iconData = [\n            {name: 'icon-home'        , color: \"#777\" },\n            {name: 'icon-user-plus'   , color: \"rgb(89, 226, 168)\" },\n            {name: 'icon-google-plus2', color: \"#A00\" },\n            {name: 'icon-youtube4'    , color:\"#00A\" },\n             // Use theming to color the font-icon\n            {name: 'icon-settings'    , color:\"#A00\", theme:\"md-warn md-hue-5\"}\n          ];\n\n      // Create a set of sizes...\n      $scope.sizes = [\n        {size:48,padding:10},\n        {size:36,padding:6},\n        {size:24,padding:2},\n        {size:12,padding:0}\n      ];\n\n      $scope.fonts = [].concat(iconData);\n  })\n  .config(function($mdThemingProvider){\n    // Update the theme colors to use themes on font-icons\n    $mdThemingProvider.theme('default')\n          .primaryPalette(\"red\")\n          .accentPalette('green')\n          .warnPalette('blue');\n  });\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithClassnames/style.css",
    "content": "\n.appDemoFontIconsWithClassnames {\n    padding:25px;\n    width: 100%;\n}\n.appDemoFontIconsWithClassnames,\n.appDemoFontIconsWithClassnames *:before,\n.appDemoFontIconsWithClassnames *:after {\n  box-sizing: border-box;\n}\n\n    /* Bootstrap Overrides */\n    [class^=\"icon-\"]:before,\n    [class*=\" icon-\"]:before {\n      font-family:\"icomoon\";\n      display:inline-block;\n      vertical-align:middle;\n      line-height:1;\n      font-weight:normal;\n      font-style:normal;\n\n      text-decoration:inherit;\n      text-transform:none;\n      text-rendering:optimizeLegibility;\n      -webkit-font-smoothing:antialiased;\n      -moz-osx-font-smoothing:grayscale;\n    }\n\n\n    .icon-home:before {\n        content: \"\\e900\";\n    }\n\n    .icon-clock:before {\n        content: \"\\e94e\";\n    }\n\n    .icon-user-plus:before {\n        content: \"\\e973\";\n    }\n\n    .icon-google-plus2:before {\n        content: \"\\ea89\";\n    }\n\n    .icon-youtube4:before {\n        content: \"\\ea9a\";\n    }\n\n    .icon-settings:before {\n        content: \"\\e600\";\n    }\n\n    md-progress-circular {\n        margin-bottom:20px;\n    }\n/* OLD STYLES */\n\nheader {\n  overflow: hidden;\n}\n\nheader h1 {\n  color: #888;\n  font-size: 36px;\n  font-weight: 300;\n}\n\n.container {\n  margin: 0 auto;\n  max-width: 1200px;\n  min-width: 960px;\n  padding: 40px 40px;\n  font: 14px/1.5 \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.glyph {\n  border-bottom: 1px dotted #ccc;\n  padding: 10px 0 20px;\n  margin-bottom: 20px;\n}\n\n.preview-scale,\n.preview-glyphs {\n  display: flex;\n  flex-direction: row;\n}\n\n.preview-scale {\n  color: #888;\n  font-size: 12px;\n  margin-top: 24px;\n}\n\n.step {\n  flex-grow: 1;\n  line-height: 0.5;\n}\n\n.usage { margin-top: 10px; }\n.usage input {\n  font-family: monospace;\n  text-align: center;\n}\n.usage .point { width: 150px; }\n.usage .class { width: 250px; }\n\nmd-radio-button {\n  display: inline-block;\n}\n\n.loading {\n  background-color: black;\n  filter: alpha(opacity=40);\n  height: 100%;\n  left: 0;\n  opacity: .40;\n  position: fixed;\n  top: 0;\n  width: 100%;\n  z-index: 90;\n}\n\n.loading md-progress-circular {\n  left: 50%;\n  position: fixed;\n  top: 48%;\n  z-index: 100;\n}\n\n\n\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithLigatures/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" ng-cloak >\n\n  <p>\n    Display 4 Material Design font-icons using ligatures [instead of CSS names]; each with different sizes and colors<br/>\n  </p>\n\n  <!-- Display font icons from Icomoon.io: -->\n  <div class=\"glyph\" ng-repeat=\"font in fonts\" layout=\"row\">\n    <div ng-repeat=\"it in sizes\" flex layout-align=\"center center\" style=\"text-align: center;\" layout=\"column\">\n      <div flex></div>\n      <div class=\"preview-glyphs\">\n        <md-icon ng-style=\"{color: font.color}\"\n            aria-label=\"{{ font.name }}\"\n            class=\"material-icons step\"\n            ng-class=\"it.size\"\n            ng-bind=\"font.name\">\n        </md-icon>\n      </div>\n    </div>\n  </div>\n\n  <p style=\"font-size:0.7em;padding-left: 25%\">\n    <span style=\"color:darkblue; font-weight: bold\">Cool Tip</span>:\n    Copy an icon and then paste in a text editor to see its textual name!\n  </p>\n\n  <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\n        rel=\"stylesheet\">\n\n</div>\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithLigatures/script.js",
    "content": "\nangular\n  .module('appDemoFontIconsWithLigatures', ['ngMaterial'])\n  .controller('DemoCtrl', function($scope) {\n      // Specify a list of font-icons with ligatures and color overrides\n      var iconData = [\n            {name: 'accessibility'  , color: \"#777\" },\n            {name: 'question_answer', color: \"rgb(89, 226, 168)\" },\n            {name: 'backup'         , color: \"#A00\" },\n            {name: 'email'          , color: \"#00A\" }\n          ];\n\n      $scope.fonts = [].concat(iconData);\n\n      // Create a set of sizes...\n      $scope.sizes = [\n        {size:\"md-18\",padding:0},\n        {size:\"md-24\",padding:2},\n        {size:\"md-36\",padding:6},\n        {size:\"md-48\",padding:10}\n      ];\n\n  });\n"
  },
  {
    "path": "src/components/icon/demoFontIconsWithLigatures/style.css",
    "content": "\n.appDemoFontIconsWithLigatures {\n    padding:25px;\n    width: 100%;\n}\n.appDemoFontIconsWithLigatures,\n.appDemoFontIconsWithLigatures *:before,\n.appDemoFontIconsWithLigatures *:after {\n  box-sizing: border-box;\n}\n\nheader {\n  overflow: hidden;\n}\n\nheader h1 {\n  color: #888;\n  font-size: 36px;\n  font-weight: 300;\n}\n\n.container {\n  margin: 0 auto;\n  max-width: 1200px;\n  min-width: 960px;\n  padding: 40px 40px;\n  font: 14px/1.5 \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.glyph {\n  border-bottom: 1px dotted #ccc;\n  padding: 10px 0 20px;\n  margin-bottom: 20px;\n}\n\n.preview-scale,\n.preview-glyphs {\n  display: flex;\n  flex-direction: row;\n}\n\n.preview-scale {\n  color: #888;\n  font-size: 12px;\n  margin-top: 24px;\n}\n\n.step {\n  flex-grow: 1;\n  line-height: 0.5;\n}\n\n.usage { margin-top: 10px; }\n.usage input {\n  font-family: monospace;\n  text-align: center;\n}\n.usage .point { width: 150px; }\n.usage .class { width: 250px; }\n\n/* Rules for sizing the icon.*/\n.material-icons.md-18 { font-size: 18px; }\n.material-icons.md-24 { font-size: 24px; }\n.material-icons.md-36 { font-size: 36px; }\n.material-icons.md-48 { font-size: 48px; }\n\n/* Rules for using icons as black on a light background.*/\n.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }\n.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }\n\n/* Rules for using icons as white on a dark background.*/\n.material-icons.md-light { color: rgba(255, 255, 255, 1); }\n.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }\n"
  },
  {
    "path": "src/components/icon/demoLoadSvgIconsFromUrl/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" ng-cloak layout=\"column\" layout-margin>\n    <p>The simplest way to display a single SVG icon is by referencing it by URL:</p>\n    <p>\n        <md-icon md-svg-src=\"{{ insertDriveIconURL }}\"\n                 aria-label=\"Insert Drive Icon\">\n        </md-icon>\n    </p>\n\n    <p>Style the icon size and color with CSS:</p>\n    <p>\n      <md-icon md-svg-src=\"img/icons/cake.svg\"            class=\"s24\" aria-label=\"Cake\"    ></md-icon>\n      <md-icon md-svg-src=\"{{ getAndroid() }}\"            class=\"s36\" aria-label=\"Android \"></md-icon>\n      <md-icon md-svg-src=\"img/icons/addShoppingCart.svg\" class=\"s48\" aria-label=\"Cart\"    ></md-icon>\n    </p>\n\n    <p>Use data URLs (base64 or un-encoded):</p>\n    <p>\n      <md-icon\n        md-svg-src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGcgaWQ9ImNha2UiPjxwYXRoIGQ9Ik0xMiA2YzEuMTEgMCAyLS45IDItMiAwLS4zOC0uMS0uNzMtLjI5LTEuMDNMMTIgMGwtMS43MSAyLjk3Yy0uMTkuMy0uMjkuNjUtLjI5IDEuMDMgMCAxLjEuOSAyIDIgMnptNC42IDkuOTlsLTEuMDctMS4wNy0xLjA4IDEuMDdjLTEuMyAxLjMtMy41OCAxLjMxLTQuODkgMGwtMS4wNy0xLjA3LTEuMDkgMS4wN0M2Ljc1IDE2LjY0IDUuODggMTcgNC45NiAxN2MtLjczIDAtMS40LS4yMy0xLjk2LS42MVYyMWMwIC41NS40NSAxIDEgMWgxNmMuNTUgMCAxLS40NSAxLTF2LTQuNjFjLS41Ni4zOC0xLjIzLjYxLTEuOTYuNjEtLjkyIDAtMS43OS0uMzYtMi40NC0xLjAxek0xOCA5aC01VjdoLTJ2Mkg2Yy0xLjY2IDAtMyAxLjM0LTMgM3YxLjU0YzAgMS4wOC44OCAxLjk2IDEuOTYgMS45Ni41MiAwIDEuMDItLjIgMS4zOC0uNTdsMi4xNC0yLjEzIDIuMTMgMi4xM2MuNzQuNzQgMi4wMy43NCAyLjc3IDBsMi4xNC0yLjEzIDIuMTMgMi4xM2MuMzcuMzcuODYuNTcgMS4zOC41NyAxLjA4IDAgMS45Ni0uODggMS45Ni0xLjk2VjEyQzIxIDEwLjM0IDE5LjY2IDkgMTggOXoiLz48L2c+PC9zdmc+\"\n        class=\"s24\"\n        aria-label=\"Cake\">\n      </md-icon>\n\n      <md-icon\n        md-svg-src=\"data:image/svg+xml;base64,{{ getAndroidEncoded() }}\"\n        class=\"s36\"\n        aria-label=\"Android\">\n      </md-icon>\n\n      <!-- un-encoded -->\n      <md-icon\n        md-svg-src=\"data:image/svg+xml, {{ getCartDecoded() }}\"\n        class=\"s48\"\n        aria-label=\"Cart\">\n      </md-icon>\n    </p>\n</div>\n\n"
  },
  {
    "path": "src/components/icon/demoLoadSvgIconsFromUrl/script.js",
    "content": "angular.module('appDemoSvgIcons', ['ngMaterial'])\n  .controller('DemoCtrl', function($scope) {\n    $scope.insertDriveIconURL = 'img/icons/ic_insert_drive_file_24px.svg';\n    $scope.getAndroid = function() {\n      return 'img/icons/android.svg';\n    };\n    // Returns base64 encoded SVG\n    $scope.getAndroidEncoded = function() {\n      return 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGcgaWQ9ImFuZHJvaWQiPjxwYXRoIGQ9Ik02IDE4YzAgLjU1LjQ1IDEgMSAxaDF2My41YzAgLjgzLjY3IDEuNSAxLjUgMS41czEuNS0uNjcgMS41LTEuNVYxOWgydjMuNWMwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjVWMTloMWMuNTUgMCAxLS40NSAxLTFWOEg2djEwek0zLjUgOEMyLjY3IDggMiA4LjY3IDIgOS41djdjMCAuODMuNjcgMS41IDEuNSAxLjVTNSAxNy4zMyA1IDE2LjV2LTdDNSA4LjY3IDQuMzMgOCAzLjUgOHptMTcgMGMtLjgzIDAtMS41LjY3LTEuNSAxLjV2N2MwIC44My42NyAxLjUgMS41IDEuNXMxLjUtLjY3IDEuNS0xLjV2LTdjMC0uODMtLjY3LTEuNS0xLjUtMS41em0tNC45Ny01Ljg0bDEuMy0xLjNjLjItLjIuMi0uNTEgMC0uNzEtLjItLjItLjUxLS4yLS43MSAwbC0xLjQ4IDEuNDhDMTMuODUgMS4yMyAxMi45NSAxIDEyIDFjLS45NiAwLTEuODYuMjMtMi42Ni42M0w3Ljg1LjE1Yy0uMi0uMi0uNTEtLjItLjcxIDAtLjIuMi0uMi41MSAwIC43MWwxLjMxIDEuMzFDNi45NyAzLjI2IDYgNS4wMSA2IDdoMTJjMC0xLjk5LS45Ny0zLjc1LTIuNDctNC44NHpNMTAgNUg5VjRoMXYxem01IDBoLTFWNGgxdjF6Ii8+PC9nPjwvc3ZnPg==';\n    };\n    // Returns decoded SVG\n    $scope.getCartDecoded = function() {\n      return '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g id=\"add-shopping-cart\"><path d=\"M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z\"/></g></svg>';\n    };\n  });\n"
  },
  {
    "path": "src/components/icon/demoLoadSvgIconsFromUrl/style.css",
    "content": "\n\n\n\nmd-progress-circular {\n    margin-bottom:20px;\n}\n\nmd-icon {\n    margin: 20px;\n    margin-top: 0;\n    width: 24px;\n    height: 24px;\n}\n\n\n\n.demo-content {\n    min-height: 210px;\n}\n\n\n.appDemoSvgIcons {\n    padding:25px;\n}\n\n.s24 {\n    width: 24px;height: 24px;\n    color: #f00;\n}\n\n.s36 {\n    width: 36px;height: 36px;\n    color: #0f0;\n}\n\n.s48 {\n    width: 48px;height: 48px;\n    color: #00f;\n\n}\n"
  },
  {
    "path": "src/components/icon/demoSvgIconSets/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" layout=\"column\" layout-margin ng-cloak>\n\n    <p>Display an icon from a pre-registered set of icons:</p>\n\n    <p>\n      <md-icon md-svg-icon=\"alarm\"          style=\"color: #0F0;\"                        aria-label=\"Alarm Icon\"></md-icon>\n      <md-icon md-svg-icon=\"social:cake\"    style=\"color: #f00;width:60px;height:60px;\" aria-label=\"Cake Icon\"></md-icon>\n      <md-icon md-svg-icon=\"social:people\"  style=\"color: #00F;\" class=\"s48\"            aria-label=\"People Icon\"></md-icon>\n      <md-icon md-svg-icon=\"symbol:spinner\" style=\"color: #f00;width:60px;height:60px;\" aria-label=\"Spinner Icon\"></md-icon>\n      <md-icon md-svg-icon=\"symbol:angular\" class=\"s48\"                                 aria-label=\"Angular Icon\"></md-icon>\n    </p>\n\n</div>\n"
  },
  {
    "path": "src/components/icon/demoSvgIconSets/script.js",
    "content": "angular.module('appSvgIconSets', ['ngMaterial'])\n  .controller('DemoCtrl', function($scope) {})\n  .config(function($mdIconProvider) {\n    $mdIconProvider\n      .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n      .iconSet('symbol', 'img/icons/sets/symbol-icons.svg', 24)\n      .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n  });\n"
  },
  {
    "path": "src/components/icon/demoSvgIconSets/style.css",
    "content": "\nmd-progress-circular {\n    margin-bottom:20px;\n}\n\nmd-icon {\n    margin: 20px;\n    margin-top: 0;\n    width: 24px;\n    height: 24px;\n}\n\n.demo-content {\n    min-height: 210px;\n}\n\n.appSvgIconSets {\n    padding:25px;\n}\n\n.s48 {\n    width:48px;\n    height:48px;\n}\n"
  },
  {
    "path": "src/components/icon/demoUsingTemplateRequest/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" layout=\"column\" layout-margin ng-cloak>\n\n  <p>\n      Pre-fetch and cache SVG icons using $templateRequest.<br/>\n      <span class=\"note\"> NOTE: Show the Source views for details...</span>\n  </p>\n\n  <p>\n    <md-icon md-svg-icon=\"core:alarm-add\"       style=\"color:#000;\" aria-label=\"Add\"    ></md-icon>\n    <md-icon md-svg-icon=\"core:alarm-off\"       style=\"color:#f00;\" aria-label=\"Off\"    ></md-icon>\n    <md-icon md-svg-icon=\"social:cake\"          style=\"color:#00F;\" aria-label=\"Cake\"   ></md-icon>\n    <md-icon md-svg-src=\"img/icons/android.svg\" style=\"color:#0F0;\" aria-label=\"Android\"></md-icon>\n  </p>\n\n</div>\n"
  },
  {
    "path": "src/components/icon/demoUsingTemplateRequest/script.js",
    "content": "angular.module('appUsingTemplateCache', ['ngMaterial'])\n  .controller('DemoCtrl', function($scope) {})\n  .config(function($mdIconProvider) {\n    // Register icon IDs with sources. Future $mdIcon( <id> ) lookups\n    // will load by url and retrieve the data via the $templateRequest\n    $mdIconProvider\n      .iconSet('core', 'img/icons/sets/core-icons.svg', 24)\n      .icon('social:cake', 'img/icons/cake.svg', 24);\n  })\n  .run(function($templateRequest) {\n    var urls = [\n      'img/icons/sets/core-icons.svg',\n      'img/icons/cake.svg',\n      'img/icons/android.svg'\n    ];\n\n    // Pre-fetch icons sources by URL and cache in the $templateCache...\n    // subsequent $templateRequest calls will look there first.\n    angular.forEach(urls, function(url) {\n      $templateRequest(url);\n    });\n  });\n"
  },
  {
    "path": "src/components/icon/demoUsingTemplateRequest/style.css",
    "content": "\nmd-progress-circular {\n    margin-bottom:20px;\n}\n\nmd-icon {\n    margin: 20px;\n    margin-top: 0;\n    width: 24px;\n    height: 24px;\n}\n\n.demo-content {\n    min-height: 210px;\n}\n\n.appUsingTemplateCache {\n    padding:25px;\n}\n\n.note {\n    font-size: 12px;\n    display: block;\n    margin-top: -2px;\n    padding-left: 25px;\n    color: rgb(127, 126, 126);\n}\n"
  },
  {
    "path": "src/components/icon/icon-theme.scss",
    "content": "md-icon.md-THEME_NAME-theme {\n  color: '{{foreground-2}}';\n\n  &.md-primary {\n    color: '{{primary-color}}';\n  }\n\n  &.md-accent {\n    color: '{{accent-color}}';\n  }\n\n  &.md-warn {\n    color: '{{warn-color}}';\n  }\n}\n\n"
  },
  {
    "path": "src/components/icon/icon.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.icon\n * @description\n * Icon\n */\nangular.module('material.components.icon', ['material.core']);\n"
  },
  {
    "path": "src/components/icon/icon.scss",
    "content": "md-icon {\n  margin: auto;\n  background-repeat: no-repeat no-repeat;\n  display: inline-block;\n  vertical-align: middle;\n  fill: currentColor;\n  height: $icon-size;\n  width: $icon-size;\n\n  // The icons should not shrink on smaller viewports.\n  min-height: $icon-size;\n  min-width: $icon-size;\n\n  svg {\n    pointer-events: none;\n    display: block;\n  }\n\n  &[md-font-icon] {\n    line-height: $icon-size;\n    width: auto;\n  }\n}\n"
  },
  {
    "path": "src/components/icon/icon.spec.js",
    "content": "describe('MdIcon directive', function() {\n  var el, $scope, $compile, $mdIconProvider, $sce;\n  var wasLastSvgSrcTrusted = false;\n\n  beforeEach(module('material.components.icon', function(_$mdIconProvider_) {\n    $mdIconProvider = _$mdIconProvider_;\n  }));\n\n  afterEach(function() {\n    $mdIconProvider.defaultFontSet('material-icons');\n    $mdIconProvider.fontSet('fa', 'fa');\n  });\n\n\n  describe('for font-icons:', function () {\n\n    beforeEach(inject(function($rootScope, _$compile_) {\n      $scope = $rootScope;\n      $compile = _$compile_;\n    }));\n\n\n    describe('using font-icons with deprecated md-font-icon=\"\"', function() {\n\n      it('should render correct HTML with md-font-icon value as class', function() {\n        el = make('<md-icon md-font-icon=\"android\"></md-icon>');\n\n        expect(el.html()).toEqual('');\n        var classes = clean(el.attr('class'));\n        expect(classes).toContain('md-font');\n        expect(classes).toContain('android');\n        expect(classes).toContain('material-icons');\n      });\n\n      it('should transclude class specifiers', function() {\n        el = make('<md-icon md-font-icon=\"android\" class=\"material-icons\"></md-icon>');\n\n        expect(el.html()).toEqual('');\n        expect(el.hasClass('md-font')).toBe(true);\n        expect(el.hasClass('android')).toBe(true);\n        expect(el.hasClass('material-icons')).toBe(true);\n      });\n\n      it('should not render any inner content if the md-font-icon value is empty', function() {\n        el = make('<md-icon md-font-icon=\"\"></md-icon>');\n        expect(el.html()).toEqual('');\n      });\n\n      it('should apply default fontset \"material-icons\" when not specified.',function() {\n        $scope.font = {\n          name: 'icon-home',\n          color: '#777',\n          size: 48\n        };\n\n        el = make(\n          '<md-icon ' +\n              'md-font-icon=\"{{ font.name }}\" ' +\n              'aria-label=\"{{ font.name + font.size }}\" ' +\n              'class=\"step\">' +\n          '</md-icon>'\n        );\n\n        expect(el.attr('md-font-icon')).toBe($scope.font.name);\n        expect(el.hasClass('step')).toBe(true);\n        expect(el.hasClass('material-icons')).toBe(true);\n        expect(el.attr('aria-label')).toBe($scope.font.name + $scope.font.size);\n        expect(el.attr('role')).toBe('img');\n      });\n\n      it('should remove old icon class and apply the new when icon changed.',function() {\n        $scope.font = 'icon-home';\n\n        el = make('<md-icon md-font-icon=\"{{ font }}\" ></md-icon>');\n\n        expect(el.attr('md-font-icon')).toBe($scope.font);\n        expect(el.hasClass('icon-home')).toBeTruthy();\n\n        $scope.font = 'android';\n        $scope.$apply();\n\n        expect(el.hasClass('icon-home')).toBeFalsy();\n        expect(el.attr('md-font-icon')).toBe($scope.font);\n        expect(el.hasClass('android')).toBeTruthy();\n      });\n    });\n\n    describe('using font-icons with ligatures: md-font-set=\"\"', function() {\n\n      it('should render correct HTML with ligatures', function() {\n        el = make('<md-icon class=\"md-48\">face</md-icon>');\n\n        expect(el.text()).toEqual('face');\n        expect(el.hasClass('material-icons')).toBeTruthy();\n        expect(el.hasClass('md-48')).toBeTruthy();\n      });\n\n      it('should render correctly using a md-font-set alias', function() {\n        $mdIconProvider.fontSet('fa', 'fontawesome');\n\n        el = make('<md-icon md-font-set=\"fa\">email</md-icon>');\n\n        expect(el.text()).toEqual('email');\n        expect(clean(el.attr('class'))).toEqual('fontawesome');\n      });\n\n      it('should remove old font set class and apply the new when set changed', function() {\n        $scope.set = 'fontawesome';\n\n        el = make('<md-icon md-font-set=\"{{ set }}\">email</md-icon>');\n\n        expect(el.text()).toEqual('email');\n        expect(clean(el.attr('class'))).toEqual('fontawesome');\n\n        $scope.set = 'material-icons';\n        $scope.$apply();\n\n        expect(clean(el.attr('class'))).toEqual('material-icons');\n      });\n\n      it('should render correctly using a md-font-set alias', function() {\n        el = make('<md-icon md-font-set=\"fa\" md-font-icon=\"fa-info\"></md-icon>');\n\n        var classes = clean(el.attr('class'));\n        expect(classes).toContain('md-font');\n        expect(classes).toContain('fa-info');\n        expect(classes).toContain('fa');\n      });\n\n      it('should render correctly using md-font-set value as class', function() {\n\n        el = make('<md-icon md-font-set=\"fontawesome\">email</md-icon>');\n\n        expect(el.text()).toEqual('email');\n        expect(clean(el.attr('class'))).toEqual('fontawesome');\n      });\n    });\n\n    describe('using font-icons with classnames', function() {\n\n      it('should auto-add the material-icons style', function() {\n        el = make('<md-icon>apple</md-icon>');\n\n        expect(el.text()).toEqual('apple');\n        expect(el.hasClass('material-icons')).toBeTruthy();\n      });\n\n\n      it('should render with icon classname', function() {\n        el = make('<md-icon class=\"custom-cake\"></md-icon>');\n\n        expect(el.text()).toEqual('');\n        expect(el.hasClass('material-icons')).toBeTruthy();\n        expect(el.hasClass('custom-cake')).toBeTruthy();\n      });\n\n      it('should support clearing default fontset', function() {\n        $mdIconProvider.defaultFontSet('');\n\n        el = make('<md-icon class=\"custom-cake\"></md-icon>');\n        expect(clean(el.attr('class'))).toEqual('custom-cake');\n\n        el = make('<md-icon class=\"custom-cake\">apple</md-icon>');\n        expect(el.text()).toEqual('apple');\n        expect(clean(el.attr('class'))).toEqual('custom-cake');\n\n      });\n\n      it('should support custom default fontset', function() {\n        $mdIconProvider.defaultFontSet('fa');\n\n        el = make('<md-icon></md-icon>');\n        expect(clean(el.attr('class'))).toEqual('fa');\n\n        el = make('<md-icon md-font-icon=\"fa-apple\">apple</md-icon>');\n        expect(el.text()).toEqual('apple');\n\n        var classes = clean(el.attr('class'));\n        expect(classes).toContain('md-font');\n        expect(classes).toContain('fa-apple');\n        expect(classes).toContain('fa');\n\n      });\n\n      it('should support clearing an invalid font alias', function() {\n\n        el = make('<md-icon md-font-set=\"none\" class=\"custom-cake\"></md-icon>');\n        expect(el.hasClass('none')).toBeTruthy();\n        expect(el.hasClass('custom-cake')).toBeTruthy();\n\n        el = make('<md-icon md-font-set=\"none\" class=\"custom-cake\">apple</md-icon>');\n        expect(el.text()).toEqual('apple');\n        expect(el.hasClass('none')).toBeTruthy();\n        expect(el.hasClass('custom-cake')).toBeTruthy();\n\n      });\n    });\n  });\n\n  describe('for SVGs: ', function () {\n\n    beforeEach(function() {\n      var $q;\n\n      module(function($provide) {\n        var $mdIconMock = function(id) {\n\n          return {\n            then: function(fn) {\n              switch (id) {\n                case 'android'          : fn('<svg><g id=\"android\"></g></svg>');\n                  break;\n                case 'cake'             : fn('<svg><g id=\"cake\"></g></svg>');\n                  break;\n                case 'android.svg'      : fn('<svg><g id=\"android\"></g></svg>');\n                  break;\n                case 'cake.svg'         : fn('<svg><g id=\"cake\"></g></svg>');\n                  break;\n                case 'image:android'    : fn('');\n                  break;\n                default                 :\n                  if (/^data:/.test(id)) {\n                    fn(window.atob(id.split(',')[1]));\n                  }\n              }\n            }\n          };\n        };\n        $mdIconMock.fontSet = function() {\n          return 'material-icons';\n        };\n        $provide.value('$mdIcon', $mdIconMock);\n      });\n\n      inject(function($rootScope, _$compile_, _$q_){\n        $scope = $rootScope;\n        $compile = _$compile_;\n        $q = _$q_;\n      });\n\n    });\n\n    describe('using md-svg-icon=\"\"', function() {\n\n      it('should update mdSvgIcon when attribute value changes', function() {\n        $scope.iconName = 'android';\n        el = make('<md-icon md-svg-icon=\"{{ iconName }}\"></md-icon>');\n        expect(el.attr('md-svg-icon')).toEqual('android');\n        $scope.iconName = 'cake';\n        $scope.$digest();\n        expect(el.attr('md-svg-icon')).toEqual('cake');\n      });\n\n      it('should not include a ng-transclude when using mdSvgIcon', function() {\n\n        el = make('<md-icon md-svg-icon=\"image:android\"></md-icon>');\n        expect(el.html()).toEqual('');\n      });\n    });\n\n    describe('using md-svg-src=\"\"', function() {\n\n      beforeEach(inject(function(_$sce_) {\n        $sce = _$sce_;\n      }));\n\n      it('should update mdSvgSrc when attribute value changes', function() {\n        $scope.url = 'android.svg';\n        el = make('<md-icon md-svg-src=\"{{ url }}\"></md-icon>');\n        expect(el.attr('md-svg-src')).toEqual('android.svg');\n        $scope.url = 'cake.svg';\n        $scope.$digest();\n        expect(el.attr('md-svg-src')).toEqual('cake.svg');\n      });\n\n      it('should not include a ng-transclude when using mdSvgSrc', inject(function($templateCache) {\n        $templateCache.put('img/android.svg', '');\n\n        el = make('<md-icon md-svg-src=\"img/android.svg\"></md-icon>');\n        expect(el.html()).toEqual('');\n      }));\n\n      describe('with a data URL', function() {\n        it('should set mdSvgSrc from a function expression', inject(function() {\n          var svgData = '<svg><g><circle cx=\"100\" cy=\"100\" r=\"50\"></circle></g></svg>';\n          $scope.getData = function() {\n            return 'data:image/svg+xml;base64,' + window.btoa(svgData);\n          };\n          el = make('<md-icon md-svg-src=\"{{ getData() }}\"></md-icon>')[0];\n          $scope.$digest();\n\n          // Notice that we only compare the tag names here.\n          // Checking the innerHTML to be the same as the svgData variable is not working, because\n          // some browsers (like IE) are swapping some attributes, adding an SVG namespace etc.\n          expect(el.firstElementChild.tagName).toBe('svg');\n          expect(el.firstElementChild.firstElementChild.tagName).toBe('g');\n          expect(el.firstElementChild.firstElementChild.firstElementChild.tagName).toBe('circle');\n        }));\n      });\n    });\n\n    describe('with ARIA support', function() {\n\n      it('should apply \"img\" role by default', function() {\n        el = make('<md-icon md-svg-icon=\"android\" ></md-icon>');\n        expect(el.attr('role')).toEqual('img');\n      });\n\n      it('should apply not replace current role', function() {\n        el = make('<md-icon md-svg-icon=\"android\" role=\"presentation\" ></md-icon>');\n        expect(el.attr('role')).toEqual('presentation');\n      });\n\n      it('should apply aria-hidden=\"true\" when parent has valid label', function() {\n        el = make('<button aria-label=\"Android\"><md-icon md-svg-icon=\"android\"></md-icon></button>');\n        expect(el.find('md-icon').attr('aria-hidden')).toEqual('true');\n\n        el = make('<md-radio-button aria-label=\"avatar 2\" role=\"radio\"> '+\n                    '<div class=\"md-container\"></div> '+\n                      '<div class=\"md-label\"> '+\n                      '<md-icon md-svg-icon=\"android\"></md-icon> '+\n                    '</div></md-radio-button>');\n\n        expect(el.find('md-icon').attr('aria-hidden')).toEqual('true');\n      });\n\n      it('should not apply aria-hidden=\"true\" when parent has valid label but invalid role', function() {\n        el = make('<button aria-label=\"Android\" role=\"command\"><md-icon md-svg-icon=\"android\"></md-icon></button>');\n        expect(el.find('md-icon').attr('aria-hidden')).toBeUndefined();\n\n        el = make('<md-radio-button aria-label=\"avatar 2\" role=\"command\"> '+\n                    '<div class=\"md-container\"></div> '+\n                      '<div class=\"md-label\"> '+\n                      '<md-icon md-svg-icon=\"android\"></md-icon> '+\n                    '</div></md-radio-button>');\n\n        expect(el.find('md-icon').attr('aria-hidden')).toBeUndefined();\n      });\n\n      it('should apply aria-hidden=\"true\" when aria-label is empty string', function() {\n        el = make('<md-icon md-svg-icon=\"android\" ></md-icon>');\n        expect(el.attr('aria-label')).toEqual('android');\n        expect(el.attr('aria-hidden')).toBeUndefined();\n      });\n\n      it('should apply use the aria-label value when set', function() {\n        el = make('<md-icon md-svg-icon=\"android\" aria-label=\"my android icon\"></md-icon>');\n        expect(el.attr('aria-label')).toEqual('my android icon');\n      });\n\n      it('should apply font-icon value to aria-label when aria-label not set', function() {\n        el = make('<md-icon md-font-icon=\"android\"></md-icon>');\n        expect(el.attr('aria-label')).toEqual('android');\n      });\n\n      it('should apply svg-icon value to aria-label when aria-label not set', function() {\n        el = make('<md-icon md-svg-icon=\"android\"></md-icon>');\n        expect(el.attr('aria-label')).toEqual('android');\n      });\n\n      it('should apply use alt text for aria-label value when not set', function() {\n        el = make('<md-icon md-svg-icon=\"android\" alt=\"my android icon\"></md-icon>');\n        expect(el.attr('aria-label')).toEqual('my android icon');\n      });\n    });\n  });\n\n\n\n  // ****************************************************\n  // Internal utility methods\n  // ****************************************************\n\n  function make(html) {\n    var el;\n    el = $compile(html)($scope);\n    $scope.$digest();\n    return el;\n  }\n\n  /**\n   * Utility to remove extra attributes to the specs are easy to compare\n   */\n  function clean(style) {\n    return style\n        .replace(/ng-scope|ng-isolate-scope|md-default-theme/gi,'')\n        .replace(/\\s\\s+/g,' ')\n        .replace(/\\s+\"/g,'\"')\n        .trim();\n  }\n\n\n});\n\n\ndescribe('MdIcon service', function() {\n\n  var $mdIcon;\n  var $httpBackend;\n  var $scope;\n  var $mdIconProvider;\n\n  beforeEach(module('material.components.icon', function(_$mdIconProvider_) {\n    $mdIconProvider = _$mdIconProvider_;\n    $mdIconProvider\n      .icon('android'           , 'android.svg')\n      .icon('c2'                , 'c2.svg')\n      .iconSet('social'         , 'social.svg')\n      .iconSet('symbol'         , 'symbol.svg')\n      .iconSet('emptyIconSet'   , 'emptyGroup.svg')\n      .defaultIconSet('core.svg');\n\n    $mdIconProvider.icon('missingIcon', 'notfoundicon.svg');\n  }));\n\n  beforeEach(inject(function($templateCache, _$httpBackend_, _$mdIcon_, $rootScope) {\n    $mdIcon = _$mdIcon_;\n    $httpBackend = _$httpBackend_;\n    $scope = $rootScope;\n\n    $templateCache.put('android.svg'    , '<svg><g id=\"android\"></g></svg>');\n    $templateCache.put('angular-logo.svg',\n      '<svg><g id=\"angular\"></g><defs><filter id=\"shadow\"></filter>' +\n      '<g id=\"bg\" fill=\"#000000\"><path d=\"M10 10\"/></g></defs>' +\n      '<path filter=\"url(#shadow)\"></path><use x=\"0\" y=\"0\" xlink:href=\"#bg\"></use>' +\n      '</svg>');\n    $templateCache.put('social.svg'     , '<svg><g id=\"s1\"></g><g id=\"s2\"></g></svg>');\n    $templateCache.put('symbol.svg'     , '<svg><symbol id=\"s1\"></symbol><symbol id=\"s2\" viewBox=\"0 0 32 32\"></symbol></svg>');\n    $templateCache.put('core.svg'       , '<svg><g id=\"c1\"></g><g id=\"c2\" class=\"core\"></g></svg>');\n    $templateCache.put('c2.svg'         , '<svg><g id=\"c2\" class=\"override\"></g></svg>');\n    $templateCache.put('emptyGroup.svg' , '<svg></svg>');\n\n  }));\n\n  describe('should configure fontSets', function() {\n\n    it('with Material Icons by default', function () {\n      expect($mdIcon.fontSet()).toBe('material-icons');\n    });\n\n    it('with register multiple font-sets', function () {\n\n      $mdIconProvider.defaultFontSet('fontawesome');\n      $mdIconProvider.fontSet('mi', 'material-icons');\n      $mdIconProvider.fontSet('ic', 'icomoon');\n\n      expect($mdIcon.fontSet()).toBe('fontawesome');\n      expect($mdIcon.fontSet('mi')).toBe('material-icons');\n      expect($mdIcon.fontSet('ic')).toBe('icomoon');\n    });\n\n  });\n\n  describe('when using SVGs and ', function () {\n\n    describe('$mdIcon() is passed an icon ID', function() {\n\n      it('should append configured SVG single icon', function() {\n        var expected = new RegExp(updateDefaults('<svg><g id=\"android_cache[0-9]+\"></g></svg>'));\n        $mdIcon('android').then(function(el) {\n          expect(el.outerHTML).toMatch(expected);\n        });\n        $scope.$digest();\n      });\n\n      it('should append configured SVG icon from named group', function() {\n        var expected = new RegExp(updateDefaults('<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"s1_cache[0-9]+\"></g></svg>'));\n        $mdIcon('social:s1').then(function(el) {\n          expect(el.outerHTML).toMatch(expected);\n        });\n        $scope.$digest();\n      });\n\n      it('should append configured SVG icon from symbol', function() {\n        var expected = updateDefaults('<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>');\n        $mdIcon('symbol:s1').then(function(el) {\n          expect(el.outerHTML).toEqual(expected);\n        });\n        $scope.$digest();\n      });\n\n      it('should append configured SVG icon from symbol with viewBox', function() {\n        var expected = updateDefaults('<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>');\n        $mdIcon('symbol:s2').then(function(el) {\n          expect(el.outerHTML).toEqual(expected);\n        });\n        $scope.$digest();\n      });\n\n      it('should append configured SVG icon from default group', function() {\n        var expected = new RegExp(updateDefaults('<svg xmlns=\"http://www.w3.org/2000/svg\"><g id=\"c1_cache[0-9]+\"></g></svg>'));\n        $mdIcon('c1').then(function(el) {\n          expect(el.outerHTML).toMatch(expected);\n        });\n        $scope.$digest();\n      });\n\n      it('should allow single icon defs to override those defined in groups', function() {\n        $mdIcon('c2').then(function(el) {\n          var list = el.querySelector('g').classList;\n\n          if (list) {\n            // classList is a part of HTMLElement, but isn't available for SVGElement\n            expect(list.contains('override')).toBe(true);\n          }\n\n        });\n\n        $scope.$digest();\n      });\n    });\n\n    describe('$mdIcon() is passed a URL', function() {\n\n      it('should return correct SVG markup', function() {\n        $mdIcon('android.svg').then(function(el) {\n          expect(el.outerHTML).toMatch(new RegExp(updateDefaults('<svg><g id=\"android_cache[0-9]+\"></g></svg>')));\n        });\n        $scope.$digest();\n      });\n\n      describe('and the URL is a data URL', function() {\n        var svgData = '<svg><g><circle r=\"50\" cx=\"100\" cy=\"100\"></circle></g></svg>';\n\n        describe('and the data is base64 encoded', function() {\n          it('should return correct SVG markup', function() {\n            var data = 'data:image/svg+xml;base64,' + btoa(svgData);\n            $mdIcon(data).then(function(el) {\n              expect(el.outerHTML).toEqual(updateDefaults(svgData));\n            });\n            $scope.$digest();\n          });\n        });\n\n        describe('and the data is un-encoded', function() {\n          it('should return correct SVG markup', function() {\n            var data = 'data:image/svg+xml,' + svgData;\n            $mdIcon(data).then(function(el) {\n              expect(el.outerHTML).toEqual(updateDefaults(svgData));\n            });\n            $scope.$digest();\n          });\n        });\n      });\n    });\n\n    describe('icon set URL is not found', function() {\n      it('should log Error', function() {\n        var msg;\n        try {\n          $mdIcon('notconfigured')\n            .catch(function(error) {\n              msg = error;\n            });\n\n          $scope.$digest();\n        } finally {\n          expect(msg).toEqual('icon $default:notconfigured not found');\n        }\n      });\n    });\n\n    describe('icon is cached', function() {\n\n      it('should prevent duplicate ids', function() {\n        var firstId;\n\n        $mdIcon('android.svg').then(function(el) {\n          // First child is in our case always the node with an id.\n          firstId = el.firstChild.id;\n        });\n\n        $scope.$digest();\n\n        $mdIcon('android.svg').then(function(el) {\n          expect(el.firstChild.id).not.toBe(firstId);\n        });\n\n        $scope.$digest();\n\n      });\n\n      it('should suffix duplicated ids', function() {\n        // Just request the icon to be stored in the cache.\n        $mdIcon('android.svg');\n\n        $scope.$digest();\n\n        $mdIcon('android.svg').then(function(el) {\n          expect(el.firstChild.id).toMatch(/.+_cache[0-9]+/g);\n        });\n\n        $scope.$digest();\n      });\n\n      // This covers a case where we saw a g3 test using an empty <svg></svg> and it could\n      // throw an exception \"Looking up elements via selectors is not supported by jqLite!\"\n      // if proper checks weren't in place in the transformClone() code.\n      it('should handle empty SVGs', function() {\n        // Just request the icon to be stored in the cache.\n        $mdIcon('emptyGroup.svg');\n\n        $scope.$digest();\n\n        $mdIcon('emptyGroup.svg').then(function(el) {\n          expect(el).toBeTruthy();\n        });\n\n        $scope.$digest();\n      });\n\n      it('should suffix duplicated ids and refs', function() {\n        // Just request the icon to be stored in the cache.\n        $mdIcon('angular-logo.svg');\n\n        $scope.$digest();\n\n        $mdIcon('angular-logo.svg').then(function(el) {\n          expect(el.querySelector('defs').firstChild.id).toMatch(/.+_cache\\d+/g);\n          expect(el.querySelectorAll('path')[1].attributes.filter.value.split(/url\\(#(.*)\\)$/g)[1])\n            .toMatch(/.+_cache[0-9]+/g);\n          expect(el.querySelectorAll('path')[1].attributes.filter.value.split(/url\\(#(.*)\\)$/g)[1])\n            .toEqual(el.querySelector('defs').firstChild.id);\n          expect(el.querySelector('use').attributes['xlink:href'].value.split(/#(.*)/)[1]).toEqual(\n            el.querySelector('defs').children[1].id);\n        });\n\n        $scope.$digest();\n      });\n    });\n\n    describe('icon in a group is not found', function() {\n\n      it('should log Error and reject', inject(function($log, $timeout) {\n        var ERROR_ICON_NOT_FOUIND_ICONSET = 'icon emptyIconSet:someIcon not found';\n        var caughtRejection = false;\n\n        $mdIcon('emptyIconSet:someIcon')\n          .catch(function(error) {\n            caughtRejection = true;\n            expect(error).toBe(ERROR_ICON_NOT_FOUIND_ICONSET);\n          });\n        $timeout.flush();\n\n        expect(caughtRejection).toBe(true);\n        expect($log.warn.logs[0]).toEqual([ERROR_ICON_NOT_FOUIND_ICONSET]);\n      }));\n    });\n\n    describe('icon is not found', function() {\n      it('should log Error and reject', inject(function($log) {\n        var ERROR_ICON_NOT_FOUND = 'Cannot GET notfoundicon.svg';\n        var caughtRejection = false;\n\n        // $mdIconProvider.icon('missingIcon', 'notfoundicon.svg');\n        $httpBackend.whenGET('notfoundicon.svg').respond(404, ERROR_ICON_NOT_FOUND);\n\n        $mdIcon('missingIcon')\n          .catch(function(error) {\n            expect(error.data).toBe(ERROR_ICON_NOT_FOUND);\n            caughtRejection = true;\n          });\n\n        $httpBackend.flush();\n\n        expect(caughtRejection).toBe(true);\n        expect($log.warn.logs[0]).toEqual([ERROR_ICON_NOT_FOUND]);\n      }));\n    });\n  });\n\n\n  function updateDefaults(svg) {\n    svg = angular.element(svg)[0];\n\n    angular.forEach({\n      'xmlns' : 'http://www.w3.org/2000/svg',\n      'fit'   : '',\n      'height': '100%',\n      'width' : '100%',\n      'preserveAspectRatio': 'xMidYMid meet',\n      'viewBox' : svg.getAttribute('viewBox') || '0 0 24 24',\n      'focusable': false\n    }, function(val, attr) {\n      svg.setAttribute(attr, val);\n    }, this);\n\n    return svg.outerHTML;\n  }\n\n});\n"
  },
  {
    "path": "src/components/icon/js/iconDirective.js",
    "content": "angular\n  .module('material.components.icon')\n  .directive('mdIcon', ['$mdIcon', '$mdTheming', '$mdAria', '$sce', mdIconDirective]);\n\n/**\n * @ngdoc directive\n * @name mdIcon\n * @module material.components.icon\n *\n * @restrict E\n *\n * @description\n * The `md-icon` directive makes it easier to use vector-based icons in your app (as opposed to\n * raster-based icons types like PNG). The directive supports both icon fonts and SVG icons.\n *\n * Icons should be considered view-only elements that should not be used directly as buttons; instead nest a `<md-icon>`\n * inside a `md-button` to add hover and click features.\n *\n * ### Icon fonts\n * Icon fonts are a technique in which you use a font where the glyphs in the font are\n * your icons instead of text. Benefits include a straightforward way to bundle everything into a\n * single HTTP request, simple scaling, easy color changing, and more.\n *\n * `md-icon` lets you consume an icon font by letting you reference specific icons in that font\n * by name rather than character code.\n *\n * When using font-icons, developers must follow three (3) simple steps:\n *\n * <ol>\n * <li>Load the font library. e.g.<br/>\n *    `<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">`\n * </li>\n * <li>\n *   Use either (a) font-icon class names or (b) a fontset and a font ligature to render the font glyph by\n *   using its textual name _or_ numerical character reference. Note that `material-icons` is the default fontset when\n *   none is specified.\n * </li>\n * <li> Use any of the following templates: <br/>\n *   <ul>\n *     <li>`<md-icon md-font-icon=\"classname\"></md-icon>`</li>\n *     <li>`<md-icon md-font-set=\"font library classname or alias\">textual_name</md-icon>`</li>\n *     <li>`<md-icon> numerical_character_reference </md-icon>`</li>\n *     <li>`<md-icon ng_bind=\"'textual_name'\"></md-icon>`</li>\n *     <li>`<md-icon ng-bind=\"scopeVariable\"></md-icon>`</li>\n *   </ul>\n * </li>\n * </ol>\n *\n * Full details for these steps can be found in the\n * <a href=\"http://google.github.io/material-design-icons/#icon-font-for-the-web\" target=\"_blank\">\n * Material Design Icon font for the web docs</a>.\n *\n * You can browse and search the Material Design icon style <code>.material-icons</code>\n * in the <a href=\"https://material.io/tools/icons/\" target=\"_blank\">Material Design Icons tool</a>.\n *\n * ### SVG\n * For SVGs, the problem with using `<img>` or a CSS `background-image` is that you can't take\n * advantage of some SVG features, such as styling specific parts of the icon with CSS or SVG\n * animation.\n *\n * `md-icon` makes it easier to use SVG icons by *inlining* the SVG into an `<svg>` element in the\n * document. The most straightforward way of referencing an SVG icon is via URL, just like a\n * traditional `<img>`. `$mdIconProvider`, as a convenience, lets you _name_ an icon so you can\n * reference it by name instead of URL throughout your templates.\n *\n * Additionally, you may not want to make separate HTTP requests for every icon, so you can bundle\n * your SVG icons together and pre-load them with `$mdIconProvider` as an icon set. An icon set can\n * also be given a name, which acts as a namespace for individual icons, so you can reference them\n * like `\"social:cake\"`.\n *\n * When using SVGs, both external SVGs (via URLs) or sets of SVGs (from icon sets) can be\n * easily loaded and used.\n *\n * ### Localization\n *\n * Because an `md-icon` element's text content is not intended to be translated, it is recommended\n * to declare the text content for an `md-icon` element in its start tag. Instead of using the HTML\n * text content, consider using `ng-bind` with a scope variable or literal string.\n *\n * Examples:\n *\n * <ul>\n *   <li>`<md-icon ng-bind=\"myIconVariable\"></md-icon>`</li>\n *   <li>`<md-icon ng-bind=\"'menu'\"></md-icon>`\n * </ul>\n *\n * <h2 id=\"material_design_icons\">Material Design Icons tool</h2>\n * Using the Material Design Icons tool, developers can easily and quickly search for a specific\n * open source Material Design icon. The search is in the top left. Below search, you can select\n * from the new icon themes or filter by icon category.\n *\n * <a href=\"https://material.io/tools/icons/\" target=\"_blank\" style=\"border-bottom:none;\">\n * <img src=\"https://user-images.githubusercontent.com/3506071/41942584-ef0695d0-796d-11e8-9436-44f25023a111.png\"\n *      aria-label=\"Material Design Icons tool\" style=\"max-width:95%\">\n * </a>\n *\n * <div class=\"md-caption\" style=\"text-align: center; margin-bottom: 24px\">\n *  Click on the image above to open the\n *  <a href=\"https://material.io/tools/icons/\" target=\"_blank\">Material Design Icons tool</a>.\n * </div>\n *\n * Click on any icon, then click on the \"Selected Icon\" chevron to see the slide-up\n * information panel with details regarding a SVG download and information on the font-icon's\n * textual name. This panel also allows you to select a black on transparent or white on transparent\n * icon and to change the icon size. These settings only affect the downloaded icons.\n *\n * @param {string} md-font-icon String name of CSS icon associated with the font-face will be used\n *  to render the icon. Requires the fonts and the named CSS styles to be preloaded.\n * @param {string} md-font-set CSS style name associated with the font library; which will be assigned as\n *  the class for the font-icon ligature. This value may also be an alias that is used to lookup the classname;\n *  internally use `$mdIconProvider.fontSet(<alias>)` to determine the style name.\n * @param {string} md-svg-src String URL (or expression) used to load, cache, and display an\n *  external SVG.\n * @param {string} md-svg-icon md-svg-icon String name used for lookup of the icon from the internal cache;\n *  interpolated strings or expressions may also be used. Specific set names can be used with\n *  the syntax `<set name>:<icon name>`.<br/><br/>\n *  To use icon sets, developers are required to pre-register the sets using the `$mdIconProvider` service.\n * @param {string=} aria-label Labels the icon for accessibility. If an empty string is provided,\n *  the icon will be hidden from the accessibility layer with `aria-hidden=\"true\"`. If there is no\n *  `aria-label` attribute on the icon, we check the following, in order: the `alt` attribute, the\n *  `aria-label` from the parent element, the icon's `md-font-icon` or `md-svg-icon` string, and the\n *  text content inside `<md-icon></md-icon>`. If none of these have any text, the icon is hidden\n *  from the accessibility layer with `aria-hidden=\"true\"`.\n * @param {string=} alt Labels the icon for accessibility. If an empty string is provided and the\n *  icon has no `aria-label`, then the icon will be hidden from accessibility layer with\n *  `aria-hidden=\"true\"`.\n *\n * @usage\n * When using SVGs:\n * <hljs lang=\"html\">\n *\n *<!-- Icon ID; may contain optional icon set prefix.\n *     Icons must be registered using $mdIconProvider. -->\n *<md-icon md-svg-icon=\"social:android\"    aria-label=\"android \" ></md-icon>\n *\n *<!-- Icon urls; may be preloaded in templateCache -->\n *<md-icon md-svg-src=\"/android.svg\"       aria-label=\"android \" ></md-icon>\n *<md-icon md-svg-src=\"{{ getAndroid() }}\" aria-label=\"android \" ></md-icon>\n *\n * </hljs>\n *\n * Use the <code>$mdIconProvider</code> to configure your application with\n * SVG icon sets.\n *\n * <hljs lang=\"js\">\n * angular.module('appSvgIconSets', ['ngMaterial'])\n *   .controller('DemoCtrl', function($scope) {})\n *   .config(function($mdIconProvider) {\n *     $mdIconProvider\n *       .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n *       .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n *    });\n * </hljs>\n *\n *\n * When using Font Icons with classnames:\n * <hljs lang=\"html\">\n *\n * <md-icon md-font-icon=\"android\" aria-label=\"android\" ></md-icon>\n * <md-icon class=\"icon_home\" aria-label=\"Home\"></md-icon>\n *\n * </hljs>\n *\n * When using Material Font Icons with ligatures:\n * <hljs lang=\"html\">\n *  <!--\n *  For Material Design Icons\n *  The class '.material-icons' is auto-added if a style has NOT been specified\n *  since `material-icons` is the default fontset. So your markup:\n *  -->\n *  <md-icon> face </md-icon>\n *  <!-- becomes this at runtime: -->\n *  <md-icon md-font-set=\"material-icons\"> face </md-icon>\n *  <!-- If the fontset does not support ligature names, then we need to use the ligature unicode.-->\n *  <md-icon> &#xE87C; </md-icon>\n *  <!-- The class '.material-icons' must be manually added if other styles are also specified-->\n *  <md-icon class=\"material-icons md-light md-48\"> face </md-icon>\n * </hljs>\n *\n * When using other Font-Icon libraries:\n *\n * <hljs lang=\"js\">\n *  // Specify a font-icon style alias\n *  angular.config(function($mdIconProvider) {\n *    $mdIconProvider.fontSet('md', 'material-icons');\n *  });\n * </hljs>\n *\n * <hljs lang=\"html\">\n *  <md-icon md-font-set=\"md\">favorite</md-icon>\n * </hljs>\n *\n */\nfunction mdIconDirective($mdIcon, $mdTheming, $mdAria, $sce) {\n\n  return {\n    restrict: 'E',\n    link : postLink\n  };\n\n\n  /**\n   * Directive postLink\n   * Supports embedded SVGs, font-icons, & external SVGs.\n   * @param {IScope} scope\n   * @param {JQLite} element\n   * @param {IAttributes} attr\n   */\n  function postLink(scope, element, attr) {\n    $mdTheming(element);\n    var lastFontIcon = attr.mdFontIcon;\n    var lastFontSet = $mdIcon.fontSet(attr.mdFontSet);\n\n    prepareForFontIcon();\n\n    attr.$observe('mdFontIcon', fontIconChanged);\n    attr.$observe('mdFontSet', fontIconChanged);\n\n    /* Provide a default accessibility role of img */\n    if (!attr.role) {\n      $mdAria.expect(element, 'role', 'img');\n      /* manually update attr variable */\n      attr.role = 'img';\n    }\n\n    // If the aria-label is explicitly set to the empty string, then hide this element from the\n    // accessibility layer.\n    if (element[0].hasAttribute('aria-label') && attr.ariaLabel === '') {\n      element.attr('aria-hidden', true);\n    }\n\n    /* Don't process ARIA if already valid */\n    if (attr.role === \"img\" && !attr.ariaHidden && !$mdAria.hasAriaLabel(element)) {\n      // If the developer signals to hide this icon from the accessibility layer, do so.\n      if (element[0].hasAttribute('alt') && attr.alt === '') {\n        element.attr('aria-hidden', true);\n      } else if (attr.alt) {\n        /* Use the alt text for the aria-label by default, if available. */\n        $mdAria.expect(element, 'aria-label', attr.alt);\n      } else if ($mdAria.parentHasAriaLabel(element, 2)) {\n        /* Parent has ARIA so we will assume it will describe the icon. */\n        $mdAria.expect(element, 'aria-hidden', 'true');\n      } else if (attr.mdFontIcon || attr.mdSvgIcon || element.text()) {\n        /* Use icon name or node's text content as the aria-label */\n        $mdAria.expect(element, 'aria-label', attr.mdFontIcon || attr.mdSvgIcon || element.text());\n      } else {\n        /* No label found, hide this icon from the accessibility layer */\n        $mdAria.expect(element, 'aria-hidden', 'true');\n      }\n    }\n\n    var attrName = attr.$normalize(attr.$attr.mdSvgIcon || attr.$attr.mdSvgSrc || '');\n    if (attrName) {\n      // Use either pre-configured SVG or URL source, respectively.\n      attr.$observe(attrName, function(attrVal) {\n        element.empty();\n        if (attrVal) {\n          $mdIcon(attrVal)\n            .then(function(svg) {\n            element.empty();\n            element.append(svg);\n          });\n        }\n      });\n    }\n\n    function prepareForFontIcon() {\n      if (!attr.mdSvgIcon && !attr.mdSvgSrc) {\n        if (attr.mdFontIcon) {\n          element.addClass('md-font ' + attr.mdFontIcon);\n        }\n\n        element.addClass(lastFontSet);\n      }\n    }\n\n    function fontIconChanged() {\n      if (!attr.mdSvgIcon && !attr.mdSvgSrc) {\n        if (attr.mdFontIcon) {\n          element.removeClass(lastFontIcon);\n          element.addClass(attr.mdFontIcon);\n\n          lastFontIcon = attr.mdFontIcon;\n        }\n\n        var fontSet = $mdIcon.fontSet(attr.mdFontSet);\n\n        if (lastFontSet !== fontSet) {\n          element.removeClass(lastFontSet);\n          element.addClass(fontSet);\n\n          lastFontSet = fontSet;\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/icon/js/iconService.js",
    "content": "  angular\n    .module('material.components.icon')\n    .constant('$$mdSvgRegistry', {\n        'mdTabsArrow':   'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyICIvPjwvZz48L3N2Zz4=',\n        'mdClose':       'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xOSA2LjQxbC0xLjQxLTEuNDEtNS41OSA1LjU5LTUuNTktNS41OS0xLjQxIDEuNDEgNS41OSA1LjU5LTUuNTkgNS41OSAxLjQxIDEuNDEgNS41OS01LjU5IDUuNTkgNS41OSAxLjQxLTEuNDEtNS41OS01LjU5eiIvPjwvZz48L3N2Zz4=',\n        'mdCancel':      'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xMiAyYy01LjUzIDAtMTAgNC40Ny0xMCAxMHM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTAtNC40Ny0xMC0xMC0xMHptNSAxMy41OWwtMS40MSAxLjQxLTMuNTktMy41OS0zLjU5IDMuNTktMS40MS0xLjQxIDMuNTktMy41OS0zLjU5LTMuNTkgMS40MS0xLjQxIDMuNTkgMy41OSAzLjU5LTMuNTkgMS40MSAxLjQxLTMuNTkgMy41OSAzLjU5IDMuNTl6Ii8+PC9nPjwvc3ZnPg==',\n        'mdMenu':        'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0zLDZIMjFWOEgzVjZNMywxMUgyMVYxM0gzVjExTTMsMTZIMjFWMThIM1YxNloiIC8+PC9zdmc+',\n        'mdToggleArrow': 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDggNDgiPjxwYXRoIGQ9Ik0yNCAxNmwtMTIgMTIgMi44MyAyLjgzIDkuMTctOS4xNyA5LjE3IDkuMTcgMi44My0yLjgzeiIvPjxwYXRoIGQ9Ik0wIDBoNDh2NDhoLTQ4eiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==',\n        'mdCalendar':    'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgM2gtMVYxaC0ydjJIOFYxSDZ2Mkg1Yy0xLjExIDAtMS45OS45LTEuOTkgMkwzIDE5YzAgMS4xLjg5IDIgMiAyaDE0YzEuMSAwIDItLjkgMi0yVjVjMC0xLjEtLjktMi0yLTJ6bTAgMTZINVY4aDE0djExek03IDEwaDV2NUg3eiIvPjwvc3ZnPg==',\n        'mdChecked':     'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik05IDE2LjE3TDQuODMgMTJsLTEuNDIgMS40MUw5IDE5IDIxIDdsLTEuNDEtMS40MXoiLz48L2c+PC9zdmc+'\n    })\n    .provider('$mdIcon', MdIconProvider);\n\n/**\n * @ngdoc service\n * @name $mdIconProvider\n * @module material.components.icon\n *\n * @description\n * `$mdIconProvider` is used only to register icon IDs with URLs. These configuration features allow\n * icons and icon sets to be pre-registered and associated with source URLs **before** the\n * `<md-icon />` directives are compiled.\n *\n * If using font-icons, the developer is responsible for loading the fonts.\n *\n * If using SVGs, loading of the actual svg files are deferred to on-demand requests and are loaded\n * internally by the `$mdIcon` service using the `$templateRequest` service. When an SVG is\n * requested by name/ID, the `$mdIcon` service searches its registry for the associated source URL;\n * that URL is used to on-demand load and parse the SVG dynamically.\n *\n * The `$templateRequest` service expects the icons source to be loaded over trusted URLs.<br/>\n * This means, when loading icons from an external URL, you have to trust the URL in the\n * `$sceDelegateProvider`.\n *\n * <hljs lang=\"js\">\n *   app.config(function($sceDelegateProvider) {\n *     $sceDelegateProvider.trustedResourceUrlList([\n *       // Adding 'self' to the allow-list, will allow requests from the current origin.\n *       'self',\n *       // Using double asterisks here, will allow all URLs to load.\n *       // However, we recommend only specifying the given domain you want to allow.\n *       '**'\n *     ]);\n *   });\n * </hljs>\n *\n * Read more about the [$sceDelegateProvider](https://docs.angularjs.org/api/ng/provider/$sceDelegateProvider).\n *\n * **Notice:** Most font-icon libraries do not support ligatures (for example `fontawesome`).<br/>\n *  In such cases you are not able to use the icon's ligature name - Like so:\n *\n *  <hljs lang=\"html\">\n *    <md-icon md-font-set=\"fa\">fa-bell</md-icon>\n *  </hljs>\n *\n * You should instead use the given unicode, instead of the ligature name.\n *\n * <p ng-hide=\"true\"> ##// Notice we can't use a hljs element here, because the characters will be escaped.</p>\n *  ```html\n *    <md-icon md-font-set=\"fa\">&#xf0f3</md-icon>\n *  ```\n *\n * All unicode ligatures are prefixed with the `&#x` string.\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Configure URLs for icons specified by [set:]id.\n *     $mdIconProvider\n *       .defaultFontSet( 'fa' )                   // This sets our default fontset className.\n *       .defaultIconSet('my/app/icons.svg')       // Register a default set of SVG icons\n *       .iconSet('social', 'my/app/social.svg')   // Register a named icon set of SVGs\n *       .icon('android', 'my/app/android.svg')    // Register a specific icon (by name)\n *       .icon('work:chair', 'my/app/chair.svg');  // Register icon in a specific set\n *   });\n * </hljs>\n *\n * SVG icons and icon sets can be easily pre-loaded and cached using either (a) a build process or\n * (b) a runtime **startup** process (shown below):\n *\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Register a default set of SVG icon definitions\n *     $mdIconProvider.defaultIconSet('my/app/icons.svg')\n *   })\n *   .run(function($templateRequest) {\n *\n *     // Pre-fetch icons sources by URL and cache in the $templateCache...\n *     // subsequent $templateRequest calls will look there first.\n *     var urls = [ 'imy/app/icons.svg', 'img/icons/android.svg'];\n *\n *     angular.forEach(urls, function(url) {\n *       $templateRequest(url);\n *     });\n *   });\n *\n * </hljs>\n *\n * > <b>Note:</b> The loaded SVG data is subsequently cached internally for future requests.\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#icon\n *\n * @description\n * Register a source URL for a specific icon name; the name may include optional 'icon set' name\n * prefix. These icons will later be retrieved from the cache using `$mdIcon(<icon name>)`.\n *\n * @param {string} id Icon name/id used to register the icon\n * @param {string} url specifies the external location for the data file. Used internally by\n *  `$templateRequest` to load the data or as part of the lookup in `$templateCache` if pre-loading\n *  was configured.\n * @param {number=} viewBoxSize Sets the width and height the icon's viewBox.\n *  It is ignored for icons with an existing viewBox. Default size is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Configure URLs for icons specified by [set:]id.\n *     $mdIconProvider\n *       .icon('android', 'my/app/android.svg')    // Register a specific icon (by name)\n *       .icon('work:chair', 'my/app/chair.svg');  // Register icon in a specific set\n *   });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#iconSet\n *\n * @description\n * Register a source URL for a 'named' set of icons; group of SVG definitions where each definition\n * has an icon id. Individual icons can be subsequently retrieved from this cached set using\n * `$mdIcon(<icon set name>:<icon name>)`\n *\n * @param {string} id Icon name/id used to register the iconset\n * @param {string} url specifies the external location for the data file. Used internally by\n * `$templateRequest` to load the data or as part of the lookup in `$templateCache` if pre-loading\n * was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.\n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.\n * Default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Configure URLs for icons specified by [set:]id.\n *     $mdIconProvider\n *       .iconSet('social', 'my/app/social.svg');   // Register a named icon set\n *   });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#defaultIconSet\n *\n * @description\n * Register a source URL for the default 'named' set of icons. Unless explicitly registered,\n * subsequent lookups of icons will fail over to search this 'default' icon set.\n * Icon can be retrieved from this cached, default set using `$mdIcon(<name>)`\n *\n * @param {string} url specifies the external location for the data file. Used internally by\n * `$templateRequest` to load the data or as part of the lookup in `$templateCache` if pre-loading\n * was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.\n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same\n * size. Default value is 24.\n *\n * @returns {Object} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Configure URLs for icons specified by [set:]id.\n *     $mdIconProvider\n *       .defaultIconSet('my/app/social.svg');   // Register a default icon set\n *   });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#defaultFontSet\n *\n * @description\n * When using Font-Icons, AngularJS Material assumes the the Material Design icons will be used and\n * automatically configures the default `font-set == 'material-icons'`. Note that the font-set\n * references the font-icon library class style that should be applied to the `<md-icon>`.\n *\n * Configuring the default means that the attributes\n * `md-font-set=\"material-icons\"` or `class=\"material-icons\"` do not need to be explicitly declared\n * on the `<md-icon>` markup.\n *\n * For example:<br/>\n * `<md-icon>face</md-icon>` will render as `<span class=\"material-icons\">face</span>`,<br/>\n * and<br/>\n * `<md-icon md-font-set=\"fa\">face</md-icon>` will render as `<span class=\"fa\">face</span>`\n *\n * @param {string} name Name of the font-library style that should be applied to the md-icon DOM\n *  element.\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *     $mdIconProvider.defaultFontSet('fa');\n *   });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#fontSet\n *\n * @description\n * When using a font-set for `<md-icon>` you must specify the correct font classname in the\n * `md-font-set` attribute. If the font-set className is really long, your markup may become\n * cluttered... an easy solution is to define an `alias` for your font-set:\n *\n * @param {string} alias Alias name of the specified font-set.\n * @param {string} className Name of the class for the font-set.\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *     // In this case, we set an alias for the `material-icons` font-set.\n *     $mdIconProvider.fontSet('md', 'material-icons');\n *   });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdIconProvider#defaultViewBoxSize\n *\n * @description\n * While `<md-icon>` markup can also be styled with sizing CSS, this method configures\n * the default width **and** height used for all icons; unless overridden by specific CSS.\n * The default sizing is (`24px`, `24px`).\n * @param {number=} viewBoxSize Sets the width and height of the viewBox for an icon or an icon set.\n * All icons in a set should be the same size. The default value is 24.\n *\n * @returns {Object} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n *   app.config(function($mdIconProvider) {\n *\n *     // Configure URLs for icons specified by [set:]id.\n *     $mdIconProvider\n *       .defaultViewBoxSize(36);   // Register a default icon size (width == height)\n *   });\n * </hljs>\n */\n\nvar config = {\n  defaultViewBoxSize: 24,\n  defaultFontSet: 'material-icons',\n  fontSets: []\n};\n\nfunction MdIconProvider() {\n}\n\nMdIconProvider.prototype = {\n  icon: function(id, url, viewBoxSize) {\n    if (id.indexOf(':') == -1) id = '$default:' + id;\n\n    config[id] = new ConfigurationItem(url, viewBoxSize);\n    return this;\n  },\n\n  iconSet: function(id, url, viewBoxSize) {\n    config[id] = new ConfigurationItem(url, viewBoxSize);\n    return this;\n  },\n\n  defaultIconSet: function(url, viewBoxSize) {\n    var setName = '$default';\n\n    if (!config[setName]) {\n      config[setName] = new ConfigurationItem(url, viewBoxSize);\n    }\n\n    config[setName].viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n\n    return this;\n  },\n\n  defaultViewBoxSize: function(viewBoxSize) {\n    config.defaultViewBoxSize = viewBoxSize;\n    return this;\n  },\n\n  /**\n   * Register an alias name associated with a font-icon library style ;\n   */\n  fontSet: function fontSet(alias, className) {\n    config.fontSets.push({\n      alias: alias,\n      fontSet: className || alias\n    });\n    return this;\n  },\n\n  /**\n   * Specify a default style name associated with a font-icon library\n   * fallback to Material Icons.\n   *\n   */\n  defaultFontSet: function defaultFontSet(className) {\n    config.defaultFontSet = !className ? '' : className;\n    return this;\n  },\n\n  defaultIconSize: function defaultIconSize(iconSize) {\n    config.defaultIconSize = iconSize;\n    return this;\n  },\n\n  $get: ['$templateRequest', '$q', '$log', '$mdUtil', '$sce', function($templateRequest, $q, $log, $mdUtil, $sce) {\n    return MdIconService(config, $templateRequest, $q, $log, $mdUtil, $sce);\n  }]\n};\n\n  /**\n   * Configuration item stored in the Icon registry; used for lookups\n   * to load if not already cached in the `loaded` cache\n   * @param {string} url\n   * @param {=number} viewBoxSize\n   * @constructor\n   */\n  function ConfigurationItem(url, viewBoxSize) {\n    this.url = url;\n    this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n  }\n\n/**\n * @ngdoc service\n * @name $mdIcon\n * @module material.components.icon\n *\n * @description\n * The `$mdIcon` service is a function used to lookup SVG icons.\n *\n * @param {string} id Query value for a unique Id or URL. If the argument is a URL, then the service will retrieve the icon element\n * from its internal cache or load the icon and cache it first. If the value is not a URL-type string, then an ID lookup is\n * performed. The Id may be a unique icon ID or may include an iconSet ID prefix.\n *\n * For the **id** query to work properly, this means that all id-to-URL mappings must have been previously configured\n * using the `$mdIconProvider`.\n *\n * @returns {angular.$q.Promise} A promise that gets resolved to a clone of the initial SVG DOM element; which was\n * created from the SVG markup in the SVG data file. If an error occurs (e.g. the icon cannot be found) the promise\n * will get rejected.\n *\n * @usage\n * <hljs lang=\"js\">\n * function SomeDirective($mdIcon) {\n *\n *   // See if the icon has already been loaded, if not then lookup the icon from the\n *   // registry cache, load and cache it for future requests.\n *   // NOTE: Non-URL queries require configuration with $mdIconProvider.\n *   $mdIcon('android').then(function(iconEl)    { element.append(iconEl); });\n *   $mdIcon('work:chair').then(function(iconEl) { element.append(iconEl); });\n *\n *   // Load and cache the external SVG using a URL.\n *   $mdIcon('img/icons/android.svg').then(function(iconEl) {\n *     element.append(iconEl);\n *   });\n * };\n * </hljs>\n *\n * > <b>Note:</b> The `<md-icon>` directive internally uses the `$mdIcon` service to query, load,\n *   and instantiate SVG DOM elements.\n */\n\n/* @ngInject */\nfunction MdIconService(config, $templateRequest, $q, $log, $mdUtil, $sce) {\n  var iconCache = {};\n  var svgCache = {};\n  var urlRegex = /[-\\w@:%+.~#?&//=]{2,}\\.[a-z]{2,4}\\b(\\/[-\\w@:%+.~#?&//=]*)?/i;\n  var dataUrlRegex = /^data:image\\/svg\\+xml[\\s*;\\w\\-=]*?(base64)?,(.*)$/i;\n\n  Icon.prototype = {clone: cloneSVG, prepare: prepareAndStyle};\n  getIcon.fontSet = findRegisteredFontSet;\n\n  // Publish service...\n  return getIcon;\n\n  /**\n   * Actual $mdIcon service is essentially a lookup function\n   * @param {*} id $sce trust wrapper over a URL string, URL, icon registry id, or icon set id\n   * @returns {angular.$q.Promise}\n   */\n  function getIcon(id) {\n    id = id || '';\n\n    // If the \"id\" provided is not a string, the only other valid value is a $sce trust wrapper\n    // over a URL string. If the value is not trusted, this will intentionally throw an error\n    // because the user is attempted to use an unsafe URL, potentially opening themselves up\n    // to an XSS attack.\n    if (!angular.isString(id)) {\n      id = $sce.getTrustedUrl(id);\n    }\n\n    // If already loaded and cached, use a clone of the cached icon.\n    // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n    if (iconCache[id]) {\n      return $q.when(transformClone(iconCache[id]));\n    }\n\n    if (urlRegex.test(id) || dataUrlRegex.test(id)) {\n      return loadByURL(id).then(cacheIcon(id));\n    }\n\n    if (id.indexOf(':') === -1) {\n      id = '$default:' + id;\n    }\n\n    var load = config[id] ? loadByID : loadFromIconSet;\n    return load(id)\n      .then(cacheIcon(id));\n  }\n\n  /**\n   * Lookup a registered fontSet style using its alias.\n   * @param {string} alias used to lookup the alias in the array of fontSets\n   * @returns {*} matching fontSet or the defaultFontSet if that alias does not match\n   */\n  function findRegisteredFontSet(alias) {\n    var useDefault = angular.isUndefined(alias) || !(alias && alias.length);\n    if (useDefault) {\n      return config.defaultFontSet;\n    }\n\n    var result = alias;\n    angular.forEach(config.fontSets, function(fontSet) {\n      if (fontSet.alias === alias) {\n        result = fontSet.fontSet || result;\n      }\n    });\n\n    return result;\n  }\n\n  /**\n   * @param {!Icon} cacheElement cached icon from the iconCache\n   * @returns {Icon} cloned Icon element with unique ids\n   */\n  function transformClone(cacheElement) {\n    var clone = cacheElement.clone();\n    var newUid = $mdUtil.nextUid();\n    var cacheSuffix, svgUrlQuerySelector, i, xlinkHrefValue;\n    // These are SVG attributes that can reference element ids.\n    var svgUrlAttributes = [\n      'clip-path', 'color-profile', 'cursor', 'fill', 'filter', 'href', 'marker-start',\n      'marker-mid', 'marker-end', 'mask', 'stroke', 'style', 'vector-effect'\n    ];\n    var isIeSvg = clone.innerHTML === undefined;\n\n    // Verify that the newUid only contains a number and not some XSS content.\n    if (!isFinite(Number(newUid))) {\n      throw new Error('Unsafe and unexpected non-number result from $mdUtil.nextUid().');\n    }\n    cacheSuffix = '_cache' + newUid;\n\n    // For each cached icon, we need to modify the id attributes and references.\n    // This is needed because SVG ids are treated as normal DOM ids and should not be duplicated on\n    // the page.\n    if (clone.id) {\n      clone.id += cacheSuffix;\n    }\n\n    // Do as much as possible with querySelectorAll as it provides much greater performance\n    // than RegEx against serialized DOM.\n    angular.forEach(clone.querySelectorAll('[id]'), function(descendantElem) {\n      svgUrlQuerySelector = '';\n      for (i = 0; i < svgUrlAttributes.length; i++) {\n        svgUrlQuerySelector += '[' + svgUrlAttributes[i] + '=\"url(#' + descendantElem.id + ')\"]';\n        if (i + 1 < svgUrlAttributes.length) {\n          svgUrlQuerySelector += ', ';\n        }\n      }\n      // Append the cacheSuffix to references of the element's id within url(#id) calls.\n      angular.forEach(clone.querySelectorAll(svgUrlQuerySelector), function(refItem) {\n        updateSvgIdReferences(descendantElem, refItem, isIeSvg, newUid);\n      });\n      // Handle usages of url(#id) in the SVG's stylesheets\n      angular.forEach(clone.querySelectorAll('style'), function(refItem) {\n        updateSvgIdReferences(descendantElem, refItem, isIeSvg, newUid);\n      });\n\n      // Update ids referenced by the deprecated (in SVG v2) xlink:href XML attribute. The now\n      // preferred href attribute is handled above. However, this non-standard XML namespaced\n      // attribute cannot be handled in the same way. Explanation of this query selector here:\n      // https://stackoverflow.com/q/23034283/633107.\n      angular.forEach(clone.querySelectorAll('[*|href]:not([href])'), function(refItem) {\n        xlinkHrefValue = refItem.getAttribute('xlink:href');\n        if (xlinkHrefValue) {\n          xlinkHrefValue = xlinkHrefValue.replace(\"#\" + descendantElem.id, \"#\" + descendantElem.id + cacheSuffix);\n          refItem.setAttribute('xlink:href', xlinkHrefValue);\n        }\n      });\n\n      descendantElem.id += cacheSuffix;\n    });\n\n    return clone;\n  }\n\n  /**\n   * @param {Element} referencedElement element w/ id that needs to be updated\n   * @param {Element} referencingElement element that references the original id\n   * @param {boolean} isIeSvg true if we're dealing with an SVG in IE11, false otherwise\n   * @param {string} newUid the cache id to add as part of the cache suffix\n   */\n  function updateSvgIdReferences(referencedElement, referencingElement, isIeSvg, newUid) {\n    var svgElement, cacheSuffix;\n\n    // Verify that the newUid only contains a number and not some XSS content.\n    if (!isFinite(Number(newUid))) {\n      throw new Error('Unsafe and unexpected non-number result for newUid.');\n    }\n    cacheSuffix = '_cache' + newUid;\n\n    // outerHTML of SVG elements is not supported by IE11\n    if (isIeSvg) {\n      svgElement = $mdUtil.getOuterHTML(referencingElement);\n      svgElement = svgElement.replace(\"url(#\" + referencedElement.id + \")\",\n        \"url(#\" + referencedElement.id + cacheSuffix + \")\");\n      referencingElement.textContent = angular.element(svgElement)[0].innerHTML;\n    } else {\n      // This use of outerHTML should be safe from XSS attack since we are only injecting the\n      // cacheSuffix with content from $mdUtil.nextUid which we verify is a finite number above.\n      referencingElement.outerHTML = referencingElement.outerHTML.replace(\n        \"url(#\" + referencedElement.id + \")\",\n        \"url(#\" + referencedElement.id + cacheSuffix + \")\");\n    }\n  }\n\n  /**\n   * Prepare and cache the loaded icon for the specified `id`.\n   * @param {string} id icon cache id\n   * @returns {function(*=): *}\n   */\n  function cacheIcon(id) {\n\n    return function updateCache(icon) {\n      iconCache[id] = isIcon(icon) ? icon : new Icon(icon, config[id]);\n\n      return transformClone(iconCache[id]);\n    };\n  }\n\n  /**\n   * Lookup the configuration in the registry, if !registered throw an error\n   * otherwise load the icon [on-demand] using the registered URL.\n   * @param {string} id icon registry id\n   * @returns {angular.$q.Promise}\n   */\n  function loadByID(id) {\n    var iconConfig = config[id];\n    return loadByURL(iconConfig.url).then(function(icon) {\n      return new Icon(icon, iconConfig);\n    });\n  }\n\n  /**\n   * Loads the file as XML and uses querySelector( <id> ) to find the desired node...\n   * @param {string} id icon id in icon set\n   * @returns {angular.$q.Promise}\n   */\n  function loadFromIconSet(id) {\n    var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n    var iconSetConfig = config[setName];\n\n    return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n    function extractFromSet(set) {\n      var iconName = id.slice(id.lastIndexOf(':') + 1);\n      var icon = set.querySelector('#' + iconName);\n      return icon ? new Icon(icon, iconSetConfig) : announceIdNotFound(id);\n    }\n\n    function announceIdNotFound(id) {\n      var msg = 'icon ' + id + ' not found';\n      $log.warn(msg);\n\n      return $q.reject(msg || id);\n    }\n  }\n\n  /**\n   * Load the icon by URL (may use the $templateCache).\n   * Extract the data for later conversion to Icon\n   * @param {string} url icon URL\n   * @returns {angular.$q.Promise}\n   */\n  function loadByURL(url) {\n    /* Load the icon from embedded data URL. */\n    function loadByDataUrl(url) {\n      var results = dataUrlRegex.exec(url);\n      var isBase64 = /base64/i.test(url);\n      var data = isBase64 ? window.atob(results[2]) : results[2];\n\n      return $q.when(angular.element(data)[0]);\n    }\n\n    /* Load the icon by URL using HTTP. */\n    function loadByHttpUrl(url) {\n      return $q(function(resolve, reject) {\n        // Catch HTTP or generic errors not related to incorrect icon IDs.\n        var announceAndReject = function(err) {\n            var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n            $log.warn(msg);\n            reject(err);\n          },\n          extractSvg = function(response) {\n            if (!svgCache[url]) {\n              svgCache[url] = angular.element('<div>').append(response)[0].querySelector('svg');\n            }\n            resolve(svgCache[url]);\n          };\n\n        $templateRequest(url, true).then(extractSvg, announceAndReject);\n      });\n    }\n\n    return dataUrlRegex.test(url)\n      ? loadByDataUrl(url)\n      : loadByHttpUrl(url);\n  }\n\n  /**\n   * Check target signature to see if it is an Icon instance.\n   * @param {Icon|Element} target\n   * @returns {boolean} true if the specified target is an Icon object, false otherwise.\n   */\n  function isIcon(target) {\n    return angular.isDefined(target.element) && angular.isDefined(target.config);\n  }\n\n  /**\n   * Define the Icon class\n   * @param {Element} el\n   * @param {=ConfigurationItem} config\n   * @constructor\n   */\n  function Icon(el, config) {\n    // If the node is a <symbol>, it won't be rendered so we have to convert it into <svg>.\n    if (el && el.tagName.toLowerCase() === 'symbol') {\n      var viewbox = el.getAttribute('viewBox');\n      // // Check if innerHTML is supported as IE11 does not support innerHTML on SVG elements.\n      if (el.innerHTML) {\n        el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">')\n          .html(el.innerHTML)[0];\n      } else {\n        el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">')\n          .append($mdUtil.getInnerHTML(el))[0];\n      }\n      if (viewbox) el.setAttribute('viewBox', viewbox);\n    }\n\n    if (el && el.tagName.toLowerCase() !== 'svg') {\n      el = angular.element(\n        '<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];\n    }\n\n    // Inject the namespace if not available...\n    if (!el.getAttribute('xmlns')) {\n      el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n    }\n\n    this.element = el;\n    this.config = config;\n    this.prepare();\n  }\n\n  /**\n   *  Prepare the DOM element that will be cached in the\n   *  loaded iconCache store.\n   */\n  function prepareAndStyle() {\n    var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;\n    angular.forEach({\n      'fit': '',\n      'height': '100%',\n      'width': '100%',\n      'preserveAspectRatio': 'xMidYMid meet',\n      'viewBox': this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize),\n      'focusable': false // Disable IE11s default behavior to make SVGs focusable\n    }, function(val, attr) {\n      this.element.setAttribute(attr, val);\n    }, this);\n  }\n\n  /**\n   * Clone the Icon DOM element.\n   */\n  function cloneSVG() {\n    // If the element or any of its children have a style attribute, then a CSP policy without\n    // 'unsafe-inline' in the style-src directive, will result in a violation.\n    return this.element.cloneNode(true);\n  }\n\n}\n"
  },
  {
    "path": "src/components/input/_input-variables.scss",
    "content": "$input-container-padding: 2px !default;\n$input-container-vertical-margin: 18px !default;\n$input-container-horizontal-margin: 0px !default;\n\n$input-label-default-offset: 24px !default;\n$input-label-default-scale: 1.0 !default;\n$input-label-float-offset: 6px !default;\n$input-label-float-scale: 0.75 !default;\n\n$input-placeholder-offset: $input-label-default-offset !default;\n\n$input-border-width-default: 1px !default;\n$input-border-width-focused: 2px !default;\n$input-line-height: 26px !default;\n$input-padding-top: 2px !default;\n$input-padding-bottom: $input-border-width-focused - $input-border-width-default !default;\n\n$input-error-font-size: 12px !default;\n$input-error-height: 24px !default;\n$input-error-line-height: $input-error-font-size + 2px !default;\n// From Text field spec\n$error-padding-top: $baseline-grid !default;\n\n$icon-offset: 36px !default;\n\n$icon-top-offset: ($icon-offset - $input-padding-top - $input-border-width-focused) * 0.25 !default;\n\n$icon-float-focused-top: -8px !default;\n\n$input-resize-handle-height: 10px !default;\n"
  },
  {
    "path": "src/components/input/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" layout=\"column\" ng-cloak class=\"md-inline-form\">\n\n  <md-content md-theme=\"docs-dark\" layout-gt-sm=\"row\" layout-padding>\n    <div>\n      <md-input-container>\n        <label>Title</label>\n        <input ng-model=\"user.title\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>Email</label>\n        <input ng-model=\"user.email\" type=\"email\">\n      </md-input-container>\n    </div>\n  </md-content>\n\n  <md-content layout-padding>\n    <div>\n      <form name=\"userForm\">\n\n        <div layout-gt-xs=\"row\">\n          <md-input-container class=\"md-block\" flex-gt-xs>\n            <label>Company (Disabled)</label>\n            <input ng-model=\"user.company\" disabled>\n          </md-input-container>\n\n          <md-input-container>\n            <label>Enter date</label>\n            <md-datepicker ng-model=\"user.submissionDate\" aria-label=\"Enter date\"></md-datepicker>\n          </md-input-container>\n        </div>\n\n        <div layout-gt-sm=\"row\">\n          <md-input-container class=\"md-block\" flex-gt-sm>\n            <label>First name</label>\n            <input ng-model=\"user.firstName\">\n          </md-input-container>\n\n          <md-input-container class=\"md-block\" flex-gt-sm>\n            <label>Long Last Name That Will Be Truncated And 3 Dots (Ellipsis) Will Appear At The End</label>\n            <input ng-model=\"theMax\">\n          </md-input-container>\n        </div>\n\n        <md-input-container class=\"md-block\">\n          <label>Address</label>\n          <input ng-model=\"user.address\">\n        </md-input-container>\n\n        <md-input-container md-no-float class=\"md-block\">\n          <input ng-model=\"user.address2\" placeholder=\"Address 2\" aria-label=\"Address 2\">\n        </md-input-container>\n\n        <div layout-gt-sm=\"row\">\n          <md-input-container class=\"md-block\" flex-gt-sm>\n            <label>City</label>\n            <input ng-model=\"user.city\">\n          </md-input-container>\n\n          <md-input-container class=\"md-block\" flex-gt-sm>\n            <label>State</label>\n            <md-select ng-model=\"user.state\">\n              <md-option ng-repeat=\"state in states\" value=\"{{state.abbrev}}\">\n                {{state.abbrev}}\n              </md-option>\n            </md-select>\n          </md-input-container>\n\n          <md-input-container class=\"md-block\" flex-gt-sm>\n            <label>Postal Code</label>\n            <input name=\"postalCode\" ng-model=\"user.postalCode\" placeholder=\"12345\"\n                   required ng-pattern=\"/^[0-9]{5}$/\" md-maxlength=\"5\">\n\n            <div ng-messages=\"userForm.postalCode.$error\" role=\"alert\" multiple>\n              <div ng-message=\"required\" class=\"my-message\">You must supply a postal code.</div>\n              <div ng-message=\"pattern\" class=\"my-message\">That doesn't look like a valid postal\n                code.\n              </div>\n              <div ng-message=\"md-maxlength\" class=\"my-message\">\n                Don't use the long version silly...we don't need to be that specific...\n              </div>\n            </div>\n          </md-input-container>\n        </div>\n\n        <md-input-container class=\"md-block\">\n          <label>Biography</label>\n          <textarea ng-model=\"user.biography\" md-maxlength=\"150\" rows=\"5\" md-select-on-focus></textarea>\n        </md-input-container>\n\n\n      </form>\n    </div>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/input/demoBasicUsage/script.js",
    "content": "angular\n  .module('inputBasicDemo', ['ngMaterial', 'ngMessages'])\n  .controller('DemoCtrl', function($scope) {\n    $scope.user = {\n      title: 'Developer',\n      email: 'ipsum@lorem.com',\n      firstName: '',\n      lastName: '',\n      company: 'Google',\n      address: '1600 Amphitheatre Pkwy',\n      city: 'Mountain View',\n      state: 'CA',\n      biography: 'Loves kittens, snowboarding, and can type at 130 WPM.\\n\\nAnd rumor has it she bouldered up Castle Craig!',\n      postalCode: '94043'\n    };\n\n    $scope.states = ('AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS ' +\n    'MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI ' +\n    'WY').split(' ').map(function(state) {\n        return {abbrev: state};\n      });\n  })\n  .config(function($mdThemingProvider) {\n\n    // Configure a dark theme with primary foreground yellow\n\n    $mdThemingProvider.theme('docs-dark', 'default')\n      .primaryPalette('yellow')\n      .dark();\n\n  });\n"
  },
  {
    "path": "src/components/input/demoErrors/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" ng-cloak>\n\n  <md-content layout-padding>\n    <form name=\"projectForm\">\n\n      <md-input-container class=\"md-block\">\n        <label>Description</label>\n        <input md-maxlength=\"30\" required md-no-asterisk name=\"description\" ng-model=\"project.description\">\n        <div ng-messages=\"projectForm.description.$error\">\n          <div ng-message=\"required\">This is required.</div>\n          <div ng-message=\"md-maxlength\">The description must be less than 30 characters long.</div>\n        </div>\n      </md-input-container>\n\n      <div layout=\"row\">\n        <md-input-container flex=\"50\">\n          <label>Client Name</label>\n          <input required name=\"clientName\" ng-model=\"project.clientName\">\n          <div ng-messages=\"projectForm.clientName.$error\">\n            <div ng-message=\"required\">This is required.</div>\n          </div>\n        </md-input-container>\n\n        <md-input-container flex=\"50\">\n          <label>Project Type</label>\n          <md-select name=\"type\" ng-model=\"project.type\" required>\n            <md-option value=\"app\">Application</md-option>\n            <md-option value=\"web\">Website</md-option>\n          </md-select>\n          <div ng-messages=\"projectForm.type.$error\">\n            <div ng-message=\"required\">This is required.</div>\n          </div>\n        </md-input-container>\n      </div>\n\n      <md-input-container class=\"md-block\">\n        <label>Client Email</label>\n        <input required type=\"email\" name=\"clientEmail\" ng-model=\"project.clientEmail\"\n               minlength=\"10\" maxlength=\"100\" ng-pattern=\"/^.+@.+\\..+$/\" />\n\n        <div ng-messages=\"projectForm.clientEmail.$error\" role=\"alert\">\n          <div ng-message-exp=\"['required', 'minlength', 'maxlength', 'pattern']\">\n            Your email must be between 10 and 100 characters long and look like an e-mail address.\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class=\"md-block\">\n        <label>Hourly Rate (USD)</label>\n        <input required type=\"number\" step=\"any\" name=\"rate\" ng-model=\"project.rate\" min=\"800\"\n               max=\"4999\" ng-pattern=\"/^1234$/\" />\n\n        <div ng-messages=\"projectForm.rate.$error\" multiple md-auto-hide=\"false\">\n          <div ng-message=\"required\">\n            You've got to charge something! You can't just <b>give away</b> a Missile Defense\n            System.\n          </div>\n\n          <div ng-message=\"min\">\n            You should charge at least $800 an hour. This job is a big deal... if you mess up,\n            everyone dies!\n          </div>\n\n          <div ng-message=\"pattern\">\n            You should charge exactly $1,234.\n          </div>\n\n          <div ng-message=\"max\">\n            {{projectForm.rate.$viewValue | currency:\"$\":0}} an hour? That's a little ridiculous. I\n            doubt even Bill Clinton could afford that.\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class=\"md-block\">\n        <md-checkbox name=\"tos\" ng-model=\"project.tos\" required>\n          I accept the terms of service.\n        </md-checkbox>\n        <div ng-messages=\"projectForm.tos.$error\" multiple md-auto-hide=\"false\">\n          <div ng-message=\"required\">\n            You must accept the terms of service before you can proceed.\n          </div>\n        </div>\n      </md-input-container>\n\n      <md-input-container class=\"md-block\">\n        <md-switch class=\"md-primary\" name=\"special\" ng-model=\"project.special\" required>\n          Enable special options.\n        </md-switch>\n        <div ng-messages=\"projectForm.special.$error\" multiple>\n          <div ng-message=\"required\">\n            You must enable all special options before you can proceed.\n          </div>\n        </div>\n      </md-input-container>\n      <div>\n        <md-button type=\"submit\">Submit</md-button>\n      </div>\n\n      <p style=\"font-size:.8em; width: 100%; text-align: center;\">\n        Make sure to include <a href=\"https://docs.angularjs.org/api/ngMessages\" target=\"_blank\">ngMessages</a> module when using ng-message markup.\n      </p>\n    </form>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/input/demoErrors/script.js",
    "content": "angular.module('inputErrorsApp', ['ngMaterial', 'ngMessages'])\n\n.controller('AppCtrl', function($scope) {\n  $scope.project = {\n    description: 'Nuclear Missile Defense System',\n    rate: 500,\n    special: true\n  };\n});\n"
  },
  {
    "path": "src/components/input/demoErrors/style.css",
    "content": ".inputErrorsApp { min-height:48px; }\n\n\nmd-input-container > p {\n    font-size: 0.8em;\n    text-align: left;\n    width:100%;\n}\n"
  },
  {
    "path": "src/components/input/demoErrorsAdvanced/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" ng-cloak>\n\n  <md-content layout-padding>\n    <form name=\"userForm\">\n      <div layout=\"row\" layout-xs=\"column\" layout-sm=\"column\" layout-align=\"space-between center\">\n        <div flex-gt-sm=\"80\">\n          <p>\n            The <code>md-input-container</code> gives you the flexibility to display your messages\n            using many standard angular directives.\n          </p>\n\n          <p>\n            For instance, toggle the switch\n\n            <span hide-xs hide-sm>to the right</span>\n            <span hide-gt-sm>below</span>\n\n            to see the messages switch between some custom hints, and the actual error messages.\n            Note that some of the <code>ng-messages</code> containers use <code>ngIf</code> while\n            others use <code>ng-show</code> or <code>ng-hide</code>.\n          </p>\n        </div>\n\n        <md-input-container>\n          <md-switch ng-model=\"showHints\">Showing {{showHints ? \"Hints\" : \"Errors\"}}</md-switch>\n        </md-input-container>\n      </div>\n\n      <div layout-gt-sm=\"row\">\n\n        <md-input-container class=\"md-block\" flex-gt-sm>\n          <label>Name</label>\n          <input md-maxlength=\"30\" required name=\"name\" ng-model=\"user.name\" />\n\n          <div class=\"hint\" ng-if=\"showHints\">Tell us what we should call you!</div>\n\n          <div ng-messages=\"userForm.name.$error\" ng-if=\"!showHints\">\n            <div ng-message=\"required\">Name is required.</div>\n            <div ng-message=\"md-maxlength\">The name has to be less than 30 characters long.</div>\n          </div>\n        </md-input-container>\n\n        <div flex=\"5\" hide-xs hide-sm>\n          <!-- Spacer //-->\n        </div>\n\n        <md-input-container class=\"md-block\" flex-gt-sm>\n          <label>Social Security Number</label>\n          <input name=\"social\" ng-model=\"user.social\" ng-pattern=\"/^[0-9]{3}-[0-9]{2}-[0-9]{4}$/\" />\n\n          <div class=\"hint\" ng-if=\"showHints\">###-##-####</div>\n\n          <div ng-messages=\"userForm.social.$error\" ng-if=\"!showHints\">\n            <div ng-message=\"pattern\">###-##-#### - Please enter a valid SSN.</div>\n          </div>\n        </md-input-container>\n\n      </div>\n\n      <div layout-gt-sm=\"row\">\n\n        <md-input-container class=\"md-block\" flex-gt-sm>\n          <label>Email</label>\n          <input name=\"email\" ng-model=\"user.email\"\n                 required minlength=\"10\" maxlength=\"100\" ng-pattern=\"/^.+@.+\\..+$/\" />\n\n          <div class=\"hint\" ng-show=\"showHints\">How can we reach you?</div>\n\n          <div ng-messages=\"userForm.email.$error\" ng-hide=\"showHints\">\n            <div ng-message-exp=\"['required', 'minlength', 'maxlength', 'pattern']\">\n              Your email must be between 10 and 100 characters long and look like an e-mail address.\n            </div>\n          </div>\n        </md-input-container>\n\n        <div flex=\"5\" hide-xs hide-sm>\n          <!-- Spacer //-->\n        </div>\n\n        <md-input-container class=\"md-block\" flex-gt-sm>\n          <label>Phone Number</label>\n          <input name=\"phone\" ng-model=\"user.phone\" ng-pattern=\"/^[(][0-9]{3}[)] [0-9]{3}-[0-9]{4}$/\" />\n\n          <div class=\"hint\" ng-show=\"showHints\">(###) ###-####</div>\n\n          <div ng-messages=\"userForm.phone.$error\" ng-hide=\"showHints\">\n            <div ng-message=\"pattern\">(###) ###-#### - Please enter a valid phone number.</div>\n          </div>\n        </md-input-container>\n\n        <style>\n          /*\n           * The Material demos system does not currently allow targeting the body element, so this\n           * must go here in the HTML.\n           */\n          body[dir=rtl] .hint {\n            right: 2px;\n            left: auto;\n          }\n        </style>\n      </div>\n\n    </form>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/input/demoErrorsAdvanced/script.js",
    "content": "angular.module('inputErrorsAdvancedApp', ['ngMaterial', 'ngMessages'])\n\n  .controller('AppCtrl', function($scope) {\n    $scope.showHints = true;\n\n    $scope.user = {\n      name: \"\",\n      email: \"\",\n      social: \"123456789\",\n      phone: \"N/A\"\n    };\n  });\n"
  },
  {
    "path": "src/components/input/demoErrorsAdvanced/style.css",
    "content": ".hint {\n    /* Position the hint */\n    position: absolute;\n    left: 2px;\n    right: auto;\n    bottom: 7px;\n\n    /* Copy styles from ng-messages */\n    font-size: 12px;\n    line-height: 14px;\n    transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);\n\n    /* Set our own color */\n    color: rgba(0, 0, 0, 0.54);\n}\n\n/* NOTE: Check the demo's HTML to see some additional RTL support CSS */\n\n/* Setup animations similar to the ng-messages */\n.hint.ng-hide,\n.hint.ng-enter,\n.hint.ng-leave.ng-leave-active {\n    bottom: 26px;\n    opacity: 0;\n}\n\n.hint.ng-leave,\n.hint.ng-enter.ng-enter-active {\n    bottom: 7px;\n    opacity: 1;\n}\n"
  },
  {
    "path": "src/components/input/demoIcons/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" layout=\"column\" layout-padding ng-cloak>\n\n  <br/>\n  <md-content class=\"md-no-momentum\">\n    <md-input-container class=\"md-icon-float md-block\">\n      <!-- Use floating label instead of placeholder -->\n      <label>Name</label>\n      <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\" class=\"name\"></md-icon>\n      <input ng-model=\"user.name\" type=\"text\">\n    </md-input-container>\n\n    <md-input-container md-no-float class=\"md-block\">\n      <md-icon md-svg-src=\"img/icons/ic_phone_24px.svg\"></md-icon>\n      <input ng-model=\"user.phone\" type=\"text\" placeholder=\"Phone Number\" aria-label=\"Phone Number\">\n    </md-input-container>\n\n    <md-input-container class=\"md-block\">\n      <!-- Use floating placeholder instead of label -->\n      <md-icon md-svg-src=\"img/icons/ic_email_24px.svg\" class=\"email\"></md-icon>\n      <input ng-model=\"user.email\" type=\"email\" placeholder=\"Email (required)\" ng-required=\"true\"\n             aria-label=\"Email (required)\">\n    </md-input-container>\n\n    <md-input-container md-no-float class=\"md-block\">\n      <input ng-model=\"user.address\" type=\"text\" placeholder=\"Address\" aria-label=\"Address\">\n      <md-icon md-svg-src=\"img/icons/ic_place_24px.svg\" style=\"display:inline-block;\"></md-icon>\n    </md-input-container>\n\n    <md-input-container class=\"md-icon-float md-icon-right md-block\">\n      <label>Donation Amount</label>\n      <md-icon md-svg-src=\"img/icons/ic_card_giftcard_24px.svg\"></md-icon>\n      <input ng-model=\"user.donation\" type=\"number\" step=\"0.01\">\n      <md-icon md-svg-src=\"img/icons/ic_euro_24px.svg\"></md-icon>\n    </md-input-container>\n\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/input/demoIcons/script.js",
    "content": "angular\n  .module('inputIconDemo', ['ngMaterial', 'ngMessages'])\n  .controller('DemoCtrl', function($scope) {\n    $scope.user = {\n      name: 'John Doe',\n      email: '',\n      phone: '',\n      address: 'Mountain View, CA',\n      donation: 19.99\n    };\n  });\n"
  },
  {
    "path": "src/components/input/demoIcons/style.scss",
    "content": ".inputIconDemo { min-height: 48px; }\nmd-input-container:not(.md-input-invalid) > md-icon.email { color: green; }\nmd-input-container:not(.md-input-invalid) > md-icon.name { color: dodgerblue; }\nmd-input-container.md-input-invalid > md-icon.email,\nmd-input-container.md-input-invalid > md-icon.name { color: red; }\n/*\n.right-icon {\n  position: absolute;\n  top: 4px;\n  right: 2px;\n  left: auto;\n  margin-top: 0;\n}\n*/"
  },
  {
    "path": "src/components/input/demoInlineForm/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" layout=\"column\" ng-cloak class=\"demo-inline-form-container\">\n  <form class=\"md-inline-form\">\n    <div layout=\"row\" layout-wrap>\n      <md-input-container>\n        <label>First name</label>\n        <input type=\"text\" ng-model=\"user.firstName\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>Last name</label>\n        <input type=\"text\" ng-model=\"user.lastName\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>State</label>\n        <md-select ng-model=\"user.state\">\n          <md-option ng-repeat=\"state in states\" value=\"{{state.abbrev}}\">\n            {{state.abbrev}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container>\n        <label>Enter date</label>\n        <md-datepicker ng-model=\"user.submissionDate\"></md-datepicker>\n      </md-input-container>\n    </div>\n    <div layout=\"row\" layout-wrap>\n      <md-input-container>\n        <label>Postal Code</label>\n        <input type=\"text\" ng-model=\"user.postalCode\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>State of Birth</label>\n        <md-select ng-model=\"user.stateOfBirth\">\n          <md-option ng-repeat=\"state in states\" value=\"{{state.abbrev}}\">\n            {{state.abbrev}}\n          </md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-input-container>\n        <label>Description</label>\n        <textarea ng-model=\"user.description\"></textarea>\n      </md-input-container>\n\n      <md-checkbox ng-model=\"user.licenseAccepted\">\n        I agree to the license terms.\n      </md-checkbox>\n    </div>\n    <div layout=\"row\" layout-wrap>\n      <md-input-container>\n        <label>Company</label>\n        <input type=\"text\" ng-model=\"user.company\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>City</label>\n        <input type=\"text\" ng-model=\"user.city\">\n      </md-input-container>\n\n      <md-switch ng-model=\"user.marketingOptIn\" aria-label=\"Opt-in to emails\">\n        Opt-in to emails\n      </md-switch>\n    </div>\n    <div layout=\"row\" layout-wrap>\n      <md-input-container>\n        <label>Title</label>\n        <input type=\"text\" ng-model=\"user.title\">\n      </md-input-container>\n\n      <label class=\"demo-radio-button-label\">Primary Language:</label>\n      <md-radio-group ng-model=\"data.group1\">\n        <md-radio-button value=\"TypeScript\">TypeScript</md-radio-button>\n        <md-radio-button value=\"JavaScript\">JavaScript</md-radio-button>\n        <md-radio-button value=\"Java\">Java</md-radio-button>\n        <md-radio-button value=\"C#\">C#</md-radio-button>\n      </md-radio-group>\n    </div>\n  </form>\n\n</div>\n"
  },
  {
    "path": "src/components/input/demoInlineForm/script.js",
    "content": "angular.module('inputInlineForm', ['ngMaterial', 'ngMessages'])\n.controller('DemoCtrl', function ($scope) {\n  $scope.user = {\n    title: 'Developer',\n    email: 'ipsum@lorem.com',\n    firstName: '',\n    lastName: '',\n    company: 'Google',\n    address: '1600 Amphitheatre Pkwy',\n    city: 'Mountain View',\n    state: null,\n    stateOfBirth: 'CA',\n    description: 'Loves TypeScript 💖',\n    postalCode: '94043',\n    licenseAccepted: true,\n    submissionDate: null,\n    marketingOptIn: true\n  };\n\n  $scope.states = ('AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS ' +\n    'MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI ' +\n    'WY').split(' ').map(function (state) {\n    return {abbrev: state};\n  });\n});\n"
  },
  {
    "path": "src/components/input/demoInlineForm/style.scss",
    "content": ".demo-inline-form-container {\n  padding: 16px;\n\n  .demo-radio-button-label {\n    margin: 18px 16px;\n    padding-top: 6px;\n  }\n}\n"
  },
  {
    "path": "src/components/input/input-animations.spec.js",
    "content": "describe('md-input-container animations', function() {\n  var $rootScope, $compile, $material, $$mdInput, $window, $animate, $rootElement, $document, $timeout,\n    el, root, body, pageScope, computedStyle, invalidAnimation, messagesAnimation, messageAnimation;\n\n  // Load our modules\n  beforeEach(module('ngAnimate', 'ngMessages', 'material.components.input', 'material.components.checkbox'));\n\n  // Run pre-test setup\n  beforeEach(injectGlobals);\n  beforeEach(setupVariables);\n\n  // Run after-test teardown\n  afterEach(teardown);\n\n  it('set the proper styles when showing messages on an input', performInputAnimationTests);\n  it('set the proper styles when showing messages on an input with animations disabled', function() {\n    $animate.enabled(false);\n    performInputAnimationTests();\n    $animate.enabled(true);\n  });\n\n  function performInputAnimationTests() {\n    compile(\n      '<form name=\"testForm\">' +\n      '  <md-input-container>' +\n      '    <input name=\"foo\" ng-model=\"foo\" required ng-pattern=\"/^1234$/\" />' +\n      '    <div class=\"errors\" ng-messages=\"testForm.foo.$error\">' +\n      '      <div ng-message=\"required\" style=\"transition: 0s none\">required</div>' +\n      '      <div ng-message=\"pattern\" style=\"transition: 0s none\">pattern</div>' +\n      '    </div>' +\n      '  </md-input-container>' +\n      '</form>'\n    );\n\n    var container = el.find('md-input-container'),\n      input = el.find('input'),\n      errors;\n\n\n    // Mimic the real validations/animations that fire\n\n    /*\n     * 1. Set to an invalid pattern but don't blur (so it's not invalid yet)\n     *\n     * Expect nothing to happen (message is hidden)\n     */\n\n    setFoo('asdf');\n    flush();\n    errors = getError();\n    expectError(errors, 'pattern');\n    expect(container).not.toHaveClass('md-input-invalid');\n    computedStyle = $window.getComputedStyle(errors[0]);\n    expect(parseInt(computedStyle.opacity)).toEqual(0);\n    expect(parseInt(computedStyle.marginTop)).toBeLessThan(0);\n\n    /*\n     * 2. Blur the input, which adds the md-input-invalid class\n     *\n     * Expect to animate in the pattern message\n     */\n\n    input.triggerHandler('blur');\n    flush();\n    errors = getError();\n    expectError(errors, 'pattern');\n    expect(container).toHaveClass('md-input-invalid');\n    computedStyle = $window.getComputedStyle(errors[0]);\n    expect(parseInt(computedStyle.opacity)).toEqual(1);\n    expect(parseInt(computedStyle.marginTop)).toEqual(0);\n\n    /*\n     * 3. Clear the field\n     *\n     * Expect to animate away pattern message and animate in the required message\n     */\n\n    // Grab the pattern error before we change foo and it disappears\n\n    setFoo('');\n    expectError(getError(), 'required');\n\n    flush();\n\n    expect(container).toHaveClass('md-input-invalid');\n    computedStyle = $window.getComputedStyle(getError()[0]);\n    expect(parseInt(computedStyle.opacity)).toEqual(1);\n    expect(parseInt(computedStyle.marginTop)).toEqual(0);\n  }\n\n  describe('method tests', function() {\n\n    describe('#getMessagesElement', function() {\n\n      it('finds the messages element itself', function() {\n        var template = '<div class=\"md-input-messages-animation\"></div>';\n        var dom = angular.element(template);\n        var messages = $$mdInput.messages.getElement(dom);\n\n        expect(dom).toEqual(messages);\n      });\n\n      it('finds a child element', function(){\n        var template = '<div><div class=\"md-input-messages-animation\"></div></div>';\n        var dom = angular.element(template);\n        var realMessages = angular.element(dom[0].querySelector('.md-input-messages-animation'));\n        var messages = $$mdInput.messages.getElement(dom);\n\n        expect(realMessages).toEqual(messages);\n      });\n\n      it('finds the parent of a message animation element', function() {\n        var template =\n              '<div class=\"md-input-messages-animation\">' +\n              '  <div class=\"md-input-message-animation\"></div>' +\n              '</div>';\n        var dom = angular.element(template);\n        var message = angular.element(dom[0].querySelector('.md-input-message-animation'));\n        var messages = $$mdInput.messages.getElement(message);\n\n        expect(dom).toEqual(messages);\n      });\n    });\n  });\n\n  it('set the proper styles when showing messages on an md-checkbox', performCheckboxAnimationTests);\n  it('set the proper styles when showing messages on an md-checkbox with animations disabled', function() {\n    $animate.enabled(false);\n    performCheckboxAnimationTests();\n    $animate.enabled(true);\n  });\n\n  function performCheckboxAnimationTests() {\n    compile(\n      '<form name=\"testForm\">' +\n      '  <md-input-container>' +\n      '    <md-checkbox name=\"cb\" ng-model=\"foo\" required>Test</md-checkbox>' +\n      '    <div class=\"errors\" ng-messages=\"testForm.cb.$error\">' +\n      '      <div ng-message=\"required\" style=\"transition: 0s none\">required</div>' +\n      '    </div>' +\n      '  </md-input-container>' +\n      '</form>'\n    );\n\n    var container = el.find('md-input-container'),\n      checkbox = el.find('md-checkbox');\n\n    // Mimic the real validations/animations that fire\n\n    /*\n     * 1. Uncheck the checkbox but don't blur (so it's not invalid yet)\n     *\n     * Expect nothing to happen (message is hidden)\n     */\n\n    setFoo(true);\n    checkbox.triggerHandler('click');\n    flush();\n\n    expectError(getError(), 'required');\n    expect(container).not.toHaveClass('md-input-invalid');\n    computedStyle = $window.getComputedStyle(getError()[0]);\n    expect(parseInt(computedStyle.opacity)).toEqual(0);\n    expect(parseInt(computedStyle.marginTop)).toBeLessThan(0);\n\n    /*\n     * 2. Blur the checkbox, which adds the md-input-invalid class\n     *\n     * Expect to animate in the required message\n     */\n\n    checkbox.triggerHandler('blur');\n    flush();\n\n    expectError(getError(), 'required');\n    expect(container).toHaveClass('md-input-invalid');\n    computedStyle = $window.getComputedStyle(getError()[0]);\n    expect(parseInt(computedStyle.opacity)).toEqual(1);\n    expect(parseInt(computedStyle.marginTop)).toEqual(0);\n\n    /*\n     * 3. Clear the field\n     *\n     * Expect to animate away required message\n     */\n\n    setFoo(true);\n    flush();\n\n    expect(getError().length).toBe(0);\n\n  }\n\n  /*\n   * Test Helper Functions\n   */\n\n  function compile(template) {\n    el = $compile(template)(pageScope);\n    root = $rootElement.append(el)[0];\n    body = $document[0].body;\n    body.appendChild(root);\n\n    pageScope.$apply();\n\n    return el;\n  }\n\n  function setFoo(value) {\n    pageScope.foo = value;\n    pageScope.$digest();\n  }\n\n  function getError() {\n    return angular.element(el[0].querySelector('.errors div'));\n  }\n\n  function expectError(element, message) {\n    expect(element.text().trim()).toBe(message);\n  }\n\n  function flush() {\n    // Note: we use flushInterimElement() because it actually calls everything 3 times which seems\n    // to be enough to actually flush the animations\n    $material.flushInterimElement();\n  }\n\n  /*\n   * before/afterEach Helper Functions\n   */\n\n  // Setup/grab our variables\n  function injectGlobals() {\n    inject(function($injector) {\n      $rootScope = $injector.get('$rootScope');\n      $compile = $injector.get('$compile');\n      $material = $injector.get('$material');\n      $$mdInput = $injector.get('$$mdInput');\n      $window = $injector.get('$window');\n      $animate = $injector.get('$animate');\n      $rootElement = $injector.get('$rootElement');\n      $document = $injector.get('$document');\n\n      // Grab our input animations (we MUST use the injector to setup dependencies)\n      invalidAnimation = $injector.get('mdInputInvalidAnimation');\n      messagesAnimation = $injector.get('mdInputMessagesAnimation');\n      messageAnimation = $injector.get('mdInputMessageAnimation');\n    });\n  }\n\n  // Setup some custom variables for these tests\n  function setupVariables() {\n    pageScope = $rootScope.$new();\n  }\n\n  // Teardown our tests by resetting variables and removing our element\n  function teardown() {\n    el && el.remove && el.remove();\n  }\n});\n"
  },
  {
    "path": "src/components/input/input-theme.scss",
    "content": "md-input-container.md-THEME_NAME-theme {\n  .md-input {\n    @include input-placeholder-color('\\'{{background-default-contrast-secondary}}\\'');\n    color: '{{background-default-contrast}}';\n    border-color: '{{background-default-contrast-divider}}';\n  }\n\n  > md-icon {\n    color: '{{background-default-contrast}}';\n  }\n\n  label,\n  .md-placeholder {\n    color: '{{background-default-contrast-secondary}}';\n  }\n\n  label.md-required:after {\n    color: '{{warn-A700}}'\n  }\n\n  &:not(.md-input-focused):not(.md-input-invalid) label.md-required:after {\n    color: '{{background-default-contrast-secondary}}';\n  }\n\n  .md-input-messages-animation, .md-input-message-animation {\n    color: '{{warn-A700}}';\n    .md-char-counter {\n      color: '{{background-default-contrast}}';\n    }\n  }\n\n  &.md-input-focused {\n    .md-input {\n      @include input-placeholder-color('\\'{{background-default-contrast-secondary}}\\'');\n    }\n  }\n\n  &:not(.md-input-invalid) {\n    &.md-input-has-value {\n      label {\n        color: '{{background-default-contrast-secondary}}';\n      }\n    }\n    &.md-input-focused,\n    &.md-input-resized {\n      .md-input {\n        border-color: '{{primary-color}}';\n      }\n    }\n\n    &.md-input-focused {\n      label,\n      md-icon {\n        color: '{{primary-color}}';\n      }\n      &.md-accent {\n        .md-input {\n          border-color: '{{accent-color}}';\n        }\n        label,\n        md-icon {\n          color: '{{accent-color}}';\n        }\n      }\n      &.md-warn {\n        .md-input {\n          border-color: '{{warn-A700}}';\n        }\n        label,\n        md-icon {\n          color: '{{warn-A700}}';\n        }\n      }\n    }\n  }\n  &.md-input-invalid {\n    .md-input {\n      border-color: '{{warn-A700}}';\n    }\n    label,\n    .md-input-message-animation,\n    .md-char-counter {\n      color: '{{warn-A700}}';\n    }\n  }\n  .md-input {\n    &[disabled],\n    [disabled] & {\n      border-bottom-color: transparent;\n      color: '{{background-default-contrast-disabled}}';\n      background-image: linear-gradient(to right, '{{background-default-contrast-disabled}}' 0%, '{{background-default-contrast-disabled}}' 33%, transparent 0%);\n      background-image: -ms-linear-gradient(left, transparent 0%, '{{background-default-contrast-disabled}}' 100%);\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/input/input.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.input\n */\nvar inputModule = angular.module('material.components.input', [\n    'material.core'\n  ])\n  .directive('mdInputContainer', mdInputContainerDirective)\n  .directive('label', labelDirective)\n  .directive('input', inputTextareaDirective)\n  .directive('textarea', inputTextareaDirective)\n  .directive('mdMaxlength', mdMaxlengthDirective)\n  .directive('placeholder', placeholderDirective)\n  .directive('ngMessages', ngMessagesDirective)\n  .directive('ngMessage', ngMessageDirective)\n  .directive('ngMessageExp', ngMessageDirective)\n  .directive('mdSelectOnFocus', mdSelectOnFocusDirective)\n\n  .animation('.md-input-invalid', mdInputInvalidMessagesAnimation)\n  .animation('.md-input-messages-animation', ngMessagesAnimation)\n  .animation('.md-input-message-animation', ngMessageAnimation);\n\n// If we are running inside of tests; expose some extra services so that we can test them\nif (window._mdMocksIncluded) {\n  inputModule.service('$$mdInput', function() {\n    return {\n      // special accessor to internals... useful for testing\n      messages: {\n        getElement  : getMessagesElement\n      }\n    };\n  })\n\n  // Register a service for each animation so that we can easily inject them into unit tests\n  .service('mdInputInvalidAnimation', mdInputInvalidMessagesAnimation)\n  .service('mdInputMessagesAnimation', ngMessagesAnimation)\n  .service('mdInputMessageAnimation', ngMessageAnimation);\n}\n\n/**\n * @ngdoc directive\n * @name mdInputContainer\n * @module material.components.input\n *\n * @restrict E\n *\n * @description\n * `<md-input-container>` is the parent of any input or textarea element. It can also optionally\n * wrap `<md-select>` elements so that they will be formatted for use in a form.\n *\n * Input and textarea elements will not behave properly unless the md-input-container parent is\n * provided.\n *\n * A single `<md-input-container>` should contain only one `<input>` or `<md-select>` element,\n * otherwise it will throw an error.\n *\n * <b>Exception:</b> Hidden inputs (`<input type=\"hidden\" />`) are ignored and will not throw an\n * error, so you may combine these with other inputs.\n *\n * <b>Note:</b> When using `ngMessages` with your input element, make sure the message and container\n * elements are *block* elements, otherwise animations applied to the messages will not look as\n * intended. Either use a `div` and apply the `ng-message` and `ng-messages` classes respectively,\n * or use the `md-block` class on your element.\n *\n * @param {expression=} md-is-error When the given expression evaluates to `true`, the input\n *   container will go into the error state. Defaults to erroring if the input has been touched and\n *   is invalid.\n * @param {boolean=} md-no-float When present, `placeholder` attributes on the input will not be\n *   converted to floating labels.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-input-container>\n *   <label>Username</label>\n *   <input type=\"text\" ng-model=\"user.name\">\n * </md-input-container>\n *\n * <md-input-container>\n *   <label>Description</label>\n *   <textarea ng-model=\"user.description\"></textarea>\n * </md-input-container>\n *\n * <md-input-container>\n *   <md-select ng-model=\"user.state\" placeholder=\"State of Residence\">\n *     <md-option ng-value=\"state\" ng-repeat=\"state in states\">{{ state }}</md-option>\n *   </md-select>\n * </md-input-container>\n * </hljs>\n *\n * <h3>When disabling floating labels</h3>\n * <hljs lang=\"html\">\n * <md-input-container md-no-float>\n *   <input type=\"text\" placeholder=\"Non-Floating Label\">\n * </md-input-container>\n * </hljs>\n *\n * <h3>Aligning Form Elements</h3>\n * Wrap your form elements with the `md-inline-form` class in order to align them horizontally\n * within a form.\n *\n * <hljs lang=\"html\">\n * <form class=\"md-inline-form\">\n *   <md-input-container>\n *     <label>Username</label>\n *     <input type=\"text\" ng-model=\"user.name\">\n *   </md-input-container>\n *\n *   <md-input-container>\n *     <label>Description</label>\n *     <textarea ng-model=\"user.description\"></textarea>\n *   </md-input-container>\n *\n *   <md-input-container>\n *     <label>State of Residence</label>\n *     <md-select ng-model=\"user.state\">\n *       <md-option ng-value=\"state\" ng-repeat=\"state in states\">{{ state }}</md-option>\n *     </md-select>\n *   </md-input-container>\n *\n *   <md-input-container>\n *     <label>Enter date</label>\n *     <md-datepicker ng-model=\"user.submissionDate\"></md-datepicker>\n *   </md-input-container>\n *\n *   <md-input-container>\n *     <md-checkbox ng-model=\"user.licenseAccepted\">\n *       I agree to the license terms.\n *     </md-checkbox>\n *   </md-input-container>\n * </form>\n * </hljs>\n */\nfunction mdInputContainerDirective($mdTheming, $parse, $$rAF) {\n\n  var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT', 'MD-SELECT'];\n\n  var LEFT_SELECTORS = INPUT_TAGS.reduce(function(selectors, isel) {\n    return selectors.concat(['md-icon ~ ' + isel, '.md-icon ~ ' + isel]);\n  }, []).join(\",\");\n\n  var RIGHT_SELECTORS = INPUT_TAGS.reduce(function(selectors, isel) {\n    return selectors.concat([isel + ' ~ md-icon', isel + ' ~ .md-icon']);\n  }, []).join(\",\");\n\n  return {\n    restrict: 'E',\n    compile: compile,\n    controller: ContainerCtrl\n  };\n\n  function compile(tElement) {\n    // Check for both a left & right icon\n    var hasLeftIcon = tElement[0].querySelector(LEFT_SELECTORS);\n    var hasRightIcon = tElement[0].querySelector(RIGHT_SELECTORS);\n\n    return function postLink(scope, element) {\n      $mdTheming(element);\n\n      if (hasLeftIcon || hasRightIcon) {\n        // When accessing the element's contents synchronously, they may not be defined yet because\n        // of the use of ng-if. If we wait one frame, then the element should be there if the ng-if\n        // resolves to true.\n        $$rAF(function() {\n          // Handle the case where the md-icon element is initially hidden via ng-if from #9529.\n          // We don't want to preserve the space for the icon in the case of ng-if, like we do for\n          // ng-show.\n          // Note that we can't use the same selectors from above because the elements are no longer\n          // siblings for textareas at this point due to the insertion of the md-resize-wrapper.\n          var iconNotRemoved = element[0].querySelector('md-icon') ||\n            element[0].querySelector('.md-icon');\n          if (hasLeftIcon && iconNotRemoved) {\n            element.addClass('md-icon-left');\n          }\n          if (hasRightIcon && iconNotRemoved) {\n            element.addClass('md-icon-right');\n          }\n        });\n      }\n    };\n  }\n\n  function ContainerCtrl($scope, $element, $attrs, $animate) {\n    var self = this;\n\n    $element.addClass('md-auto-horizontal-margin');\n\n    self.isErrorGetter = $attrs.mdIsError && $parse($attrs.mdIsError);\n\n    self.delegateClick = function() {\n      self.input.focus();\n    };\n    self.element = $element;\n    self.setFocused = function(isFocused) {\n      $element.toggleClass('md-input-focused', !!isFocused);\n    };\n    self.setHasValue = function(hasValue) {\n      $element.toggleClass('md-input-has-value', !!hasValue);\n    };\n    self.setHasPlaceholder = function(hasPlaceholder) {\n      $element.toggleClass('md-input-has-placeholder', !!hasPlaceholder);\n    };\n    self.setInvalid = function(isInvalid) {\n      if (isInvalid) {\n        $animate.addClass($element, 'md-input-invalid');\n      } else {\n        $animate.removeClass($element, 'md-input-invalid');\n      }\n    };\n    $scope.$watch(function() {\n      return self.label && self.input;\n    }, function(hasLabelAndInput) {\n      if (hasLabelAndInput && !self.label.attr('for')) {\n        self.label.attr('for', self.input.attr('id'));\n      }\n    });\n  }\n}\n\nfunction labelDirective() {\n  return {\n    restrict: 'E',\n    require: '^?mdInputContainer',\n    link: function(scope, element, attr, containerCtrl) {\n      if (!containerCtrl || attr.mdNoFloat || element.hasClass('md-container-ignore')) return;\n\n      containerCtrl.label = element;\n      scope.$on('$destroy', function() {\n        containerCtrl.label = null;\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name mdInput\n * @restrict E\n * @module material.components.input\n *\n * @description\n * You can use any `<input>` or `<textarea>` element as a child of an `<md-input-container>`. This\n * allows you to build complex forms for data entry.\n *\n * When the input is required and uses a floating label, then the label will automatically contain\n * an asterisk (`*`).<br/>\n * This behavior can be disabled by using the `md-no-asterisk` attribute.\n *\n * @param {number=} md-maxlength The maximum number of characters allowed in this input. If this is\n *   specified, a character counter will be shown underneath the input.<br/><br/>\n *   The purpose of **`md-maxlength`** is exactly to show the max length counter text. If you don't\n *   want the counter text and only need \"plain\" validation, you can use the \"simple\" `ng-maxlength`\n *   or maxlength attributes.<br/><br/>\n * @param {boolean=} ng-trim If set to false, the input text will be not trimmed automatically.\n *     Defaults to true.\n * @param {string=} aria-label Aria-label is required when no label is present.  A warning message\n *   will be logged in the console if not present.\n * @param {string=} placeholder An alternative approach to using aria-label when the label is not\n *   PRESENT. The placeholder text is copied to the aria-label attribute.\n * @param {boolean=} md-no-autogrow When present, textareas will not grow automatically.\n * @param {boolean=} md-no-asterisk When present, an asterisk will not be appended to the inputs\n *   floating label.\n * @param {boolean=} md-no-resize Disables the textarea resize handle.\n * @param {number=} max-rows The maximum amount of rows for a textarea.\n * @param {boolean=} md-detect-hidden When present, textareas will be sized properly when they are\n *   revealed after being hidden. This is off by default for performance reasons because it\n *   guarantees a reflow every digest cycle.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-input-container>\n *   <label>Color</label>\n *   <input type=\"text\" ng-model=\"color\" required md-maxlength=\"10\">\n * </md-input-container>\n * </hljs>\n *\n * <h3>With Errors</h3>\n *\n * `md-input-container` also supports errors using the standard `ng-messages` directives and\n * animates the messages when they become visible using from the `ngEnter`/`ngLeave` events or\n * the `ngShow`/`ngHide` events.\n *\n * By default, the messages will be hidden until the input is in an error state. This is based off\n * of the `md-is-error` expression of the `md-input-container`. This gives the user a chance to\n * fill out the form before the errors become visible.\n *\n * <hljs lang=\"html\">\n * <form name=\"colorForm\">\n *   <md-input-container>\n *     <label>Favorite Color</label>\n *     <input name=\"favoriteColor\" ng-model=\"favoriteColor\" required>\n *     <div ng-messages=\"colorForm.favoriteColor.$error\">\n *       <div ng-message=\"required\">This is required!</div>\n *     </div>\n *   </md-input-container>\n * </form>\n * </hljs>\n *\n * We automatically disable this auto-hiding functionality if you provide any of the following\n * visibility directives on the `ng-messages` container:\n *\n *  - `ng-if`\n *  - `ng-show`/`ng-hide`\n *  - `ng-switch-when`/`ng-switch-default`\n *\n * You can also disable this functionality manually by adding the `md-auto-hide=\"false\"` expression\n * to the `ng-messages` container. This may be helpful if you always want to see the error messages\n * or if you are building your own visibility directive.\n *\n * _<b>Note:</b> The `md-auto-hide` attribute is a static string that is  only checked upon\n * initialization of the `ng-messages` directive to see if it equals the string `false`._\n *\n * <hljs lang=\"html\">\n * <form name=\"userForm\">\n *   <md-input-container>\n *     <label>Last Name</label>\n *     <input name=\"lastName\" ng-model=\"lastName\" required md-maxlength=\"10\" minlength=\"4\">\n *     <div ng-messages=\"userForm.lastName.$error\" ng-show=\"userForm.lastName.$dirty\">\n *       <div ng-message=\"required\">This is required!</div>\n *       <div ng-message=\"md-maxlength\">That's too long!</div>\n *       <div ng-message=\"minlength\">That's too short!</div>\n *     </div>\n *   </md-input-container>\n *   <md-input-container>\n *     <label>Biography</label>\n *     <textarea name=\"bio\" ng-model=\"biography\" required md-maxlength=\"150\"></textarea>\n *     <div ng-messages=\"userForm.bio.$error\" ng-show=\"userForm.bio.$dirty\">\n *       <div ng-message=\"required\">This is required!</div>\n *       <div ng-message=\"md-maxlength\">That's too long!</div>\n *     </div>\n *   </md-input-container>\n *   <md-input-container>\n *     <input aria-label='title' ng-model='title'>\n *   </md-input-container>\n *   <md-input-container>\n *     <input placeholder='title' ng-model='title'>\n *   </md-input-container>\n * </form>\n * </hljs>\n *\n * <h3>Notes</h3>\n *\n * - Requires [ngMessages](https://docs.angularjs.org/api/ngMessages).\n * - Behaves like the [AngularJS input directive](https://docs.angularjs.org/api/ng/directive/input).\n *\n * The `md-input` and `md-input-container` directives use very specific positioning to achieve the\n * error animation effects. Therefore, it is *not* advised to use the Layout system inside of the\n * `<md-input-container>` tags. Instead, use relative or absolute positioning.\n *\n *\n * <h3>Textarea directive</h3>\n * The `textarea` element within a `md-input-container` has the following specific behavior:\n * - By default the `textarea` grows as the user types. This can be disabled via the `md-no-autogrow`\n * attribute.\n * - If a `textarea` has the `rows` attribute, it will treat the `rows` as the minimum height and will\n * continue growing as the user types. For example a textarea with `rows=\"3\"` will be 3 lines of text\n * high initially. If no rows are specified, the directive defaults to 1.\n * - The textarea's height gets set on initialization, as well as while the user is typing. In certain situations\n * (e.g. while animating) the directive might have been initialized, before the element got it's final height. In\n * those cases, you can trigger a resize manually by broadcasting a `md-resize-textarea` event on the scope.\n * - If you want a `textarea` to stop growing at a certain point, you can specify the `max-rows` attribute.\n * - The textarea's bottom border acts as a handle which users can drag, in order to resize the element vertically.\n * Once the user has resized a `textarea`, the autogrowing functionality becomes disabled. If you don't want a\n * `textarea` to be resizeable by the user, you can add the `md-no-resize` attribute.\n */\n\nfunction inputTextareaDirective($mdUtil, $window, $mdAria, $timeout, $mdGesture) {\n  return {\n    restrict: 'E',\n    require: ['^?mdInputContainer', '?ngModel', '?^form'],\n    link: postLink\n  };\n\n  function postLink(scope, element, attr, ctrls) {\n\n    var containerCtrl = ctrls[0];\n    var hasNgModel = !!ctrls[1];\n    var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();\n    var parentForm = ctrls[2];\n    var isReadonly = angular.isDefined(attr.readonly);\n    var mdNoAsterisk = $mdUtil.parseAttributeBoolean(attr.mdNoAsterisk);\n    var tagName = element[0].tagName.toLowerCase();\n\n\n    if (!containerCtrl) return;\n    if (attr.type === 'hidden') {\n      element.attr('aria-hidden', 'true');\n      return;\n    } else if (containerCtrl.input) {\n      if (containerCtrl.input[0].contains(element[0])) {\n        return;\n      } else {\n        throw new Error(\"<md-input-container> can only have *one* <input>, <textarea> or <md-select> child element!\");\n      }\n    }\n    containerCtrl.input = element;\n\n    setupAttributeWatchers();\n\n    // Add an error spacer div after our input to provide space for the char counter and any ng-messages\n    var errorsSpacer = angular.element('<div class=\"md-errors-spacer\">');\n    element.after(errorsSpacer);\n\n    var placeholderText = angular.isString(attr.placeholder) ? attr.placeholder.trim() : '';\n    if (!containerCtrl.label && !placeholderText.length) {\n      $mdAria.expect(element, 'aria-label');\n    }\n\n    element.addClass('md-input');\n    if (!element.attr('id')) {\n      element.attr('id', 'input_' + $mdUtil.nextUid());\n    }\n\n    // This works around a Webkit issue where number inputs, placed in a flexbox, that have\n    // a `min` and `max` will collapse to about 1/3 of their proper width. Please check #7349\n    // for more info. Also note that we don't override the `step` if the user has specified it,\n    // in order to prevent some unexpected behaviour.\n    if (tagName === 'input' && attr.type === 'number' && attr.min && attr.max && !attr.step) {\n      element.attr('step', 'any');\n    } else if (tagName === 'textarea') {\n      setupTextarea();\n    }\n\n    // If the input doesn't have an ngModel, it may have a static value. For that case,\n    // we have to do one initial check to determine if the container should be in the\n    // \"has a value\" state.\n    if (!hasNgModel) {\n      inputCheckValue();\n    }\n\n    var isErrorGetter = containerCtrl.isErrorGetter || function() {\n      return ngModelCtrl.$invalid && (ngModelCtrl.$touched || (parentForm && parentForm.$submitted));\n    };\n\n    scope.$watch(isErrorGetter, containerCtrl.setInvalid);\n\n    // When the developer uses the ngValue directive for the input, we have to observe the attribute, because\n    // AngularJS's ngValue directive is just setting the `value` attribute.\n    if (attr.ngValue) {\n      attr.$observe('value', inputCheckValue);\n    }\n\n    ngModelCtrl.$parsers.push(ngModelPipelineCheckValue);\n    ngModelCtrl.$formatters.push(ngModelPipelineCheckValue);\n\n    element.on('input', inputCheckValue);\n\n    if (!isReadonly) {\n      element\n        .on('focus', function(ev) {\n          $mdUtil.nextTick(function() {\n            containerCtrl.setFocused(true);\n          });\n        })\n        .on('blur', function(ev) {\n          $mdUtil.nextTick(function() {\n            containerCtrl.setFocused(false);\n            inputCheckValue();\n          });\n        });\n    }\n\n    scope.$on('$destroy', function() {\n      containerCtrl.setFocused(false);\n      containerCtrl.setHasValue(false);\n      containerCtrl.input = null;\n    });\n\n    /** Gets run through ngModel's pipeline and set the `has-value` class on the container. */\n    function ngModelPipelineCheckValue(arg) {\n      containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));\n      return arg;\n    }\n\n    function setupAttributeWatchers() {\n      if (containerCtrl.label) {\n        attr.$observe('required', function (value) {\n          // We don't need to parse the required value, it's always a boolean because of AngularJS'\n          // required directive.\n          if (containerCtrl.label) {\n            containerCtrl.label.toggleClass('md-required', value && !mdNoAsterisk);\n          }\n        });\n      }\n    }\n\n    function inputCheckValue() {\n      // An input's value counts if its length > 0,\n      // or if the input's validity state says it has bad input (eg string in a number input)\n      containerCtrl.setHasValue(element.val().length > 0 || (element[0].validity || {}).badInput);\n    }\n\n    function setupTextarea() {\n      var isAutogrowing = !attr.hasOwnProperty('mdNoAutogrow');\n\n      attachResizeHandle();\n\n      if (!isAutogrowing) return;\n\n      // Can't check if height was or not explicity set,\n      // so rows attribute will take precedence if present\n      var minRows = attr.hasOwnProperty('rows') ? parseInt(attr.rows) : NaN;\n      var maxRows = attr.hasOwnProperty('maxRows') ? parseInt(attr.maxRows) : NaN;\n      var scopeResizeListener = scope.$on('md-resize-textarea', growTextarea);\n      var lineHeight = null;\n      var node = element[0];\n\n      // This timeout is necessary, because the browser needs a little bit\n      // of time to calculate the `clientHeight` and `scrollHeight`.\n      $timeout(function() {\n        $mdUtil.nextTick(growTextarea);\n      }, 10, false);\n\n      // We could leverage ngModel's $parsers here, however it\n      // isn't reliable, because AngularJS trims the input by default,\n      // which means that growTextarea won't fire when newlines and\n      // spaces are added.\n      element.on('input', growTextarea);\n\n      // We should still use the $formatters, because they fire when\n      // the value was changed from outside the textarea.\n      if (hasNgModel) {\n        ngModelCtrl.$formatters.push(formattersListener);\n      }\n\n      if (!minRows) {\n        element.attr('rows', 1);\n      }\n\n      angular.element($window).on('resize', growTextarea);\n      scope.$on('$destroy', disableAutogrow);\n\n      function growTextarea() {\n        // temporarily disables element's flex so its height 'runs free'\n        element\n          .attr('rows', 1)\n          .css('height', 'auto')\n          .addClass('md-no-flex');\n\n        var height = getHeight();\n\n        if (!lineHeight) {\n          // offsetHeight includes padding which can throw off our value\n          var originalPadding = element[0].style.padding || '';\n          lineHeight = element.css('padding', 0).prop('offsetHeight');\n          element[0].style.padding = originalPadding;\n        }\n\n        if (minRows && lineHeight) {\n          height = Math.max(height, lineHeight * minRows);\n        }\n\n        if (maxRows && lineHeight) {\n          var maxHeight = lineHeight * maxRows;\n\n          if (maxHeight < height) {\n            element.attr('md-no-autogrow', '');\n            height = maxHeight;\n          } else {\n            element.removeAttr('md-no-autogrow');\n          }\n        }\n\n        if (lineHeight) {\n          element.attr('rows', Math.round(height / lineHeight));\n        }\n\n        element\n          .css('height', height + 'px')\n          .removeClass('md-no-flex');\n      }\n\n      function getHeight() {\n        var offsetHeight = node.offsetHeight;\n        var line = node.scrollHeight - offsetHeight;\n        return offsetHeight + Math.max(line, 0);\n      }\n\n      function formattersListener(value) {\n        $mdUtil.nextTick(growTextarea);\n        return value;\n      }\n\n      function disableAutogrow() {\n        if (!isAutogrowing) return;\n\n        isAutogrowing = false;\n        angular.element($window).off('resize', growTextarea);\n        scopeResizeListener && scopeResizeListener();\n        element\n          .attr('md-no-autogrow', '')\n          .off('input', growTextarea);\n\n        if (hasNgModel) {\n          var listenerIndex = ngModelCtrl.$formatters.indexOf(formattersListener);\n\n          if (listenerIndex > -1) {\n            ngModelCtrl.$formatters.splice(listenerIndex, 1);\n          }\n        }\n      }\n\n      function attachResizeHandle() {\n        if (attr.hasOwnProperty('mdNoResize')) return;\n\n        var handle = angular.element('<div class=\"md-resize-handle\"></div>');\n        var isDragging = false;\n        var dragStart = null;\n        var startHeight = 0;\n        var container = containerCtrl.element;\n        var dragGestureHandler = $mdGesture.register(handle, 'drag', { horizontal: false });\n\n\n        element.wrap('<div class=\"md-resize-wrapper\">').after(handle);\n        handle.on('mousedown', onMouseDown);\n\n        container\n          .on('$md.dragstart', onDragStart)\n          .on('$md.drag', onDrag)\n          .on('$md.dragend', onDragEnd);\n\n        scope.$on('$destroy', function() {\n          handle\n            .off('mousedown', onMouseDown)\n            .remove();\n\n          container\n            .off('$md.dragstart', onDragStart)\n            .off('$md.drag', onDrag)\n            .off('$md.dragend', onDragEnd);\n\n          dragGestureHandler();\n          handle = null;\n          container = null;\n          dragGestureHandler = null;\n        });\n\n        function onMouseDown(ev) {\n          ev.preventDefault();\n          isDragging = true;\n          dragStart = ev.clientY;\n          startHeight = parseFloat(element.css('height')) || element.prop('offsetHeight');\n        }\n\n        function onDragStart(ev) {\n          if (!isDragging) return;\n          ev.preventDefault();\n          disableAutogrow();\n          container.addClass('md-input-resized');\n        }\n\n        function onDrag(ev) {\n          if (!isDragging) return;\n\n          element.css('height', (startHeight + ev.pointer.distanceY) + 'px');\n        }\n\n        function onDragEnd(ev) {\n          if (!isDragging) return;\n          isDragging = false;\n          container.removeClass('md-input-resized');\n        }\n      }\n\n      // Attach a watcher to detect when the textarea gets shown.\n      if (attr.hasOwnProperty('mdDetectHidden')) {\n\n        var handleHiddenChange = function() {\n          var wasHidden = false;\n\n          return function() {\n            var isHidden = node.offsetHeight === 0;\n\n            if (isHidden === false && wasHidden === true) {\n              growTextarea();\n            }\n\n            wasHidden = isHidden;\n          };\n        }();\n\n        // Check every digest cycle whether the visibility of the textarea has changed.\n        // Queue up to run after the digest cycle is complete.\n        scope.$watch(function() {\n          $mdUtil.nextTick(handleHiddenChange, false);\n          return true;\n        });\n      }\n    }\n  }\n}\n\nfunction mdMaxlengthDirective($animate, $mdUtil) {\n  return {\n    restrict: 'A',\n    require: ['ngModel', '^mdInputContainer'],\n    link: postLink\n  };\n\n  function postLink(scope, element, attr, ctrls) {\n    var maxlength = parseInt(attr.mdMaxlength);\n    if (isNaN(maxlength)) maxlength = -1;\n    var ngModelCtrl = ctrls[0];\n    var containerCtrl = ctrls[1];\n    var charCountEl, errorsSpacer;\n    var ngTrim = angular.isDefined(attr.ngTrim) ? $mdUtil.parseAttributeBoolean(attr.ngTrim) : true;\n    var isPasswordInput = attr.type === 'password';\n\n    scope.$watch(attr.mdMaxlength, function(value) {\n      maxlength = value;\n    });\n\n    ngModelCtrl.$validators['md-maxlength'] = function(modelValue, viewValue) {\n      if (!angular.isNumber(maxlength) || maxlength < 0) {\n        return true;\n      }\n\n      // We always update the char count, when the modelValue has changed.\n      // Using the $validators for triggering the update works very well.\n      renderCharCount();\n\n      var elementVal = element.val() || viewValue;\n      if (elementVal === undefined || elementVal === null) {\n        elementVal = '';\n      }\n      elementVal = ngTrim && !isPasswordInput && angular.isString(elementVal) ? elementVal.trim() : elementVal;\n      // Force the value into a string since it may be a number,\n      // which does not have a length property.\n      return String(elementVal).length <= maxlength;\n    };\n\n    /**\n     * Override the default NgModelController $isEmpty check to take ng-trim, password inputs,\n     * etc. into account.\n     * @param value {*} the input's value\n     * @returns {boolean} true if the input's value should be considered empty, false otherwise\n     */\n    ngModelCtrl.$isEmpty = function(value) {\n      return calculateInputValueLength(value) === 0;\n    };\n\n    // Wait until the next tick to ensure that the input has setup the errors spacer where we will\n    // append our counter\n    $mdUtil.nextTick(function() {\n      errorsSpacer = angular.element(containerCtrl.element[0].querySelector('.md-errors-spacer'));\n      charCountEl = angular.element('<div class=\"md-char-counter\">');\n\n      // Append our character counter inside the errors spacer\n      errorsSpacer.append(charCountEl);\n\n      attr.$observe('ngTrim', function (value) {\n        ngTrim = angular.isDefined(value) ? $mdUtil.parseAttributeBoolean(value) : true;\n      });\n\n      scope.$watch(attr.mdMaxlength, function(value) {\n        if (angular.isNumber(value) && value > 0) {\n          if (!charCountEl.parent().length) {\n            $animate.enter(charCountEl, errorsSpacer);\n          }\n          renderCharCount();\n        } else {\n          $animate.leave(charCountEl);\n        }\n      });\n    });\n\n    /**\n     * Calculate the input value's length after coercing it to a string\n     * and trimming it if appropriate.\n     * @param value {*} the input's value\n     * @returns {number} calculated length of the input's value\n     */\n    function calculateInputValueLength(value) {\n      value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value;\n      if (value === undefined || value === null) {\n        value = '';\n      }\n      return String(value).length;\n    }\n\n    function renderCharCount() {\n      // If we have not been initialized or appended to the body yet; do not render.\n      if (!charCountEl || !charCountEl.parent()) {\n        return;\n      }\n      // Force the value into a string since it may be a number,\n      // which does not have a length property.\n      charCountEl.text(calculateInputValueLength(element.val()) + ' / ' + maxlength);\n    }\n  }\n}\n\nfunction placeholderDirective($compile) {\n  return {\n    restrict: 'A',\n    require: '^^?mdInputContainer',\n    priority: 200,\n    link: {\n      // Note that we need to do this in the pre-link, as opposed to the post link, if we want to\n      // support data bindings in the placeholder. This is necessary, because we have a case where\n      // we transfer the placeholder value to the `<label>` and we remove it from the original `<input>`.\n      // If we did this in the post-link, AngularJS would have set up the observers already and would be\n      // re-adding the attribute, even though we removed it from the element.\n      pre: preLink\n    }\n  };\n\n  function preLink(scope, element, attr, inputContainer) {\n    // If there is no input container, just return\n    if (!inputContainer) return;\n\n    var label = inputContainer.element.find('label');\n    var noFloat = inputContainer.element.attr('md-no-float');\n\n    // If we have a label, or they specify the md-no-float attribute, just return\n    if ((label && label.length) || noFloat === '' || scope.$eval(noFloat)) {\n      // Add a placeholder class so we can target it in the CSS\n      inputContainer.setHasPlaceholder(true);\n      return;\n    }\n\n    // md-select handles placeholders on it's own\n    if (element[0].nodeName !== 'MD-SELECT') {\n      // Move the placeholder expression to the label\n      var newLabel = angular.element(\n        '<label ng-click=\"delegateClick()\" tabindex=\"-1\" aria-hidden=\"true\">' + attr.placeholder +\n        '</label>');\n\n      // Note that we unset it via `attr`, in order to get AngularJS\n      // to remove any observers that it might have set up. Otherwise\n      // the attribute will be added on the next digest.\n      attr.$set('placeholder', null);\n\n      // We need to compile the label manually in case it has any bindings.\n      // A gotcha here is that we first add the element to the DOM and we compile\n      // it later. This is necessary, because if we compile the element beforehand,\n      // it won't be able to find the `mdInputContainer` controller.\n      inputContainer.element\n        .addClass('md-icon-float')\n        .prepend(newLabel);\n\n      $compile(newLabel)(scope);\n    }\n  }\n}\n\n/**\n * @ngdoc directive\n * @name mdSelectOnFocus\n * @module material.components.input\n *\n * @restrict A\n *\n * @description\n * The `md-select-on-focus` directive allows you to automatically select the element's input text on focus.\n *\n * <h3>Notes</h3>\n * - The use of `md-select-on-focus` is restricted to `<input>` and `<textarea>` elements.\n *\n * @usage\n * <h3>Using with an Input</h3>\n * <hljs lang=\"html\">\n *\n * <md-input-container>\n *   <label>Auto Select</label>\n *   <input type=\"text\" md-select-on-focus>\n * </md-input-container>\n * </hljs>\n *\n * <h3>Using with a Textarea</h3>\n * <hljs lang=\"html\">\n *\n * <md-input-container>\n *   <label>Auto Select</label>\n *   <textarea md-select-on-focus>This text will be selected on focus.</textarea>\n * </md-input-container>\n *\n * </hljs>\n */\nfunction mdSelectOnFocusDirective($document, $timeout) {\n\n  return {\n    restrict: 'A',\n    link: postLink\n  };\n\n  function postLink(scope, element, attr) {\n    if (element[0].nodeName !== 'INPUT' && element[0].nodeName !== \"TEXTAREA\") return;\n\n    var preventMouseUp = false;\n\n    element\n      .on('focus', onFocus)\n      .on('mouseup', onMouseUp);\n\n    scope.$on('$destroy', function() {\n      element\n        .off('focus', onFocus)\n        .off('mouseup', onMouseUp);\n    });\n\n    function onFocus() {\n      preventMouseUp = true;\n\n      $timeout(function() {\n\n        // Use HTMLInputElement#select to fix firefox select issues.\n        // The debounce is here for Edge's sake, otherwise the selection doesn't work.\n        // Since focus may already have been lost on the input (and because `select()`\n        // will re-focus), make sure the element is still active before applying.\n        if ($document[0].activeElement === element[0]) {\n          element[0].select();\n        }\n\n        // This should be reset from inside the `focus`, because the event might\n        // have originated from something different than a click, e.g. a keyboard event.\n        preventMouseUp = false;\n      }, 1, false);\n    }\n\n    // Prevents the default action of the first `mouseup` after a focus.\n    // This is necessary, because browsers fire a `mouseup` right after the element\n    // has been focused. In some browsers (Firefox in particular) this can clear the\n    // selection. There are examples of the problem in issue #7487.\n    function onMouseUp(event) {\n      if (preventMouseUp) {\n        event.preventDefault();\n      }\n    }\n  }\n}\n\nvar visibilityDirectives = ['ngIf', 'ngShow', 'ngHide', 'ngSwitchWhen', 'ngSwitchDefault'];\nfunction ngMessagesDirective() {\n  return {\n    restrict: 'EA',\n    link: postLink,\n\n    // This is optional because we don't want target *all* ngMessage instances, just those inside of\n    // mdInputContainer.\n    require: '^^?mdInputContainer'\n  };\n\n  function postLink(scope, element, attrs, inputContainer) {\n    // If we are not a child of an input container, don't do anything\n    if (!inputContainer) return;\n\n    // Add our animation class\n    element.toggleClass('md-input-messages-animation', true);\n\n    // Add our md-auto-hide class to automatically hide/show messages when container is invalid\n    element.toggleClass('md-auto-hide', true);\n\n    // If we see some known visibility directives, remove the md-auto-hide class\n    if (attrs.mdAutoHide == 'false' || hasVisibiltyDirective(attrs)) {\n      element.toggleClass('md-auto-hide', false);\n    }\n  }\n\n  function hasVisibiltyDirective(attrs) {\n    return visibilityDirectives.some(function(attr) {\n      return attrs[attr];\n    });\n  }\n}\n\nfunction ngMessageDirective($mdUtil) {\n  return {\n    restrict: 'EA',\n    compile: compile,\n    priority: 100\n  };\n\n  function compile(tElement) {\n    if (!isInsideInputContainer(tElement)) {\n\n      // When the current element is inside of a document fragment, then we need to check for an input-container\n      // in the postLink, because the element will be later added to the DOM and is currently just in a temporary\n      // fragment, which causes the input-container check to fail.\n      if (isInsideFragment()) {\n        return function (scope, element) {\n          if (isInsideInputContainer(element)) {\n            // Inside of the postLink function, a ngMessage directive will be a comment element, because it's\n            // currently hidden. To access the shown element, we need to use the element from the compile function.\n            initMessageElement(tElement);\n          }\n        };\n      }\n    } else {\n      initMessageElement(tElement);\n    }\n\n    function isInsideFragment() {\n      var nextNode = tElement[0];\n      while (nextNode = nextNode.parentNode) {\n        if (nextNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n          return true;\n        }\n      }\n      return false;\n    }\n\n    function isInsideInputContainer(element) {\n      return !!$mdUtil.getClosest(element, \"md-input-container\");\n    }\n\n    function initMessageElement(element) {\n      // Add our animation class\n      element.toggleClass('md-input-message-animation', true);\n    }\n  }\n}\n\nvar $$AnimateRunner, $animateCss, $mdUtil;\n\nfunction mdInputInvalidMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil) {\n  saveSharedServices($$AnimateRunner, $animateCss, $mdUtil);\n\n  return {\n    addClass: function(element, className, done) {\n      showInputMessages(element, done);\n    }\n\n    // NOTE: We do not need the removeClass method, because the message ng-leave animation will fire\n  };\n}\n\nfunction ngMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil) {\n  saveSharedServices($$AnimateRunner, $animateCss, $mdUtil);\n\n  return {\n    enter: function(element, done) {\n      showInputMessages(element, done);\n    },\n\n    leave: function(element, done) {\n      hideInputMessages(element, done);\n    },\n\n    addClass: function(element, className, done) {\n      if (className == \"ng-hide\") {\n        hideInputMessages(element, done);\n      } else {\n        done();\n      }\n    },\n\n    removeClass: function(element, className, done) {\n      if (className == \"ng-hide\") {\n        showInputMessages(element, done);\n      } else {\n        done();\n      }\n    }\n  };\n}\n\nfunction ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil, $log) {\n  saveSharedServices($$AnimateRunner, $animateCss, $mdUtil, $log);\n\n  return {\n    enter: function(element, done) {\n      var animator = showMessage(element);\n\n      animator.start().done(done);\n    },\n\n    leave: function(element, done) {\n      var animator = hideMessage(element);\n\n      animator.start().done(done);\n    }\n  };\n}\n\nfunction showInputMessages(element, done) {\n  var animators = [], animator;\n  var messages = getMessagesElement(element);\n  var children = messages.children();\n\n  if (messages.length == 0 || children.length == 0) {\n    done();\n    return;\n  }\n\n  angular.forEach(children, function(child) {\n    animator = showMessage(angular.element(child));\n\n    animators.push(animator.start());\n  });\n\n  $$AnimateRunner.all(animators, done);\n}\n\nfunction hideInputMessages(element, done) {\n  var animators = [], animator;\n  var messages = getMessagesElement(element);\n  var children = messages.children();\n\n  if (messages.length == 0 || children.length == 0) {\n    done();\n    return;\n  }\n\n  angular.forEach(children, function(child) {\n    animator = hideMessage(angular.element(child));\n\n    animators.push(animator.start());\n  });\n\n  $$AnimateRunner.all(animators, done);\n}\n\nfunction showMessage(element) {\n  var height = parseInt(window.getComputedStyle(element[0]).height);\n  var topMargin = parseInt(window.getComputedStyle(element[0]).marginTop);\n\n  var messages = getMessagesElement(element);\n  var container = getInputElement(element);\n\n  // Check to see if the message is already visible so we can skip\n  var alreadyVisible = (topMargin > -height);\n\n  // If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip\n  if (alreadyVisible || (messages.hasClass('md-auto-hide') && !container.hasClass('md-input-invalid'))) {\n    return $animateCss(element, {});\n  }\n\n  return $animateCss(element, {\n    event: 'enter',\n    structural: true,\n    from: {\"opacity\": 0, \"margin-top\": -height + \"px\"},\n    to: {\"opacity\": 1, \"margin-top\": \"0\"},\n    duration: 0.3\n  });\n}\n\nfunction hideMessage(element) {\n  var height = element[0].offsetHeight;\n  var styles = window.getComputedStyle(element[0]);\n\n  // If we are already hidden, just return an empty animation\n  if (parseInt(styles.opacity) === 0) {\n    return $animateCss(element, {});\n  }\n\n  // Otherwise, animate\n  return $animateCss(element, {\n    event: 'leave',\n    structural: true,\n    from: {\"opacity\": 1, \"margin-top\": 0},\n    to: {\"opacity\": 0, \"margin-top\": -height + \"px\"},\n    duration: 0.3\n  });\n}\n\nfunction getInputElement(element) {\n  var inputContainer = element.controller('mdInputContainer');\n\n  return inputContainer.element;\n}\n\nfunction getMessagesElement(element) {\n  // If we ARE the messages element, just return ourself\n  if (element.hasClass('md-input-messages-animation')) {\n    return element;\n  }\n\n  // If we are a ng-message element, we need to traverse up the DOM tree\n  if (element.hasClass('md-input-message-animation')) {\n    return angular.element($mdUtil.getClosest(element, function(node) {\n      return node.classList.contains('md-input-messages-animation');\n    }));\n  }\n\n  // Otherwise, we can traverse down\n  return angular.element(element[0].querySelector('.md-input-messages-animation'));\n}\n\nfunction saveSharedServices(_$$AnimateRunner_, _$animateCss_, _$mdUtil_) {\n  $$AnimateRunner = _$$AnimateRunner_;\n  $animateCss = _$animateCss_;\n  $mdUtil = _$mdUtil_;\n}\n"
  },
  {
    "path": "src/components/input/input.scss",
    "content": "md-input-container {\n  @include pie-clearfix();\n  display: inline-block;\n  position: relative;\n  padding: $input-container-padding;\n  margin: $input-container-vertical-margin $input-container-horizontal-margin;\n  vertical-align: middle;\n\n  &.md-block {\n    display: block;\n  }\n\n  // Setup a spacer that is always there as a placeholder for any messages so we don't change\n  // height with only 1 message\n  .md-errors-spacer {\n    @include rtl(float, right, left);\n    min-height: $input-error-height;\n\n    // Ensure the element always takes up space, even if empty\n    min-width: 1px;\n  }\n\n  > md-icon {\n    position: absolute;\n    top: $icon-top-offset;\n    @include rtl(left, 2px, auto);\n    @include rtl(right, auto, 2px);\n  }\n\n  textarea,\n  input[type=\"text\"],\n  input[type=\"password\"],\n  input[type=\"datetime\"],\n  input[type=\"datetime-local\"],\n  input[type=\"date\"],\n  input[type=\"month\"],\n  input[type=\"time\"],\n  input[type=\"week\"],\n  input[type=\"number\"],\n  input[type=\"email\"],\n  input[type=\"url\"],\n  input[type=\"search\"],\n  input[type=\"tel\"],\n  input[type=\"color\"] {\n    /* remove default appearance from all input/textarea */\n    -moz-appearance: none;\n    -webkit-appearance: none;\n  }\n  input[type=\"date\"],\n  input[type=\"datetime-local\"],\n  input[type=\"month\"],\n  input[type=\"time\"],\n  input[type=\"week\"] {\n    min-height: $input-line-height + $input-padding-top * 2;\n  }\n  textarea {\n    resize: none;\n    overflow: hidden;\n\n    &.md-input {\n      min-height: $input-line-height + $input-padding-top * 2;\n      -ms-flex-preferred-size: auto; // IE fix\n    }\n\n    // The height usually gets set to 1 line by `.md-input`.\n    &[md-no-autogrow] {\n      height: auto;\n      overflow: auto;\n    }\n  }\n\n  label:not(.md-container-ignore) {\n    position: absolute;\n    bottom: 100%;\n    @include rtl(left, 0, auto);\n    @include rtl(right, auto, 0);\n\n    &.md-required:after {\n      content: ' *';\n      font-size: 13px;\n      vertical-align: top;\n    }\n  }\n\n  label:not(.md-no-float):not(.md-container-ignore),\n  .md-placeholder {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    width: 100%;\n    order: 1;\n    pointer-events: none;\n    -webkit-font-smoothing: antialiased;\n    @include rtl(padding-left, $input-container-padding, 0);\n    @include rtl(padding-right, 0, $input-container-padding);\n    z-index: 1;\n    transform: translate3d(0, $input-label-default-offset + 4, 0) scale($input-label-default-scale);\n    transition: transform $swift-ease-out-duration $swift-ease-out-timing-function;\n\n    // The max-width is necessary, because in some browsers, using this together with\n    // a calc might cause it to overflow the parent. See #7403\n    max-width: 100%;\n\n    @include rtl(transform-origin, left top, right top);\n  }\n  &.md-input-has-value {\n    label:not(.md-no-float):not(.md-container-ignore),\n    .md-placeholder {\n      @include rtl(padding-left, $input-container-padding + 1px, 0);\n      @include rtl(padding-right, 0, $input-container-padding + 1px);\n    }\n  }\n  .md-placeholder {\n    position: absolute;\n    top: 0;\n    opacity: 0;\n    transition-property: opacity, transform;\n    transform: translate3d(0, $input-placeholder-offset + $baseline-grid * 0.75, 0);\n  }\n  &.md-input-focused .md-placeholder {\n    opacity: 1;\n    transform: translate3d(0, $input-placeholder-offset, 0);\n  }\n  // Placeholder should immediately disappear when the user starts typing\n  &.md-input-has-value .md-placeholder {\n    transition: none;\n    opacity: 0;\n  }\n\n  &:not( .md-input-has-value ):not( .md-input-has-placeholder ) input:not( :focus ) {\n    color: transparent;\n  }\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-ampm-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-day-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-hour-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-millisecond-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-minute-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-month-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-second-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-week-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-year-field,\n  &:not( .md-input-has-value ) input:not( :focus )::-webkit-datetime-edit-text {\n    color: transparent;\n  }\n\n  /*\n   * The .md-input class is added to the input/textarea\n   */\n  .md-input {\n    order: 2;\n    display: block;\n    margin-top: 0;\n\n    background: none;\n    padding-top: $input-padding-top;\n    padding-bottom: $input-padding-bottom;\n    @include rtl(padding-left, 0, $input-container-padding);\n    @include rtl(padding-right, $input-container-padding, 0);\n    border-width: 0 0 $input-border-width-default 0;\n    line-height: $input-line-height;\n    height: $input-line-height + $input-padding-top * 2;\n    -ms-flex-preferred-size: $input-line-height; //IE fix\n    border-radius: 0;\n    border-style: solid; // Firefox fix\n    transition: border-color $swift-ease-out-duration $swift-ease-out-timing-function;\n\n    // Fix number inputs in Firefox to be full-width\n    width: 100%;\n    box-sizing: border-box;\n\n    // Hacky fix to force vertical alignment between `input` and `textarea`\n    // Input and textarea do not align by default:\n    // http://jsbin.com/buqomevage/1/edit?html,css,js,output\n    @include rtl(float, left, right);\n\n    &:focus {\n      outline: none;\n    }\n    &:invalid {\n      outline: none;\n      box-shadow: none;\n    }\n\n    &.md-no-flex {\n      flex: none !important;\n    }\n  }\n\n  .md-char-counter {\n    @include rtl(text-align, right, left);\n    @include rtl(padding-right, $input-container-padding, 0);\n    @include rtl(padding-left, 0, $input-container-padding);\n  }\n\n  //\n  // ngMessage base styles - animations moved to input.js\n  //\n  .md-input-messages-animation {\n    position: relative;\n    order: 4;\n    overflow: hidden;\n    @include rtl(clear, left, right);\n  }\n\n  .md-input-message-animation, .md-char-counter {\n    font-size: $input-error-font-size;\n    line-height: $input-error-line-height;\n    overflow: hidden;\n\n    transition: $swift-ease-in;\n\n    // Default state for messages is to be visible\n    opacity: 1;\n    margin-top: 0;\n    padding-top: $error-padding-top;\n\n    &:not(.md-char-counter) {\n      // Add some padding so that the messages don't touch the character counter\n      @include rtl(padding-right, rem(0.5), 0);\n      @include rtl(padding-left, 0, rem(0.5));\n    }\n  }\n\n  &:not(.md-input-invalid) {\n    .md-auto-hide {\n      .md-input-message-animation {\n        opacity: 0;\n        margin-top: -100px;\n      }\n    }\n  }\n\n  .md-input-message-animation {\n    // Enter animation\n    // Pre-animation state is transparent and off target\n    &.ng-enter-prepare {\n      opacity: 0;\n      margin-top: -100px;\n    }\n\n    // First keyframe of entry animation\n    &.ng-enter:not(.ng-enter-active) {\n      opacity: 0;\n      margin-top: -100px;\n    }\n  }\n\n  &.md-input-focused,\n  &.md-input-has-placeholder,\n  &.md-input-has-value {\n    label:not(.md-no-float) {\n      transform: translate3d(0, $input-label-float-offset, 0) scale($input-label-float-scale);\n      transition: transform $swift-ease-out-timing-function $swift-ease-out-duration,\n                  width $swift-ease-out-timing-function $swift-ease-out-duration;\n    }\n  }\n\n  // If we have an existing value; don't animate the transform as it happens on page load and\n  // causes erratic/unnecessary animation\n  &.md-input-has-value {\n    label {\n      transition: none;\n    }\n  }\n\n  // Use wide border in error state or in focused state\n  &.md-input-focused .md-input,\n  .md-input.ng-invalid.ng-dirty,\n  &.md-input-resized .md-input {\n    padding-bottom: 0; // Increase border width by 1px, decrease padding by 1\n    border-width: 0 0 $input-border-width-focused 0;\n  }\n\n  .md-input {\n    &[disabled],\n    [disabled] & {\n      // The negative border width offsets the dotted \"border\" so\n      // it's placed in the same place as the solid one before it.\n      background-position: bottom $input-border-width-default * -1 left 0;\n      // This background-size is coordinated with a linear-gradient set in input-theme.scss\n      // to create a dotted line under the input.\n      background-size: 4px 1px;\n      background-repeat: repeat-x;\n    }\n  }\n\n  &.md-icon-float {\n\n    transition: margin-top $swift-ease-out-duration $swift-ease-out-timing-function;\n\n    > label {\n      pointer-events: none;\n      position: absolute;\n    }\n\n    > md-icon {\n      top: $icon-top-offset;\n      @include rtl(left, 2px, auto);\n      @include rtl(right, auto, 2px);\n    }\n\n  }\n\n  &.md-icon-left,\n  &.md-icon-right {\n    > label {\n      &:not(.md-no-float):not(.md-container-ignore),\n      .md-placeholder {\n        width: calc(100% - #{$icon-offset});\n        padding: 0;\n      }\n    }\n  }\n\n  // icon offset should have higher priority as normal label\n  &.md-icon-left {\n    @include rtl(padding-left, $icon-offset, 0);\n    @include rtl(padding-right, 0, $icon-offset);\n    > label {\n      @include rtl(left, $icon-offset, auto);\n      @include rtl(right, auto, $icon-offset);\n    }\n  }\n\n  &.md-icon-right {\n    @include rtl(padding-left, 0, $icon-offset);\n    @include rtl(padding-right, $icon-offset, 0);\n\n    > md-icon:last-of-type {\n      margin: 0;\n\n      @include rtl(right, 2px, auto);\n      @include rtl(left, auto, 2px);\n    }\n  }\n\n  &.md-icon-left.md-icon-right {\n    padding-left: $icon-offset;\n    padding-right: $icon-offset;\n\n    > label {\n      &:not(.md-no-float):not(.md-container-ignore),\n      .md-placeholder {\n        width: calc(100% - (#{$icon-offset} * 2));\n      }\n    }\n  }\n}\n\n.md-resize-wrapper {\n  @include pie-clearfix();\n  position: relative;\n}\n\n.md-resize-handle {\n  position: absolute;\n  bottom: math.div($input-resize-handle-height, -2);\n  left: 0;\n  height: $input-resize-handle-height;\n  background: transparent;\n  width: 100%;\n  cursor: ns-resize;\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-input-container.md-default-theme > md-icon {\n    fill: #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/input/input.spec.js",
    "content": "describe('md-input-container directive', function() {\n  var $rootScope, $compile, $timeout, pageScope, $material;\n\n  beforeEach(module('ngAria', 'material.components.input', 'ngMessages'));\n\n  // Setup/grab our variables\n  beforeEach(inject(function($injector) {\n    $compile = $injector.get('$compile');\n    $timeout = $injector.get('$timeout');\n    $material = $injector.get('$material');\n\n    $rootScope = $injector.get('$rootScope');\n    pageScope = $rootScope.$new();\n  }));\n\n  function setup(attrs, isForm) {\n    var container;\n\n    var template =\n      '<md-input-container>' +\n      '  <label></label>' +\n      '  <input ' + (attrs || '') + '>' +\n      '</md-input-container>';\n\n    if (isForm) {\n      template = '<form>' + template + '</form>';\n    }\n\n    container = $compile(template)(pageScope);\n\n    pageScope.$apply();\n    return container;\n  }\n\n  function compile(template) {\n    var container;\n\n    container = $compile(template)(pageScope);\n\n    pageScope.$apply();\n    return container;\n  }\n\n  it('should by default show error on $touched and $invalid', function() {\n    var el = setup('ng-model=\"foo\"');\n\n    expect(el).not.toHaveClass('md-input-invalid');\n\n    var model = el.find('input').controller('ngModel');\n    model.$touched = model.$invalid = true;\n    pageScope.$apply();\n\n    expect(el).toHaveClass('md-input-invalid');\n\n    model.$touched = model.$invalid = false;\n    pageScope.$apply();\n    expect(el).not.toHaveClass('md-input-invalid');\n  });\n\n  it('should show error on $submitted and $invalid', function() {\n    var el = setup('ng-model=\"foo\"', true);\n\n    expect(el.find('md-input-container')).not.toHaveClass('md-input-invalid');\n\n    var model = el.find('input').controller('ngModel');\n    model.$invalid = true;\n\n    var form = el.controller('form');\n    form.$submitted = true;\n    pageScope.$apply();\n\n    expect(el.find('md-input-container')).toHaveClass('md-input-invalid');\n  });\n\n  it('should show error on $submitted and $invalid with nested forms', function() {\n    var template =\n      '<form>' +\n      '  <div ng-form>' +\n      '    <md-input-container>' +\n      '      <input ng-model=\"foo\">' +\n      '      <label></label>' +\n      '    </md-input-container>' +\n      '  </div>' +\n      '</form>';\n\n    var parentForm = $compile(template)(pageScope).find('div');\n    pageScope.$apply();\n\n    expect(parentForm.find('md-input-container')).not.toHaveClass('md-input-invalid');\n\n    var model = parentForm.find('input').controller('ngModel');\n    model.$invalid = true;\n\n    var form = parentForm.controller('form');\n    form.$submitted = true;\n    pageScope.$apply();\n\n    expect(parentForm.find('md-input-container')).toHaveClass('md-input-invalid');\n  });\n\n  it('should not show error on $invalid and not $submitted', function() {\n    var el = setup('ng-model=\"foo\"', true);\n\n    expect(el.find('md-input-container')).not.toHaveClass('md-input-invalid');\n\n    var model = el.find('input').controller('ngModel');\n    model.$invalid = true;\n\n    pageScope.$apply();\n\n    expect(el.find('md-input-container')).not.toHaveClass('md-input-invalid');\n  });\n\n  it('should show error with given md-is-error expression', function() {\n    var el = $compile(\n      '<md-input-container md-is-error=\"isError\">' +\n      '  <input ng-model=\"foo\">' +\n      '</md-input-container>')(pageScope);\n\n    pageScope.$apply();\n    expect(el).not.toHaveClass('md-input-invalid');\n\n    pageScope.$apply('isError = true');\n    expect(el).toHaveClass('md-input-invalid');\n\n    pageScope.$apply('isError = false');\n    expect(el).not.toHaveClass('md-input-invalid');\n  });\n\n  it('should set focus class on container', function() {\n    var el = setup();\n    expect(el).not.toHaveClass('md-input-focused');\n\n    el.find('input').triggerHandler('focus');\n\n    // Expect a slight delay (via $mdUtil.nextTick()) which fixes a tabbing issue in Safari, see\n    // https://github.com/angular/material/issues/4203 for more info.\n    expect(el).not.toHaveClass('md-input-focused');\n    $timeout.flush();\n    expect(el).toHaveClass('md-input-focused');\n\n    el.find('input').triggerHandler('blur');\n\n    // Again, expect the change to not be immediate\n    expect(el).toHaveClass('md-input-focused');\n    $timeout.flush();\n    expect(el).not.toHaveClass('md-input-focused');\n  });\n\n  it('not should set focus class on container if readonly', function() {\n    var el = setup('readonly');\n    expect(el).not.toHaveClass('md-input-focused');\n\n    el.find('input').triggerHandler('focus');\n    expect(el).not.toHaveClass('md-input-focused');\n\n    el.find('input').triggerHandler('blur');\n    expect(el).not.toHaveClass('md-input-focused');\n  });\n\n  it('should skip a hidden input', function() {\n    var container = setup('type=\"hidden\"');\n    var controller = container.controller('mdInputContainer');\n    var textInput = angular.element('<input type=\"text\">');\n\n    expect(controller.input).toBeUndefined();\n\n    container.append(textInput);\n    $compile(textInput)(pageScope);\n\n    expect(controller.input[0]).toBe(textInput[0]);\n  });\n\n\n  it('should set has-value class on container for non-ng-model input', function() {\n    var el = setup();\n    expect(el).not.toHaveClass('md-input-has-value');\n\n    el.find('input').val('123').triggerHandler('input');\n    expect(el).toHaveClass('md-input-has-value');\n\n    el.find('input').val('').triggerHandler('input');\n    expect(el).not.toHaveClass('md-input-has-value');\n  });\n\n  it('should set has-value class on container with ng-value', function() {\n    var el = setup('ng-value=\"value\"');\n\n    pageScope.$apply('value = \"My Value\"');\n\n    expect(el).toHaveClass('md-input-has-value');\n\n    pageScope.$apply('value = \"\"');\n\n    expect(el).not.toHaveClass('md-input-has-value');\n  });\n\n  it('should set has-value class on container for ng-model input', function() {\n    pageScope.value = 'test';\n    var el = setup('ng-model=\"value\"');\n    expect(el).toHaveClass('md-input-has-value');\n\n    pageScope.$apply('value = \"3\"');\n    expect(el).toHaveClass('md-input-has-value');\n\n    pageScope.$apply('value = null');\n    expect(el).not.toHaveClass('md-input-has-value');\n  });\n\n  it('should match label to given input id', function() {\n    var el = setup('id=\"foo\"');\n    expect(el.find('label').attr('for')).toBe('foo');\n    expect(el.find('input').attr('id')).toBe('foo');\n  });\n\n  it('should match label to automatic input id', function() {\n    var el = setup();\n    expect(el.find('input').attr('id')).toBeTruthy();\n    expect(el.find('label').attr('for')).toBe(el.find('input').attr('id'));\n  });\n\n  it('should set the \"step\" attribute to \"any\" if \"min\" and \"max\" are specified', function() {\n    // check #7349 for more info\n    var el = setup('type=\"number\" min=\"1\" max=\"999\"');\n    expect(el.find('input').attr('step')).toBe('any');\n  });\n\n  describe('md-no-asterisk', function() {\n\n    it('should not show asterisk on required label if disabled', function() {\n      var el = setup('md-no-asterisk required');\n      var ctrl = el.controller('mdInputContainer');\n\n      expect(ctrl.label).not.toHaveClass('md-required');\n    });\n\n    it('should not show an asterisk when attribute value is `true`', function() {\n      var el = setup('md-no-asterisk=\"true\" required');\n      var ctrl = el.controller('mdInputContainer');\n\n      expect(ctrl.label).not.toHaveClass('md-required');\n    });\n\n    it('should show an asterisk when attribute value is `false`', function() {\n      var el = setup('md-no-asterisk=\"false\" required');\n      var ctrl = el.controller('mdInputContainer');\n\n      expect(ctrl.label).toHaveClass('md-required');\n    });\n\n  });\n\n  describe('md-maxlength', function() {\n    function getCharCounter(el) {\n      return angular.element(el[0].querySelector('.md-char-counter'));\n    }\n\n    it('should error with a constant and incorrect initial value', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"2\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply('foo = \"ABCDEFGHIJ\"');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBe(true);\n      expect(getCharCounter(el).text()).toBe('10 / 2');\n    });\n\n    it('should work with a constant and correct initial value', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"5\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply('foo = \"abcde\"');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('5 / 5');\n    });\n\n    it('should error with an interpolated value and incorrect initial value', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"mymax\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n        pageScope.$apply('mymax = 8');\n        pageScope.$apply('foo = \"ABCDEFGHIJ\"');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBe(true);\n      expect(getCharCounter(el).text()).toBe('10 / 8');\n    });\n\n    it('should work with an interpolated value and correct initial value', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"mymax\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply('mymax = 5');\n      pageScope.$apply('foo = \"abcde\"');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('5 / 5');\n    });\n\n    it('should work with a constant', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"5\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply();\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('0 / 5');\n\n      pageScope.$apply('foo = \"abcde\"');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('5 / 5');\n\n      pageScope.$apply('foo = \"abcdef\"');\n      el.find('input').triggerHandler('input');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBe(true);\n      expect(getCharCounter(el).text()).toBe('6 / 5');\n\n      pageScope.$apply('foo = \"abc\"');\n      el.find('input').triggerHandler('input');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('3 / 5');\n    });\n\n    it('should render correct character count when value is a number', function() {\n      var template =\n        '<md-input-container>' +\n        '  <input ng-model=\"item.numberValue\" md-maxlength=\"6\">' +\n        '</md-input-container>';\n      var element = $compile(template)(pageScope);\n      pageScope.$apply();\n\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      pageScope.item = {numberValue: 456};\n      pageScope.$apply();\n\n      expect(getCharCounter(element).text()).toBe('3 / 6');\n    });\n\n    it('should update correctly the counter, when deleting the model value', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n          '<md-input-container>' +\n          '<input md-maxlength=\"5\" ng-model=\"foo\" name=\"foo\">' +\n          '</md-input-container>' +\n        '</form>'\n      )(pageScope);\n\n      pageScope.$apply();\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('0 / 5');\n\n      pageScope.$apply('foo = \"abcdef\"');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBe(true);\n      expect(getCharCounter(el).text()).toBe('6 / 5');\n\n\n      pageScope.$apply('foo = \"\"');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).text()).toBe('0 / 5');\n    });\n\n    it('should add and remove maxlength element & error with expression', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"max\" ng-model=\"foo\" name=\"foo\">' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply('max = -1');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).length).toBe(0);\n\n      pageScope.$apply('max = 5');\n      pageScope.$apply('foo = \"abcdef\"');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeTruthy();\n      expect(getCharCounter(el).length).toBe(1);\n      expect(getCharCounter(el).text()).toBe('6 / 5');\n\n      pageScope.$apply('max = -1');\n      pageScope.$apply('foo = \"abcdefg\"');\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n      expect(getCharCounter(el).length).toBe(0);\n    });\n\n    it('should not accept spaces for required inputs by default', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"max\" ng-model=\"foo\" name=\"foo\" required>' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n      var input = el.find('input');\n\n      pageScope.$apply('foo = \"\"');\n      pageScope.$apply('max = 1');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(input.hasClass('ng-invalid')).toBe(true);\n      expect(input.hasClass('ng-invalid-required')).toBe(true);\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n\n      pageScope.$apply('foo = \"  \"');\n      expect(input.hasClass('ng-invalid')).toBe(true);\n      expect(input.hasClass('ng-invalid-required')).toBe(true);\n      expect(pageScope.form.foo.$error['required']).toBeTruthy();\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n    });\n\n    it('should not trim spaces for required password inputs', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"max\" ng-model=\"foo\" name=\"foo\" type=\"password\" required>' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n      var input = el.find('input');\n\n      pageScope.$apply('foo = \"\"');\n      pageScope.$apply('max = 1');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(input.hasClass('ng-invalid')).toBe(true);\n      expect(input.hasClass('ng-invalid-required')).toBe(true);\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n\n      pageScope.$apply('foo = \"  \"');\n      expect(input.hasClass('ng-invalid')).toBe(true);\n      expect(input.hasClass('ng-invalid-required')).toBe(false);\n      expect(pageScope.form.foo.$error['required']).toBeFalsy();\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeTruthy();\n    });\n\n    it('should respect ng-trim=\"false\"', function() {\n      var el = $compile(\n        '<form name=\"form\">' +\n        '  <md-input-container>' +\n        '    <input md-maxlength=\"max\" ng-model=\"foo\" name=\"foo\" ng-trim=\"false\" required>' +\n        '  </md-input-container>' +\n        '</form>')(pageScope);\n\n      pageScope.$apply('foo = \"\"');\n      pageScope.$apply('max = 1');\n\n      // Flush any pending $mdUtil.nextTick calls\n      $timeout.flush();\n\n      expect(pageScope.form.foo.$error['required']).toBeTruthy();\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeFalsy();\n\n      pageScope.$apply('foo = \"  \"');\n      expect(pageScope.form.foo.$error['required']).toBeFalsy();\n      expect(pageScope.form.foo.$error['md-maxlength']).toBeTruthy();\n    });\n  });\n\n  it('should not add the md-input-has-placeholder class when the placeholder is transformed into a label', inject(function($rootScope, $compile) {\n    var el = $compile(\n      '<md-input-container><input ng-model=\"foo\" placeholder=\"some placeholder\"></md-input-container>'\n    )($rootScope);\n\n    expect(el.hasClass('md-input-has-placeholder')).toBe(false);\n  }));\n\n\n  it('should add the md-input-has-placeholder class when both the placeholder and label are provided', inject(function($rootScope, $compile) {\n    var el = $compile(\n      '<md-input-container>' +\n      '  <label>Hello</label>' +\n      '  <input ng-model=\"foo\" placeholder=\"some placeholder\" />' +\n      '</md-input-container>'\n    )($rootScope);\n\n    expect(el.hasClass('md-input-has-placeholder')).toBe(true);\n  }));\n\n  it('should put placeholder into a label element', function() {\n    var el = $compile('<md-input-container><input ng-model=\"foo\" placeholder=\"some placeholder\"></md-input-container>')(pageScope);\n    var placeholder = el[0].querySelector('.md-placeholder');\n    var label = el.find('label')[0];\n\n    expect(el.find('input')[0].hasAttribute('placeholder')).toBe(false);\n    expect(label).toBeTruthy();\n    expect(label.textContent).toEqual('some placeholder');\n  });\n\n  it('should not create a floating label from a placeholder if md-no-float is empty', function() {\n    var el = compile(\n      '<md-input-container md-no-float>' +\n      '  <input placeholder=\"Foo\" ng-model=\"foo\">' +\n      '</md-input-container>'\n    );\n\n    expect(el.find('label').length).toBe(0);\n  });\n\n  it('should not create a floating label from a placeholder if md-no-float is truthy', function() {\n    pageScope.inputs = [{\n      placeholder: 'Name',\n      model: ''\n    }, {\n      placeholder: 'Email',\n      model: ''\n    }];\n\n    var el = compile(\n      '<div>' +\n      '  <md-input-container ng-repeat=\"input in inputs\" md-no-float=\"$index !== 0\">' +\n      '    <input placeholder=\"{{input.placeholder}}\" ng-model=\"input.model\">' +\n      '  </md-input-container>' +\n      '</div>'\n    );\n\n    var labels = el.find('label');\n\n    expect(labels.length).toBe(1);\n    expect(labels[0].textContent).toEqual('Name');\n  });\n\n  it('should create a floating label from a placeholder if md-no-float is falsey', function() {\n    var el = compile(\n      '<md-input-container md-no-float=\"false\">' +\n      '  <input placeholder=\"Foo\" ng-model=\"foo\">' +\n      '</md-input-container>'\n    );\n\n    expect(el.find('label').length).toBe(1);\n  });\n\n  it('should ignore placeholder when a label element is present', function() {\n    var el = $compile(\n      '<md-input-container>' +\n      '  <label>Hello</label>' +\n      '  <input ng-model=\"foo\" placeholder=\"some placeholder\" />' +\n      '</md-input-container>'\n    )(pageScope);\n\n    var label = el.find('label')[0];\n\n    expect(el.find('input')[0].hasAttribute('placeholder')).toBe(true);\n    expect(label).toBeTruthy();\n    expect(label.textContent).toEqual('Hello');\n  });\n\n  it('should transfer the placeholder data binding to the newly-created label', function() {\n    var el = $compile(\n      '<md-input-container>' +\n      '  <input ng-model=\"foo\" placeholder=\"{{placeholder}}\" />' +\n      '</md-input-container>'\n    )(pageScope);\n\n    var label = el[0].querySelector('label');\n    var input = el[0].querySelector('input');\n\n    pageScope.placeholder = 'foo';\n    pageScope.$digest();\n\n    expect(label).toBeTruthy();\n\n    expect(input.hasAttribute('placeholder')).toBe(false);\n    expect(label.textContent).toEqual('foo');\n\n    pageScope.placeholder = 'bar';\n    pageScope.$digest();\n\n    // We should check again to make sure that AngularJS didn't\n    // re-add the placeholder attribute and cause double labels.\n    expect(input.hasAttribute('placeholder')).toBe(false);\n    expect(label.textContent).toEqual('bar');\n  });\n\n  it('should not copy placeholder text to aria-label on the input', inject(function($timeout) {\n    var el = $compile(\n      '<form name=\"form\">' +\n      '  <md-input-container md-no-float>' +\n      '    <input placeholder=\"baz\" ng-model=\"foo\" name=\"foo\">' +\n      '  </md-input-container>' +\n      '</form>')(pageScope);\n\n    // Flushes the $mdUtil.nextTick\n    $timeout.flush();\n\n    var input = el.find('input');\n    expect(input.attr('aria-label')).toBeUndefined();\n  }));\n\n  it('should put the container in \"has value\" state when input has a static value', function() {\n    var scope = pageScope.$new();\n    var template =\n      '<md-input-container>' +\n      '  <label>Name</label>' +\n      '  <input value=\"Larry\">' +\n      '</md-input-container>';\n\n    var element = $compile(template)(scope);\n    scope.$apply();\n\n    expect(element.hasClass('md-input-has-value')).toBe(true);\n  });\n\n  it('adds the md-auto-hide class to messages without a visiblity directive', function() {\n    var el = compile(\n      '<md-input-container><input ng-model=\"foo\">' +\n      '  <div ng-messages></div>' +\n      '</md-input-container>'\n    );\n\n    expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(true);\n  });\n\n  it('does not add the md-auto-hide class with md-auto-hide=\"false\" on the messages', function() {\n    var el = compile(\n      '<md-input-container><input ng-model=\"foo\">' +\n      '  <div ng-messages md-auto-hide=\"false\">Test Message</div>' +\n      '</md-input-container>'\n    );\n\n    expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(false);\n  });\n\n  describe('with ng-messages', function() {\n    it('adds the md-auto-hide class to messages without a visiblity directive', inject(function() {\n      var el = compile(\n        '<md-input-container><input ng-model=\"foo\">' +\n        '  <div ng-messages></div>' +\n        '</md-input-container>'\n      );\n\n      expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(true);\n    }));\n\n    it('does not add the md-auto-hide class with md-auto-hide=\"false\" on the messages', inject(function() {\n      var el = compile(\n        '<md-input-container><input ng-model=\"foo\">' +\n        '  <div ng-messages md-auto-hide=\"false\">Test Message</div>' +\n        '</md-input-container>'\n      );\n\n      expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(false);\n    }));\n\n    var visibilityDirectives = ['ng-if', 'ng-show', 'ng-hide'];\n    visibilityDirectives.forEach(function(vdir) {\n      it('does not add the md-auto-hide class with ' + vdir + ' on the messages', inject(function() {\n        var el = compile(\n          '<md-input-container><input ng-model=\"foo\">' +\n          '  <div ng-messages ' + vdir + '=\"true\">Test Message</div>' +\n          '</md-input-container>'\n        );\n\n        expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(false);\n      }));\n    });\n\n    it('does not add the md-auto-hide class with ngSwitch on the messages', inject(function() {\n      pageScope.switchVal = 1;\n\n      var el = compile(\n        '<md-input-container ng-switch=\"switchVal\">' +\n        '  <input ng-model=\"foo\">' +\n        '  <div ng-messages ng-switch-when=\"1\">1</div>' +\n        '  <div ng-messages ng-switch-when=\"2\">2</div>' +\n        '  <div ng-messages ng-switch-default>Other</div>' +\n        '</md-input-container>'\n      );\n\n      expect(el[0].querySelector(\"[ng-messages]\").classList.contains('md-auto-hide')).toBe(false);\n    }));\n\n    it('should set the animation class on the ngMessage properly', inject(function() {\n      var element = compile(\n        '<form name=\"myForm\">' +\n        '  <md-input-container>' +\n        '    <input ng-model=\"inputVal\" name=\"myModel\" required>' +\n        '    <div ng-messages=\"myForm.myModel.$error\">' +\n        '      <ng-message id=\"requiredMessage\" when=\"required\">Field required</ng-message>' +\n        '    </div>' +\n        '  </md-input-container>' +\n        '</form>'\n      );\n\n      var ngMessage = element.find('ng-message');\n\n      expect(ngMessage).toHaveClass('md-input-message-animation');\n    }));\n\n    // NOTE: I believe this test was erroneously passing since we did not properly include the\n    // ngMessages module. After properly including this test now fails, so I have disabled it\n    // until we can figure out if this is a valid test. - Topher - 7/26/2016\n    xit('should set the animation class on a transcluded ngMessage', function() {\n      // We can emulate the transclusion, by wrapping the ngMessage inside of a document fragment.\n      // It is not necessary to add a *extra* component / directive for that, since we just\n      // want to the test the DocumentFragment detection.\n      var fragment = document.createDocumentFragment();\n\n      var inputContainer = compile(\n        '<md-input-container>' +\n        '  <input ng-model=\"inputVal\">' +\n        '  <div ng-messages id=\"messageInsertion\">' +\n        '  </div>' +\n        '</md-input-container>'\n      );\n\n      // We build our element, without compiling and linking it.\n      // Because we invoke those steps manually during the tests.\n      var messageElement = angular.element(\n        '<ng-message id=\"requiredMessage\" when=\"required\">Field Required</ng-message>'\n      );\n\n      fragment.appendChild(messageElement[0]);\n\n      // Only compile the element at this time, and link it to its scope later.\n      // Normally the directive will add the animation class upon compile.\n      var linkFn = $compile(messageElement);\n\n      expect(messageElement).not.toHaveClass('md-input-message-animation');\n\n      // Now we emulate the finish of the transclusion.\n      // We move the element from the fragment into the correct input\n      // container.\n      inputContainer[0].appendChild(messageElement[0]);\n\n      // Manually invoke the postLink function of the directive.\n      linkFn($rootScope.$new());\n\n      expect(messageElement).toHaveClass('md-input-message-animation');\n    });\n\n    it('should select the input value on focus', inject(function($timeout) {\n      var input = $compile('<input md-select-on-focus value=\"Text\">')($rootScope);\n\n      document.body.appendChild(input[0]);\n\n      expect(isTextSelected(input[0])).toBe(false);\n\n      input.focus();\n      input.triggerHandler('focus');\n      $timeout.flush();\n\n      expect(isTextSelected(input[0])).toBe(true);\n\n      input.remove();\n\n\n      function isTextSelected(input) {\n        if (typeof input.selectionStart === \"number\") {\n          return input.selectionStart === 0 && input.selectionEnd === input.value.length;\n        } else if (typeof document.selection !== \"undefined\") {\n          return document.selection.createRange().text === input.value;\n        }\n      }\n    }));\n\n    it('should not refocus the input after focus is lost', inject(function($document, $timeout) {\n      var wrapper = $compile('<div><input md-select-on-focus value=\"Text\"><input></div>')($rootScope),\n          input1 = angular.element(wrapper[0].childNodes[0]),\n          input2 = angular.element(wrapper[0].childNodes[1]);\n      $document[0].body.appendChild(wrapper[0]);\n\n      input1.focus();\n      input1.triggerHandler('focus');\n      input2.focus();\n      input2.triggerHandler('focus');\n\n      $timeout.flush();\n      expect(input2).toBeFocused();\n\n      wrapper.remove();\n    }));\n\n    describe('Textarea auto-sizing', function() {\n      var ngElement, element, ngTextarea, textarea, scope, parentElement;\n\n      function createAndAppendElement(attrs) {\n        scope = $rootScope.$new();\n\n        attrs = attrs || '';\n        var template =\n          '<div ng-hide=\"parentHidden\">' +\n          '  <md-input-container>' +\n          '    <label>Biography</label>' +\n          '    <textarea ' + attrs + '>Single line</textarea>' +\n          '  </md-input-container>' +\n          '</div>';\n        parentElement = $compile(template)(scope);\n        ngElement = parentElement.find('md-input-container');\n        element = ngElement[0];\n        ngTextarea = ngElement.find('textarea');\n        textarea = ngTextarea[0];\n        document.body.appendChild(parentElement[0]);\n      }\n\n      afterEach(function() {\n        document.body.removeChild(parentElement[0]);\n      });\n\n      it('should auto-size the textarea as the user types', function() {\n        createAndAppendElement();\n        var oldHeight = textarea.offsetHeight;\n        ngTextarea.val('Multiple\\nlines\\nof\\ntext');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.offsetHeight).toBeGreaterThan(oldHeight);\n      });\n\n      it('should auto-size the textarea in response to an outside ngModel change', function() {\n        createAndAppendElement('ng-model=\"model\"');\n        var oldHeight = textarea.offsetHeight;\n        scope.model = '1\\n2\\n3\\n';\n        $timeout.flush();\n        expect(textarea.offsetHeight).toBeGreaterThan(oldHeight);\n      });\n\n      it('should allow the textarea to shrink if text is being deleted', function() {\n        createAndAppendElement();\n        ngTextarea.val('Multiple\\nlines\\nof\\ntext');\n        ngTextarea.triggerHandler('input');\n        var oldHeight = textarea.offsetHeight;\n\n        ngTextarea.val('One line of text');\n        ngTextarea.triggerHandler('input');\n\n        expect(textarea.offsetHeight).toBeLessThan(oldHeight);\n      });\n\n      it('should not auto-size if md-no-autogrow is present', function() {\n        createAndAppendElement('md-no-autogrow');\n        var oldHeight = textarea.offsetHeight;\n        ngTextarea.val('Multiple\\nlines\\nof\\ntext');\n        ngTextarea.triggerHandler('input');\n        var newHeight = textarea.offsetHeight;\n        expect(newHeight).toEqual(oldHeight);\n      });\n\n      it('should auto-size when revealed if md-detect-hidden is present', function() {\n        createAndAppendElement('md-detect-hidden');\n\n        var oldHeight = textarea.offsetHeight;\n\n        scope.parentHidden = true;\n        ngTextarea.val('Multiple\\nlines\\nof\\ntext');\n        ngTextarea.triggerHandler('input');\n        scope.$apply();\n\n        // Textarea should still be hidden.\n        expect(textarea.offsetHeight).toBe(0);\n\n        scope.parentHidden = false;\n        scope.$apply();\n\n        var newHeight = textarea.offsetHeight;\n        expect(textarea.offsetHeight).toBeGreaterThan(oldHeight);\n      });\n\n      it('should set the rows attribute as the user types', function() {\n        createAndAppendElement();\n        expect(textarea.rows).toBe(1);\n\n        ngTextarea.val('1\\n2\\n3');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.rows).toBe(3);\n      });\n\n      it('should not allow the textarea rows to be less than the minimum number of rows', function() {\n        createAndAppendElement('rows=\"5\"');\n        ngTextarea.val('1\\n2\\n3\\n4\\n5\\n6\\n7');\n        ngTextarea.triggerHandler('input');\n        ngTextarea.val('');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.rows).toBe(5);\n      });\n\n      it('should not let a textarea grow past its maximum number of rows', function() {\n        createAndAppendElement('max-rows=\"5\"');\n        ngTextarea.val('1\\n2\\n3');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.rows).toBe(3);\n        expect(ngTextarea.attr('md-no-autogrow')).toBeUndefined();\n\n        ngTextarea.val('1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.rows).toBe(5);\n        expect(ngTextarea.attr('md-no-autogrow')).toBeDefined();\n      });\n\n      it('should add a handle for resizing the textarea', function() {\n        createAndAppendElement();\n        expect(element.querySelector('.md-resize-handle')).toBeTruthy();\n      });\n\n      it('should disable auto-sizing if the handle gets dragged', function() {\n        createAndAppendElement();\n        var handle = angular.element(element.querySelector('.md-resize-handle'));\n\n        ngTextarea.val('1\\n2\\n3');\n        ngTextarea.triggerHandler('input');\n        var oldHeight = textarea.offsetHeight;\n\n        handle.triggerHandler('mousedown');\n        ngElement.triggerHandler('$md.dragstart');\n        ngTextarea.val('1\\n2\\n3\\n4\\n5\\n6');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.offsetHeight).toBe(oldHeight);\n      });\n\n      it('should not add the handle if md-no-resize is present', function() {\n        createAndAppendElement('md-no-resize');\n        expect(element.querySelector('.md-resize-handle')).toBeFalsy();\n      });\n\n      it('should reset the padding after measuring the line height', function() {\n        createAndAppendElement();\n        ngTextarea.triggerHandler('input');\n        expect(textarea.style.padding).toBeFalsy();\n      });\n\n      it('should preserve the original inline padding', function() {\n        createAndAppendElement('style=\"padding: 10px;\"');\n        ngTextarea.triggerHandler('input');\n        expect(textarea.style.padding).toBe('10px');\n      });\n    });\n\n    describe('icons', function() {\n      it('should add md-icon-left class when md-icon is before the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon></md-icon>' +\n          '  <input ng-model=\"foo\">' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeTruthy();\n      });\n\n      it('should add md-icon-left class when .md-icon is before the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <i class=\"md-icon\"></i>' +\n          '  <input ng-model=\"foo\">' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeTruthy();\n      });\n\n      it('should add md-icon-right class when md-icon is after the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <input ng-model=\"foo\">' +\n          '  <md-icon></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeTruthy();\n\n      });\n\n      it('should add md-icon-right class when .md-icon is after the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <input ng-model=\"foo\">' +\n          '  <i class=\"md-icon\"></i>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeTruthy();\n      });\n      it('should not add md-icon-left class when md-icon is before the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '  <input ng-model=\"foo\">' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeFalsy();\n      });\n\n      it('should not add md-icon-left class when .md-icon is before the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <i class=\"md-icon\" ng-if=\"false\"></i>' +\n          '  <input ng-model=\"foo\">' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeFalsy();\n      });\n\n      it('should not add md-icon-right class when md-icon is after the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <input ng-model=\"foo\">' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeFalsy();\n\n      });\n\n      it('should not add md-icon-right class when .md-icon is after the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <input ng-model=\"foo\">' +\n          '  <i class=\"md-icon\" ng-if=\"false\"></i>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeFalsy();\n      });\n\n      it('should add md-icon-left and md-icon-right classes when md-icons are before and after the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon></md-icon>' +\n          '  <input ng-model=\"foo\">' +\n          '  <md-icon></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left md-icon-right')).toBeTruthy();\n      });\n\n      it('should add md-icon-left and md-icon-right classes when .md-icons are before and after the input', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <i class=\"md-icon\"></i>' +\n          '  <input ng-model=\"foo\">' +\n          '  <i class=\"md-icon\"></i>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left md-icon-right')).toBeTruthy();\n      });\n\n      it('should not add md-icon-left and md-icon-right classes when md-icons are before and after the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '  <input ng-model=\"foo\">' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left md-icon-right')).toBeFalsy();\n      });\n\n      it('should not add md-icon-left and md-icon-right classes when .md-icons are before and after the input and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <i class=\"md-icon\" ng-if=\"false\"></i>' +\n          '  <input ng-model=\"foo\">' +\n          '  <i class=\"md-icon\" ng-if=\"false\"></i>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left md-icon-right')).toBeFalsy();\n      });\n\n      it('should add md-icon-left class when md-icon is before select', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon></md-icon>' +\n          '  <md-select ng-model=\"foo\"></md-select>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeTruthy();\n      });\n\n      it('should add md-icon-right class when md-icon is before select', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-select ng-model=\"foo\"></md-select>' +\n          '  <md-icon></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeTruthy();\n      });\n\n      it('should add md-icon-left class when md-icon is before textarea', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon></md-icon>' +\n          '  <textarea ng-model=\"foo\"></textarea>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeTruthy();\n      });\n\n      it('should add md-icon-right class when md-icon is before textarea', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <textarea ng-model=\"foo\"></textarea>' +\n          '  <md-icon></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeTruthy();\n      });\n\n      it('should not add md-icon-left class when md-icon is before textarea and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '  <textarea ng-model=\"foo\"></textarea>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-left')).toBeFalsy();\n      });\n\n      it('should not add md-icon-right class when md-icon is before textarea and ng-if=\"false\"', function() {\n        var el = compile(\n          '<md-input-container>' +\n          '  <textarea ng-model=\"foo\"></textarea>' +\n          '  <md-icon ng-if=\"false\"></md-icon>' +\n          '</md-input-container>'\n        );\n        $material.flushOutstandingAnimations();\n        expect(el.hasClass('md-icon-right')).toBeFalsy();\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/list/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak layout-gt-sm=\"row\">\n\n  <div flex-gt-sm=\"50\" flex>\n\n    <md-toolbar layout=\"row\" class=\"md-hue-3\">\n      <div class=\"md-toolbar-tools\">\n        <span>Normal</span>\n      </div>\n    </md-toolbar>\n\n    <md-content>\n      <md-list flex>\n        <md-subheader class=\"md-no-sticky\">3 line item (with hover)</md-subheader>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"item in todos\" ng-click=\"null\">\n          <img ng-src=\"{{item.face}}?{{$index}}\" class=\"md-avatar\" alt=\"{{item.who}}\" />\n          <div class=\"md-list-item-text\" layout=\"column\">\n            <h3>{{ item.who }}</h3>\n            <h4>{{ item.what }}</h4>\n            <p>{{ item.notes }}</p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">2 line item</md-subheader>\n        <md-list-item class=\"md-2-line\">\n          <img ng-src=\"{{todos[0].face}}?20\" class=\"md-avatar\" alt=\"{{todos[0].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[0].who }}</h3>\n            <p>Secondary text</p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">3 line item, long paragraph (see on mobile)</md-subheader>\n        <md-list-item class=\"md-3-line md-long-text\">\n          <img ng-src=\"{{todos[0].face}}?25\" class=\"md-avatar\" alt=\"{{todos[0].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[0].who }}</h3>\n            <p>\n              Secondary line text Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n              Nam massa quam. Nulla metus metus, ullamcorper vel, tincidunt sed.\n            </p>\n          </div>\n        </md-list-item>\n        <md-list-item class=\"md-3-line md-long-text\">\n          <img ng-src=\"{{todos[1].face}}?25\" class=\"md-avatar\" alt=\"{{todos[1].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[1].who }}</h3>\n            <p>\n              Secondary line text Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n              Nam massa quam. Nulla metus metus, ullamcorper vel, tincidunt sed.\n            </p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">Classes</md-subheader>\n        <md-list-item class=\"md-2-line\" ng-repeat=\"phone in phones\">\n          <md-icon md-svg-icon=\"{{phone.options.icon}}\" ng-if=\"phone.options.icon\" ng-class=\"{'md-avatar-icon': phone.options.avatarIcon}\"></md-icon>\n          <img ng-src=\"{{phone.options.face}}?25\" class=\"md-avatar\" alt=\"{{phone.options.face}}\"\n               ng-if=\"phone.options.face\"/>\n          <div class=\"md-list-item-text\" ng-class=\"{'md-offset': phone.options.offset }\">\n            <h3> {{ phone.number }} </h3>\n            <p> {{ phone.type }} </p>\n          </div>\n          <md-button class=\"md-secondary md-icon-button\" ng-click=\"doSecondaryAction($event)\" ng-if=\"phone.options.actionIcon\" aria-label=\"call\">\n            <md-icon md-svg-icon=\"{{phone.options.actionIcon}}\"></md-icon>\n          </md-button>\n        </md-list-item>\n      </md-list>\n    </md-content>\n  </div>\n\n  <md-divider></md-divider>\n\n  <div flex-gt-sm=\"50\" flex>\n\n    <md-toolbar layout=\"row\" class=\"md-hue-3\">\n      <div class=\"md-toolbar-tools\">\n        <span>Dense</span>\n      </div>\n    </md-toolbar>\n\n    <md-content>\n\n      <md-list class=\"md-dense\" flex>\n        <md-subheader class=\"md-no-sticky\">3 line item (dense)</md-subheader>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"item in todos\">\n          <img ng-src=\"{{item.face}}?{{$index}}\" class=\"md-avatar\" alt=\"{{item.who}}\" />\n          <div class=\"md-list-item-text\" layout=\"column\">\n            <h3>{{ item.who }}</h3>\n            <h4>{{ item.what }}</h4>\n            <p>{{ item.notes }}</p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">2 line item</md-subheader>\n        <md-list-item class=\"md-2-line\">\n          <img ng-src=\"{{todos[0].face}}?20\" class=\"md-avatar\" alt=\"{{todos[0].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[0].who }}</h3>\n            <p>Secondary text</p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">3 line item, long paragraph (see on mobile)</md-subheader>\n        <md-list-item class=\"md-3-line md-long-text\">\n          <img ng-src=\"{{todos[0].face}}?25\" class=\"md-avatar\" alt=\"{{todos[0].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[0].who }}</h3>\n            <p>\n              Secondary line text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa\n              quam.  Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque\n              volutpat condimentum velit.\n            </p>\n          </div>\n        </md-list-item>\n        <md-list-item class=\"md-3-line md-long-text\">\n          <img ng-src=\"{{todos[1].face}}?25\" class=\"md-avatar\" alt=\"{{todos[1].who}}\" />\n          <div class=\"md-list-item-text\">\n            <h3>{{ todos[1].who }}</h3>\n            <p>\n              Secondary line text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa\n              quam.  Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque\n              volutpat condimentum velit.\n            </p>\n          </div>\n        </md-list-item>\n        <md-divider ></md-divider>\n        <md-subheader class=\"md-no-sticky\">Classes</md-subheader>\n        <md-list-item class=\"md-2-line\" ng-repeat=\"phone in phones\">\n          <md-icon md-svg-icon=\"{{phone.options.icon}}\" ng-if=\"phone.options.icon\" ng-class=\"{'md-avatar-icon': phone.options.avatarIcon}\"></md-icon>\n          <img ng-src=\"{{phone.options.face}}?25\" class=\"md-avatar\" alt=\"{{phone.options.face}}\"\n               ng-if=\"phone.options.face\"/>\n          <div class=\"md-list-item-text\" ng-class=\"{'md-offset': phone.options.offset }\">\n            <h3> {{ phone.number }} </h3>\n            <p> {{ phone.type }} </p>\n          </div>\n          <md-button class=\"md-secondary md-icon-button\" ng-click=\"doSecondaryAction($event)\" ng-if=\"phone.options.actionIcon\" aria-label=\"call\">\n            <md-icon md-svg-icon=\"{{phone.options.actionIcon}}\"></md-icon>\n          </md-button>\n        </md-list-item>\n      </md-list>\n    </md-content>\n  </div>\n\n</div>\n"
  },
  {
    "path": "src/components/list/demoBasicUsage/script.js",
    "content": "\nangular.module('listDemo1', ['ngMaterial'])\n.config(function($mdIconProvider) {\n  $mdIconProvider\n    .iconSet('communication', 'img/icons/sets/communication-icons.svg', 24);\n})\n.controller('AppCtrl', function($scope) {\n    var imagePath = 'img/60.jpeg';\n\n    $scope.phones = [\n      {\n        type: 'Home',\n        number: '(555) 251-1234',\n        options: {\n          icon: 'communication:phone'\n        }\n      },\n      {\n        type: 'Cell',\n        number: '(555) 786-9841',\n        options: {\n          icon: 'communication:phone',\n          avatarIcon: true\n        }\n      },\n      {\n        type: 'Office',\n        number: '(555) 314-1592',\n        options: {\n          face : imagePath\n        }\n      },\n      {\n        type: 'Offset',\n        number: '(555) 192-2010',\n        options: {\n          offset: true,\n          actionIcon: 'communication:phone'\n        }\n      }\n    ];\n    $scope.todos = [\n      {\n        face : imagePath,\n        what: 'My quirky, joyful porg',\n        who: 'Kaguya w/ #qjporg',\n        when: '3:08PM',\n        notes: \" I was lucky to find a quirky, joyful porg!\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n    ];\n});\n"
  },
  {
    "path": "src/components/list/demoBasicUsage/style.css",
    "content": "md-divider {\n  margin-top: 10px;\n  margin-bottom: 0;\n}\n"
  },
  {
    "path": "src/components/list/demoListControls/index.html",
    "content": "<md-list ng-controller=\"ListCtrl\" ng-cloak>\n\n  <md-subheader class=\"md-no-sticky\">Single Action Checkboxes</md-subheader>\n  <md-list-item ng-repeat=\"topping in toppings\">\n    <p> {{ topping.name }} </p>\n    <md-checkbox class=\"md-secondary\" ng-model=\"topping.wanted\"></md-checkbox>\n  </md-list-item>\n\n  <md-divider></md-divider>\n\n  <md-subheader class=\"md-no-sticky\">Secondary Buttons</md-subheader>\n  <md-list-item class=\"secondary-button-padding\">\n    <p>Clicking the button to the right will fire the secondary action</p>\n    <md-button class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\">More Info</md-button>\n  </md-list-item>\n  <md-list-item class=\"secondary-button-padding\" ng-click=\"doPrimaryAction($event)\">\n    <p>Click anywhere to fire the primary action, or the button to fire the secondary</p>\n    <md-button class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\">More Info</md-button>\n  </md-list-item>\n\n  <md-divider></md-divider>\n\n  <md-subheader class=\"md-no-sticky\">Secondary Menus</md-subheader>\n  <md-list-item>\n    <p>Click anywhere to fire the secondary action</p>\n\n    <md-menu class=\"md-secondary\">\n      <md-button class=\"md-icon-button\">\n        <md-icon md-svg-icon=\"communication:message\"></md-icon>\n      </md-button>\n      <md-menu-content width=\"4\">\n        <md-menu-item>\n          <md-button>\n            Redial\n          </md-button>\n        </md-menu-item>\n        <md-menu-item>\n          <md-button>\n            Check voicemail\n          </md-button>\n        </md-menu-item>\n        <md-menu-divider></md-menu-divider>\n        <md-menu-item>\n          <md-button>\n            Notifications\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n\n  </md-list-item>\n\n  <md-divider></md-divider>\n\n  <md-subheader class=\"md-no-sticky\">Clickable Items with Secondary Controls</md-subheader>\n  <md-list-item ng-click=\"navigateTo(setting.extraScreen, $event)\" ng-repeat=\"setting in settings\">\n    <md-icon md-svg-icon=\"{{setting.icon}}\"></md-icon>\n    <p> {{ setting.name }} </p>\n    <md-switch class=\"md-secondary\" ng-model=\"setting.enabled\"></md-switch>\n  </md-list-item>\n  <md-list-item ng-click=\"navigateTo('data usage', $event)\">\n    <md-icon md-svg-icon=\"cached\"></md-icon>\n    <p>Data Usage</p>\n  </md-list-item>\n\n  <md-divider></md-divider>\n\n  <md-subheader class=\"md-no-sticky\">Checkbox with Secondary Action</md-subheader>\n  <md-list-item ng-repeat=\"message in messages\">\n    <md-checkbox ng-model=\"message.selected\"></md-checkbox>\n    <p>{{message.title}}</p>\n    <md-icon class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\" aria-label=\"Chat\" md-svg-icon=\"communication:message\"></md-icon>\n  </md-list-item>\n\n  <md-divider></md-divider>\n\n  <md-subheader class=\"md-no-sticky\">Avatar with Secondary Action Icon</md-subheader>\n  <md-list-item ng-repeat=\"person in people\" ng-click=\"goToPerson(person.name, $event)\" class=\"noright\">\n    <img alt=\"{{ person.name }}\" ng-src=\"{{ person.img }}\" class=\"md-avatar\" />\n    <p>{{ person.name }}</p>\n    <md-checkbox class=\"md-secondary\" ng-model=\"person.selected\"></md-checkbox>\n    <md-icon md-svg-icon=\"communication:email\"  ng-click=\"doSecondaryAction($event)\" aria-label=\"Send Email\" class=\"md-secondary md-hue-3\" ></md-icon>\n    <md-icon class=\"md-secondary\" ng-click=\"doSecondaryAction($event)\" aria-label=\"Chat\" md-svg-icon=\"communication:message\"></md-icon>\n  </md-list-item>\n</md-list>\n"
  },
  {
    "path": "src/components/list/demoListControls/script.js",
    "content": "angular.module('listDemo2', ['ngMaterial'])\n.config(function($mdIconProvider) {\n  $mdIconProvider\n    .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n    .iconSet('device', 'img/icons/sets/device-icons.svg', 24)\n    .iconSet('communication', 'img/icons/sets/communication-icons.svg', 24)\n    .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n})\n.controller('ListCtrl', function($scope, $mdDialog) {\n  $scope.toppings = [\n    { name: 'Pepperoni', wanted: true },\n    { name: 'Sausage', wanted: false },\n    { name: 'Black Olives', wanted: true },\n    { name: 'Green Peppers', wanted: false }\n  ];\n\n  $scope.settings = [\n    { name: 'Wi-Fi', extraScreen: 'Wi-Fi menu', icon: 'device:network-wifi', enabled: true },\n    { name: 'Bluetooth', extraScreen: 'Bluetooth menu', icon: 'device:bluetooth', enabled: false },\n  ];\n\n  $scope.messages = [\n    {id: 1, title: \"Message A\", selected: false},\n    {id: 2, title: \"Message B\", selected: true},\n    {id: 3, title: \"Message C\", selected: true},\n  ];\n\n  $scope.people = [\n    { name: 'Janet Perkins', img: 'img/100-0.jpeg', newMessage: true },\n    { name: 'Mary Johnson', img: 'img/100-1.jpeg', newMessage: false },\n    { name: 'Peter Carlsson', img: 'img/100-2.jpeg', newMessage: false }\n  ];\n\n  $scope.goToPerson = function(person, event) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('Navigating')\n        .textContent('Inspect ' + person)\n        .ariaLabel('Person inspect demo')\n        .ok('Neat!')\n        .targetEvent(event)\n    );\n  };\n\n  $scope.navigateTo = function(to, event) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('Navigating')\n        .textContent('Imagine being taken to ' + to)\n        .ariaLabel('Navigation demo')\n        .ok('Neat!')\n        .targetEvent(event)\n    );\n  };\n\n  $scope.doPrimaryAction = function(event) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('Primary Action')\n        .textContent('Primary actions can be used for one click actions')\n        .ariaLabel('Primary click demo')\n        .ok('Awesome!')\n        .targetEvent(event)\n    );\n  };\n\n  $scope.doSecondaryAction = function(event) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('Secondary Action')\n        .textContent('Secondary actions can be used for one click actions')\n        .ariaLabel('Secondary click demo')\n        .ok('Neat!')\n        .targetEvent(event)\n    );\n  };\n\n});\n"
  },
  {
    "path": "src/components/list/demoListControls/style.css",
    "content": "md-divider {\n  margin-top: 0;\n  margin-bottom: 0;\n}\nmd-list {\n  padding-top: 0;\n}\nmd-list-item > p,\nmd-list-item > .md-list-item-inner > p,\nmd-list-item .md-list-item-inner > p,\nmd-list-item .md-list-item-inner > .md-list-item-inner > p {\n  -webkit-user-select: none; /* Chrome all / Safari all */\n  -moz-user-select: none; /* Firefox all */\n  -ms-user-select: none; /* IE 10+ */\n  user-select: none; /* Likely future */\n}\n"
  },
  {
    "path": "src/components/list/list-theme.scss",
    "content": "md-list.md-THEME_NAME-theme {\n  md-list-item.md-2-line .md-list-item-text,\n  md-list-item.md-3-line .md-list-item-text {\n    h3, h4 {\n      color: '{{foreground-1}}';\n    }\n    p {\n      color: '{{foreground-2}}';\n    }\n  }\n  .md-proxy-focus.md-focused div.md-no-style {\n    background-color: '{{background-100}}';\n  }\n\n  md-list-item .md-avatar-icon {\n    background-color: '{{foreground-3}}';\n    color: '{{background-color}}';\n  }\n\n  md-list-item > md-icon {\n    color: '{{foreground-2}}';\n\n    &.md-highlight {\n      color: '{{primary-color}}';\n      &.md-accent {\n        color: '{{accent-color}}';\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/list/list.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.list\n * @description\n * List module\n */\nangular.module('material.components.list', [\n  'material.core'\n])\n  .controller('MdListController', MdListController)\n  .directive('mdList', mdListDirective)\n  .directive('mdListItem', mdListItemDirective);\n\n/**\n * @ngdoc directive\n * @name mdList\n * @module material.components.list\n *\n * @restrict E\n *\n * @description\n * The `<md-list>` directive is a list container for 1..n `<md-list-item>` tags.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-list>\n *   <md-list-item class=\"md-2-line\" ng-repeat=\"item in todos\">\n *     <md-checkbox ng-model=\"item.done\"></md-checkbox>\n *     <div class=\"md-list-item-text\">\n *       <h3>{{item.title}}</h3>\n *       <p>{{item.description}}</p>\n *     </div>\n *   </md-list-item>\n * </md-list>\n * </hljs>\n */\n\nfunction mdListDirective($mdTheming) {\n  return {\n    restrict: 'E',\n    compile: function(tEl) {\n      tEl[0].setAttribute('role', 'list');\n      return $mdTheming;\n    }\n  };\n}\n/**\n * @ngdoc directive\n * @name mdListItem\n * @module material.components.list\n *\n * @restrict E\n *\n * @description\n * A `md-list-item` element can be used to represent some information in a row.<br/>\n *\n * @usage\n * ### Single Row Item\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <span>Single Row Item</span>\n *   </md-list-item>\n * </hljs>\n *\n * ### Multiple Lines\n * By using the following markup, you will be able to have two lines inside of one `md-list-item`.\n *\n * <hljs lang=\"html\">\n *   <md-list-item class=\"md-2-line\">\n *     <div class=\"md-list-item-text\" layout=\"column\">\n *       <p>First Line</p>\n *       <p>Second Line</p>\n *     </div>\n *   </md-list-item>\n * </hljs>\n *\n * It is also possible to have three lines inside of one list item.\n *\n * <hljs lang=\"html\">\n *   <md-list-item class=\"md-3-line\">\n *     <div class=\"md-list-item-text\" layout=\"column\">\n *       <p>First Line</p>\n *       <p>Second Line</p>\n *       <p>Third Line</p>\n *     </div>\n *   </md-list-item>\n * </hljs>\n *\n * ### Secondary Items\n * Secondary items are elements which will be aligned at the end of the `md-list-item`.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <span>Single Row Item</span>\n *     <md-button class=\"md-secondary\">\n *       Secondary Button\n *     </md-button>\n *   </md-list-item>\n * </hljs>\n *\n * It also possible to have multiple secondary items inside of one `md-list-item`.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <span>Single Row Item</span>\n *     <md-button class=\"md-secondary\">First Button</md-button>\n *     <md-button class=\"md-secondary\">Second Button</md-button>\n *   </md-list-item>\n * </hljs>\n *\n * ### Proxy Item\n * Proxies are elements, which will execute their specific action on click<br/>\n * Currently supported proxy items are\n * - `md-checkbox` (Toggle)\n * - `md-switch` (Toggle)\n * - `md-menu` (Open)\n *\n * This means, when using a supported proxy item inside of `md-list-item`, the list item will\n * automatically become clickable and executes the associated action of the proxy element on click.\n *\n * It is possible to disable this behavior by applying the `md-no-proxy` class to the list item.\n *\n * <hljs lang=\"html\">\n *   <md-list-item class=\"md-no-proxy\">\n *     <span>No Proxy List</span>\n *     <md-checkbox class=\"md-secondary\"></md-checkbox>\n *   </md-list-item>\n * </hljs>\n *\n * Here are a few examples of proxy elements inside of a list item.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <span>First Line</span>\n *     <md-checkbox class=\"md-secondary\"></md-checkbox>\n *   </md-list-item>\n * </hljs>\n *\n * The `md-checkbox` element will be automatically detected as a proxy element and will toggle on\n * click.\n *\n * If not provided, an `aria-label` will be applied using the text of the list item.\n * In this case, the following will be applied to the `md-checkbox`:\n * `aria-label=\"Toggle First Line\"`.\n * When localizing your application, you should supply a localized `aria-label`.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <span>First Line</span>\n *     <md-switch class=\"md-secondary\"></md-switch>\n *   </md-list-item>\n * </hljs>\n *\n * The recognized `md-switch` will toggle its state, when the user clicks on the `md-list-item`.\n *\n * It is also possible to have a `md-menu` inside of a `md-list-item`.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <p>Click anywhere to fire the secondary action</p>\n *     <md-menu class=\"md-secondary\">\n *       <md-button class=\"md-icon-button\">\n *         <md-icon md-svg-icon=\"communication:message\"></md-icon>\n *       </md-button>\n *       <md-menu-content width=\"4\">\n *         <md-menu-item>\n *           <md-button>\n *             Redial\n *           </md-button>\n *         </md-menu-item>\n *         <md-menu-item>\n *           <md-button>\n *             Check voicemail\n *           </md-button>\n *         </md-menu-item>\n *         <md-menu-divider></md-menu-divider>\n *         <md-menu-item>\n *           <md-button>\n *             Notifications\n *           </md-button>\n *         </md-menu-item>\n *       </md-menu-content>\n *     </md-menu>\n *   </md-list-item>\n * </hljs>\n *\n * The menu will automatically open, when the users clicks on the `md-list-item`.<br/>\n *\n * If the developer didn't specify any position mode on the menu, the `md-list-item` will\n * automatically detect the position mode and apply it to the `md-menu`.\n *\n * ### Avatars\n * Sometimes you may want to have avatars inside of the `md-list-item `.<br/>\n * You are able to create an optimized icon for the list item, by applying the `.md-avatar` class on\n * the `<img>` element.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <img src=\"my-avatar.png\" class=\"md-avatar\">\n *     <span>Alan Turing</span>\n * </hljs>\n *\n * When using `<md-icon>` for an avatar, you have to use the `.md-avatar-icon` class.\n *\n * <hljs lang=\"html\">\n *   <md-list-item>\n *     <md-icon class=\"md-avatar-icon\" md-svg-icon=\"social:person\"></md-icon>\n *     <span>Timothy Kopra</span>\n *   </md-list-item>\n * </hljs>\n *\n * In cases where you have a `md-list-item`, which doesn't have an avatar,\n * but you want to align it with the other avatar items, you need to use the `.md-offset` class.\n *\n * <hljs lang=\"html\">\n *   <md-list-item class=\"md-offset\">\n *     <span>Jon Doe</span>\n *   </md-list-item>\n * </hljs>\n *\n * ### DOM modification\n * The `md-list-item` component automatically detects if the list item should be clickable.\n *\n * ---\n * If the `md-list-item` is clickable, we wrap all content inside of a `<div>` and create\n * an overlaying button, which will will execute the given actions (like `ng-href`, `ng-click`).\n *\n * We create an overlaying button, instead of wrapping all content inside of the button,\n * because otherwise some elements may not be clickable inside of the button.\n *\n * ---\n * When using a secondary item inside of your list item, the `md-list-item` component will\n * automatically create a secondary container at the end of the `md-list-item`, which contains all\n * secondary items.\n *\n * The secondary item container is not static, because that would cause issues with the overflow\n * of the list item.\n */\nfunction mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {\n  var proxiedTypes = ['md-checkbox', 'md-switch', 'md-menu'];\n  return {\n    restrict: 'E',\n    controller: 'MdListController',\n\n    compile: function(tElement, tAttrs) {\n\n      // Check for proxy controls (no ng-click on parent, and a control inside)\n      var secondaryItems = tElement[0].querySelectorAll('.md-secondary');\n      var hasProxiedElement;\n      var proxyElement;\n      var itemContainer = tElement;\n\n      tElement[0].setAttribute('role', 'listitem');\n\n      if (tAttrs.ngClick || tAttrs.ngDblclick ||  tAttrs.ngHref || tAttrs.href || tAttrs.uiSref || tAttrs.ngAttrUiSref) {\n        wrapIn('button');\n      } else if (!tElement.hasClass('md-no-proxy')) {\n\n        for (var i = 0, type; i < proxiedTypes.length; ++i) {\n          proxyElement = tElement[0].querySelector(proxiedTypes[i]);\n          if (proxyElement !== null) {\n            hasProxiedElement = true;\n            break;\n          }\n        }\n\n        if (hasProxiedElement) {\n          wrapIn('div');\n        } else {\n          tElement.addClass('md-no-proxy');\n        }\n      }\n\n      wrapSecondaryItems();\n      setupToggleAria();\n\n      if (hasProxiedElement && proxyElement.nodeName === \"MD-MENU\") {\n        setupProxiedMenu();\n      }\n\n      function setupToggleAria() {\n        var toggleTypes = ['md-switch', 'md-checkbox'];\n        var toggle;\n\n        for (var i = 0, toggleType; i < toggleTypes.length; ++i) {\n          toggle = tElement.find(toggleTypes[i])[0];\n          if (toggle) {\n            if (!toggle.hasAttribute('aria-label')) {\n              var labelElement = tElement.find('p')[0];\n              if (!labelElement) {\n                labelElement = tElement.find('span')[0];\n              }\n              if (!labelElement) return;\n              toggle.setAttribute('aria-label', 'Toggle ' + labelElement.textContent);\n            }\n          }\n        }\n      }\n\n      function setupProxiedMenu() {\n        var menuEl = angular.element(proxyElement);\n\n        var isEndAligned = menuEl.parent().hasClass('md-secondary-container') ||\n                           proxyElement.parentNode.firstElementChild !== proxyElement;\n\n        var xAxisPosition = 'left';\n\n        if (isEndAligned) {\n          // When the proxy item is aligned at the end of the list, we have to set the origin to the end.\n          xAxisPosition = 'right';\n        }\n\n        // Set the position mode / origin of the proxied menu.\n        if (!menuEl.attr('md-position-mode')) {\n          menuEl.attr('md-position-mode', xAxisPosition + ' target');\n        }\n\n        // Apply menu open binding to menu button\n        var menuOpenButton = menuEl.children().eq(0);\n        if (!hasClickEvent(menuOpenButton[0])) {\n          menuOpenButton.attr('ng-click', '$mdMenu.open($event)');\n        }\n\n        if (!menuOpenButton.attr('aria-label')) {\n          menuOpenButton.attr('aria-label', 'Open List Menu');\n        }\n      }\n\n      /**\n       * @param {'div'|'button'} type\n       */\n      function wrapIn(type) {\n        if (type === 'div') {\n          itemContainer = angular.element('<div class=\"md-no-style md-list-item-inner\">');\n          itemContainer.append(tElement.contents());\n          tElement.addClass('md-proxy-focus');\n        } else {\n          // Element which holds the default list-item content.\n          itemContainer = angular.element(\n            '<div class=\"md-button md-no-style\">' +\n            '   <div class=\"md-list-item-inner\"></div>' +\n            '</div>'\n          );\n\n          // Button which shows ripple and executes primary action.\n          var buttonWrap = angular.element('<md-button class=\"md-no-style\"></md-button>');\n\n          moveAttributes(tElement[0], buttonWrap[0]);\n\n          // If there is no aria-label set on the button (previously copied over if present)\n          // we determine the label from the content and copy it to the button.\n          if (!buttonWrap.attr('aria-label')) {\n            buttonWrap.attr('aria-label', $mdAria.getText(tElement));\n\n            // If we set the button's aria-label to the text content, then make the content hidden\n            // from screen readers so that it isn't read/traversed twice.\n            var listItemInner = itemContainer[0].querySelector('.md-list-item-inner');\n            if (listItemInner) {\n              listItemInner.setAttribute('aria-hidden', 'true');\n            }\n          }\n\n          // We allow developers to specify the `md-no-focus` class, to disable the focus style\n          // on the button executor. Once more classes should be forwarded, we should probably make\n          // the class forward more generic.\n          if (tElement.hasClass('md-no-focus')) {\n            buttonWrap.addClass('md-no-focus');\n          }\n\n          // Append the button wrap before our list-item content, because it will overlay in\n          // relative.\n          itemContainer.prepend(buttonWrap);\n          itemContainer.children().eq(1).append(tElement.contents());\n\n          tElement.addClass('_md-button-wrap');\n        }\n\n        tElement[0].setAttribute('tabindex', '-1');\n        tElement.append(itemContainer);\n      }\n\n      function wrapSecondaryItems() {\n        var secondaryItemsWrapper = angular.element('<div class=\"md-secondary-container\">');\n\n        angular.forEach(secondaryItems, function(secondaryItem) {\n          wrapSecondaryItem(secondaryItem, secondaryItemsWrapper);\n        });\n\n        itemContainer.append(secondaryItemsWrapper);\n      }\n\n      /**\n       * @param {HTMLElement} secondaryItem\n       * @param {HTMLDivElement} container\n       */\n      function wrapSecondaryItem(secondaryItem, container) {\n        // If the current secondary item is not a button, but contains a ng-click attribute,\n        // the secondary item will be automatically wrapped inside of a button.\n        if (secondaryItem && !isButton(secondaryItem) && secondaryItem.hasAttribute('ng-click')) {\n\n          $mdAria.expect(secondaryItem, 'aria-label');\n          var buttonWrapper = angular.element('<md-button class=\"md-secondary md-icon-button\">');\n\n          // Move the attributes from the secondary item to the generated button.\n          // We also support some additional attributes from the secondary item,\n          // because some developers may use a ngIf, ngHide, ngShow on their item.\n          moveAttributes(secondaryItem, buttonWrapper[0], ['ng-if', 'ng-hide', 'ng-show']);\n\n          secondaryItem.setAttribute('tabindex', '-1');\n          buttonWrapper.append(secondaryItem);\n\n          secondaryItem = buttonWrapper[0];\n        }\n\n        if (secondaryItem &&\n            (!hasClickEvent(secondaryItem) ||\n              (!tAttrs.ngClick && isProxiedElement(secondaryItem)))) {\n          // In this case we remove the secondary class, so we can identify it later, when searching\n          // for the proxy items.\n          angular.element(secondaryItem).removeClass('md-secondary');\n        }\n\n        tElement.addClass('md-with-secondary');\n        container.append(secondaryItem);\n      }\n\n      /**\n       * Moves attributes from a source element to the destination element.\n       * By default, the function will copy the most necessary attributes, supported\n       * by the button executor for clickable list items.\n       * @param {Element} source Element with the specified attributes\n       * @param {Element} destination Element which will receive the attributes\n       * @param {string|string[]} extraAttrs Additional attributes, which will be moved over\n       */\n      function moveAttributes(source, destination, extraAttrs) {\n        var copiedAttrs = $mdUtil.prefixer([\n          'ng-if', 'ng-click', 'ng-dblclick', 'aria-label', 'ng-disabled', 'ui-sref',\n          'href', 'ng-href', 'rel', 'target', 'ng-attr-ui-sref', 'ui-sref-opts', 'download'\n        ]);\n\n        if (extraAttrs) {\n          copiedAttrs = copiedAttrs.concat($mdUtil.prefixer(extraAttrs));\n        }\n\n        angular.forEach(copiedAttrs, function(attr) {\n          if (source.hasAttribute(attr)) {\n            destination.setAttribute(attr, source.getAttribute(attr));\n            source.removeAttribute(attr);\n          }\n        });\n      }\n\n      /**\n       * @param {HTMLElement} element\n       * @return {boolean} true if the element has one of the proxied tags, false otherwise\n       */\n      function isProxiedElement(element) {\n        return proxiedTypes.indexOf(element.nodeName.toLowerCase()) !== -1;\n      }\n\n      /**\n       * @param {HTMLElement} element\n       * @return {boolean} true if the element is a button or md-button, false otherwise\n       */\n      function isButton(element) {\n        var nodeName = element.nodeName.toUpperCase();\n\n        return nodeName === \"MD-BUTTON\" || nodeName === \"BUTTON\";\n      }\n\n      /**\n       * @param {Element} element\n       * @return {boolean} true if the element has an ng-click attribute, false otherwise\n       */\n      function hasClickEvent(element) {\n        var attr = element.attributes;\n        for (var i = 0; i < attr.length; i++) {\n          if (tAttrs.$normalize(attr[i].name) === 'ngClick') {\n            return true;\n          }\n        }\n        return false;\n      }\n\n      return postLink;\n\n      function postLink($scope, $element, $attr, ctrl) {\n        $element.addClass('_md');     // private md component indicator for styling\n\n        var proxies       = [],\n            firstElement  = $element[0].firstElementChild,\n            isButtonWrap  = $element.hasClass('_md-button-wrap'),\n            clickChild    = isButtonWrap ? firstElement.firstElementChild : firstElement,\n            hasClick      = clickChild && hasClickEvent(clickChild),\n            noProxies     = $element.hasClass('md-no-proxy');\n\n        computeProxies();\n        computeClickable();\n\n        if (proxies.length) {\n          angular.forEach(proxies, function(proxy) {\n            proxy = angular.element(proxy);\n\n            $scope.mouseActive = false;\n            proxy.on('mousedown', function() {\n              $scope.mouseActive = true;\n              $timeout(function() {\n                $scope.mouseActive = false;\n              }, 100);\n            })\n            .on('focus', function() {\n              if ($scope.mouseActive === false) { $element.addClass('md-focused'); }\n              proxy.on('blur', function proxyOnBlur() {\n                $element.removeClass('md-focused');\n                proxy.off('blur', proxyOnBlur);\n              });\n            });\n          });\n        }\n\n        function computeProxies() {\n          if (firstElement && firstElement.children && !hasClick && !noProxies) {\n\n            angular.forEach(proxiedTypes, function(type) {\n              // All elements which are not capable of being used as a proxy have the .md-secondary\n              // class applied. These items were identified in the secondary wrap function.\n              angular.forEach(firstElement.querySelectorAll(type + ':not(.md-secondary)'), function(child) {\n                proxies.push(child);\n              });\n            });\n          }\n        }\n\n        function computeClickable() {\n          if (proxies.length === 1 || hasClick) {\n            $element.addClass('md-clickable');\n\n            if (!hasClick) {\n              ctrl.attachRipple($scope, angular.element($element[0].querySelector('.md-no-style')));\n            }\n          }\n        }\n\n        /**\n         * @param {MouseEvent} event\n         * @return {boolean}\n         */\n        function isEventFromControl(event) {\n          var forbiddenControls = ['md-slider'];\n          var eventBubblePath = $mdUtil.getEventPath(event);\n\n          // If there is no bubble path, then the event was not bubbled.\n          if (!eventBubblePath || eventBubblePath.length === 0) {\n            return forbiddenControls.indexOf(event.target.tagName.toLowerCase()) !== -1;\n          }\n\n          // We iterate the event bubble path up and check for a possible component.\n          // Our maximum index to search, is the list item root.\n          var maxPath = eventBubblePath.indexOf($element.children()[0]);\n\n          for (var i = 0; i < maxPath; i++) {\n            if (forbiddenControls.indexOf(eventBubblePath[i].tagName.toLowerCase()) !== -1) {\n              return true;\n            }\n          }\n          return false;\n        }\n\n        /**\n         * @param {KeyboardEvent} keypressEvent\n         */\n        var clickChildKeypressListener = function(keypressEvent) {\n          if (keypressEvent.target.nodeName !== 'INPUT' &&\n              keypressEvent.target.nodeName !== 'TEXTAREA' &&\n              !keypressEvent.target.isContentEditable) {\n            var keyCode = keypressEvent.which || keypressEvent.keyCode;\n            if (keyCode === $mdConstant.KEY_CODE.SPACE) {\n              if (clickChild) {\n                clickChild.click();\n                keypressEvent.preventDefault();\n                keypressEvent.stopPropagation();\n              }\n            }\n          }\n        };\n\n        if (!hasClick && !proxies.length) {\n          clickChild && clickChild.addEventListener('keypress', clickChildKeypressListener);\n        }\n\n        $element.off('click');\n        $element.off('keypress');\n        // Disable ng-aria's \"helpful\" keydown event that causes our ng-click handlers to be called\n        // twice.\n        $element.off('keydown');\n\n        if (proxies.length === 1 && clickChild) {\n          $element.children().eq(0).on('click', function(clickEvent) {\n            // When the event is coming from a control and it should not trigger the proxied element\n            // then we are skipping.\n            if (isEventFromControl(clickEvent)) return;\n\n            var parentButton = $mdUtil.getClosest(clickEvent.target, 'BUTTON');\n            if (!parentButton && clickChild.contains(clickEvent.target)) {\n              angular.forEach(proxies, function(proxy) {\n                if (clickEvent.target !== proxy && !proxy.contains(clickEvent.target)) {\n                  if (proxy.nodeName === 'MD-MENU') {\n                    proxy = proxy.children[0];\n                  }\n                  angular.element(proxy).triggerHandler('click');\n                }\n              });\n            }\n          });\n        }\n\n        $scope.$on('$destroy', function () {\n          clickChild && clickChild.removeEventListener('keypress', clickChildKeypressListener);\n        });\n      }\n    }\n  };\n}\n\n/*\n * @private\n * @ngdoc controller\n * @name MdListController\n * @module material.components.list\n */\nfunction MdListController($scope, $element, $mdListInkRipple) {\n  var ctrl = this;\n  ctrl.attachRipple = attachRipple;\n\n  function attachRipple (scope, element) {\n    var options = {};\n    $mdListInkRipple.attach(scope, element, options);\n  }\n}\n"
  },
  {
    "path": "src/components/list/list.scss",
    "content": "$dense-baseline-grid: $baseline-grid * 0.5 !default;\n\n$list-h3-margin: 0 0 0 0 !default;\n$list-h4-margin: 3px 0 1px 0 !default;\n$list-h4-font-weight: 400 !default;\n$list-header-line-height: 1.2em !default;\n$list-p-margin: 0 0 0 0 !default;\n$list-p-line-height: 1.6em !default;\n\n$list-padding-top: $baseline-grid !default;\n$list-padding-right: 0px !default;\n$list-padding-left: 0px !default;\n$list-padding-bottom: $baseline-grid !default;\n\n$item-padding-top: 0px !default;\n$item-padding-right: 0px !default;\n$item-padding-left: 0px !default;\n$item-padding-bottom: 0px !default;\n$list-item-padding-vertical: 0px !default;\n$list-item-padding-horizontal: $baseline-grid * 2 !default;\n$list-item-primary-width: $baseline-grid * 7 !default;\n$list-item-primary-avatar-width: $baseline-grid * 5 !default;\n$list-item-primary-icon-width: $baseline-grid * 3 !default;\n$list-item-secondary-left-margin: $baseline-grid * 2 !default;\n$list-item-secondary-button-width: $baseline-grid * 6 !default;\n$list-item-inset-divider-offset: 9 * $baseline-grid !default;\n$list-item-height: 6 * $baseline-grid !default;\n$list-item-two-line-height: 9 * $baseline-grid !default;\n$list-item-three-line-height: 11 * $baseline-grid !default;\n\n$list-item-dense-height: 10 * $dense-baseline-grid !default;\n$list-item-dense-two-line-height: 15 * $dense-baseline-grid !default;\n$list-item-dense-three-line-height: 19 * $dense-baseline-grid !default;\n$list-item-dense-primary-icon-width: $dense-baseline-grid * 5 !default;\n$list-item-dense-primary-avatar-width: $dense-baseline-grid * 9 !default;\n$list-item-dense-header-font-size: round($subhead-font-size-base * 0.8) !default;\n$list-item-dense-font-size: round($body-font-size-base * 0.85) !default;\n$list-item-dense-line-height: 1.05 !default;\n\nmd-list {\n  display: block;\n  padding: $list-padding-top $list-padding-right $list-padding-bottom $list-padding-left;\n\n  .md-subheader {\n    font-size: $body-font-size-base;\n    font-weight: 500;\n    letter-spacing: 0.010em;\n    line-height: $list-header-line-height;\n  }\n\n  &.md-dense:not(.md-dense-disabled) {\n    md-list-item {\n      &,\n      .md-list-item-inner {\n        min-height: $list-item-dense-height;\n        @include ie11-min-height-flexbug($list-item-dense-height);\n\n\n        // Layout for controls in primary or secondary divs, or auto-inferred first child\n\n        md-icon:first-child {\n          width: $list-item-dense-primary-icon-width;\n          height: $list-item-dense-primary-icon-width;\n        }\n\n        > md-icon:first-child:not(.md-avatar-icon) {\n          @include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-dense-primary-icon-width, auto);\n          margin-top: $dense-baseline-grid;\n          margin-bottom: $dense-baseline-grid;\n        }\n        .md-avatar, .md-avatar-icon {\n          @include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-dense-primary-avatar-width, auto);\n          margin-top: $dense-baseline-grid + 2px;\n          margin-bottom: $dense-baseline-grid + 2px;\n        }\n        .md-avatar {\n          flex: none;\n          width: $list-item-dense-primary-avatar-width;\n          height: $list-item-dense-primary-avatar-width;\n        }\n        .md-secondary-container {\n          .md-secondary.md-button {\n            margin-top: $dense-baseline-grid;\n            margin-bottom: $dense-baseline-grid;\n          }\n          md-checkbox:not(.md-dense-disabled) {\n            min-height: $icon-button-height;\n          }\n        }\n      }\n\n      &.md-2-line,\n      &.md-3-line {\n        &, & > .md-no-style {\n          .md-list-item-text {\n            &.md-offset {\n              @include rtl-prop(margin-left, margin-right, $list-item-primary-width, auto);\n            }\n\n            h3,\n            h4,\n            p {\n              line-height: $list-item-dense-line-height;\n              font-size: $list-item-dense-font-size;\n              padding-bottom: 4px;\n            }\n\n            h3 {\n              font-size: $list-item-dense-header-font-size;\n            }\n          }\n        }\n      }\n\n      &.md-2-line {\n        &, & > .md-no-style {\n          min-height: $list-item-dense-two-line-height;\n          @include ie11-min-height-flexbug($list-item-dense-two-line-height);\n\n          > .md-avatar, .md-avatar-icon {\n            margin-top: $baseline-grid * 1.5;\n          }\n        }\n      }\n\n      &.md-3-line {\n        &, & > .md-no-style {\n\n          min-height: $list-item-dense-three-line-height;\n          @include ie11-min-height-flexbug($list-item-dense-three-line-height);\n\n          > md-icon:first-child,\n          > .md-avatar {\n            margin-top: $baseline-grid * 2;\n          }\n        }\n      }\n    }\n    .md-subheader-inner {\n      padding-top: $dense-baseline-grid * 3;\n      padding-bottom: $dense-baseline-grid * 3;\n    }\n  }\n}\n\nmd-list-item {\n  // Ensure nested dividers are properly positioned\n  position: relative;\n\n  &.md-proxy-focus.md-focused .md-no-style {\n    transition: background-color 0.15s linear;\n  }\n\n  &._md-button-wrap {\n    position: relative;\n\n    > div.md-button:first-child {\n      // Layout - Vertically align the item content.\n      display: flex;\n      align-items: center;\n      justify-content: flex-start;\n\n      padding: $list-item-padding-vertical $list-item-padding-horizontal;\n      margin: 0;\n\n      font-weight: 400;\n      @include rtl(text-align, left, right);\n      border: medium none;\n\n      // The button executor should fill the whole list item.\n      > .md-button:first-child {\n        position: absolute;\n        top: 0;\n        left: 0;\n        height: 100%;\n\n        margin: 0;\n        padding: 0;\n      }\n\n      .md-list-item-inner {\n        // The list item content should fill the complete width.\n        width: 100%;\n        @include ie11-min-height-flexbug(inherit);\n      }\n\n    }\n\n  }\n\n  &.md-no-proxy,\n  .md-no-style {\n    position: relative;\n    padding: $list-item-padding-vertical $list-item-padding-horizontal;\n\n    // Layout [flex='auto']\n    flex: 1 1 auto;\n\n    &.md-button {\n      font-size: inherit;\n      height: inherit;\n      @include rtl(text-align, left, right);\n      text-transform: none;\n      width: 100%;\n      white-space: normal;\n      flex-direction: inherit;\n      align-items: inherit;\n      border-radius: 0;\n      margin: 0;\n\n      & > .md-ripple-container {\n        border-radius: 0;\n      }\n    }\n    &:focus {\n      outline: none\n    }\n  }\n  &.md-clickable:hover {\n    cursor: pointer;\n  }\n\n  md-divider {\n    position: absolute;\n    bottom: 0;\n    @include rtl-prop(left, right, 0, auto);\n    width: 100%;\n    &[md-inset] {\n      @include rtl-prop(left, right, $list-item-inset-divider-offset, auto);\n      width: calc(100% - #{$list-item-inset-divider-offset});\n      margin: 0 !important;\n    }\n  }\n\n  &,\n  .md-list-item-inner {\n\n    // Layout [flex layout-align='start center']\n    display: flex;\n    justify-content: flex-start;\n    align-items: center;\n\n    min-height: $list-item-height;\n    @include ie11-min-height-flexbug($list-item-height);\n\n    height: auto;\n\n    // Layout for controls in primary or secondary divs, or auto-infered first child\n    & > div.md-primary > md-icon:not(.md-avatar-icon),\n    & > div.md-secondary > md-icon:not(.md-avatar-icon),\n    & > md-icon:first-child:not(.md-avatar-icon),\n    > md-icon.md-secondary:not(.md-avatar-icon) {\n      width: $list-item-primary-icon-width;\n      margin-top: 16px;\n      margin-bottom: 12px;\n      box-sizing: content-box;\n    }\n    & > div.md-primary > md-checkbox,\n    & > div.md-secondary > md-checkbox,\n    & > md-checkbox,\n    md-checkbox.md-secondary {\n      align-self: center;\n      .md-label {\n        display: none;\n      }\n    }\n\n    & > md-icon:first-child:not(.md-avatar-icon) {\n      @include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-primary-icon-width, auto);\n    }\n\n    & .md-avatar, .md-avatar-icon {\n      margin-top: $baseline-grid;\n      margin-bottom: $baseline-grid;\n      @include rtl-prop(margin-right, margin-left, $list-item-primary-width - $list-item-primary-avatar-width, auto);\n      border-radius: 50%;\n      box-sizing: content-box;\n    }\n    & .md-avatar {\n      flex: none;\n      width: $list-item-primary-avatar-width;\n      height: $list-item-primary-avatar-width;\n    }\n    & .md-avatar-icon {\n      padding: 8px;\n\n      // Set the width/height to the same as the icon to fix issue on iOS Safari where the\n      // height: 100% was causing it to be larger than it's parent\n      svg {\n        width: $icon-size;\n        height: $icon-size;\n      }\n    }\n\n    & > md-checkbox {\n      width: 3 * $baseline-grid;\n      min-height: $icon-button-height;\n      @include rtl(margin-left, 0px, 29px);\n      @include rtl(margin-right, 29px, 0px);\n    }\n\n    .md-secondary-container {\n      display: flex;\n      align-items: center;\n      // Ensure the secondary button is not behind the primary button if its template is provided by\n      // a directive.\n      position: relative;\n\n      // Per W3C: https://www.w3.org/TR/css-flexbox/#flex-common\n      // By default, flex items won’t shrink below their minimum content size.\n      // Safari doesn't follow that specification due to a bug and expects the developer to\n      // explicitly disable flex shrinking.\n      flex-shrink: 0;\n\n      // Using margin auto to move them to the end of the list item is more elegant, because it has\n      // a lower priority than a flex filler and isn't introducing any overflow issues.\n      // The margin on the top is important to align multiple secondary items vertically.\n      margin: auto;\n\n      @include rtl(margin-right, 0, auto);\n      @include rtl(margin-left, auto, 0);\n\n      .md-button, .md-icon-button {\n        &:last-of-type {\n          // Reset 6px margin for the button.\n          @include rtl-prop(margin-right, margin-left, 0, auto);\n        }\n      }\n\n      md-checkbox {\n        margin: 0 6px;\n        padding: 0 8px;\n        min-height: $icon-button-height;\n\n        &:last-child {\n          width: $icon-button-width;\n          @include rtl-prop(margin-right, margin-left, 0, auto);\n        }\n      }\n\n      md-switch {\n        margin-top: 0;\n        margin-bottom: 0;\n\n        @include rtl-prop(margin-right, margin-left, -6px, auto);\n      }\n    }\n\n    & > p, & > .md-list-item-inner > p {\n      flex: 1 1 auto;\n      margin: 0;\n    }\n  }\n\n  &.md-2-line,\n  &.md-3-line {\n    &, & > .md-no-style {\n      align-items: flex-start;\n      justify-content: center;\n\n      &.md-long-text {\n        margin-top: $baseline-grid;\n        margin-bottom: $baseline-grid;\n      }\n\n      .md-list-item-text {\n        flex: 1 1 auto;\n        margin: auto;\n        text-overflow: ellipsis;\n        overflow: hidden;\n\n        &.md-offset {\n          @include rtl-prop(margin-left, margin-right, $list-item-primary-width, auto);\n        }\n\n        h3 {\n          font-size: $subhead-font-size-base;\n          font-weight: 400;\n          letter-spacing: 0.010em;\n          margin: $list-h3-margin;\n          line-height: $list-header-line-height;\n          overflow: hidden;\n          white-space: nowrap;\n          text-overflow: ellipsis;\n        }\n        h4 {\n          font-size: $body-font-size-base;\n          letter-spacing: 0.010em;\n          margin: $list-h4-margin;\n          font-weight: $list-h4-font-weight;\n          line-height: $list-header-line-height;\n          overflow: hidden;\n          white-space: nowrap;\n          text-overflow: ellipsis;\n        }\n        p {\n          font-size: $body-font-size-base;\n          font-weight: 500;\n          letter-spacing: 0.010em;\n          margin: $list-p-margin;\n          line-height: $list-p-line-height;\n        }\n      }\n    }\n  }\n\n  &.md-2-line {\n    &, & > .md-no-style {\n      height: auto;\n\n      min-height: $list-item-two-line-height;\n      @include ie11-min-height-flexbug($list-item-two-line-height);\n\n      > .md-avatar, .md-avatar-icon {\n        margin-top: $baseline-grid * 1.5;\n      }\n\n      > md-icon:first-child {\n        align-self: flex-start;\n      }\n\n      .md-list-item-text {\n        flex: 1 1 auto;\n      }\n    }\n  }\n\n  &.md-3-line {\n    &, & > .md-no-style {\n      height: auto;\n\n      min-height: $list-item-three-line-height;\n      @include ie11-min-height-flexbug($list-item-three-line-height);\n\n      > md-icon:first-child,\n      > .md-avatar {\n        margin-top: $baseline-grid * 2;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/list/list.spec.js",
    "content": "describe('mdListItem directive', function() {\n  var attachedElements = [];\n  var $compile, $rootScope;\n\n  beforeEach(module(\n    'material.components.list',\n    'material.components.checkbox',\n    'material.components.switch',\n    'material.components.button'\n  ));\n\n  beforeEach(inject(function(_$compile_, _$rootScope_) {\n    $compile = _$compile_;\n    $rootScope = _$rootScope_;\n  }));\n\n  afterEach(function() {\n    attachedElements.forEach(function(element) {\n      element.remove();\n    });\n    attachedElements = [];\n  });\n\n  function setup(html) {\n    var el;\n    inject(function($compile, $rootScope) {\n      el = $compile(html)($rootScope);\n      $rootScope.$apply();\n    });\n    attachedElements.push(el);\n\n    return el;\n  }\n\n  describe('md-list-item', function() {\n    it('should have `._md` class indicator', inject(function($compile, $rootScope) {\n      var element = $compile('<md-list><md-list-item></md-list-item></md-list>')($rootScope.$new());\n      expect(element.find('md-list-item').hasClass('_md')).toBe(true);\n    }));\n  });\n\n  it('forwards click events for md-checkbox', function() {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<md-checkbox ng-model=\"modelVal\"></md-checkbox>' +\n      '</md-list-item>');\n\n    var cntr = listItem[0].querySelector('div');\n\n    cntr.click();\n    expect($rootScope.modelVal).toBe(true);\n\n    cntr.click();\n    expect($rootScope.modelVal).toBe(false);\n\n  });\n\n  it('forwards click events for md-switch', function() {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<md-switch ng-model=\"modelVal\"></md-switch>' +\n      '</md-list-item>');\n\n    var cntr = listItem[0].querySelector('div');\n\n    cntr.click();\n    expect($rootScope.modelVal).toBe(true);\n\n    cntr.click();\n    expect($rootScope.modelVal).toBe(false);\n  });\n\n  it('should not wrap when proxies are disabled', function() {\n    var listItem = setup(\n      '<md-list-item class=\"md-no-proxy\">' +\n        '<md-switch ng-model=\"modelVal\"></md-switch>' +\n      '</md-list-item>'\n    );\n\n    var switchEl = listItem[0].querySelector('md-switch');\n\n    // If proxies are disabled, the list will not wrap anything.\n    expect(switchEl.parentNode).toBe(listItem[0]);\n\n    listItem.triggerHandler('click');\n    expect($rootScope.modelVal).toBeFalsy();\n\n    switchEl.click();\n    expect($rootScope.modelVal).toBeTruthy();\n\n    expect(listItem).not.toHaveClass('md-clickable')\n  });\n\n  it('should not trigger the proxy element, when clicking on a slider', function() {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<md-slider></md-slider>' +\n        '<md-switch ng-model=\"modelVal\"></md-switch>' +\n      '</md-list-item>');\n\n    var slider = listItem.find('md-slider')[0];\n\n    slider.click();\n\n    expect($rootScope.modelVal).toBeFalsy();\n  });\n\n  it('should convert spacebar keypress events as clicks', inject(function($mdConstant) {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<md-checkbox ng-model=\"modelVal\"></md-checkbox>' +\n      '</md-list-item>');\n\n    var checkbox = angular.element(listItem[0].querySelector('md-checkbox'));\n\n    expect($rootScope.modelVal).toBeFalsy();\n\n    checkbox.triggerHandler({\n      type: 'keypress',\n      keyCode: $mdConstant.KEY_CODE.SPACE\n    });\n\n    expect($rootScope.modelVal).toBe(true);\n  }));\n\n  it('should not convert spacebar keypress for text areas', inject(function($mdConstant) {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<textarea ng-model=\"modelVal\">' +\n      '</md-list-item>');\n\n    var inputEl = angular.element(listItem[0].querySelector('textarea')[0]);\n\n    expect($rootScope.modelVal).toBeFalsy();\n\n    inputEl.triggerHandler({\n      type: 'keypress',\n      keyCode: $mdConstant.KEY_CODE.SPACE\n    });\n\n    expect($rootScope.modelVal).toBeFalsy();\n  }));\n\n  it('should not convert spacebar keypress for editable elements', inject(function($mdConstant) {\n    var listItem = setup(\n      '<md-list-item>' +\n        '<div contenteditable=\"true\"></div>' +\n      '</md-list-item>');\n\n    var editableEl = listItem.find('div');\n    var onClickSpy = jasmine.createSpy('onClickSpy');\n\n    // We need to append our element to the DOM because the browser won't detect `contentEditable` when the element\n    // is hidden in the DOM. See the related issue for chromium:\n    // https://code.google.com/p/chromium/issues/detail?id=313082\n    document.body.appendChild(listItem[0]);\n\n    editableEl.on('click', onClickSpy);\n\n    // We need to dispatch the keypress natively, because otherwise the `keypress` won't be triggered in the list.\n    var event = document.createEvent('Event');\n    event.keyCode = $mdConstant.KEY_CODE.SPACE;\n    event.initEvent('keypress', true, true);\n\n    editableEl[0].dispatchEvent(event);\n\n    expect(onClickSpy).not.toHaveBeenCalled();\n\n    document.body.removeChild(listItem[0]);\n  }));\n\n  it('creates buttons when used with ng-click', function() {\n    var listItem = setup(\n      '<md-list-item ng-click=\"sayHello()\" ng-disabled=\"true\">' +\n        '<p>Hello world</p>' +\n      '</md-list-item>');\n\n    // List items, which are clickable always contain a button wrap at the top level.\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The button wrap should contain the button executor, the inner content and the\n    // secondary item container as children.\n    expect(buttonWrap.children().length).toBe(3);\n\n    var buttonExecutor = buttonWrap.children()[0];\n\n    // The list item should forward the click and disabled attributes.\n    expect(buttonExecutor.hasAttribute('ng-click')).toBe(true);\n    expect(buttonExecutor.hasAttribute('ng-disabled')).toBe(true);\n\n    var innerContent = buttonWrap.children()[1];\n\n    expect(innerContent.nodeName).toBe('DIV');\n    expect(innerContent.firstElementChild.nodeName).toBe('P');\n  });\n\n  it('creates buttons when used with ng-dblclick', function() {\n    var listItem = setup(\n      '<md-list-item ng-dblclick=\"sayHello()\" ng-disabled=\"true\">' +\n        '<p>Hello world</p>' +\n      '</md-list-item>');\n\n    // List items, which are clickable always contain a button wrap at the top level.\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The button wrap should contain the button executor, the inner content and the\n    // secondary item container as children.\n    expect(buttonWrap.children().length).toBe(3);\n\n    var buttonExecutor = buttonWrap.children()[0];\n\n    // The list item should forward the click and disabled attributes.\n    expect(buttonExecutor.hasAttribute('ng-dblclick')).toBe(true);\n    expect(buttonExecutor.hasAttribute('ng-disabled')).toBe(true);\n\n    var innerContent = buttonWrap.children()[1];\n\n    expect(innerContent.nodeName).toBe('DIV');\n    expect(innerContent.firstElementChild.nodeName).toBe('P');\n  });\n\n  it('creates buttons when used with ui-sref', function() {\n    var listItem = setup(\n      '<md-list-item ui-sref=\"somestate\">' +\n        '<p>Hello world</p>' +\n      '</md-list-item>');\n\n    // List items, which are clickable always contain a button wrap at the top level.\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The button wrap should contain the button executor, the inner content and the\n    // secondary item container as children.\n    expect(buttonWrap.children().length).toBe(3);\n\n    var buttonExecutor = buttonWrap.children()[0];\n\n    // The list item should forward the ui-sref attribute.\n    expect(buttonExecutor.hasAttribute('ui-sref')).toBe(true);\n\n    var innerContent = buttonWrap.children()[1];\n\n    expect(innerContent.nodeName).toBe('DIV');\n    expect(innerContent.firstElementChild.nodeName).toBe('P');\n  });\n\n  it('creates buttons when used with href', function() {\n    var listItem = setup(\n      '<md-list-item href=\"/somewhere\">' +\n        '<p>Hello world</p>' +\n      '</md-list-item>');\n\n    // List items, which are clickable always contain a button wrap at the top level.\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The button wrap should contain the button executor, the inner content and the\n    // secondary item container as children.\n    expect(buttonWrap.children().length).toBe(3);\n\n    var buttonExecutor = buttonWrap.children()[0];\n\n    // The list item should forward the href attribute.\n    expect(buttonExecutor.hasAttribute('href')).toBe(true);\n\n    var innerContent = buttonWrap.children()[1];\n\n    expect(innerContent.nodeName).toBe('DIV');\n    expect(innerContent.firstElementChild.nodeName).toBe('P');\n  });\n\n  it('should forward the md-no-focus class', function() {\n    var listItem = setup(\n      '<md-list-item ng-click=\"null\" class=\"md-no-focus\">' +\n        '<p>Clickable - Without Focus Style</p>' +\n      '</md-list-item>');\n\n    // List items, which are clickable always contain a button wrap at the top level.\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The button wrap should contain the button executor, the inner content and the\n    // secondary item container as children.\n    expect(buttonWrap.children().length).toBe(3);\n\n    var buttonExecutor = buttonWrap.children();\n\n    // The list item should forward the href and md-no-focus-style attribute.\n    expect(buttonExecutor.attr('ng-click')).toBeTruthy();\n    expect(buttonExecutor.hasClass('md-no-focus')).toBe(true);\n  });\n\n  it('moves aria-label to primary action', function() {\n    var listItem = setup('<md-list-item ng-click=\"sayHello()\" aria-label=\"Hello\"></md-list-item>');\n\n    var buttonWrap = listItem.children().eq(0);\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // The actual click button will be a child of the button.md-no-style wrapper.\n    var buttonExecutor = buttonWrap.children()[0];\n\n    expect(buttonExecutor.nodeName).toBe('BUTTON');\n    expect(buttonExecutor.getAttribute('aria-label')).toBe('Hello');\n  });\n\n  it('moves secondary items outside of the button', function() {\n    var listItem = setup(\n      '<md-list-item ng-click=\"sayHello()\">' +\n        '<p>Hello World</p>' +\n        '<md-icon class=\"md-secondary\" ng-click=\"goWild()\"></md-icon>' +\n      '</md-list-item>');\n\n    // First child is our button wrap\n    var firstChild = listItem.children().eq(0);\n    expect(firstChild[0].nodeName).toBe('DIV');\n\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // It should contain three elements, the button overlay, inner content\n    // and the secondary container.\n    expect(firstChild.children().length).toBe(3);\n\n    var secondaryContainer = firstChild.children().eq(2);\n    expect(secondaryContainer).toHaveClass('md-secondary-container');\n\n    // The secondary container should contain the md-icon,\n    // which has been transformed to an icon button.\n    expect(secondaryContainer.children()[0].nodeName).toBe('BUTTON');\n  });\n\n  it('should copy ng-show to the generated button parent of a clickable secondary item', function() {\n    var listItem = setup(\n      '<md-list-item ng-click=\"sayHello()\">' +\n        '<p>Hello World</p>' +\n        '<md-icon class=\"md-secondary\" ng-show=\"isShown\" ng-click=\"goWild()\"></md-icon>' +\n      '</md-list-item>');\n\n    // First child is our button wrap\n    var firstChild = listItem.children().eq(0);\n    expect(firstChild[0].nodeName).toBe('DIV');\n\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // It should contain three elements, the button overlay, inner content\n    // and the secondary container.\n    expect(firstChild.children().length).toBe(3);\n\n    var secondaryContainer = firstChild.children().eq(2);\n    expect(secondaryContainer).toHaveClass('md-secondary-container');\n\n    // The secondary container should contain the md-icon,\n    // which has been transformed to an icon button.\n    var iconButton = secondaryContainer.children()[0];\n\n    expect(iconButton.nodeName).toBe('BUTTON');\n    expect(iconButton.hasAttribute('ng-show')).toBe(true);\n\n    // The actual `md-icon` element, should not have the ng-show attribute anymore.\n    expect(iconButton.firstElementChild.hasAttribute('ng-show')).toBe(false);\n  });\n\n  it('moves multiple md-secondary items outside of the button', function() {\n    var listItem = setup(\n      '<md-list-item ng-click=\"sayHello()\">' +\n        '<p>Hello World</p>' +\n        '<md-icon class=\"md-secondary\" ng-click=\"goWild()\"></md-icon>' +\n        '<md-icon class=\"md-secondary\" ng-click=\"goWild2()\"></md-icon>' +\n      '</md-list-item>');\n\n    // First child is our button wrap\n    var firstChild = listItem.children().eq(0);\n    expect(firstChild[0].nodeName).toBe('DIV');\n\n    expect(listItem).toHaveClass('_md-button-wrap');\n\n    // It should contain three elements, the button overlay, inner content,\n    // and the secondary container.\n    expect(firstChild.children().length).toBe(3);\n\n    var secondaryContainer = firstChild.children().eq(2);\n    expect(secondaryContainer).toHaveClass('md-secondary-container');\n\n    // The secondary container should hold the two secondary items.\n    expect(secondaryContainer.children().length).toBe(2);\n\n    expect(secondaryContainer.children()[0].nodeName).toBe('BUTTON');\n    expect(secondaryContainer.children()[1].nodeName).toBe('BUTTON');\n  });\n\n  it('should not detect a normal button as a proxy element', function() {\n    var listItem = setup('<md-list-item><md-button ng-click=\"sayHello()\">Hello</md-button></md-list-item>');\n    expect(listItem.hasClass('md-no-proxy')).toBeTruthy();\n  });\n\n  it('should not detect a secondary button as a proxy element', function() {\n    var listItem = setup(\n      '<md-list-item>' +\n      '  <div>Content Here</div>' +\n      '  <md-button class=\"md-secondary\" ng-click=\"sayHello()\">Hello</md-button>' +\n      '</md-list-item>'\n    );\n    expect(listItem.hasClass('md-no-proxy')).toBeTruthy();\n  });\n\n  it('should copy md-icon.md-secondary attributes to the button', function() {\n    var listItem = setup(\n      '<md-list-item>' +\n      '  <div>Content Here</div>' +\n      '  <md-checkbox></md-checkbox>' +\n      '  <md-icon class=\"md-secondary\" ng-click=\"sayHello()\" ng-disabled=\"true\">Hello</md-icon>' +\n      '</md-list-item>'\n    );\n\n    var button = listItem.find('button');\n\n    expect(button[0].hasAttribute('ng-click')).toBeTruthy();\n    expect(button[0].hasAttribute('ng-disabled')).toBeTruthy();\n  });\n\n  describe('with a md-menu', function() {\n\n    it('should forward click events on the md-menu trigger button', function() {\n      var template =\n        '<md-list-item>' +\n          '<md-menu>' +\n            '<md-button ng-click=\"openMenu()\"></md-button>' +\n        ' </md-menu>' +\n        '</md-list-item>';\n\n      var listItem = setup(template);\n      var cntr = listItem[0].querySelector('div');\n      var openMenu = jasmine.createSpy('openMenu');\n\n      $rootScope.openMenu = openMenu;\n\n      if (cntr && cntr.click) {\n        cntr.click();\n        expect(openMenu).toHaveBeenCalled();\n      }\n\n    });\n\n    it('should detect the menu position mode when md-menu is aligned at right', function() {\n      var template =\n        '<md-list-item>' +\n          '<span>Menu should be aligned right</span>' +\n          '<md-menu>' +\n            '<md-button ng-click=\"openMenu()\"></md-button>' +\n          '</md-menu>' +\n        '</md-list-item>';\n\n      var listItem = setup(template);\n\n      var mdMenu = listItem.find('md-menu');\n\n      expect(mdMenu.attr('md-position-mode')).toBe('right target');\n    });\n\n    it('should detect the menu position mode when md-menu is aligned at left', function() {\n      var template =\n        '<md-list-item>' +\n          '<md-menu>' +\n            '<md-button ng-click=\"openMenu()\"></md-button>' +\n          '</md-menu>' +\n          '<span>Menu should be aligned left</span>' +\n        '</md-list-item>';\n\n      var listItem = setup(template);\n\n      var mdMenu = listItem.find('md-menu');\n\n      expect(mdMenu.attr('md-position-mode')).toBe('left target');\n    });\n\n    it('should apply an aria-label if not specified', function() {\n      var template =\n        '<md-list-item>' +\n          '<span>Aria Label Menu</span>' +\n          '<md-menu>' +\n            '<md-button ng-click=\"openMenu()\"></md-button>' +\n          '</md-menu>' +\n        '</md-list-item>';\n\n      var listItem = setup(template);\n\n      var mdMenuButton = listItem[0].querySelector('md-menu > button');\n\n      expect(mdMenuButton.getAttribute('aria-label')).toBe('Open List Menu');\n    });\n\n    it('should apply $mdMenuOpen to the button if not present', function() {\n      var template =\n        '<md-list-item>' +\n          '<span>Aria Label Menu</span>' +\n          '<md-menu>' +\n            '<md-button>Should Open the Menu</md-button>' +\n          '</md-menu>' +\n        '</md-list-item>';\n\n      var listItem = setup(template);\n\n      var mdMenuButton = listItem[0].querySelector('md-menu > button');\n\n      expect(mdMenuButton.getAttribute('ng-click')).toBe('$mdMenu.open($event)');\n    });\n  });\n\n  describe('aria-label', function() {\n\n    it('should copy label to the button executor element', function() {\n      var listItem = setup('<md-list-item ng-click=\"null\" aria-label=\"Test\">');\n      var buttonEl = listItem.find('button');\n      var listItemInnerElement = listItem[0].querySelector('.md-list-item-inner');\n\n      // The aria-label attribute should be moved to the button element.\n      expect(buttonEl.attr('aria-label')).toBe('Test');\n      expect(listItem.attr('aria-label')).toBeFalsy();\n      expect(listItemInnerElement.getAttribute('aria-hidden')).toBeFalsy();\n    });\n\n    it('should determine the label from the content if not set', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"null\">' +\n          '<span>Content</span>' +\n          '<span aria-hidden=\"true\">Hidden</span>' +\n        '</md-list-item>'\n      );\n\n      var buttonEl = listItem.find('button');\n      var listItemInnerElement = listItem[0].querySelector('.md-list-item-inner');\n\n      // The aria-label attribute should be determined from the content.\n      expect(buttonEl.attr('aria-label')).toBe('Content');\n      expect(listItemInnerElement.getAttribute('aria-hidden')).toBeTruthy();\n    });\n\n    it('should determine the label from the bound content if aria-label is not set', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"null\">' +\n        '<span>{{ content }}</span>' +\n        '<span aria-hidden=\"true\">Hidden</span>' +\n        '</md-list-item>'\n      );\n\n      $rootScope.$apply('content = \"Content\"');\n\n      var buttonEl = listItem.find('button');\n\n      // The aria-label attribute should be determined from the content.\n      expect(buttonEl.attr('aria-label')).toBe('Content');\n    });\n\n    it('should determine the toggle label from the content if not set', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"null\">' +\n        '  <span>Content</span>' +\n        '  <md-switch class=\"md-secondary\" ng-model=\"isContentOn\"></md-switch>' +\n        '</md-list-item>'\n      );\n\n      var buttonElement = listItem.find('button');\n      var switchElement = listItem.find('md-switch');\n\n      // The aria-label attribute should be determined from the content.\n      expect(buttonElement.attr('aria-label')).toBe('Content');\n      expect(switchElement.attr('aria-label')).toBe('Toggle Content');\n    });\n\n    it('should warn when label is missing and content is empty', inject(function($log) {\n      // Clear the log stack to assert that a new warning has been added.\n      $log.reset();\n\n      setup('<md-list-item ng-click=\"null\">');\n\n      // Expect $log to have one $mdAria warning, because the button misses an aria-label.\n      expect($log.warn.logs.length).toBe(1);\n    }));\n\n  });\n\n  describe('with a clickable item', function() {\n\n    it('should wrap secondary icons in a md-button', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"something()\">' +\n        '  <p>Content Here</p>' +\n        '  <md-icon class=\"md-secondary\" ng-click=\"heart()\">heart</md-icon>' +\n        '</md-list-item>'\n      );\n\n      var buttons = listItem.find('button');\n\n      // Check that we wrapped the icon\n      expect(listItem[0].querySelector('button > md-icon')).toBeTruthy();\n\n      // Check the button actions\n      expect(buttons[0].attributes['ng-click'].value).toBe(\"something()\");\n      expect(buttons[1].attributes['ng-click'].value).toBe(\"heart()\");\n    });\n\n    it('should not wrap secondary buttons in a md-button', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"something()\">' +\n        '  <p>Content Here</p>' +\n        '  <button class=\"md-secondary\" ng-click=\"like()\">Like</button>' +\n        '</md-list-item>'\n      );\n\n      // There should be two buttons (the button executor, and the secondary item)\n      expect(listItem.find('button').length).toBe(2);\n\n      // Check that we didn't wrap the button in an md-button\n      expect(listItem[0].querySelector('md-button button.md-secondary')).toBeFalsy();\n    });\n\n    it('should not wrap secondary md-buttons in a md-button', function() {\n      var listItem = setup(\n        '<md-list-item ng-click=\"something()\">' +\n        '  <p>Content Here</p>' +\n        '  <md-button class=\"md-secondary\" ng-click=\"like()\">Like</md-button>' +\n        '</md-list-item>'\n      );\n\n      // There should be 2 buttons that are siblings\n      expect(listItem.find('button').length).toBe(2);\n\n      // Check that we didn't wrap the md-button in an md-button\n      expect(listItem[0].querySelector('button.md-button button.md-button.md-secondary')).toBeFalsy();\n    });\n  });\n\n});\n"
  },
  {
    "path": "src/components/menu/demoBasicUsage/index.html",
    "content": "<div class=\"md-menu-demo\" ng-controller=\"BasicDemoCtrl as ctrl\" ng-cloak>\n\n  <div class=\"menu-demo-container\" layout-align=\"center center\" layout=\"column\">\n    <h2 class=\"md-title\">Simple dropdown menu</h2>\n    <p>Applying the <code>md-menu-origin</code> and <code>md-menu-align-target</code> attributes ensure that the menu elements align.\n    Note: If you select the Redial menu option, then a modal dialog will zoom out of the phone icon button.</p>\n    <md-menu>\n      <md-button aria-label=\"Open phone interactions menu\" class=\"md-icon-button\" ng-click=\"ctrl.openMenu($mdMenu, $event)\">\n        <md-icon md-menu-origin md-svg-icon=\"call:phone\"></md-icon>\n      </md-button>\n      <md-menu-content width=\"4\">\n        <md-menu-item>\n          <md-button ng-click=\"ctrl.redial($event)\">\n            <md-icon md-svg-icon=\"call:dialpad\" md-menu-align-target></md-icon>\n            Redial\n          </md-button>\n        </md-menu-item>\n        <md-menu-item>\n          <md-button disabled=\"disabled\" ng-click=\"ctrl.checkVoicemail()\">\n            <md-icon md-svg-icon=\"call:voicemail\"></md-icon>\n            Check voicemail\n          </md-button>\n        </md-menu-item>\n        <md-menu-divider></md-menu-divider>\n        <md-menu-item>\n          <md-button ng-click=\"ctrl.toggleNotifications()\">\n            <md-icon md-svg-icon=\"social:notifications-{{ctrl.notificationsEnabled ? 'off' : 'on'}}\"></md-icon>\n            {{ctrl.notificationsEnabled ? 'Disable' : 'Enable' }} notifications\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/menu/demoBasicUsage/script.js",
    "content": "angular\n  .module('menuDemoBasic', ['ngMaterial'])\n  .config(function($mdIconProvider) {\n    $mdIconProvider\n      .iconSet(\"call\", 'img/icons/sets/communication-icons.svg', 24)\n      .iconSet(\"social\", 'img/icons/sets/social-icons.svg', 24);\n  })\n  .controller('BasicDemoCtrl', function DemoCtrl($mdDialog) {\n    var originatorEv;\n\n    this.openMenu = function($mdMenu, ev) {\n      originatorEv = ev;\n      $mdMenu.open(ev);\n    };\n\n    this.notificationsEnabled = true;\n    this.toggleNotifications = function() {\n      this.notificationsEnabled = !this.notificationsEnabled;\n    };\n\n    this.redial = function() {\n      $mdDialog.show(\n        $mdDialog.alert()\n          .targetEvent(originatorEv)\n          .clickOutsideToClose(true)\n          .parent('body')\n          .title('Suddenly, a redial')\n          .textContent('You just called a friend; who told you the most amazing story. Have a cookie!')\n          .ok('That was easy')\n      );\n\n      originatorEv = null;\n    };\n\n    this.checkVoicemail = function() {\n      // This never happens.\n    };\n  });\n"
  },
  {
    "path": "src/components/menu/demoBasicUsage/style.css",
    "content": ".md-menu-demo {\n  padding: 24px;\n}\n\n.menu-demo-container {\n  min-height: 200px;\n}\n"
  },
  {
    "path": "src/components/menu/demoCustomTrigger/index.html",
    "content": "<div class=\"md-menu-demo\" ng-cloak>\n  <div class=\"menu-demo-container\" layout-align=\"center center\" layout=\"column\">\n    <h2 class=\"md-title\">Custom triggers</h2>\n    <p>\n      You can customize the events that open and close a menu by using the <code>$mdMenu.open</code> and\n      <code>$mdMenu.close</code> methods. This is an example of triggering a menu on hover, instead of click.\n    </p>\n\n    <md-menu>\n      <md-button aria-label=\"Open menu with custom trigger\" class=\"md-icon-button\" ng-mouseenter=\"$mdMenu.open()\">\n        <md-icon md-menu-origin md-svg-icon=\"call:textsms\"></md-icon>\n      </md-button>\n      <md-menu-content width=\"4\" ng-mouseleave=\"$mdMenu.close()\">\n        <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n          <md-button>\n            Option {{item}}\n          </md-button>\n        </md-menu-item>\n      </md-menu-content>\n    </md-menu>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/menu/demoCustomTrigger/script.js",
    "content": "angular\n  .module('menuDemoCustomTrigger', ['ngMaterial'])\n  .config(function($mdIconProvider) {\n    $mdIconProvider\n      .iconSet('call', 'img/icons/sets/communication-icons.svg', 24);\n  });\n"
  },
  {
    "path": "src/components/menu/demoCustomTrigger/style.css",
    "content": ".md-menu-demo {\n  padding: 24px;\n}\n\n.menu-demo-container {\n  min-height: 200px;\n}\n"
  },
  {
    "path": "src/components/menu/demoMenuDensity/index.html",
    "content": "<div class=\"md-menu-demo\" ng-controller=\"DensityDemoCtrl as ctrl\" style=\"min-height: 350px\" ng-cloak>\n  <div class=\"menu-demo-container\" layout-align=\"start center\" layout=\"column\">\n    <div layout-align=\"start center\" layout=\"column\" style=\"min-height: 70px;\">\n      <h2 class=\"md-title\">Different Densities</h2>\n      <p>\n        You can add the <code>md-dense</code> class to the <code>md-menu-content</code> element\n        in order to reduce the size of menu items as described in the\n        <a ng-href=\"{{ctrl.menuHref}}\" target=\"_blank\">Menu Specs</a>.\n      </p>\n    </div>\n    <div layout-wrap layout=\"row\" layout-fill layout-align=\"space-between center\"\n         style=\"min-height: 100px;\">\n      <div layout=\"column\" flex=\"50\" flex-sm=\"100\" flex-xs=\"100\" layout-align=\"center center\">\n        <p>Normal density menu</p>\n        <md-menu>\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\"\n                     ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:phone\"></md-icon>\n          </md-button>\n          <md-menu-content>\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"><span\n                  md-menu-align-target>Option</span> {{item}}\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div layout=\"column\" flex=\"50\" flex-sm=\"100\" flex-xs=\"100\" layout-align=\"center center\">\n        <p>Dense menu</p>\n        <md-menu>\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\"\n                     ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:email\"></md-icon>\n          </md-button>\n          <md-menu-content class=\"md-dense\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"><span\n                  md-menu-align-target>Option</span> {{item}}\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/menu/demoMenuDensity/script.js",
    "content": "angular.module('menuDemoDensity', ['ngMaterial']).config(function($mdIconProvider) {\n  $mdIconProvider\n    .iconSet(\"call\", 'img/icons/sets/communication-icons.svg', 24)\n    .iconSet(\"social\", 'img/icons/sets/social-icons.svg', 24);\n}).controller('DensityDemoCtrl', function($mdDialog) {\n  var ctrl = this;\n  ctrl.menuHref = \"https://material.io/archive/guidelines/components/menus.html#menus-specs\";\n\n  this.announceClick = function(index) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('You clicked!')\n        .textContent('You clicked the menu item at index ' + index)\n        .ok('Nice')\n    );\n  };\n});\n"
  },
  {
    "path": "src/components/menu/demoMenuDensity/style.css",
    "content": ".md-menu-demo {\n  padding: 24px;\n}\n.menu-demo-container {\n  min-height: 200px;\n}\n"
  },
  {
    "path": "src/components/menu/demoMenuPositionModes/index.html",
    "content": "<div class=\"md-menu-demo\" ng-controller=\"PositionDemoCtrl as ctrl\" ng-cloak style=\"min-height:350px;\">\n  <div class=\"menu-demo-container\" layout-align=\"start center\" layout=\"column\" >\n    <div layout-align=\"start center\" layout=\"column\" style=\"min-height:150px;\" >\n      <h2 class=\"md-title\">Position Mode Demos</h2>\n      <p>The <code>md-position-mode</code> attribute can be used to specify the positioning along the <code>x</code> and <code>y</code> axis.</p>\n    </div>\n    <div class=\"menus\"  layout-wrap layout=\"row\" layout-fill layout-align=\"space-between center\" style=\"min-height:200px;\">\n      <div layout=\"column\" flex-xs=\"100\" flex-sm=\"100\" flex=\"33\" layout-align=\"center center\">\n        <p>Target Mode Positioning (default)</p>\n        <md-menu>\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:business\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"6\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\">\n                <md-icon md-menu-align-target md-svg-icon=\"call:no-sim\"></md-icon>\n                Option {{item}}\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div layout=\"column\" flex-xs=\"100\" flex-sm=\"100\" flex=\"33\" layout-align=\"center center\">\n        <p>Target mode with <code>md-offset</code></p>\n        <md-menu md-offset=\"0 -5\">\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"ctrl.openMenu($mdMenu, $event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:ring-volume\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"4\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"> <span md-menu-align-target>Option</span> {{item}} </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div layout=\"column\" flex-xs=\"100\" flex-sm=\"100\" flex=\"33\" layout-align=\"center center\">\n        <p><code>md-position-mode=\"target-right target\"</code></p>\n        <md-menu md-position-mode=\"target-right target\" >\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:portable-wifi-off\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"4\" >\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\">\n                  <div layout=\"row\" flex>\n                    <p flex>Option {{item}}</p>\n                    <md-icon md-menu-align-target md-svg-icon=\"call:portable-wifi-off\" style=\"margin: auto 3px auto 0;\"></md-icon>\n                  </div>\n              </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n    </div>\n  </div>\n</div>\n\n"
  },
  {
    "path": "src/components/menu/demoMenuPositionModes/script.js",
    "content": "angular\n  .module('menuDemoPosition', ['ngMaterial'])\n  .config(function($mdIconProvider) {\n    $mdIconProvider\n      .iconSet(\"call\", 'img/icons/sets/communication-icons.svg', 24)\n      .iconSet(\"social\", 'img/icons/sets/social-icons.svg', 24);\n  })\n  .controller('PositionDemoCtrl', function DemoCtrl($mdDialog) {\n    var originatorEv;\n\n    this.openMenu = function($mdMenu, ev) {\n      originatorEv = ev;\n      $mdMenu.open(ev);\n    };\n\n    this.announceClick = function(index) {\n      $mdDialog.show(\n        $mdDialog.alert()\n          .title('You clicked!')\n          .textContent('You clicked the menu item at index ' + index)\n          .ok('Nice')\n          .targetEvent(originatorEv)\n      );\n      originatorEv = null;\n    };\n  });\n\n\n"
  },
  {
    "path": "src/components/menu/demoMenuPositionModes/style.css",
    "content": ".md-menu-demo {\n  padding: 24px;\n}\n\n.menu-demo-container {\n  min-height: 200px;\n}\n"
  },
  {
    "path": "src/components/menu/demoMenuWidth/index.html",
    "content": "<div class=\"md-menu-demo\" ng-controller=\"WidthDemoCtrl as ctrl\" style=\"min-height:350px\" ng-cloak>\n  <div class=\"menu-demo-container\" layout-align=\"start center\" layout=\"column\">\n    <div layout-align=\"start center\" layout=\"column\" style=\"min-height:70px;\" >\n      <h2 class=\"md-title\">Different Widths</h2>\n      <p>\n        <code>md-menu-content</code> may specify a <code>width</code> attribute which will follow\n        the <a ng-href=\"{{ctrl.menuHref}}\" target=\"_blank\">Menu Specs</a>.\n      </p>\n    </div>\n    <div class=\"menus\" layout-wrap layout=\"row\" layout-fill layout-align=\"space-between center\" style=\"min-height:100px;\">\n      <div layout=\"column\" flex=\"33\" flex-sm=\"100\" flex-xs=\"100\" layout-align=\"center center\">\n        <p>Wide menu (<code>width=6</code>)</p>\n        <md-menu md-offset=\"0 -7\">\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:phone\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"6\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"> <span md-menu-align-target>Option</span> {{item}} </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div layout=\"column\" flex=\"33\" flex-sm=\"100\" flex-xs=\"100\" layout-align=\"center center\">\n        <p>Medium menu (<code>width=4</code>)</p>\n        <md-menu md-offset=\"0 -7\">\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:email\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"4\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"> <span md-menu-align-target>Option</span> {{item}} </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n      <div layout=\"column\" flex=\"33\" flex-sm=\"100\" flex-xs=\"100\" layout-align=\"center center\">\n        <p>Small menu (<code>width=2</code>)</p>\n        <md-menu md-offset=\"0 -7\">\n          <md-button aria-label=\"Open demo menu\" class=\"md-icon-button\" ng-click=\"$mdMenu.open($event)\">\n            <md-icon md-menu-origin md-svg-icon=\"call:chat\"></md-icon>\n          </md-button>\n          <md-menu-content width=\"2\">\n            <md-menu-item ng-repeat=\"item in [1, 2, 3]\">\n              <md-button ng-click=\"ctrl.announceClick($index)\"> <span md-menu-align-target>Option</span> {{item}} </md-button>\n            </md-menu-item>\n          </md-menu-content>\n        </md-menu>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/menu/demoMenuWidth/script.js",
    "content": "angular.module('menuDemoWidth', ['ngMaterial']).config(function($mdIconProvider) {\n  $mdIconProvider\n    .iconSet(\"call\", 'img/icons/sets/communication-icons.svg', 24)\n    .iconSet(\"social\", 'img/icons/sets/social-icons.svg', 24);\n}).controller('WidthDemoCtrl', function($mdDialog) {\n  var ctrl = this;\n  ctrl.menuHref = \"https://material.io/archive/guidelines/components/menus.html#menus-specs\";\n\n  this.announceClick = function(index) {\n    $mdDialog.show(\n      $mdDialog.alert()\n        .title('You clicked!')\n        .textContent('You clicked the menu item at index ' + index)\n        .ok('Nice')\n    );\n  };\n});\n"
  },
  {
    "path": "src/components/menu/demoMenuWidth/style.css",
    "content": ".md-menu-demo {\n  padding: 24px;\n}\n\n.menu-demo-container {\n  min-height: 200px;\n}\n"
  },
  {
    "path": "src/components/menu/js/menuController.js",
    "content": "\n\nangular\n    .module('material.components.menu')\n    .controller('mdMenuCtrl', MenuController);\n\n/**\n * @ngInject\n */\nfunction MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $rootScope, $q, $log) {\n\n  var prefixer = $mdUtil.prefixer();\n  var menuContainer;\n  var self = this;\n  var triggerElement;\n\n  this.nestLevel = parseInt($attrs.mdNestLevel, 10) || 0;\n\n  /**\n   * Called by our linking fn to provide access to the menu-content\n   * element removed during link\n   */\n  this.init = function init(setMenuContainer, opts) {\n    opts = opts || {};\n    menuContainer = setMenuContainer;\n\n    // Default element for ARIA attributes has the ngClick or ngMouseenter expression\n    triggerElement = $element[0].querySelector(prefixer.buildSelector(['ng-click', 'ng-mouseenter']));\n    triggerElement.setAttribute('aria-expanded', 'false');\n\n    this.isInMenuBar = opts.isInMenuBar;\n    this.mdMenuBarCtrl = opts.mdMenuBarCtrl;\n    this.nestedMenus = $mdUtil.nodesToArray(menuContainer[0].querySelectorAll('.md-nested-menu'));\n\n    menuContainer.on('$mdInterimElementRemove', function() {\n      self.isOpen = false;\n      $mdUtil.nextTick(function(){ self.onIsOpenChanged(self.isOpen);});\n    });\n    $mdUtil.nextTick(function(){ self.onIsOpenChanged(self.isOpen);});\n\n    var menuContainerId = 'menu_container_' + $mdUtil.nextUid();\n    menuContainer.attr('id', menuContainerId);\n    angular.element(triggerElement).attr({\n      'aria-owns': menuContainerId,\n      'aria-haspopup': 'true'\n    });\n\n    $scope.$on('$destroy', angular.bind(this, function() {\n      this.disableHoverListener();\n      $mdMenu.destroy();\n    }));\n\n    menuContainer.on('$destroy', function() {\n      $mdMenu.destroy();\n    });\n  };\n\n  var openMenuTimeout, menuItems, deregisterScopeListeners = [];\n  this.enableHoverListener = function() {\n    deregisterScopeListeners.push($rootScope.$on('$mdMenuOpen', function(event, el) {\n      if (menuContainer[0].contains(el[0])) {\n        self.currentlyOpenMenu = el.controller('mdMenu');\n        self.isAlreadyOpening = false;\n        self.currentlyOpenMenu.registerContainerProxy(self.triggerContainerProxy.bind(self));\n      }\n    }));\n    deregisterScopeListeners.push($rootScope.$on('$mdMenuClose', function(event, el) {\n      if (menuContainer[0].contains(el[0])) {\n        self.currentlyOpenMenu = undefined;\n      }\n    }));\n    menuItems = angular.element($mdUtil.nodesToArray(menuContainer[0].children[0].children));\n    menuItems.on('mouseenter', self.handleMenuItemHover);\n    menuItems.on('mouseleave', self.handleMenuItemMouseLeave);\n  };\n\n  this.disableHoverListener = function() {\n    while (deregisterScopeListeners.length) {\n      deregisterScopeListeners.shift()();\n    }\n    menuItems && menuItems.off('mouseenter', self.handleMenuItemHover);\n    menuItems && menuItems.off('mouseleave', self.handleMenuItemMouseLeave);\n  };\n\n  this.handleMenuItemHover = function(event) {\n    if (self.isAlreadyOpening) return;\n    var nestedMenu = (\n      event.target.querySelector('md-menu')\n        || $mdUtil.getClosest(event.target, 'MD-MENU')\n    );\n    openMenuTimeout = $timeout(function() {\n      if (nestedMenu) {\n        nestedMenu = angular.element(nestedMenu).controller('mdMenu');\n      }\n\n      if (self.currentlyOpenMenu && self.currentlyOpenMenu != nestedMenu) {\n        var closeTo = self.nestLevel + 1;\n        self.currentlyOpenMenu.close(true, { closeTo: closeTo });\n        self.isAlreadyOpening = !!nestedMenu;\n        nestedMenu && nestedMenu.open();\n      } else if (nestedMenu && !nestedMenu.isOpen && nestedMenu.open) {\n        self.isAlreadyOpening = !!nestedMenu;\n        nestedMenu && nestedMenu.open();\n      }\n    }, nestedMenu ? 100 : 250);\n    var focusableTarget = event.currentTarget.querySelector('.md-button:not([disabled])');\n    focusableTarget && focusableTarget.focus();\n  };\n\n  this.handleMenuItemMouseLeave = function() {\n    if (openMenuTimeout) {\n      $timeout.cancel(openMenuTimeout);\n      openMenuTimeout = undefined;\n    }\n  };\n\n\n  /**\n   * Uses the $mdMenu interim element service to open the menu contents\n   */\n  this.open = function openMenu(ev) {\n    ev && ev.stopPropagation();\n    ev && ev.preventDefault();\n    if (self.isOpen) return;\n    self.enableHoverListener();\n    self.isOpen = true;\n    $mdUtil.nextTick(function(){ self.onIsOpenChanged(self.isOpen);});\n    triggerElement = triggerElement || (ev ? ev.target : $element[0]);\n    triggerElement.setAttribute('aria-expanded', 'true');\n    $scope.$emit('$mdMenuOpen', $element);\n    $mdMenu.show({\n      scope: $scope,\n      mdMenuCtrl: self,\n      nestLevel: self.nestLevel,\n      element: menuContainer,\n      target: triggerElement,\n      preserveElement: true,\n      parent: 'body'\n    }).finally(function() {\n      triggerElement.setAttribute('aria-expanded', 'false');\n      self.disableHoverListener();\n    });\n  };\n\n  this.onIsOpenChanged = function(isOpen) {\n    if (isOpen) {\n      menuContainer.attr('aria-hidden', 'false');\n      $element[0].classList.add('md-open');\n      angular.forEach(self.nestedMenus, function(el) {\n        el.classList.remove('md-open');\n      });\n    } else {\n      menuContainer.attr('aria-hidden', 'true');\n      $element[0].classList.remove('md-open');\n    }\n    $scope.$mdMenuIsOpen = self.isOpen;\n  };\n\n  this.focusMenuContainer = function focusMenuContainer() {\n    var focusTarget = menuContainer[0]\n      .querySelector(prefixer.buildSelector(['md-menu-focus-target', 'md-autofocus']));\n\n    if (!focusTarget) focusTarget = menuContainer[0].querySelector('.md-button:not([disabled])');\n    focusTarget.focus();\n  };\n\n  this.registerContainerProxy = function registerContainerProxy(handler) {\n    this.containerProxy = handler;\n  };\n\n  this.triggerContainerProxy = function triggerContainerProxy(ev) {\n    this.containerProxy && this.containerProxy(ev);\n  };\n\n  this.destroy = function() {\n    return self.isOpen ? $mdMenu.destroy() : $q.when(false);\n  };\n\n  // Use the $mdMenu interim element service to close the menu contents\n  this.close = function closeMenu(skipFocus, closeOpts) {\n    if (!self.isOpen) return;\n    self.isOpen = false;\n    $mdUtil.nextTick(function(){ self.onIsOpenChanged(self.isOpen);});\n\n    var eventDetails = angular.extend({}, closeOpts, { skipFocus: skipFocus });\n    $scope.$emit('$mdMenuClose', $element, eventDetails);\n    $mdMenu.hide(null, closeOpts);\n\n    if (!skipFocus) {\n      var el = self.restoreFocusTo || $element.find('button')[0];\n      if (el instanceof angular.element) el = el[0];\n      if (el) el.focus();\n    }\n  };\n\n  /**\n   * Build a nice object out of our string attribute which specifies the\n   * target mode for left and top positioning\n   */\n  this.positionMode = function positionMode() {\n    var attachment = ($attrs.mdPositionMode || 'target').split(' ');\n\n    // If attachment is a single item, duplicate it for our second value.\n    // ie. 'target' -> 'target target'\n    if (attachment.length === 1) {\n      attachment.push(attachment[0]);\n    }\n\n    return {\n      left: attachment[0],\n      top: attachment[1]\n    };\n  };\n\n  /**\n   * Build a nice object out of our string attribute which specifies\n   * the offset of top and left in pixels.\n   */\n  this.offsets = function offsets() {\n    var position = ($attrs.mdOffset || '0 0').split(' ').map(parseFloat);\n    if (position.length === 2) {\n      return {\n        left: position[0],\n        top: position[1]\n      };\n    } else if (position.length === 1) {\n      return {\n        top: position[0],\n        left: position[0]\n      };\n    } else {\n      throw Error('Invalid offsets specified. Please follow format <x, y> or <n>');\n    }\n  };\n\n  // Functionality that is exposed in the view.\n  $scope.$mdMenu = {\n    open: this.open,\n    close: this.close\n  };\n}\n"
  },
  {
    "path": "src/components/menu/js/menuDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name mdMenu\n * @module material.components.menu\n * @restrict E\n * @description\n *\n * Menus are elements that open when clicked. They are useful for displaying\n * additional options within the context of an action.\n *\n * Every `md-menu` must specify exactly two child elements. The first element is what is\n * left in the DOM and is used to open the menu. This element is called the trigger element.\n * The trigger element's scope has access to `$mdMenu.open($event)`\n * which it may call to open the menu. By passing $event as argument, the\n * corresponding event is stopped from propagating up the DOM-tree. Similarly, `$mdMenu.close()`\n * can be used to close the menu.\n *\n * The second element is the `md-menu-content` element which represents the\n * contents of the menu when it is open. Typically this will contain `md-menu-item`s,\n * but you can do custom content as well.\n *\n * <hljs lang=\"html\">\n * <md-menu>\n *  <!-- Trigger element is a md-button with an icon -->\n *  <md-button ng-click=\"$mdMenu.open($event)\" class=\"md-icon-button\" aria-label=\"Open sample menu\">\n *    <md-icon md-svg-icon=\"call:phone\"></md-icon>\n *  </md-button>\n *  <md-menu-content>\n *    <md-menu-item><md-button ng-click=\"doSomething()\">Do Something</md-button></md-menu-item>\n *  </md-menu-content>\n * </md-menu>\n * </hljs>\n\n * ## Sizing Menus\n *\n * The width of the menu when it is open may be specified by specifying a `width`\n * attribute on the `md-menu-content` element.\n * See the [Material Design Spec](https://material.io/archive/guidelines/components/menus.html#menus-simple-menus)\n * for more information.\n *\n * ## Menu Density\n *\n * You can use dense menus by adding the `md-dense` class to the `md-menu-content` element.\n * This reduces the height of menu items, their top and bottom padding, and default font size.\n * Without the `md-dense` class, we use the \"mobile\" height of `48px`. With the `md-dense` class,\n * we use the \"desktop\" height of `32px`. We do not support the \"dense desktop\" option in the spec,\n * which uses a height of `24px`, at this time.\n * See the [Menu Specs](https://material.io/archive/guidelines/components/menus.html#menus-specs)\n * section of the Material Design Spec for more information.\n *\n * ## Aligning Menus\n *\n * When a menu opens, it is important that the content aligns with the trigger element.\n * Failure to align menus can result in jarring experiences for users as content\n * suddenly shifts. To help with this, `md-menu` provides several APIs to help\n * with alignment.\n *\n * ### Target Mode\n *\n * By default, `md-menu` will attempt to align the `md-menu-content` by aligning\n * designated child elements in both the trigger and the menu content.\n *\n * To specify the alignment element in the `trigger` you can use the `md-menu-origin`\n * attribute on a child element. If no `md-menu-origin` is specified, the `md-menu`\n * will be used as the origin element.\n *\n * Similarly, the `md-menu-content` may specify a `md-menu-align-target` for a\n * `md-menu-item` to specify the node that it should try and align with.\n *\n * In this example code, we specify an icon to be our origin element, and an\n * icon in our menu content to be our alignment target. This ensures that both\n * icons are aligned when the menu opens.\n *\n * <hljs lang=\"html\">\n * <md-menu>\n *  <md-button ng-click=\"$mdMenu.open($event)\" class=\"md-icon-button\" aria-label=\"Open some menu\">\n *    <md-icon md-menu-origin md-svg-icon=\"call:phone\"></md-icon>\n *  </md-button>\n *  <md-menu-content>\n *    <md-menu-item>\n *      <md-button ng-click=\"doSomething()\" aria-label=\"Do something\">\n *        <md-icon md-menu-align-target md-svg-icon=\"call:phone\"></md-icon>\n *        Do Something\n *      </md-button>\n *    </md-menu-item>\n *  </md-menu-content>\n * </md-menu>\n * </hljs>\n *\n * ### Position Mode\n *\n * We can specify the origin of the menu by using the `md-position-mode` attribute.\n * This attribute allows specifying the positioning by the `x` and `y` axes.\n *\n * The default mode is `target target`. This mode uses the left and top edges of the origin element\n * to position the menu in LTR layouts. The `x` axis modes will adjust when in RTL layouts.\n *\n * Sometimes you want to specify alignment from the right side of a origin element. For example,\n * if we have a menu on the right side a toolbar, we may want to right align our menu content.\n * We can use `target-right target` to specify a right-oriented alignment target.\n * There is a working example of this in the Menu Position Modes demo.\n *\n * #### Horizontal Positioning Options\n * - `target`\n * - `target-left`\n * - `target-right`\n * - `cascade`\n * - `right`\n * - `left`\n *\n * #### Vertical Positioning Options\n * - `target`\n * - `cascade`\n * - `bottom`\n *\n * ### Menu Offsets\n *\n * It is sometimes unavoidable to need to have a deeper level of control for\n * the positioning of a menu to ensure perfect alignment. `md-menu` provides\n * the `md-offset` attribute to allow pixel-level specificity when adjusting\n * menu positioning.\n *\n * This offset is provided in the format of `x y` or `n` where `n` will be used\n * in both the `x` and `y` axis.\n * For example, to move a menu by `2px` down from the top, we can use:\n *\n * <hljs lang=\"html\">\n * <md-menu md-offset=\"0 2\">\n *   <!-- menu-content -->\n * </md-menu>\n * </hljs>\n *\n * Specifying `md-offset=\"2 2\"` would shift the menu two pixels down and two pixels to the right.\n *\n * ### Auto Focus\n * By default, when a menu opens, `md-menu` focuses the first button in the menu content.\n *\n * Sometimes you would like to focus another menu item instead of the first.<br/>\n * This can be done by applying the `md-autofocus` directive on the given element.\n *\n * <hljs lang=\"html\">\n * <md-menu-item>\n *   <md-button md-autofocus ng-click=\"doSomething()\">\n *     Auto Focus\n *   </md-button>\n * </md-menu-item>\n * </hljs>\n *\n *\n * ### Preventing close\n *\n * Sometimes you would like to be able to click on a menu item without having the menu\n * close. To do this, AngularJS Material exposes the `md-prevent-menu-close` attribute which\n * can be added to a button inside a menu to stop the menu from automatically closing.\n * You can then close the menu either by using `$mdMenu.close()` in the template,\n * or programmatically by injecting `$mdMenu` and calling `$mdMenu.hide()`.\n *\n * <hljs lang=\"html\">\n * <md-menu-content ng-mouseleave=\"$mdMenu.close()\">\n *   <md-menu-item>\n *     <md-button ng-click=\"doSomething()\" aria-label=\"Do something\" md-prevent-menu-close=\"md-prevent-menu-close\">\n *       <md-icon md-menu-align-target md-svg-icon=\"call:phone\"></md-icon>\n *       Do Something\n *     </md-button>\n *   </md-menu-item>\n * </md-menu-content>\n * </hljs>\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-menu>\n *  <md-button ng-click=\"$mdMenu.open($event)\" class=\"md-icon-button\">\n *    <md-icon md-svg-icon=\"call:phone\"></md-icon>\n *  </md-button>\n *  <md-menu-content>\n *    <md-menu-item><md-button ng-click=\"doSomething()\">Do Something</md-button></md-menu-item>\n *  </md-menu-content>\n * </md-menu>\n * </hljs>\n *\n * @param {string=} md-position-mode Specify pre-defined position modes for the `x` and `y` axes.\n *  The default modes are `target target`. This positions the origin of the menu using the left and top edges\n *  of the origin element in LTR layouts.<br>\n *  #### Valid modes for horizontal positioning\n * - `target`\n * - `target-left`\n * - `target-right`\n * - `cascade`\n * - `right`\n * - `left`<br>\n *  #### Valid modes for vertical positioning\n * - `target`\n * - `cascade`\n * - `bottom`\n * @param {string=} md-offset An offset to apply to the dropdown on opening, after positioning.\n *  Defined as `x` and `y` pixel offset values in the form of `x y`.<br>\n *  The default value is `0 0`.\n */\nangular\n    .module('material.components.menu')\n    .directive('mdMenu', MenuDirective);\n\n/**\n * @ngInject\n */\nfunction MenuDirective($mdUtil) {\n  var INVALID_PREFIX = 'Invalid HTML for md-menu: ';\n  return {\n    restrict: 'E',\n    require: ['mdMenu', '?^mdMenuBar'],\n    controller: 'mdMenuCtrl', // empty function to be built by link\n    scope: true,\n    compile: compile\n  };\n\n  function compile(templateElement) {\n    templateElement.addClass('md-menu');\n\n    var triggerEl = templateElement.children()[0];\n    var prefixer = $mdUtil.prefixer();\n\n    if (!prefixer.hasAttribute(triggerEl, 'ng-click')) {\n      triggerEl = triggerEl\n          .querySelector(prefixer.buildSelector(['ng-click', 'ng-mouseenter'])) || triggerEl;\n    }\n\n    var isButtonTrigger = triggerEl.nodeName === 'MD-BUTTON' || triggerEl.nodeName === 'BUTTON';\n\n    if (triggerEl && isButtonTrigger && !triggerEl.hasAttribute('type')) {\n      triggerEl.setAttribute('type', 'button');\n    }\n\n    if (!triggerEl) {\n      throw Error(INVALID_PREFIX + 'Expected the menu to have a trigger element.');\n    }\n\n    if (templateElement.children().length !== 2) {\n      throw Error(INVALID_PREFIX + 'Expected two children elements. The second element must have a `md-menu-content` element.');\n    }\n\n    // Default element for ARIA attributes has the ngClick or ngMouseenter expression\n    triggerEl && triggerEl.setAttribute('aria-haspopup', 'true');\n\n    var nestedMenus = templateElement[0].querySelectorAll('md-menu');\n    var nestingDepth = parseInt(templateElement[0].getAttribute('md-nest-level'), 10) || 0;\n    if (nestedMenus) {\n      angular.forEach($mdUtil.nodesToArray(nestedMenus), function(menuEl) {\n        if (!menuEl.hasAttribute('md-position-mode')) {\n          menuEl.setAttribute('md-position-mode', 'cascade');\n        }\n        menuEl.classList.add('_md-nested-menu');\n        menuEl.setAttribute('md-nest-level', nestingDepth + 1);\n      });\n    }\n    return link;\n  }\n\n  function link(scope, element, attr, ctrls) {\n    var mdMenuCtrl = ctrls[0];\n    var isInMenuBar = !!ctrls[1];\n    var mdMenuBarCtrl = ctrls[1];\n    // Move everything into a md-menu-container and pass it to the controller\n    var menuContainer = angular.element('<div class=\"_md md-open-menu-container md-whiteframe-z2\"></div>');\n    var menuContents = element.children()[1];\n\n    element.addClass('_md');     // private md component indicator for styling\n\n    if (!menuContents.hasAttribute('role')) {\n      menuContents.setAttribute('role', 'menu');\n    }\n    menuContainer.append(menuContents);\n\n    element.on('$destroy', function() {\n      menuContainer.remove();\n    });\n\n    element.append(menuContainer);\n    menuContainer[0].style.display = 'none';\n    mdMenuCtrl.init(menuContainer, { isInMenuBar: isInMenuBar, mdMenuBarCtrl: mdMenuBarCtrl });\n  }\n}\n"
  },
  {
    "path": "src/components/menu/js/menuServiceProvider.js",
    "content": "angular\n  .module('material.components.menu')\n  .provider('$mdMenu', MenuProvider);\n\n/**\n * Interim element provider for the menu.\n * Handles behavior for a menu while it is open, including:\n *    - handling animating the menu opening/closing\n *    - handling key/mouse events on the menu element\n *    - handling enabling/disabling scroll while the menu is open\n *    - handling redrawing during resizes and orientation changes\n *\n */\n\nfunction MenuProvider($$interimElementProvider) {\n  var MENU_EDGE_MARGIN = 8;\n\n  return $$interimElementProvider('$mdMenu')\n    .setDefaults({\n      methods: ['target'],\n      options: menuDefaultOptions\n    });\n\n  /* @ngInject */\n  function menuDefaultOptions($mdUtil, $mdTheming, $mdConstant, $document, $window, $q, $$rAF,\n                              $animateCss, $animate, $log) {\n\n    var prefixer = $mdUtil.prefixer();\n    var animator = $mdUtil.dom.animator;\n\n    return {\n      parent: 'body',\n      onShow: onShow,\n      onRemove: onRemove,\n      hasBackdrop: true,\n      disableParentScroll: true,\n      skipCompile: true,\n      preserveScope: true,\n      multiple: true,\n      themable: true\n    };\n\n    /**\n     * Show modal backdrop element...\n     * @returns {function(): void} A function that removes this backdrop\n     */\n    function showBackdrop(scope, element, options) {\n      if (options.nestLevel) return angular.noop;\n\n      // If we are not within a dialog...\n      if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {\n        // !! DO this before creating the backdrop; since disableScrollAround()\n        //    configures the scroll offset; which is used by mdBackDrop postLink()\n        options.restoreScroll = $mdUtil.disableScrollAround(options.element, options.parent);\n      } else {\n        options.disableParentScroll = false;\n      }\n\n      if (options.hasBackdrop) {\n        options.backdrop = $mdUtil.createBackdrop(scope, \"md-menu-backdrop md-click-catcher\");\n\n        $animate.enter(options.backdrop, options.backdropParent || $document[0].body);\n      }\n\n      /**\n       * Hide and destroys the backdrop created by showBackdrop()\n       */\n      return function hideBackdrop() {\n        if (options.backdrop) options.backdrop.remove();\n        if (options.disableParentScroll) options.restoreScroll();\n      };\n    }\n\n    /**\n     * Removing the menu element from the DOM and remove all associated event listeners\n     * and backdrop\n     */\n    function onRemove(scope, element, opts) {\n      opts.cleanupInteraction();\n      opts.cleanupBackdrop();\n      opts.cleanupResizing();\n      opts.hideBackdrop();\n\n      // Before the menu is closing remove the clickable class.\n      element.removeClass('md-clickable');\n\n      // For navigation $destroy events, do a quick, non-animated removal,\n      // but for normal closes (from clicks, etc) animate the removal\n\n      return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then(detachAndClean);\n\n      /**\n       * For normal closes, animate the removal.\n       * For forced closes (like $destroy events), skip the animations\n       */\n      function animateRemoval() {\n        return $animateCss(element, {addClass: 'md-leave'}).start();\n      }\n\n      /**\n       * Detach the element\n       */\n      function detachAndClean() {\n        element.removeClass('md-active');\n        detachElement(element, opts);\n        opts.alreadyOpen = false;\n      }\n\n    }\n\n    /**\n     * Inserts and configures the staged Menu element into the DOM, positioning it,\n     * and wiring up various interaction events\n     */\n    function onShow(scope, element, opts) {\n      sanitizeAndConfigure(opts);\n\n      if (opts.menuContentEl[0]) {\n        // Inherit the theme from the target element.\n        $mdTheming.inherit(opts.menuContentEl, opts.target);\n      } else {\n        $log.warn(\n          '$mdMenu: Menu elements should always contain a `md-menu-content` element,' +\n          'otherwise interactivity features will not work properly.',\n          element\n        );\n      }\n\n      // Register various listeners to move menu on resize/orientation change\n      opts.cleanupResizing = startRepositioningOnResize();\n      opts.hideBackdrop = showBackdrop(scope, element, opts);\n\n      // Return the promise for when our menu is done animating in\n      return showMenu()\n        .then(function(response) {\n          opts.alreadyOpen = true;\n          opts.cleanupInteraction = activateInteraction();\n          opts.cleanupBackdrop = setupBackdrop();\n\n          // Since the menu finished its animation, mark the menu as clickable.\n          element.addClass('md-clickable');\n\n          return response;\n        });\n\n      /**\n       * Place the menu into the DOM and call positioning related functions\n       */\n      function showMenu() {\n        opts.parent.append(element);\n        element[0].style.display = '';\n\n        return $q(function(resolve) {\n          var position = calculateMenuPosition(element, opts);\n\n          element.removeClass('md-leave');\n\n          // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n          // to normal scale.\n          $animateCss(element, {\n            addClass: 'md-active',\n            from: animator.toCss(position),\n            to: animator.toCss({transform: ''})\n          })\n          .start()\n          .then(resolve);\n\n        });\n      }\n\n      /**\n       * Check for valid opts and set some useful defaults\n       */\n      function sanitizeAndConfigure() {\n        if (!opts.target) {\n          throw Error(\n            '$mdMenu.show() expected a target to animate from in options.target'\n          );\n        }\n        angular.extend(opts, {\n          alreadyOpen: false,\n          isRemoved: false,\n          target: angular.element(opts.target), // make sure it's not a naked DOM node\n          parent: angular.element(opts.parent),\n          menuContentEl: angular.element(element[0].querySelector('md-menu-content'))\n        });\n      }\n\n      /**\n       * Configure various resize listeners for screen changes\n       */\n      function startRepositioningOnResize() {\n\n        var repositionMenu = (function(target, options) {\n          return $$rAF.throttle(function() {\n            if (opts.isRemoved) return;\n            var position = calculateMenuPosition(target, options);\n\n            target.css(animator.toCss(position));\n          });\n        })(element, opts);\n\n        $window.addEventListener('resize', repositionMenu);\n        $window.addEventListener('orientationchange', repositionMenu);\n\n        return function stopRepositioningOnResize() {\n\n          // Disable resizing handlers\n          $window.removeEventListener('resize', repositionMenu);\n          $window.removeEventListener('orientationchange', repositionMenu);\n\n        };\n      }\n\n      /**\n       * Sets up the backdrop and listens for click elements.\n       * Once the backdrop will be clicked, the menu will automatically close.\n       * @returns {!Function} Function to remove the backdrop.\n       */\n      function setupBackdrop() {\n        if (!opts.backdrop) return angular.noop;\n\n        opts.backdrop.on('click', onBackdropClick);\n\n        return function() {\n          opts.backdrop.off('click', onBackdropClick);\n        };\n      }\n\n      /**\n       * Function to be called whenever the backdrop is clicked.\n       * @param {!MouseEvent} event\n       */\n      function onBackdropClick(event) {\n        event.preventDefault();\n        event.stopPropagation();\n\n        scope.$apply(function() {\n          opts.mdMenuCtrl.close(true, { closeAll: true });\n        });\n      }\n\n      /**\n       * Activate interaction on the menu. Resolves the focus target and closes the menu on\n       * escape or option click.\n       * @returns {!Function} Function to deactivate the interaction listeners.\n       */\n      function activateInteraction() {\n        if (!opts.menuContentEl[0]) return angular.noop;\n\n        // Wire up keyboard listeners.\n        // - Close on escape,\n        // - focus next item on down arrow,\n        // - focus prev item on up\n        opts.menuContentEl.on('keydown', onMenuKeyDown);\n        opts.menuContentEl[0].addEventListener('click', captureClickListener, true);\n\n        // kick off initial focus in the menu on the first enabled element\n        var focusTarget = opts.menuContentEl[0]\n          .querySelector(prefixer.buildSelector(['md-menu-focus-target', 'md-autofocus']));\n\n        if (!focusTarget) {\n          var childrenLen = opts.menuContentEl[0].children.length;\n          for (var childIndex = 0; childIndex < childrenLen; childIndex++) {\n            var child = opts.menuContentEl[0].children[childIndex];\n            focusTarget = child.querySelector('.md-button:not([disabled])');\n            if (focusTarget) {\n              break;\n            }\n            // Need to check the attribute as well since this might be a custom element whose\n            // disabled property is undefined.\n            if (child.firstElementChild && !child.firstElementChild.disabled &&\n                !child.firstElementChild.getAttribute('disabled')) {\n              focusTarget = child.firstElementChild;\n              break;\n            }\n          }\n        }\n\n        focusTarget && focusTarget.focus();\n\n        return function cleanupInteraction() {\n          opts.menuContentEl.off('keydown', onMenuKeyDown);\n          opts.menuContentEl[0].removeEventListener('click', captureClickListener, true);\n        };\n\n        // ************************************\n        // internal functions\n        // ************************************\n\n        function onMenuKeyDown(ev) {\n          var handled;\n          switch (ev.keyCode) {\n            case $mdConstant.KEY_CODE.ESCAPE:\n              if (opts.nestLevel) {\n                opts.mdMenuCtrl.close();\n              } else {\n                opts.mdMenuCtrl.close(false, { closeAll: true });\n              }\n              handled = true;\n              break;\n            case $mdConstant.KEY_CODE.TAB:\n              opts.mdMenuCtrl.close(false, { closeAll: true });\n              // Don't prevent default or stop propagation on this event as we want tab\n              // to move the focus to the next focusable element on the page.\n              handled = false;\n              break;\n            case $mdConstant.KEY_CODE.UP_ARROW:\n              if (!focusMenuItem(ev, opts.menuContentEl, opts, -1) && !opts.nestLevel) {\n                opts.mdMenuCtrl.triggerContainerProxy(ev);\n              }\n              handled = true;\n              break;\n            case $mdConstant.KEY_CODE.DOWN_ARROW:\n              if (!focusMenuItem(ev, opts.menuContentEl, opts, 1) && !opts.nestLevel) {\n                opts.mdMenuCtrl.triggerContainerProxy(ev);\n              }\n              handled = true;\n              break;\n            case $mdConstant.KEY_CODE.LEFT_ARROW:\n              if (opts.nestLevel) {\n                opts.mdMenuCtrl.close();\n              } else {\n                opts.mdMenuCtrl.triggerContainerProxy(ev);\n              }\n              handled = true;\n              break;\n            case $mdConstant.KEY_CODE.RIGHT_ARROW:\n              var parentMenu = $mdUtil.getClosest(ev.target, 'MD-MENU');\n              if (parentMenu && parentMenu != opts.parent[0]) {\n                ev.target.click();\n              } else {\n                opts.mdMenuCtrl.triggerContainerProxy(ev);\n              }\n              handled = true;\n              break;\n          }\n          if (handled) {\n            ev.preventDefault();\n            ev.stopImmediatePropagation();\n          }\n        }\n\n        function onBackdropClick(e) {\n          e.preventDefault();\n          e.stopPropagation();\n          scope.$apply(function() {\n            opts.mdMenuCtrl.close(true, { closeAll: true });\n          });\n        }\n\n        // Close menu on menu item click, if said menu-item is not disabled\n        function captureClickListener(e) {\n          var target = e.target;\n          // Traverse up the event until we get to the menuContentEl to see if\n          // there is an ng-click and that the ng-click is not disabled\n          do {\n            if (target == opts.menuContentEl[0]) return;\n            if ((hasAnyAttribute(target, ['ng-click', 'ng-href', 'ui-sref']) ||\n                target.nodeName == 'BUTTON' || target.nodeName == 'MD-BUTTON') && !hasAnyAttribute(target, ['md-prevent-menu-close'])) {\n              var closestMenu = $mdUtil.getClosest(target, 'MD-MENU');\n              if (!target.hasAttribute('disabled') && (!closestMenu || closestMenu == opts.parent[0])) {\n                close();\n              }\n              break;\n            }\n          } while (target = target.parentNode);\n\n          function close() {\n            scope.$apply(function() {\n              opts.mdMenuCtrl.close(true, { closeAll: true });\n            });\n          }\n\n          function hasAnyAttribute(target, attrs) {\n            if (!target) return false;\n\n            for (var i = 0, attr; attr = attrs[i]; ++i) {\n              if (prefixer.hasAttribute(target, attr)) {\n                return true;\n              }\n            }\n\n            return false;\n          }\n        }\n\n      }\n    }\n\n    /**\n     * Takes a keypress event and focuses the next/previous menu\n     * item from the emitting element\n     * @param {event} e - The origin keypress event\n     * @param {angular.element} menuEl - The menu element\n     * @param {object} opts - The interim element options for the mdMenu\n     * @param {number} direction - The direction to move in (+1 = next, -1 = prev)\n     */\n    function focusMenuItem(e, menuEl, opts, direction) {\n      var currentItem = $mdUtil.getClosest(e.target, 'MD-MENU-ITEM');\n\n      var items = $mdUtil.nodesToArray(menuEl[0].children);\n      var currentIndex = items.indexOf(currentItem);\n\n      // Traverse through our elements in the specified direction (+/-1) and try to\n      // focus them until we find one that accepts focus\n      var didFocus;\n      for (var i = currentIndex + direction; i >= 0 && i < items.length; i = i + direction) {\n        var focusTarget = items[i].querySelector('.md-button');\n        didFocus = attemptFocus(focusTarget);\n        if (didFocus) {\n          break;\n        }\n      }\n      return didFocus;\n    }\n\n    /**\n     * Attempts to focus an element. Checks whether that element is the currently\n     * focused element after attempting.\n     * @param {HTMLElement} el - the element to attempt focus on\n     * @returns {boolean} - whether the element was successfully focused\n     */\n    function attemptFocus(el) {\n      if (el && el.getAttribute('tabindex') != -1) {\n        el.focus();\n        return ($document[0].activeElement == el);\n      }\n    }\n\n    /**\n     * Use browser to remove this element without triggering a $destroy event\n     */\n    function detachElement(element, opts) {\n      if (!opts.preserveElement) {\n        if (toNode(element).parentNode === toNode(opts.parent)) {\n          toNode(opts.parent).removeChild(toNode(element));\n        }\n      } else {\n        toNode(element).style.display = 'none';\n      }\n    }\n\n    /**\n     * Computes menu position and sets the style on the menu container\n     * @param {HTMLElement} el - the menu container element\n     * @param {object} opts - the interim element options object\n     */\n    function calculateMenuPosition(el, opts) {\n\n      var containerNode = el[0],\n        openMenuNode = el[0].firstElementChild,\n        openMenuNodeRect = openMenuNode.getBoundingClientRect(),\n        boundryNode = $document[0].body,\n        boundryNodeRect = boundryNode.getBoundingClientRect();\n\n      var menuStyle = $window.getComputedStyle(openMenuNode);\n\n      var originNode = opts.target[0].querySelector(prefixer.buildSelector('md-menu-origin')) || opts.target[0],\n        originNodeRect = originNode.getBoundingClientRect();\n\n      var bounds = {\n        left: boundryNodeRect.left + MENU_EDGE_MARGIN,\n        top: Math.max(boundryNodeRect.top, 0) + MENU_EDGE_MARGIN,\n        bottom: Math.max(boundryNodeRect.bottom, Math.max(boundryNodeRect.top, 0) + boundryNodeRect.height) - MENU_EDGE_MARGIN,\n        right: boundryNodeRect.right - MENU_EDGE_MARGIN\n      };\n\n      var alignTarget, alignTargetRect = { top:0, left : 0, right:0, bottom:0 }, existingOffsets  = { top:0, left : 0, right:0, bottom:0  };\n      var positionMode = opts.mdMenuCtrl.positionMode();\n\n      if (positionMode.top === 'target' || positionMode.left === 'target' || positionMode.left === 'target-right') {\n        alignTarget = firstVisibleChild();\n        if (alignTarget) {\n          // TODO: Allow centering on an arbitrary node, for now center on first menu-item's child\n          alignTarget = alignTarget.firstElementChild || alignTarget;\n          alignTarget = alignTarget.querySelector(prefixer.buildSelector('md-menu-align-target')) || alignTarget;\n          alignTargetRect = alignTarget.getBoundingClientRect();\n\n          existingOffsets = {\n            top: parseFloat(containerNode.style.top || 0),\n            left: parseFloat(containerNode.style.left || 0)\n          };\n        }\n      }\n\n      var position = {};\n      var transformOrigin = 'top ';\n\n      switch (positionMode.top) {\n        case 'target':\n          position.top = existingOffsets.top + originNodeRect.top - alignTargetRect.top;\n          break;\n        case 'cascade':\n          position.top = originNodeRect.top - parseFloat(menuStyle.paddingTop) - originNode.style.top;\n          break;\n        case 'bottom':\n          position.top = originNodeRect.top + originNodeRect.height;\n          break;\n        default:\n          throw new Error('Invalid target mode \"' + positionMode.top + '\" specified for md-menu on Y axis.');\n      }\n\n      var rtl = $mdUtil.isRtl(el);\n\n      switch (positionMode.left) {\n        case 'target':\n          position.left = existingOffsets.left + originNodeRect.left - alignTargetRect.left;\n          transformOrigin += rtl ? 'right'  : 'left';\n          break;\n        case 'target-left':\n          position.left = originNodeRect.left;\n          transformOrigin += 'left';\n          break;\n        case 'target-right':\n          position.left = originNodeRect.right - openMenuNodeRect.width + (openMenuNodeRect.right - alignTargetRect.right);\n          transformOrigin += 'right';\n          break;\n        case 'cascade':\n          var willFitRight = rtl ? (originNodeRect.left - openMenuNodeRect.width) < bounds.left : (originNodeRect.right + openMenuNodeRect.width) < bounds.right;\n          position.left = willFitRight ? originNodeRect.right - originNode.style.left : originNodeRect.left - originNode.style.left - openMenuNodeRect.width;\n          transformOrigin += willFitRight ? 'left' : 'right';\n          break;\n        case 'right':\n          if (rtl) {\n            position.left = originNodeRect.right - originNodeRect.width;\n            transformOrigin += 'left';\n          } else {\n            position.left = originNodeRect.right - openMenuNodeRect.width;\n            transformOrigin += 'right';\n          }\n          break;\n        case 'left':\n          if (rtl) {\n            position.left = originNodeRect.right - openMenuNodeRect.width;\n            transformOrigin += 'right';\n          } else {\n            position.left = originNodeRect.left;\n            transformOrigin += 'left';\n          }\n          break;\n        default:\n          throw new Error('Invalid target mode \"' + positionMode.left + '\" specified for md-menu on X axis.');\n      }\n\n      var offsets = opts.mdMenuCtrl.offsets();\n      position.top += offsets.top;\n      position.left += offsets.left;\n\n      clamp(position);\n\n      var scaleX = Math.round(100 * Math.min(originNodeRect.width / containerNode.offsetWidth, 1.0)) / 100;\n      var scaleY = Math.round(100 * Math.min(originNodeRect.height / containerNode.offsetHeight, 1.0)) / 100;\n\n      return {\n        top: Math.round(position.top),\n        left: Math.round(position.left),\n        // Animate a scale out if we aren't just repositioning\n        transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : undefined,\n        transformOrigin: transformOrigin\n      };\n\n      /**\n       * Clamps the repositioning of the menu within the confines of\n       * bounding element (often the screen/body)\n       */\n      function clamp(pos) {\n        pos.top = Math.max(Math.min(pos.top, bounds.bottom - containerNode.offsetHeight), bounds.top);\n        pos.left = Math.max(Math.min(pos.left, bounds.right - containerNode.offsetWidth), bounds.left);\n      }\n\n      /**\n       * Gets the first visible child in the openMenuNode\n       * Necessary incase menu nodes are being dynamically hidden\n       */\n      function firstVisibleChild() {\n        for (var i = 0; i < openMenuNode.children.length; ++i) {\n          if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') {\n            return openMenuNode.children[i];\n          }\n        }\n      }\n    }\n  }\n  function toNode(el) {\n    if (el instanceof angular.element) {\n      el = el[0];\n    }\n    return el;\n  }\n}\n"
  },
  {
    "path": "src/components/menu/menu-theme.scss",
    "content": "md-menu-content.md-THEME_NAME-theme {\n  background-color: '{{background-hue-1}}';\n\n  md-menu-item {\n    color: '{{foreground-1}}';\n\n    md-icon {\n      color: '{{foreground-2}}';\n    }\n\n    .md-button[disabled] {\n      color: '{{foreground-3}}';\n\n      md-icon {\n        color: '{{foreground-3}}';\n      }\n    }\n\n  }\n\n  md-menu-divider {\n    background-color: '{{foreground-4}}';\n  }\n}\n"
  },
  {
    "path": "src/components/menu/menu.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.menu\n */\n\nangular.module('material.components.menu', [\n  'material.core',\n  'material.components.backdrop'\n]);\n"
  },
  {
    "path": "src/components/menu/menu.scss",
    "content": "$menu-border-radius: 2px !default;\n$max-visible-items: 6 !default;\n$menu-item-height: 6 * $baseline-grid !default;\n$dense-menu-item-height: 4 * $baseline-grid !default;\n$max-menu-height: 2 * $baseline-grid + $max-visible-items * $menu-item-height !default;\n$max-dense-menu-height: 2 * $baseline-grid + $max-visible-items * $dense-menu-item-height !default;\n\n.md-open-menu-container {\n  position: fixed;\n  left: 0;\n  top: 0;\n  z-index: $z-index-menu;\n  opacity: 0;\n  border-radius: $menu-border-radius;\n  max-height: calc(100vh - 10px);\n  overflow: auto;\n\n  md-menu-divider {\n    margin-top: $baseline-grid * 0.5;\n    margin-bottom: $baseline-grid * 0.5;\n    height: 1px;\n    min-height: 1px;\n    max-height: 1px;\n    width: 100%;\n  }\n\n  md-menu-content > * {\n    opacity: 0;\n  }\n\n  // Don't let the user click something until it's animated\n  &:not(.md-clickable) {\n    pointer-events: none;\n  }\n\n  // enter: menu scales in, then list fade in.\n  &.md-active {\n    opacity: 1;\n    transition: $swift-ease-out;\n    transition-duration: 200ms;\n    > md-menu-content > * {\n      opacity: 1;\n      transition: $swift-ease-in;\n      transition-duration: 200ms;\n      transition-delay: 100ms;\n    }\n  }\n  // leave: the container fades out\n  &.md-leave {\n    opacity: 0;\n    transition: $swift-ease-in;\n    transition-duration: 250ms;\n  }\n}\n\nmd-menu-content {\n  display: flex;\n  flex-direction: column;\n  padding: $baseline-grid 0;\n  max-height: $max-menu-height;\n  overflow-y: auto;\n  &.md-dense {\n    max-height: $max-dense-menu-height;\n    md-menu-item {\n      height: $dense-menu-item-height;\n      min-height: $dense-menu-item-height;\n    }\n  }\n}\n\nmd-menu-item {\n  display: flex;\n  flex-direction: row;\n  min-height: $menu-item-height;\n  height: $menu-item-height;\n  align-content: center;\n  justify-content: flex-start;\n\n  > * {\n    width: 100%;\n    margin: auto 0;\n    padding-left: 2*$baseline-grid;\n    padding-right: 2*$baseline-grid;\n  }\n\n  /*\n   * We cannot use flex on <button> elements due to a bug in Firefox, so we also can't use it on\n   * <a> elements. Add some top padding to fix alignment since buttons automatically align their\n   * text vertically.\n   */\n  > a.md-button {\n    padding-top: 5px;\n  }\n\n  > .md-button {\n    // Firefox-specific reset styling to fix alignment issues (see #8464)\n    &::-moz-focus-inner {\n      padding: 0;\n      border: 0\n    }\n\n    @include rtl(text-align, left, right);\n\n    display: inline-block;\n    border-radius: 0;\n    margin: auto 0;\n    font-size: (2*$baseline-grid) - 1;\n    text-transform: none;\n    font-weight: 400;\n    height: 100%;\n    padding-left: 2*$baseline-grid;\n    padding-right: 2*$baseline-grid;\n    width:100%;\n    md-icon {\n      @include rtl(margin, auto 2*$baseline-grid auto 0,  auto 0 auto 2*$baseline-grid);\n    }\n    p {\n      display:inline-block;\n      margin: auto;\n    }\n    span {\n      margin-top: auto;\n      margin-bottom: auto;\n    }\n    .md-ripple-container {\n      border-radius: inherit;\n    }\n  }\n}\n\nmd-toolbar {\n  .md-menu {\n    height: auto;\n    margin: auto;\n    padding: 0;\n  }\n}\n\n@media (max-width: $layout-breakpoint-sm - 1) {\n  md-menu-content {\n    min-width: 112px;\n  }\n  @for $i from 3 through 7 {\n    md-menu-content[width=\"#{$i}\"] {\n      min-width: $i * 56px;\n    }\n  }\n}\n\n@media (min-width: $layout-breakpoint-sm) {\n  md-menu-content {\n    min-width: 96px;\n  }\n  @for $i from 3 through 7 {\n    md-menu-content[width=\"#{$i}\"] {\n      min-width: $i * 64px;\n    }\n  }\n}\n\n"
  },
  {
    "path": "src/components/menu/menu.spec.js",
    "content": "describe('material.components.menu', function() {\n  var attachedElements = [];\n  var $mdMenu, $timeout, menuActionPerformed, $mdUtil;\n\n  beforeEach(module('material.components.menu'));\n  beforeEach(inject(function(_$mdUtil_, _$mdMenu_, _$timeout_) {\n    $mdUtil = _$mdUtil_;\n    $mdMenu = _$mdMenu_;\n    $timeout = _$timeout_;\n  }));\n\n  afterEach(inject(function($document) {\n    menuActionPerformed = false;\n    attachedElements.forEach(function(element) {\n      element.remove();\n    });\n    attachedElements = [];\n\n    var abandonedMenus = $document[0].querySelectorAll('.md-open-menu-container');\n    angular.element(abandonedMenus).remove();\n  }));\n\n  describe('md-menu directive', function() {\n\n    it('should have `._md` class indicator', function() {\n      var element = setup();\n      expect(element.hasClass('_md')).toBe(true);\n    });\n\n    it('should throw when trigger element is missing', inject(function($compile, $rootScope) {\n      function createInvalidMenu() {\n        $compile(\n          '<md-menu>' +\n          '  <md-menu-content>Menu Content</md-menu-content>' +\n          '</md-menu>'\n        )($rootScope);\n      }\n\n      expect(createInvalidMenu).toThrow();\n    }));\n\n    it('should throw when md-menu-content is missing', inject(function($compile, $rootScope) {\n      function createInvalidMenu() {\n        $compile(\n          '<md-menu>' +\n          '  <button ng-click=\"null\">Trigger Element</button>' +\n          '</md-menu>'\n        )($rootScope);\n      }\n\n      expect(createInvalidMenu).toThrow();\n    }));\n\n    it('nested md-menu-content should be allowed', inject(function($compile, $rootScope) {\n        function createValidMenu() {\n            $compile(\n                '<md-menu>' +\n                '  <button ng-click=\"null\">Trigger Element</button>' +\n                '  <some-custom-element>' +\n                '    <md-menu-content>Menu Content</md-menu-content>' +\n                '  </some-custom-element>' +\n                '</md-menu>'\n            )($rootScope);\n        }\n\n        expect(createValidMenu).not.toThrow();\n    }));\n\n    it('specifies button type', inject(function($compile, $rootScope) {\n      var menu = setup()[0];\n      expect(menu.firstElementChild.getAttribute('type')).toBe('button');\n    }));\n\n    it('opens on click', function () {\n      var menu = setup();\n      openMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(1);\n      closeMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    });\n\n    it('cleans up an open menu when the element leaves the DOM', function() {\n      var menu = setup();\n      openMenu(menu);\n      menu.remove();\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    });\n\n    it('sets up proper aria-owns and aria-haspopup relations between the button and the container', function() {\n      var menu = setup();\n      var button = menu[0].querySelector('button');\n      expect(button.hasAttribute('aria-haspopup')).toBe(true);\n      expect(button.hasAttribute('aria-owns')).toBe(true);\n      var ownsId = button.getAttribute('aria-owns');\n      openMenu(menu);\n      expect(getOpenMenuContainer(menu).attr('id')).toBe(ownsId);\n    });\n\n    it('opens on click without $event', function() {\n      var menu = setup('ng-click=\"$mdMenu.open()\"');\n      openMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(1);\n      closeMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    });\n\n    it('opens on mouseEnter', function() {\n        var menu = setup('ng-mouseenter=\"$mdMenu.open($event)\"');\n        openMenu(menu, 'mouseenter');\n        expect(getOpenMenuContainer(menu).length).toBe(1);\n        closeMenu(menu);\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n      });\n\n    it('opens on mouseEnter without $event', function() {\n        var menu = setup('ng-mouseenter=\"$mdMenu.open()\"');\n        openMenu(menu, 'mouseenter');\n        expect(getOpenMenuContainer(menu).length).toBe(1);\n        closeMenu(menu);\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n      });\n\n    it('should not propagate the click event', function() {\n      var clickDetected = false, menu = setup();\n      menu.on('click', function() {\n        clickDetected = true;\n      });\n\n      openMenu(menu);\n      expect(clickDetected).toBe(false);\n      closeMenu(menu);\n      expect(clickDetected).toBe(false);\n    });\n\n    it('should remove the backdrop if container got destroyed', inject(function($document) {\n      var menu = setup();\n      openMenu(menu);\n\n      expect($document.find('md-backdrop').length).not.toBe(0);\n\n      menu.remove();\n\n      expect($document.find('md-backdrop').length).toBe(0);\n    }));\n\n    it('should remove the backdrop if the container scope got destroyed', inject(function($document, $rootScope) {\n      var scope = $rootScope.$new();\n      var menu = setup(null, scope);\n\n      openMenu(menu);\n      expect($document.find('md-backdrop').length).not.toBe(0);\n\n      scope.$destroy();\n      expect($document.find('md-backdrop').length).toBe(0);\n    }));\n\n    it('closes on backdrop click', inject(function($document) {\n\n      var menu = setup();\n      openMenu(menu);\n\n      expect(getOpenMenuContainer(menu).length).toBe(1);\n\n      $document.find('md-backdrop').triggerHandler('click');\n      waitForMenuClose();\n\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    }));\n\n\n    it('closes on escape', inject(function($document, $mdConstant) {\n      var menu = setup();\n      openMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(1);\n\n      var openMenuEl = $document[0].querySelector('md-menu-content');\n\n      pressKey(openMenuEl, $mdConstant.KEY_CODE.ESCAPE);\n      waitForMenuClose();\n\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    }));\n\n    it('closes on tab', inject(function($document, $mdConstant) {\n      var menu = setup();\n      openMenu(menu);\n      expect(getOpenMenuContainer(menu).length).toBe(1);\n\n      var openMenuEl = $document[0].querySelector('md-menu-content');\n\n      pressKey(openMenuEl, $mdConstant.KEY_CODE.TAB);\n      waitForMenuClose();\n\n      expect(getOpenMenuContainer(menu).length).toBe(0);\n    }));\n\n    describe('default focus', function() {\n      it('should focus on first item automatically', inject(function($compile, $rootScope, $document) {\n        var menu = $compile(\n          '<md-menu>' +\n            '<button ng-click=\"$mdMenu.open($event)\">Hello World</button>' +\n            '<md-menu-content>' +\n              '<md-menu-item>' +\n                '<button id=\"menuItem0\" ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n              '<md-menu-item>' +\n                '<button ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n            '</md-menu-content>' +\n          '</md-menu>'\n        )($rootScope);\n\n        openMenu(menu);\n\n        var menuTarget = $document[0].querySelector('#menuItem0');\n\n        expect(document.activeElement).toBe(menuTarget);\n      }));\n\n      it('should focus on first non-disabled item', inject(function($compile, $rootScope, $document) {\n        var menu = $compile(\n          '<md-menu>' +\n            '<button ng-click=\"$mdMenu.open($event)\">Hello World</button>' +\n            '<md-menu-content>' +\n              '<md-menu-item>' +\n                '<button disabled ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n              '<md-menu-item>' +\n                '<button id=\"menuItem1\" ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n            '</md-menu-content>' +\n          '</md-menu>'\n        )($rootScope);\n\n        openMenu(menu);\n\n        var menuTarget = $document[0].querySelector('#menuItem1');\n\n        expect(document.activeElement).toBe(menuTarget);\n      }));\n    });\n\n    describe('autofocus', function() {\n\n      it('should focus a button with md-menu-focus-target', inject(function($compile, $rootScope, $document) {\n        var menu = $compile(\n          '<md-menu>' +\n            '<button ng-click=\"$mdMenu.open($event)\">Hello World</button>' +\n            '<md-menu-content>' +\n              '<md-menu-item>' +\n                '<button ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n              '<md-menu-item>' +\n                '<button id=\"menuFocus\" md-menu-focus-target ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n            '</md-menu-content>' +\n          '</md-menu>'\n        )($rootScope);\n\n        openMenu(menu);\n\n        var menuTarget = $document[0].querySelector('#menuFocus');\n\n        expect(document.activeElement).toBe(menuTarget);\n      }));\n\n      it('should focus a button with md-autofocus', inject(function($compile, $rootScope, $document) {\n        var menu = $compile(\n          '<md-menu>' +\n            '<button ng-click=\"$mdMenu.open($event)\">Hello World</button>' +\n            '<md-menu-content>' +\n              '<md-menu-item>' +\n                '<button ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n              '<md-menu-item>' +\n                '<button id=\"menuFocus\" md-autofocus ng-click=\"doSomething($event)\"></button>' +\n              '</md-menu-item>' +\n            '</md-menu-content>' +\n          '</md-menu>'\n        )($rootScope);\n\n        openMenu(menu);\n\n        var menuTarget = $document[0].querySelector('#menuFocus');\n\n        expect(document.activeElement).toBe(menuTarget);\n      }));\n\n    });\n\n    describe('closes with -', function() {\n      it('closes on normal option click', function() {\n\n        var menu = setup();\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n        openMenu(menu);\n\n        expect(menuActionPerformed).toBeFalsy();\n        expect(getOpenMenuContainer(menu).length).toBe(1);\n\n        var btn = getOpenMenuContainer(menu)[0].querySelector('md-button');\n        btn.click();\n\n        waitForMenuClose();\n\n        expect(menuActionPerformed).toBeTruthy();\n\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n      });\n\n      it('closes via the scope method', function() {\n        var menu = setup('ng-mouseenter=\"$mdMenu.open($event)\" ng-mouseleave=\"$mdMenu.close()\"');\n\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n        openMenu(menu, 'mouseenter');\n        expect(getOpenMenuContainer(menu).length).toBe(1);\n\n        menu.find('button').triggerHandler('mouseleave');\n        waitForMenuClose();\n        expect(getOpenMenuContainer(menu).length).toBe(0);\n      });\n\n      itClosesWithAttributes([\n        'data-ng-click', 'x-ng-click',\n        'ui-sref', 'data-ui-sref', 'x-ui-sref',\n        'ng-href', 'data-ng-href', 'x-ng-href'\n      ]);\n\n      function itClosesWithAttributes(types) {\n        for (var i = 0; i < types.length; ++i) {\n          it('closes with ' + types[i], testAttribute(types[i]));\n        }\n\n        function testAttribute(attr) {\n          return inject(function($rootScope, $compile, $timeout) {\n            var template = '' +\n              '<md-menu>' +\n              ' <button ng-click=\"$mdMenu.open($event)\">Hello World</button>' +\n              ' <md-menu-content>' +\n              '  <md-menu-item>' +\n              '    <md-button ' + attr + '=\"\"></md-button>' +\n              '  </md-menu-item>' +\n              ' </md-menu-content>' +\n              '</md-menu>';\n\n\n            var menu = $compile(template)($rootScope);\n            openMenu(menu);\n\n            expect(getOpenMenuContainer(menu).length).toBe(1);\n\n            $timeout.flush();\n            var btn = getOpenMenuContainer(menu)[0].querySelector('md-button');\n            btn.click();\n\n            waitForMenuClose();\n\n            expect(getOpenMenuContainer(menu).length).toBe(0);\n          });\n        }\n      }\n    });\n\n    function setup(buttonAttrs, scope) {\n      var menu,\n        template = $mdUtil.supplant('' +\n          '<md-menu>' +\n          ' <button {0}>Hello World</button>' +\n          ' <md-menu-content>' +\n          '  <md-menu-item>' +\n          '    <md-button ng-click=\"doSomething($event)\"></md-button>' +\n          '  </md-menu-item>' +\n          ' </md-menu-content>' +\n          '</md-menu>', [buttonAttrs || 'ng-click=\"$mdMenu.open($event)\"']);\n\n      inject(function($compile, $rootScope) {\n        $rootScope.doSomething = function($event) {\n          menuActionPerformed = true;\n        };\n        menu = $compile(template)(scope || $rootScope);\n      });\n\n      attachedElements.push(menu);\n      return menu;\n    }\n  });\n\n  describe('with $mdMenu service', function() {\n\n    var $mdMenu, $rootScope, $compile, $timeout, $log = null;\n\n    beforeEach(inject(function($injector) {\n      $mdMenu = $injector.get('$mdMenu');\n      $rootScope = $injector.get('$rootScope');\n      $compile = $injector.get('$compile');\n      $timeout = $injector.get('$timeout');\n      $log = $injector.get('$log');\n    }));\n\n    it('backdrop should attach to backdropParent', function() {\n      var parent = angular.element('<div>');\n      var menuEl = angular.element(\n        '<md-menu>' +\n        '  <button ng-click=\"null\">Trigger</button>' +\n        '</md-menu>'\n      );\n      var backdropParent = angular.element('<div>');\n\n      $mdMenu.show({\n        scope: $rootScope,\n        element: menuEl,\n        target: document.body,\n        preserveElement: true,\n        parent: parent,\n        backdropParent: backdropParent,\n      });\n\n      $timeout.flush();\n\n      expect(backdropParent.find('md-backdrop').length).toBe(1);\n\n      // Close the menu and remove the containers\n      $mdMenu.hide();\n      parent.remove();\n      backdropParent.remove();\n    });\n\n    it('should warn when the md-menu-content element is missing', function() {\n      spyOn($log, 'warn');\n\n      var parent = angular.element('<div>');\n      var menuEl = angular.element(\n        '<md-menu>' +\n        '  <button ng-click=\"null\">Trigger</button>' +\n        '</md-menu>'\n      );\n\n      expect($log.warn).not.toHaveBeenCalled();\n\n      $mdMenu.show({\n        scope: $rootScope,\n        mdMenuCtrl: createFakeMenuController(),\n        element: menuEl,\n        target: document.body,\n        preserveElement: true,\n        parent: parent\n      });\n\n      $timeout.flush();\n\n      expect($log.warn).toHaveBeenCalledTimes(1);\n\n      // Close the menu and remove the parent container\n      $mdMenu.hide();\n      parent.remove();\n    });\n\n    function createFakeMenuController() {\n      return {\n        open: function() {},\n        close: function() { $mdMenu.hide(); },\n        positionMode: function() { return { left: 'left', top: 'target' }; },\n        offsets: function() { return { top: 0, left: 0 }; }\n      }\n    }\n\n  });\n\n\n  // ********************************************\n  // Internal methods\n  // ********************************************\n\n  function getOpenMenuContainer(el) {\n    var res;\n    el = (el instanceof angular.element) ? el[0] : el;\n    inject(function($document) {\n      var container = $document[0].querySelector('.md-open-menu-container');\n      if (container && container.style.display == 'none') {\n        res = [];\n      } else {\n        res = angular.element(container);\n      }\n    });\n    return res;\n  }\n\n  function openMenu(el, triggerType) {\n    el.children().eq(0).triggerHandler(triggerType || 'click');\n    waitForMenuOpen();\n  }\n\n  function closeMenu() {\n    inject(function($document) {\n      $document.find('md-backdrop').triggerHandler('click');\n      waitForMenuClose();\n    });\n  }\n\n  function waitForMenuOpen() {\n    inject(function($material) {\n      $material.flushInterimElement();\n    });\n  }\n\n  function waitForMenuClose() {\n    inject(function($material) {\n      $material.flushInterimElement();\n    });\n  }\n\n  function pressKey(el, code) {\n    if (!(el instanceof angular.element)) {\n      el = angular.element(el);\n    }\n    el.triggerHandler({\n      type: 'keydown',\n      keyCode: code\n    });\n  }\n});\n"
  },
  {
    "path": "src/components/menuBar/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"DemoBasicCtrl as ctrl\" ng-cloak>\n  <md-toolbar class=\"md-menu-toolbar\">\n    <div layout=\"row\">\n      <md-toolbar-filler>\n        <md-icon md-svg-icon=\"content-paste\"></md-icon>\n      </md-toolbar-filler>\n      <div>\n        <h2 class=\"md-toolbar-tools\">Untitled document</h2>\n        <md-menu-bar>\n          <md-menu>\n            <button ng-click=\"$mdMenu.open()\">\n              File\n            </button>\n            <md-menu-content>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('share', $event)\">\n                  Share...\n                </md-button>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item>\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\">New</md-button>\n                  <md-menu-content>\n                    <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Document', $event)\">Document</md-button></md-menu-item>\n                    <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Spreadsheet', $event)\">Spreadsheet</md-button></md-menu-item>\n                    <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Presentation', $event)\">Presentation</md-button></md-menu-item>\n                    <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Form', $event)\">Form</md-button></md-menu-item>\n                    <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Drawing', $event)\">Drawing</md-button></md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('Open', $event)\">\n                  Open...\n                  <span class=\"md-alt-text\"> {{ 'M-O' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button disabled=\"disabled\" ng-click=\"ctrl.sampleAction('Rename', $event)\">\n                  Rename\n                </md-button>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('Print', $event)\">\n                  Print\n                  <span class=\"md-alt-text\">{{ 'M-P' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n          <md-menu>\n            <button ng-click=\"$mdMenu.open()\">\n              Edit\n            </button>\n            <md-menu-content>\n              <md-menu-item class=\"md-indent\">\n                <md-icon md-svg-icon=\"undo\"></md-icon>\n                <md-button ng-click=\"ctrl.sampleAction('undo', $event)\">\n                  Undo\n                  <span class=\"md-alt-text\">{{ 'M-Z' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item class=\"md-indent\">\n                <md-icon md-svg-icon=\"redo\"></md-icon>\n                <md-button ng-click=\"ctrl.sampleAction('redo', $event)\">\n                  Redo\n                  <span class=\"md-alt-text\">{{ 'M-Y' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item class=\"md-indent\">\n                <md-icon md-svg-icon=\"content-cut\"></md-icon>\n                <md-button ng-click=\"ctrl.sampleAction('cut', $event)\">\n                  Cut\n                  <span class=\"md-alt-text\">{{ 'M-X' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item class=\"md-indent\">\n                <md-icon md-svg-icon=\"content-copy\"></md-icon>\n                <md-button ng-click=\"ctrl.sampleAction('copy', $event)\">\n                  Copy\n                  <span class=\"md-alt-text\">{{ 'M-C' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item class=\"md-indent\">\n                <md-icon md-svg-icon=\"content-paste\"></md-icon>\n                <md-button ng-click=\"ctrl.sampleAction('paste', $event)\">\n                  Paste\n                  <span class=\"md-alt-text\">{{ 'M-P' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item class=\"md-indent\">\n                <md-button ng-click=\"ctrl.sampleAction('Find and replace', $event)\">\n                  Find and replace...\n                  <span class=\"md-alt-text\">{{ 'M-S-H' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n          <md-menu>\n            <button ng-click=\"$mdMenu.open()\">\n              View\n            </button>\n            <md-menu-content>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.printLayout\">Print layout</md-menu-item>\n              <md-menu-item class=\"md-indent\">\n                <md-menu>\n                  <md-button ng-click=\"$mdMenu.open()\">Mode</md-button>\n                  <md-menu-content width=\"3\">\n                    <md-menu-item type=\"radio\" ng-model=\"ctrl.settings.presentationMode\" value=\"'presentation'\">Presentation</md-menu-item>\n                    <md-menu-item type=\"radio\" ng-model=\"ctrl.settings.presentationMode\" value=\"'edit'\">Edit</md-menu-item>\n                    <md-menu-item type=\"radio\" ng-model=\"ctrl.settings.presentationMode\" value=\"'modifiable'\">Modifiable</md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.showRuler\">Show ruler</md-menu-item>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.showEquationToolbar\">Show equation toolbar</md-menu-item>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.showSpellingSuggestions\">Show spelling suggestions</md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.compactControls\">Compact controls</md-menu-item>\n              <md-menu-item type=\"checkbox\" ng-model=\"ctrl.settings.fullScreen\">Full screen</md-menu-item>\n            </md-menu-content>\n          </md-menu>\n          <md-menu>\n            <button ng-click=\"$mdMenu.open()\">\n              Format\n            </button>\n            <md-menu-content>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('bold', $event)\">\n                  Bold\n                  <span class=\"md-alt-text\"> {{ 'M-B' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('italic', $event)\">\n                  Italic\n                  <span class=\"md-alt-text\">{{ 'M-I' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('underline', $event)\">\n                  Underline\n                  <span class=\"md-alt-text\">{{ 'M-U' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('strikethrough', $event)\">\n                  Strikethrough\n                  <span class=\"md-alt-text\">{{ 'A-S-5' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('superscript', $event)\">\n                  Superscript\n                  <span class=\"md-alt-text\">{{ 'M-.' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-item>\n                <md-button ng-click=\"ctrl.sampleAction('subscript', $event)\">\n                  Subscript\n                  <span class=\"md-alt-text\">{{ 'M-,' | keyboardShortcut }}</span>\n                </md-button>\n              </md-menu-item>\n              <md-menu-divider></md-menu-divider>\n              <md-menu-item><md-button ng-click=\"ctrl.toggleSetting('clearFormatting')\">Clear Formatting</md-button></md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </md-menu-bar>\n      </div>\n    </div>\n  </md-toolbar>\n\n  <md-content class=\"page-container\">\n    <md-card class=\"page\">\n      <h1>Untitled document</h1>\n      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>\n      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vestibulum id ligula porta felis euismod semper. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Nulla vitae elit libero, a pharetra augue. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>\n      <p>Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>\n    </md-card>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/menuBar/demoBasicUsage/script.js",
    "content": "angular\n  .module('menuBarDemoBasic', ['ngMaterial'])\n  .config(function($mdIconProvider) {\n    $mdIconProvider\n      .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n  })\n  .filter('keyboardShortcut', function($window) {\n    return function(str) {\n      if (!str) return;\n      var keys = str.split('-');\n      var isOSX = /Mac OS X/.test($window.navigator.userAgent);\n\n      var separator = (!isOSX || keys.length > 2) ? '+' : '';\n\n      var abbreviations = {\n        M: isOSX ? '⌘' : 'Ctrl',\n        A: isOSX ? 'Option' : 'Alt',\n        S: 'Shift'\n      };\n\n      return keys.map(function(key, index) {\n        var last = index === keys.length - 1;\n        return last ? key : abbreviations[key];\n      }).join(separator);\n    };\n  })\n  .controller('DemoBasicCtrl', function DemoCtrl($mdDialog) {\n    this.settings = {\n      printLayout: true,\n      showRuler: true,\n      showSpellingSuggestions: true,\n      presentationMode: 'edit'\n    };\n\n    this.sampleAction = function(name, ev) {\n      $mdDialog.show($mdDialog.alert()\n        .title(name)\n        .textContent('You triggered the \"' + name + '\" action')\n        .ok('Great')\n        .targetEvent(ev)\n      );\n    };\n  });\n\n"
  },
  {
    "path": "src/components/menuBar/demoBasicUsage/style.scss",
    "content": "md-toolbar-filler {\n  display: flex;\n}\n.page-container {\n  padding: 32px;\n\n  .page {\n    margin: 0 auto;\n    padding: 24px;\n    max-width: 680px;\n    box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.25);\n\n    h1 {\n      text-align: center;\n      font-size: 1.8rem;\n      margin-top: 0;\n      font-weight: normal;\n    }\n    p {\n      line-height: 1.6rem;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/menuBar/demoDynamicNestedMenus/index.html",
    "content": "<div ng-controller=\"DemoDynamicNestedMenusCtrl as ctrl\" ng-cloak>\n  <md-toolbar class=\"md-menu-toolbar\">\n    <div layout=\"row\">\n      <md-toolbar-filler>\n        <md-icon md-svg-icon=\"communication:business\"></md-icon>\n      </md-toolbar-filler>\n      <div>\n        <h2 class=\"md-toolbar-tools\">Mission Statement</h2>\n        <md-menu-bar>\n          <md-menu>\n            <button aria-label=\"Open menu\" ng-click=\"$mdMenu.open($event)\">\n              Organizations\n            </button>\n            <md-menu-content width=\"3\">\n              <md-menu-item ng-repeat=\"org in ctrl.organizations\">\n                <md-menu class=\"nested-menu\">\n                  <md-button ng-click=\"ctrl.onClick(org.department)\">{{ org.department }}</md-button>\n                  <md-menu-content width=\"3\">\n                    <md-menu-item ng-repeat=\"manager in org.managers\">\n                      <md-menu>\n                        <md-button ng-click=\"ctrl.onClick(manager.name)\">{{ manager.name }}</md-button>\n                        <md-menu-content width=\"2\">\n                          <md-menu-item ng-repeat=\"person in manager.reports\">\n                            <md-button ng-click=\"ctrl.onClick(person.name)\">{{ person.name }}</md-button>\n                          </md-menu-item>\n                        </md-menu-content>\n                      </md-menu>\n                    </md-menu-item>\n                  </md-menu-content>\n                </md-menu>\n              </md-menu-item>\n            </md-menu-content>\n          </md-menu>\n        </md-menu-bar>\n      </div>\n    </div>\n  </md-toolbar>\n\n  <md-content class=\"page-container\">\n    <md-card class=\"page\">\n      <h1>Mission Statement</h1>\n      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu\n        leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis\n        consectetur purus sit amet fermentum. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh\n        ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>\n      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vestibulum id ligula porta felis euismod semper.\n        Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel\n        scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia\n        odio sem nec elit. Nulla vitae elit libero, a pharetra augue. Aenean eu leo quam. Pellentesque ornare sem\n        lacinia quam venenatis vestibulum.</p>\n      <p>Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus\n        varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>\n    </md-card>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/menuBar/demoDynamicNestedMenus/script.js",
    "content": "angular\n  .module('menuBarDemoDynamicNestedMenus', ['ngMaterial'])\n  .config(function ($mdIconProvider) {\n    $mdIconProvider.iconSet(\"call\", 'img/icons/sets/communication-icons.svg', 24);\n  })\n  .controller('DemoDynamicNestedMenusCtrl', function DemoCtrl($log) {\n    this.organizations = [\n      {\n        department: 'Sales',\n        managers: [\n          {\n            name: 'Jane',\n            reports: [\n              {name: 'Rick'},\n              {name: 'Joan'},\n              {name: 'Ron'}\n            ]\n          },\n          {\n            name: 'Jim',\n            reports: [\n              {name: 'Bob'},\n              {name: 'Sandra'},\n              {name: 'Juan'}\n            ]\n          }\n        ]\n      },\n      {\n        department: 'Engineering',\n        managers: [\n          {\n            name: 'Janet',\n            reports: [\n              {name: 'Betty'},\n              {name: 'Corrie'},\n              {name: 'Carlos'}\n            ]\n          },\n          {\n            name: 'Randy',\n            reports: [\n              {name: 'Julia'},\n              {name: 'Matt'},\n              {name: 'Kara'}\n            ]\n          }\n        ]\n      },\n      {\n        department: 'Marketing',\n        managers: [\n          {\n            name: 'Peggy',\n            reports: [\n              {name: 'Dwight'},\n              {name: 'Pam'},\n              {name: 'Jeremy'}\n            ]\n          },\n          {\n            name: 'Andrew',\n            reports: [\n              {name: 'Stephen'},\n              {name: 'Naomi'},\n              {name: 'Erin'}\n            ]\n          }\n        ]\n      }\n    ];\n\n    this.onClick = function onClick(item) {\n      $log.log(item);\n    };\n  });\n"
  },
  {
    "path": "src/components/menuBar/demoDynamicNestedMenus/style.scss",
    "content": "md-toolbar-filler {\n  display: flex;\n}\n.page-container {\n  padding: 32px;\n\n  .page {\n    margin: 0 auto;\n    padding: 24px;\n    max-width: 680px;\n    box-shadow: 0 1px 2px 1px rgba(0, 0, 0, 0.25);\n\n    h1 {\n      text-align: center;\n      font-size: 1.8rem;\n      margin-top: 0;\n      font-weight: normal;\n    }\n    p {\n      line-height: 1.6rem;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/menuBar/js/menuBarController.js",
    "content": "\nangular\n  .module('material.components.menuBar')\n  .controller('MenuBarController', MenuBarController);\n\nvar BOUND_MENU_METHODS = ['handleKeyDown', 'handleMenuHover', 'scheduleOpenHoveredMenu', 'cancelScheduledOpen'];\n\n/**\n * @ngInject\n */\nfunction MenuBarController($scope, $rootScope, $element, $attrs, $mdConstant, $document, $mdUtil, $timeout) {\n  this.$element = $element;\n  this.$attrs = $attrs;\n  this.$mdConstant = $mdConstant;\n  this.$mdUtil = $mdUtil;\n  this.$document = $document;\n  this.$scope = $scope;\n  this.$rootScope = $rootScope;\n  this.$timeout = $timeout;\n\n  var self = this;\n  angular.forEach(BOUND_MENU_METHODS, function(methodName) {\n    self[methodName] = angular.bind(self, self[methodName]);\n  });\n}\n\nMenuBarController.prototype.init = function() {\n  var $element = this.$element;\n  var $mdUtil = this.$mdUtil;\n  var $scope = this.$scope;\n\n  var self = this;\n  var deregisterFns = [];\n  $element.on('keydown', this.handleKeyDown);\n  this.parentToolbar = $mdUtil.getClosest($element, 'MD-TOOLBAR');\n\n  deregisterFns.push(this.$rootScope.$on('$mdMenuOpen', function(event, el) {\n    if (self.getMenus().indexOf(el[0]) != -1) {\n      $element[0].classList.add('md-open');\n      el[0].classList.add('md-open');\n      self.currentlyOpenMenu = el.controller('mdMenu');\n      self.currentlyOpenMenu.registerContainerProxy(self.handleKeyDown);\n      self.enableOpenOnHover();\n    }\n  }));\n\n  deregisterFns.push(this.$rootScope.$on('$mdMenuClose', function(event, el, opts) {\n    var rootMenus = self.getMenus();\n    if (rootMenus.indexOf(el[0]) != -1) {\n      $element[0].classList.remove('md-open');\n      el[0].classList.remove('md-open');\n    }\n\n    var ctrl = angular.element(el[0]).controller('mdMenu');\n    if (ctrl.isInMenuBar && ctrl.mdMenuBarCtrl === self) {\n      var parentMenu = el[0];\n      while (parentMenu && rootMenus.indexOf(parentMenu) == -1) {\n        parentMenu = $mdUtil.getClosest(parentMenu, 'MD-MENU', true);\n      }\n      if (parentMenu) {\n        if (!opts.skipFocus) parentMenu.querySelector('button:not([disabled])').focus();\n        self.currentlyOpenMenu = undefined;\n      }\n      self.disableOpenOnHover();\n      self.setKeyboardMode(true);\n    }\n  }));\n\n  $scope.$on('$destroy', function() {\n    self.disableOpenOnHover();\n    while (deregisterFns.length) {\n      deregisterFns.shift()();\n    }\n  });\n\n\n  this.setKeyboardMode(true);\n};\n\nMenuBarController.prototype.setKeyboardMode = function(enabled) {\n  if (enabled) this.$element[0].classList.add('md-keyboard-mode');\n  else this.$element[0].classList.remove('md-keyboard-mode');\n};\n\nMenuBarController.prototype.enableOpenOnHover = function() {\n  if (this.openOnHoverEnabled) return;\n\n  var self = this;\n\n  self.openOnHoverEnabled = true;\n\n  if (self.parentToolbar) {\n    self.parentToolbar.classList.add('md-has-open-menu');\n\n    // Needs to be on the next tick so it doesn't close immediately.\n    self.$mdUtil.nextTick(function() {\n      angular.element(self.parentToolbar).on('click', self.handleParentClick);\n    }, false);\n  }\n\n  angular\n    .element(self.getMenus())\n    .on('mouseenter', self.handleMenuHover);\n};\n\nMenuBarController.prototype.handleMenuHover = function(e) {\n  this.setKeyboardMode(false);\n  if (this.openOnHoverEnabled) {\n    this.scheduleOpenHoveredMenu(e);\n  }\n};\n\nMenuBarController.prototype.disableOpenOnHover = function() {\n  if (!this.openOnHoverEnabled) return;\n\n  this.openOnHoverEnabled = false;\n\n  if (this.parentToolbar) {\n    this.parentToolbar.classList.remove('md-has-open-menu');\n    angular.element(this.parentToolbar).off('click', this.handleParentClick);\n  }\n\n  angular\n    .element(this.getMenus())\n    .off('mouseenter', this.handleMenuHover);\n};\n\nMenuBarController.prototype.scheduleOpenHoveredMenu = function(e) {\n  var menuEl = angular.element(e.currentTarget);\n  var menuCtrl = menuEl.controller('mdMenu');\n  this.setKeyboardMode(false);\n  this.scheduleOpenMenu(menuCtrl);\n};\n\nMenuBarController.prototype.scheduleOpenMenu = function(menuCtrl) {\n  var self = this;\n  var $timeout = this.$timeout;\n  if (menuCtrl != self.currentlyOpenMenu) {\n    $timeout.cancel(self.pendingMenuOpen);\n    self.pendingMenuOpen = $timeout(function() {\n      self.pendingMenuOpen = undefined;\n      if (self.currentlyOpenMenu) {\n        self.currentlyOpenMenu.close(true, { closeAll: true });\n      }\n      menuCtrl.open();\n    }, 200, false);\n  }\n};\n\nMenuBarController.prototype.handleKeyDown = function(e) {\n  var keyCodes = this.$mdConstant.KEY_CODE;\n  var currentMenu = this.currentlyOpenMenu;\n  var wasOpen = currentMenu && currentMenu.isOpen;\n  this.setKeyboardMode(true);\n  var handled, newMenu, newMenuCtrl;\n  switch (e.keyCode) {\n    case keyCodes.DOWN_ARROW:\n      if (currentMenu) {\n        currentMenu.focusMenuContainer();\n      } else {\n        this.openFocusedMenu();\n      }\n      handled = true;\n      break;\n    case keyCodes.UP_ARROW:\n      currentMenu && currentMenu.close();\n      handled = true;\n      break;\n    case keyCodes.LEFT_ARROW:\n      newMenu = this.focusMenu(-1);\n      if (wasOpen) {\n        newMenuCtrl = angular.element(newMenu).controller('mdMenu');\n        this.scheduleOpenMenu(newMenuCtrl);\n      }\n      handled = true;\n      break;\n    case keyCodes.RIGHT_ARROW:\n      newMenu = this.focusMenu(+1);\n      if (wasOpen) {\n        newMenuCtrl = angular.element(newMenu).controller('mdMenu');\n        this.scheduleOpenMenu(newMenuCtrl);\n      }\n      handled = true;\n      break;\n  }\n  if (handled) {\n    e && e.preventDefault && e.preventDefault();\n    e && e.stopImmediatePropagation && e.stopImmediatePropagation();\n  }\n};\n\nMenuBarController.prototype.focusMenu = function(direction) {\n  var menus = this.getMenus();\n  var focusedIndex = this.getFocusedMenuIndex();\n\n  if (focusedIndex == -1) { focusedIndex = this.getOpenMenuIndex(); }\n\n  var changed = false;\n\n  if (focusedIndex == -1) { focusedIndex = 0; changed = true; }\n  else if (\n    direction < 0 && focusedIndex > 0 ||\n    direction > 0 && focusedIndex < menus.length - direction\n  ) {\n    focusedIndex += direction;\n    changed = true;\n  }\n  if (changed) {\n    menus[focusedIndex].querySelector('button').focus();\n    return menus[focusedIndex];\n  }\n};\n\nMenuBarController.prototype.openFocusedMenu = function() {\n  var menu = this.getFocusedMenu();\n  menu && angular.element(menu).controller('mdMenu').open();\n};\n\nMenuBarController.prototype.getMenus = function() {\n  var $element = this.$element;\n  return this.$mdUtil.nodesToArray($element[0].children)\n    .filter(function(el) { return el.nodeName == 'MD-MENU'; });\n};\n\nMenuBarController.prototype.getFocusedMenu = function() {\n  return this.getMenus()[this.getFocusedMenuIndex()];\n};\n\nMenuBarController.prototype.getFocusedMenuIndex = function() {\n  var $mdUtil = this.$mdUtil;\n  var focusedEl = $mdUtil.getClosest(\n    this.$document[0].activeElement,\n    'MD-MENU'\n  );\n  if (!focusedEl) return -1;\n\n  var focusedIndex = this.getMenus().indexOf(focusedEl);\n  return focusedIndex;\n};\n\nMenuBarController.prototype.getOpenMenuIndex = function() {\n  var menus = this.getMenus();\n  for (var i = 0; i < menus.length; ++i) {\n    if (menus[i].classList.contains('md-open')) return i;\n  }\n  return -1;\n};\n\nMenuBarController.prototype.handleParentClick = function(event) {\n  var openMenu = this.querySelector('md-menu.md-open');\n\n  if (openMenu && !openMenu.contains(event.target)) {\n    angular.element(openMenu).controller('mdMenu').close(true, {\n      closeAll: true\n    });\n  }\n};\n"
  },
  {
    "path": "src/components/menuBar/js/menuBarDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name mdMenuBar\n * @module material.components.menuBar\n * @restrict E\n * @description\n *\n * Menu bars are containers that hold multiple menus. They change the behavior and appearance\n * of the `md-menu` directive to behave similar to an operating system provided menu.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-menu-bar>\n *   <md-menu>\n *     <button ng-click=\"$mdMenu.open()\">\n *       File\n *     </button>\n *     <md-menu-content>\n *       <md-menu-item>\n *         <md-button ng-click=\"ctrl.sampleAction('share', $event)\">\n *           Share...\n *         </md-button>\n *       </md-menu-item>\n *       <md-menu-divider></md-menu-divider>\n *       <md-menu-item>\n *       <md-menu-item>\n *         <md-menu>\n *           <md-button ng-click=\"$mdMenu.open()\">New</md-button>\n *           <md-menu-content>\n *             <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Document', $event)\">Document</md-button></md-menu-item>\n *             <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Spreadsheet', $event)\">Spreadsheet</md-button></md-menu-item>\n *             <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Presentation', $event)\">Presentation</md-button></md-menu-item>\n *             <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Form', $event)\">Form</md-button></md-menu-item>\n *             <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Drawing', $event)\">Drawing</md-button></md-menu-item>\n *           </md-menu-content>\n *         </md-menu>\n *       </md-menu-item>\n *     </md-menu-content>\n *   </md-menu>\n * </md-menu-bar>\n * </hljs>\n *\n * ## Menu Bar Controls\n *\n * You may place `md-menu-item`s that function as controls within menu bars.\n * There are two modes that are exposed via the `type` attribute of the `md-menu-item`.\n * `type=\"checkbox\"` will function as a boolean control for the `ng-model` attribute of the\n * `md-menu-item`. `type=\"radio\"` will function like a radio button, setting the `ngModel`\n * to the `string` value of the `value` attribute. If you need non-string values, you can use\n * `ng-value` to provide an expression (this is similar to how angular's native `input[type=radio]`\n * works.\n *\n * If you want either to disable closing the opened menu when clicked, you can add the\n * `md-prevent-menu-close` attribute to the `md-menu-item`. The attribute will be forwarded to the\n * `button` element that is generated.\n *\n * <hljs lang=\"html\">\n * <md-menu-bar>\n *  <md-menu>\n *    <button ng-click=\"$mdMenu.open()\">\n *      Sample Menu\n *    </button>\n *    <md-menu-content>\n *      <md-menu-item type=\"checkbox\" ng-model=\"settings.allowChanges\" md-prevent-menu-close>\n *        Allow changes\n *      </md-menu-item>\n *      <md-menu-divider></md-menu-divider>\n *      <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"1\">Mode 1</md-menu-item>\n *      <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"2\">Mode 2</md-menu-item>\n *      <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"3\">Mode 3</md-menu-item>\n *    </md-menu-content>\n *  </md-menu>\n * </md-menu-bar>\n * </hljs>\n *\n *\n * ### Nesting Menus\n *\n * Menus may be nested within menu bars. This is commonly called cascading menus.\n * To nest a menu place the nested menu inside the content of the `md-menu-item`.\n * <hljs lang=\"html\">\n * <md-menu-item>\n *   <md-menu>\n *     <button ng-click=\"$mdMenu.open()\">New</md-button>\n *     <md-menu-content>\n *       <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Document', $event)\">Document</md-button></md-menu-item>\n *       <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Spreadsheet', $event)\">Spreadsheet</md-button></md-menu-item>\n *       <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Presentation', $event)\">Presentation</md-button></md-menu-item>\n *       <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Form', $event)\">Form</md-button></md-menu-item>\n *       <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Drawing', $event)\">Drawing</md-button></md-menu-item>\n *     </md-menu-content>\n *   </md-menu>\n * </md-menu-item>\n * </hljs>\n *\n */\n\nangular\n  .module('material.components.menuBar')\n  .directive('mdMenuBar', MenuBarDirective);\n\n/* @ngInject */\nfunction MenuBarDirective($mdUtil, $mdTheming) {\n  return {\n    restrict: 'E',\n    require: 'mdMenuBar',\n    controller: 'MenuBarController',\n\n    compile: function compile(templateEl, templateAttrs) {\n      if (!templateAttrs.ariaRole) {\n        templateEl[0].setAttribute('role', 'menubar');\n      }\n      angular.forEach(templateEl[0].children, function(menuEl) {\n        if (menuEl.nodeName == 'MD-MENU') {\n          if (!menuEl.hasAttribute('md-position-mode')) {\n            menuEl.setAttribute('md-position-mode', 'left bottom');\n\n            // Since we're in the compile function and actual `md-buttons` are not compiled yet,\n            // we need to query for possible `md-buttons` as well.\n            menuEl.querySelector('button, a, md-button').setAttribute('role', 'menuitem');\n          }\n          var contentEls = $mdUtil.nodesToArray(menuEl.querySelectorAll('md-menu-content'));\n          angular.forEach(contentEls, function(contentEl) {\n            contentEl.classList.add('md-menu-bar-menu');\n            contentEl.classList.add('md-dense');\n            if (!contentEl.hasAttribute('width')) {\n              contentEl.setAttribute('width', 5);\n            }\n          });\n        }\n      });\n\n      // Mark the child menu items that they're inside a menu bar. This is necessary,\n      // because mnMenuItem has special behaviour during compilation, depending on\n      // whether it is inside a mdMenuBar. We can usually figure this out via the DOM,\n      // however if a directive that uses documentFragment is applied to the child (e.g. ngRepeat),\n      // the element won't have a parent and won't compile properly.\n      templateEl.find('md-menu-item').addClass('md-in-menu-bar');\n\n      return function postLink(scope, el, attr, ctrl) {\n        el.addClass('_md');     // private md component indicator for styling\n        $mdTheming(scope, el);\n        ctrl.init();\n      };\n    }\n  };\n\n}\n"
  },
  {
    "path": "src/components/menuBar/js/menuDividerDirective.js",
    "content": "\nangular\n  .module('material.components.menuBar')\n  .directive('mdMenuDivider', MenuDividerDirective);\n\n\nfunction MenuDividerDirective() {\n  return {\n    restrict: 'E',\n    compile: function(templateEl, templateAttrs) {\n      if (!templateAttrs.role) {\n        templateEl[0].setAttribute('role', 'separator');\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/menuBar/js/menuItemController.js",
    "content": "\nangular\n  .module('material.components.menuBar')\n  .controller('MenuItemController', MenuItemController);\n\n\n/**\n * @ngInject\n */\nfunction MenuItemController($scope, $element, $attrs) {\n  this.$element = $element;\n  this.$attrs = $attrs;\n  this.$scope = $scope;\n}\n\nMenuItemController.prototype.init = function(ngModel) {\n  var $element = this.$element;\n  var $attrs = this.$attrs;\n\n  this.ngModel = ngModel;\n  if ($attrs.type == 'checkbox' || $attrs.type == 'radio') {\n    this.mode  = $attrs.type;\n    this.iconEl = $element[0].children[0];\n    this.buttonEl = $element[0].children[1];\n    if (ngModel) {\n      // Clear ngAria set attributes\n      this.initClickListeners();\n    }\n  }\n};\n\n// ngAria auto sets attributes on a menu-item with a ngModel.\n// We don't want this because our content (buttons) get the focus\n// and set their own aria attributes appropritately. Having both\n// breaks NVDA / JAWS. This undeoes ngAria's attrs.\nMenuItemController.prototype.clearNgAria = function() {\n  var el = this.$element[0];\n  var clearAttrs = ['role', 'tabindex', 'aria-invalid', 'aria-checked'];\n  angular.forEach(clearAttrs, function(attr) {\n    el.removeAttribute(attr);\n  });\n};\n\nMenuItemController.prototype.initClickListeners = function() {\n  var self = this;\n  var ngModel = this.ngModel;\n  var $scope = this.$scope;\n  var $attrs = this.$attrs;\n  var $element = this.$element;\n  var mode = this.mode;\n\n  this.handleClick = angular.bind(this, this.handleClick);\n\n  var icon = this.iconEl;\n  var button = angular.element(this.buttonEl);\n  var handleClick = this.handleClick;\n\n  $attrs.$observe('disabled', setDisabled);\n  setDisabled($attrs.disabled);\n\n  ngModel.$render = function render() {\n    self.clearNgAria();\n    if (isSelected()) {\n      icon.style.display = '';\n      button.attr('aria-checked', 'true');\n    } else {\n      icon.style.display = 'none';\n      button.attr('aria-checked', 'false');\n    }\n  };\n\n  $scope.$$postDigest(ngModel.$render);\n\n  function isSelected() {\n    if (mode == 'radio') {\n      var val = $attrs.ngValue ? $scope.$eval($attrs.ngValue) : $attrs.value;\n      return ngModel.$modelValue == val;\n    } else {\n      return ngModel.$modelValue;\n    }\n  }\n\n  function setDisabled(disabled) {\n    if (disabled) {\n      button.off('click', handleClick);\n    } else {\n      button.on('click', handleClick);\n    }\n  }\n};\n\nMenuItemController.prototype.handleClick = function(e) {\n  var mode = this.mode;\n  var ngModel = this.ngModel;\n  var $attrs = this.$attrs;\n  var newVal;\n  if (mode == 'checkbox') {\n    newVal = !ngModel.$modelValue;\n  } else if (mode == 'radio') {\n    newVal = $attrs.ngValue ? this.$scope.$eval($attrs.ngValue) : $attrs.value;\n  }\n  ngModel.$setViewValue(newVal);\n  ngModel.$render();\n};\n"
  },
  {
    "path": "src/components/menuBar/js/menuItemDirective.js",
    "content": "\nangular\n  .module('material.components.menuBar')\n  .directive('mdMenuItem', MenuItemDirective);\n\n /* @ngInject */\nfunction MenuItemDirective($mdUtil, $mdConstant, $$mdSvgRegistry) {\n  return {\n    controller: 'MenuItemController',\n    require: ['mdMenuItem', '?ngModel'],\n    priority: $mdConstant.BEFORE_NG_ARIA,\n    compile: function(templateEl, templateAttrs) {\n      var type = templateAttrs.type;\n      var inMenuBarClass = 'md-in-menu-bar';\n\n      // Note: This allows us to show the `check` icon for the md-menu-bar items.\n      // The `md-in-menu-bar` class is set by the mdMenuBar directive.\n      if ((type === 'checkbox' || type === 'radio') && templateEl.hasClass(inMenuBarClass)) {\n        var text = templateEl[0].textContent;\n        var buttonEl = angular.element('<md-button type=\"button\"></md-button>');\n        var iconTemplate = '<md-icon md-svg-src=\"' + $$mdSvgRegistry.mdChecked + '\"></md-icon>';\n\n        buttonEl.html(text);\n        buttonEl.attr('tabindex', '0');\n\n        if (angular.isDefined(templateAttrs.mdPreventMenuClose)) {\n          buttonEl.attr('md-prevent-menu-close', templateAttrs.mdPreventMenuClose);\n        }\n\n        templateEl.html('');\n        templateEl.append(angular.element(iconTemplate));\n        templateEl.append(buttonEl);\n        templateEl.addClass('md-indent').removeClass(inMenuBarClass);\n\n        setDefault('role', type === 'checkbox' ? 'menuitemcheckbox' : 'menuitemradio', buttonEl);\n        moveAttrToButton('ng-disabled');\n\n      } else {\n        setDefault('role', 'menuitem', templateEl[0].querySelector('md-button, button, a'));\n      }\n\n\n      return function(scope, el, attrs, ctrls) {\n        var ctrl = ctrls[0];\n        var ngModel = ctrls[1];\n        ctrl.init(ngModel);\n      };\n\n      function setDefault(attr, val, el) {\n        el = el || templateEl;\n        if (el instanceof angular.element) {\n          el = el[0];\n        }\n        if (!el.hasAttribute(attr)) {\n          el.setAttribute(attr, val);\n        }\n      }\n\n      function moveAttrToButton(attribute) {\n        var attributes = $mdUtil.prefixer(attribute);\n\n        angular.forEach(attributes, function(attr) {\n          if (templateEl[0].hasAttribute(attr)) {\n            var val = templateEl[0].getAttribute(attr);\n            buttonEl[0].setAttribute(attr, val);\n            templateEl[0].removeAttribute(attr);\n          }\n        });\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/menuBar/menu-bar-theme.scss",
    "content": "md-menu-bar.md-THEME_NAME-theme {\n  & > button.md-button {\n    color: '{{foreground-1}}';\n    border-radius: 2px;\n  }\n\n  md-menu > button {\n    color: '{{foreground-1}}';\n  }\n\n  md-menu.md-open > button, md-menu > button:focus {\n    outline: none;\n    background-color: '{{ background-500-0.18}}';\n  }\n\n  &.md-open:not(.md-keyboard-mode) md-menu:hover > button {\n    background-color: '{{ background-500-0.18}}';\n  }\n\n  &:not(.md-keyboard-mode):not(.md-open) {\n    md-menu button:hover,\n    md-menu button:focus {\n      background: transparent;\n    }\n  }\n}\n\nmd-menu-content.md-THEME_NAME-theme {\n  .md-menu > .md-button:after {\n    color: '{{foreground-2}}';\n  }\n\n  .md-menu.md-open > .md-button {\n    background-color: '{{ background-500-0.18}}';\n  }\n}\n\nmd-toolbar.md-THEME_NAME-theme.md-menu-toolbar {\n  background-color: '{{background-hue-1}}';\n  color: '{{foreground-1}}';\n  md-toolbar-filler {\n    background-color: '{{primary-color}}';\n    color: '{{primary-contrast}}';\n    md-icon {\n      color: '{{primary-contrast}}';\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/components/menuBar/menu-bar.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.menuBar\n */\n\nangular.module('material.components.menuBar', [\n  'material.core',\n  'material.components.icon',\n  'material.components.menu'\n]);\n"
  },
  {
    "path": "src/components/menuBar/menu-bar.scss",
    "content": "md-toolbar {\n  &.md-menu-toolbar {\n    h2.md-toolbar-tools {\n      line-height: 1rem;\n      height: auto;\n      padding: 3.5 * $baseline-grid;\n      padding-bottom: 1.5 * $baseline-grid;\n    }\n  }\n\n  // Used to allow hovering from one menu to the\n  // next when inside of a toolbar.\n  &.md-has-open-menu {\n    position: relative;\n    z-index: $z-index-menu;\n  }\n}\n\nmd-menu-bar {\n  padding: 0 2.5 * $baseline-grid;\n  display: block;\n  position: relative;\n  z-index: 2;\n  .md-menu {\n    display: inline-block;\n    padding: 0;\n    position: relative;\n  }\n  button {\n    font-size: rem(1.4);\n    padding: 0 1.25 * $baseline-grid;\n    margin: 0;\n    border: 0;\n    background-color: transparent;\n    height: 5 * $baseline-grid;\n  }\n\n  md-backdrop.md-menu-backdrop {\n    z-index: -2;\n  }\n}\n\nmd-menu-content.md-menu-bar-menu.md-dense {\n  max-height: none;\n  padding: 2 * $baseline-grid 0;\n  md-menu-item.md-indent {\n    position: relative;\n    > md-icon {\n      position: absolute;\n      padding: 0;\n      width: 24px;\n      top: 0.75 * $baseline-grid;\n      @include rtl-prop(left, right, 3 * $baseline-grid, auto);\n    }\n    > .md-button, .md-menu > .md-button {\n      @include rtl(padding, 0 4 * $baseline-grid 0 8 * $baseline-grid, 0 8 * $baseline-grid 0 4 * $baseline-grid);\n    }\n  }\n  .md-button {\n    min-height: 0;\n    height: 4 * $baseline-grid;\n    span {\n      @include rtl(float, left, right);\n    }\n    span.md-alt-text {\n      @include rtl(float, right, left);\n      margin: 0 $baseline-grid;\n    }\n  }\n  md-menu-divider {\n    margin: $baseline-grid 0;\n  }\n\n  md-menu-item > .md-button, .md-menu > .md-button {\n    @include rtl(text-align, left, right);\n  }\n\n  .md-menu {\n    padding: 0;\n    > .md-button {\n      position: relative;\n      margin: 0;\n      width: 100%;\n      text-transform: none;\n      font-weight: normal;\n      border-radius: 0px;\n      @include rtl-prop(padding-left, padding-right, 2 * $baseline-grid, 0);\n      &:after {\n        display: block;\n        content: '\\25BC';\n        position: absolute;\n        top: 0px;\n        speak: none;\n        @include rtl(transform, rotate(270deg) scaleY(0.45) scaleX(0.9), rotate(90deg) scaleY(0.45) scaleX(0.9));\n        @include rtl-prop(right, left, 3.5 * $baseline-grid, auto);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/menuBar/menu-bar.spec.js",
    "content": "describe('material.components.menuBar', function() {\n  var attachedMenuElements = [];\n\n  beforeEach(module('material.components.menuBar'));\n\n  afterEach(function() {\n    attachedMenuElements.forEach(function(element) {\n      element.remove();\n    });\n    attachedMenuElements = [];\n  });\n\n  describe('MenuBar', function() {\n    describe('MenuBar Directive', function() {\n\n      it('should have `._md` class indicator', function() {\n        var element = setup();\n        expect(element.hasClass('_md')).toBe(true);\n      });\n\n      it('sets md-position-mode to \"bottom left\" on nested menus', function() {\n        var menuBar = setup();\n        var nestedMenu = menuBar[0].querySelector('md-menu');\n\n        expect(nestedMenu.getAttribute('md-position-mode')).toBe('left bottom');\n      });\n\n      it('should close when clicking on the wrapping toolbar', inject(function($compile, $rootScope, $timeout, $material) {\n        var ctrl = null;\n        var menuCtrl = null;\n        var toolbar = $compile(\n          '<md-toolbar>' +\n            '<md-menu-bar>' +\n              '<md-menu ng-repeat=\"i in [1, 2, 3]\">' +\n                '<button ng-click></button>' +\n                '<md-menu-content></md-menu-content>' +\n              '</md-menu>' +\n            '</md-menu-bar>' +\n          '</md-toolbar>'\n        )($rootScope);\n\n        $rootScope.$digest();\n        attachedMenuElements.push(toolbar); // ensure it gets cleaned up\n\n        ctrl = toolbar.find('md-menu-bar').controller('mdMenuBar');\n        menuCtrl = toolbar.find('md-menu').eq(0).controller('mdMenu');\n\n        menuCtrl.open();\n        $timeout.flush();\n\n        expect(toolbar).toHaveClass('md-has-open-menu');\n        spyOn(menuCtrl, 'close').and.callThrough();\n\n        toolbar.triggerHandler('click');\n        $material.flushInterimElement(); // flush out the scroll mask\n\n        expect(toolbar).not.toHaveClass('md-has-open-menu');\n        expect(ctrl.getOpenMenuIndex()).toBe(-1);\n        expect(menuCtrl.close).toHaveBeenCalledWith(true, {\n          closeAll: true\n        });\n      }));\n\n      it('should close when clicking on a menu item', inject(function($compile, $rootScope, $timeout, $material) {\n        var toolbar = $compile(\n          '<md-toolbar class=\"md-menu-toolbar\">' +\n            '<md-menu-bar>' +\n              '<md-menu>' +\n                '<button ng-click=\"clicked=true\">root</button>' +\n                '<md-menu-content>' +\n                  '<md-menu-item>' +\n                    '<md-button ng-click=\"subclicked=true\">child</md-button>' +\n                  '</md-menu-item>' +\n                '</md-menu-content>' +\n              '</md-menu>' +\n            '</md-menu-bar>' +\n          '</md-toolbar>'\n        )($rootScope);\n\n        $rootScope.$digest();\n        attachedMenuElements.push(toolbar); // ensure it gets cleaned up\n\n        var ctrl = toolbar.find('md-menu-bar').controller('mdMenuBar');\n        var rootMenu = toolbar[0].querySelector('md-menu');\n\n        angular.element(document.body).append(toolbar);\n\n        var menuCtrl = angular.element(rootMenu).controller('mdMenu');\n\n        menuCtrl.open();\n        waitForMenuOpen();\n\n        expect(toolbar).toHaveClass('md-has-open-menu');\n        spyOn(menuCtrl, 'close').and.callThrough();\n\n        var subMenu = getOpenSubMenu();\n        var childButton = subMenu[0].querySelector('md-button');\n        childButton.dispatchEvent(new MouseEvent('click'));\n        waitForMenuClose();\n\n        expect(toolbar).not.toHaveClass('md-has-open-menu');\n        expect(ctrl.getOpenMenuIndex()).toBe(-1);\n        expect(menuCtrl.close).toHaveBeenCalledWith(true, {\n          closeAll: true\n        });\n\n        function getOpenSubMenu() {\n          var containers = document.body.querySelectorAll('.md-open-menu-container.md-active');\n          var lastContainer = containers.item(containers.length - 1);\n\n          return angular.element(lastContainer.querySelector('md-menu-content'));\n        }\n      }));\n\n      it('should close when clicking on a nested menu item', inject(function($compile, $rootScope, $timeout, $material) {\n        var toolbar = $compile(\n          '<md-toolbar class=\"md-menu-toolbar\">' +\n            '<md-menu-bar>' +\n              '<md-menu>' +\n                '<button>root</button>' +\n                '<md-menu-content>' +\n                  '<md-menu-item>' +\n                    '<md-menu>' +\n                      '<md-button ng-click=\"$mdMenu.open()\">child</md-button>' +\n                      '<md-menu-content>' +\n                        '<md-menu-item>' +\n                          '<md-button>grandchild</md-button>' +\n                        '</md-menu-item>' +\n                      '</md-menu-content>' +\n                    '</md-menu>' +\n                  '</md-menu-item>' +\n                '</md-menu-content>' +\n              '</md-menu>' +\n            '</md-menu-bar>' +\n          '</md-toolbar>'\n        )($rootScope);\n\n        $rootScope.$digest();\n        attachedMenuElements.push(toolbar); // ensure it gets cleaned up\n\n        var ctrl = toolbar.find('md-menu-bar').controller('mdMenuBar');\n        var rootMenu = toolbar[0].querySelector('md-menu');\n\n        angular.element(document.body).append(toolbar);\n\n        var menuCtrl = angular.element(rootMenu).controller('mdMenu');\n\n        menuCtrl.open();\n        waitForMenuOpen();\n\n        expect(toolbar).toHaveClass('md-has-open-menu');\n\n        var subMenu = getLastOpenSubMenu();\n        var childButton = subMenu[0].querySelector('md-button');\n        childButton.dispatchEvent(new MouseEvent('click'));\n        waitForMenuOpen();\n\n        var nestedMenu = getLastOpenSubMenu();\n        var nestedButton = nestedMenu[0].querySelector('md-button');\n        nestedButton.dispatchEvent(new MouseEvent('click'));\n        waitForMenuClose();\n\n        expect(toolbar).not.toHaveClass('md-has-open-menu');\n        expect(ctrl.getOpenMenuIndex()).toBe(-1);\n\n        function getLastOpenSubMenu() {\n          var containers = document.body.querySelectorAll('.md-open-menu-container.md-active');\n          var lastContainer = containers.item(containers.length - 1);\n\n          return angular.element(lastContainer.querySelector('md-menu-content'));\n        }\n      }));\n\n      describe('ARIA', function() {\n\n        it('sets role=\"menubar\" on the menubar', function() {\n          var menuBar = setup();\n          var ariaRole = menuBar[0].getAttribute('role');\n          expect(ariaRole).toBe('menubar');\n        });\n\n        it('should set the role on the menu trigger correctly', inject(function($compile, $rootScope) {\n          var el = $compile(\n            '<md-menu-bar>' +\n              '<md-menu ng-repeat=\"i in [1, 2, 3]\">' +\n                '<md-button id=\"triggerButton\" ng-click=\"lastClicked = $index\"></md-button>' +\n                '<md-menu-content></md-menu-content>' +\n              '</md-menu>' +\n            '</md-menu-bar>'\n          )($rootScope);\n\n          $rootScope.$digest();\n\n          expect(el[0].querySelector('#triggerButton').getAttribute('role')).toBe('menuitem');\n        }));\n      });\n\n      describe('nested menus', function() {\n        var menuBar, menus, subMenuOpen, ctrl;\n\n        it('opens consecutive nested menus', function() {\n          menuBar = setup();\n          ctrl = menuBar.controller('mdMenuBar');\n          menus = menuBar[0].querySelectorAll('md-menu md-menu');\n\n          angular.element(document.body).append(menuBar);\n\n          // Open the menu-bar menu\n          ctrl.focusMenu(1);\n          ctrl.openFocusedMenu();\n          waitForMenuOpen();\n\n          // Open the first nested menu\n          openSubMenu(0);\n          waitForMenuOpen();\n          expect(getOpenSubMenu().text().trim()).toBe('Sub 1 - Content');\n\n          // Open the second nested menu, the first menu should close\n          openSubMenu(1);\n          waitForMenuClose();\n\n          // Then the second menu should become visible\n          waitForMenuOpen();\n          expect(getOpenSubMenu().text().trim()).toBe('Sub 2 - Content');\n\n          menuBar.remove();\n        });\n\n        it('closes only current sub-menu with escape key', inject(function($mdConstant) {\n          menuBar = setup();\n          ctrl = menuBar.controller('mdMenuBar');\n          menus = menuBar[0].querySelectorAll('md-menu md-menu');\n\n          angular.element(document.body).append(menuBar);\n\n          expect(getNumberOfOpenMenus()).toBe(0);\n\n          // Open the menu-bar menu\n          ctrl.focusMenu(1);\n          ctrl.openFocusedMenu();\n          waitForMenuOpen();\n\n          expect(getNumberOfOpenMenus()).toBe(1);\n\n          // Open the first nested menu\n          openSubMenu(0);\n          waitForMenuOpen();\n          expect(getOpenSubMenu().text().trim()).toBe('Sub 1 - Content');\n\n          expect(getNumberOfOpenMenus()).toBe(2);\n\n          // Close the first nested menu with escape key\n          pressKey(getOpenSubMenu(), $mdConstant.KEY_CODE.ESCAPE);\n          waitForMenuClose();\n\n          // Just main menu should be visible\n          expect(getNumberOfOpenMenus()).toBe(1);\n\n          menuBar.remove();\n        }));\n\n        function openSubMenu(index) {\n          // If a menu is already open, trigger the mouse leave to close it\n          if (subMenuOpen) {\n            subMenuOpen.triggerHandler({\n              type: 'mouseleave',\n              target: subMenuOpen[0],\n              currentTarget: subMenuOpen[0]\n            });\n          }\n\n          // Set the currently open sub-menu and trigger the mouse enter\n          subMenuOpen = angular.element(menus[index]);\n          subMenuOpen.triggerHandler({\n            type: 'mouseenter',\n            target: subMenuOpen[0],\n            currentTarget: subMenuOpen[0]\n          });\n        }\n\n        function getOpenSubMenu() {\n          var containers = document.body.querySelectorAll('.md-open-menu-container.md-active');\n          var lastContainer = containers.item(containers.length - 1);\n\n          return angular.element(lastContainer.querySelector('md-menu-content'));\n        }\n\n        function getNumberOfOpenMenus() {\n          var containers = document.body.querySelectorAll('.md-open-menu-container.md-active');\n          return containers.length;\n        }\n\n        function pressKey(el, code) {\n          el.triggerHandler({\n            type: 'keydown',\n            keyCode: code\n          });\n        }\n\n        function setup() {\n          var el;\n          inject(function($compile, $rootScope) {\n            el = $compile([\n              '<md-menu-bar>',\n              '  <md-menu>',\n              '    <md-menu-item>',\n              '      <button ng-click=\"clicked=true\">Button {{i}}</button>',\n              '    </md-menu-item>',\n              '    <md-menu-content class=\"test-submenu\">',\n              '      <md-menu ng-repeat=\"i in [1, 2]\">',\n              '        <md-menu-item>',\n              '          <button ng-click=\"subclicked=true\">Sub Button{{i}}</button>',\n              '        </md-menu-item>',\n              '        <md-menu-content>Sub {{i}} - Content</md-menu-content>',\n              '      </md-menu>',\n              '    </md-menu-content>',\n              '  </md-menu>',\n              '</md-menu-bar>'\n            ].join(''))($rootScope);\n            $rootScope.$digest();\n          });\n          attachedMenuElements.push(el);\n\n          return el;\n        }\n      });\n    });\n\n    describe('MenuBarCtrl', function() {\n      var menuBar, ctrl;\n      beforeEach(function() {\n        menuBar = setup();\n        ctrl = menuBar.controller('mdMenuBar');\n      });\n      describe('#getMenus', function() {\n        it('gets the menus in the menubar', function() {\n          var menus = ctrl.getMenus();\n          expect(Array.isArray(menus)).toBe(true);\n          expect(menus.length).toBe(3);\n          expect(menus[0].nodeName).toBe('MD-MENU');\n        });\n      });\n\n      describe('#getFocusedMenuIndex', function() {\n        it('gets the focused menu index', function() {\n          var menus = ctrl.getMenus();\n          ctrl.$document = [{\n            activeElement: menus[1].querySelector('button')\n          }];\n          expect(ctrl.getFocusedMenuIndex()).toBe(1);\n        });\n      });\n\n      describe('#getFocusedMenu', function() {\n        it('gets the menu at the focused index', function() {\n          var menus = [{}, {}, {}];\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(1);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          expect(ctrl.getFocusedMenu()).toBe(menus[1]);\n        });\n      });\n\n      describe('#focusMenu', function() {\n        var focused;\n        beforeEach(function() { focused = false; });\n        it('focuses the first menu if none is focused', function() {\n          var menus = mockButtonAtIndex(0);\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(-1);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          ctrl.focusMenu(1);\n          expect(focused).toBe(true);\n        });\n        it('focuses the next menu', function() {\n          var menus = mockButtonAtIndex(1);\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(0);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          ctrl.focusMenu(1);\n          expect(focused).toBe(true);\n        });\n        it('focuses the previous menu', function() {\n          var menus = mockButtonAtIndex(1);\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(2);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          ctrl.focusMenu(-1);\n          expect(focused).toBe(true);\n        });\n\n        it('does not focus prev at the start of the array', function() {\n          var menus = mockButtonAtIndex(0);\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(0);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          ctrl.focusMenu(-1);\n          expect(focused).toBe(false);\n        });\n\n        it('does not focus next at the end of the array', function() {\n          var menus = mockButtonAtIndex(2);\n          spyOn(ctrl, 'getFocusedMenuIndex').and.returnValue(2);\n          spyOn(ctrl, 'getMenus').and.returnValue(menus);\n          ctrl.focusMenu(1);\n          expect(focused).toBe(false);\n        });\n\n        function mockButtonAtIndex(index) {\n          var result = [];\n          var mockButton = {\n            querySelector: function() { return {\n              focus: function() { focused = true; }\n            }; },\n\n            // TODO: This may need to become more complex if more of the tests use it\n            classList: { contains: function() { return false; } }\n          };\n          for (var i = 0; i < 3; ++i) {\n            if (i == index) {\n              result.push(mockButton);\n            } else {\n              result.push({ classList: mockButton.classList });\n            }\n          }\n          return result;\n        }\n      });\n\n      describe('#openFocusedMenu', function() {\n        it('clicks the focused menu', function() {\n          var opened = false;\n          spyOn(ctrl, 'getFocusedMenu').and.returnValue({\n            querySelector: function() { return true; }\n          });\n          spyOn(angular, 'element').and.returnValue({\n            controller: function() { return {\n              open: function() { opened = true; }\n            }; }\n          });\n          ctrl.openFocusedMenu();\n          expect(opened).toBe(true);\n        });\n      });\n\n      describe('#handleKeyDown', function() {\n        var keyCodes, call, called, calledWith;\n        beforeEach(inject(function($injector) {\n          var $mdConstant = $injector.get('$mdConstant');\n          keyCodes = $mdConstant.KEY_CODE;\n          called = false;\n          call = function(arg) { called = true; calledWith = arg; };\n        }));\n        describe('DOWN_ARROW', function() {\n          it('opens the currently focused menu', function() {\n            spyOn(ctrl, 'openFocusedMenu').and.callFake(call);\n            ctrl.handleKeyDown({ keyCode: keyCodes.DOWN_ARROW });\n            expect(called).toBe(true);\n          });\n        });\n        describe('RIGHT_ARROW', function() {\n          it('focuses the next menu', function() {\n            spyOn(ctrl, 'focusMenu').and.callFake(call);\n            ctrl.handleKeyDown({ keyCode: keyCodes.RIGHT_ARROW });\n            expect(called).toBe(true);\n            expect(calledWith).toBe(1);\n          });\n        });\n        describe('LEFT_ARROW', function() {\n          it('focuses the previous menu', function() {\n            spyOn(ctrl, 'focusMenu').and.callFake(call);\n            ctrl.handleKeyDown({ keyCode: keyCodes.LEFT_ARROW });\n            expect(called).toBe(true);\n            expect(calledWith).toBe(-1);\n          });\n        });\n      });\n    });\n\n    function setup() {\n      var el;\n      inject(function($compile, $rootScope) {\n        el = $compile([\n          '<md-menu-bar>',\n            '<md-menu ng-repeat=\"i in [1, 2, 3]\">',\n              '<button ng-click=\"lastClicked = $index\"></button>',\n              '<md-menu-content></md-menu-content>',\n            '</md-menu>',\n          '</md-menu-bar>'\n        ].join(''))($rootScope);\n        $rootScope.$digest();\n      });\n      attachedMenuElements.push(el);\n\n      return el;\n    }\n  });\n\n  describe('md-menu-divider directive', function() {\n\n    it('sets role=\"separator\"', function() {\n      var el = setup();\n      expect(el.attr('role')).toBe('separator');\n    });\n    function setup() {\n      var divider;\n      inject(function($compile, $rootScope) {\n        divider = $compile('<md-menu-divider></md-menu-divider>')($rootScope);\n      });\n      return divider;\n    }\n  });\n\n  describe('md-menu-item directive', function() {\n    describe('type=\"checkbox\"', function() {\n      function setup(attrs) {\n        return setupMenuItem(attrs + ' type=\"checkbox\"');\n      }\n\n      it('compiles', function() {\n        var menuItem = setup('ng-model=\"test\"')[0];\n        expect(menuItem.classList.contains('md-indent')).toBe(true);\n        var children = menuItem.children;\n        expect(children[0].nodeName).toBe('MD-ICON');\n        expect(children[1].nodeName).toBe('MD-BUTTON');\n      });\n      it('compiles with ng-repeat', function() {\n        var menuItem = setup('ng-repeat=\"i in [1, 2, 3]\"')[0];\n        expect(menuItem.classList.contains('md-indent')).toBe(true);\n        var children = menuItem.children;\n        expect(children[0].nodeName).toBe('MD-ICON');\n        expect(children[1].nodeName).toBe('MD-BUTTON');\n      });\n      it('sets aria role', function() {\n        var menuItem = setup()[0].querySelector('md-button');\n        expect(menuItem.getAttribute('role')).toBe('menuitemcheckbox');\n      });\n      it('toggles on click', function() {\n        var menuItem = setup('ng-model=\"test\"')[0];\n        var button = menuItem.querySelector('md-button');\n        button.click();\n        inject(function($rootScope) {\n          expect($rootScope.test).toBe(true);\n        });\n      });\n      it('does not toggle if disabled', function() {\n        var menuItem = setup('ng-model=\"test\" ng-disabled=\"true\"')[0];\n        var button = menuItem.querySelector('md-button');\n        button.click();\n        inject(function($rootScope) {\n          expect($rootScope.test).toBeFalsy();\n        });\n      });\n      it('reflects the ng-model value', inject(function($rootScope) {\n        var menuItem = setup('ng-model=\"test\"')[0];\n        var button = menuItem.querySelector('md-button');\n        expect(button.getAttribute('aria-checked')).toBe('false');\n        expect(menuItem.children[0].style.display).toBe('none');\n        $rootScope.test = true;\n        $rootScope.$digest();\n        expect(menuItem.children[0].style.display).toBe('');\n        expect(button.getAttribute('aria-checked')).toBe('true');\n      }));\n    });\n\n    describe('type=\"radio\"', function() {\n      function setup(attrs) {\n        return setupMenuItem(attrs + ' type=\"radio\"');\n      }\n\n      it('compiles', function() {\n        var menuItem = setup('ng-model=\"test\"')[0];\n        expect(menuItem.classList.contains('md-indent')).toBe(true);\n        var children = menuItem.children;\n        expect(children[0].nodeName).toBe('MD-ICON');\n        expect(children[1].nodeName).toBe('MD-BUTTON');\n      });\n      it('compiles with ng-repeat', function() {\n        var menuItem = setup('ng-repeat=\"i in [1, 2, 3]\"')[0];\n        expect(menuItem.classList.contains('md-indent')).toBe(true);\n        var children = menuItem.children;\n        expect(children[0].nodeName).toBe('MD-ICON');\n        expect(children[1].nodeName).toBe('MD-BUTTON');\n      });\n      it('sets aria role', function() {\n        var menuItem = setup()[0].querySelector('md-button');\n        expect(menuItem.getAttribute('role')).toBe('menuitemradio');\n      });\n      it('toggles on click', function() {\n        var menuItem = setup('ng-model=\"test\" value=\"hello\"')[0];\n        var button = menuItem.querySelector('md-button');\n        button.click();\n        inject(function($rootScope) {\n          expect($rootScope.test).toBe(\"hello\");\n        });\n      });\n\n      it('does not toggle if disabled', function() {\n        var menuItem = setup('ng-model=\"test\" value=\"hello\" ng-disabled=\"true\"')[0];\n        var button = menuItem.querySelector('md-button');\n        button.click();\n        inject(function($rootScope) {\n          expect($rootScope.test).toBeFalsy();\n        });\n      });\n\n      it('reflects the ng-model value', inject(function($rootScope) {\n        $rootScope.test = 'apple';\n        var menuItem = setup('ng-model=\"test\" value=\"hello\"')[0];\n        var button = menuItem.querySelector('md-button');\n        expect(button.getAttribute('aria-checked')).toBe('false');\n        expect(menuItem.children[0].style.display).toBe('none');\n        $rootScope.test = 'hello';\n        $rootScope.$digest();\n        expect(menuItem.children[0].style.display).toBeFalsy();\n        expect(button.getAttribute('aria-checked')).toBe('true');\n      }));\n    });\n\n    function setupMenuItem(attrs) {\n      // We need to have a `md-menu-bar` as a parent of our menu item, because the menu-item\n      // is only wrapping and indenting the content if it's inside of a menu bar.\n      var menuBar;\n      var template =\n        '<md-menu-bar>' +\n          '<md-menu-item ' + (attrs = attrs || '') + '>Test Item</md-menu-item>' +\n        '</md-menu-bar>';\n\n      inject(function($compile, $rootScope) {\n        menuBar = $compile(template)($rootScope);\n        $rootScope.$digest();\n      });\n\n      return menuBar.find('md-menu-item');\n    }\n  });\n\n  function waitForMenuOpen() {\n    inject(function($material) {\n      $material.flushInterimElement();\n    });\n  }\n\n  function waitForMenuClose() {\n    inject(function($material) {\n      $material.flushInterimElement();\n    });\n  }\n});\n\n"
  },
  {
    "path": "src/components/navBar/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <md-nav-bar\n      md-no-ink-bar=\"disableInkBar\"\n      md-selected-nav-item=\"currentNavItem\"\n      nav-bar-aria-label=\"navigation links\">\n      <md-nav-item md-nav-click=\"goto('page1')\" name=\"page1\">\n        Page One\n      </md-nav-item>\n      <md-nav-item md-nav-click=\"goto('page2')\" name=\"page2\" ng-disabled=\"secondTabDisabled\">\n        Page Two\n      </md-nav-item>\n      <md-nav-item md-nav-click=\"goto('page3')\" name=\"page3\">\n        Page Three\n      </md-nav-item>\n      <md-nav-item md-nav-click=\"goto('page4')\" name=\"page4\" disabled>\n        Page Four\n      </md-nav-item>\n      <!-- these require actual routing with ui-router or ng-route, so they\n      won't work in the demo\n      <md-nav-item md-nav-href=\"#page4\" name=\"page5\">Page Four</md-nav-item>\n      <md-nav-item md-nav-sref=\"app.page5\" name=\"page4\">Page Five</md-nav-item>\n      You can also add options for the <code>ui-sref-opts</code> attribute.\n      <md-nav-item md-nav-sref=\"page6\" sref-opts=\"{reload:true, notify:true}\">\n        Page Six\n      </md-nav-item>\n      -->\n    </md-nav-bar>\n    <span>{{status}}</span>\n    <div class=\"ext-content\">\n      External content for `<span>{{currentNavItem}}</span>`.\n    </div>\n\n    <md-checkbox ng-model=\"disableInkBar\">Disable Ink Bar</md-checkbox>\n\n    <md-checkbox ng-model=\"secondTabDisabled\" aria-label=\"Disable Second Tab\" style=\"margin: 5px;\">\n      Disable Second Tab\n    </md-checkbox>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/navBar/demoBasicUsage/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular.module('navBarDemoBasicUsage', ['ngMaterial'])\n      .controller('AppCtrl', AppCtrl);\n\n  function AppCtrl($scope) {\n    $scope.currentNavItem = 'page1';\n\n    $scope.goto = function(page) {\n      $scope.status = \"Goto \" + page;\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/navBar/demoBasicUsage/style.scss",
    "content": "md-content {\n\n  .ext-content {\n    padding:50px;\n    margin:20px;\n    background-color: #FFF2E0;\n  }\n\n}\n"
  },
  {
    "path": "src/components/navBar/navBar-theme.scss",
    "content": "@mixin md-nav-bar-primary {\n  > .md-nav-bar {\n    background-color: '{{primary-color}}';\n    .md-button._md-nav-button {\n      & {\n        color: '{{primary-100}}';\n      }\n      &.md-active, &.md-focused {\n        color: '{{primary-contrast}}';\n      }\n      &.md-focused {\n        background: '{{primary-contrast-0.1}}';\n      }\n    }\n  }\n}\n\n@mixin md-nav-bar-warn {\n  > .md-nav-bar {\n    background-color: '{{warn-color}}';\n    .md-button._md-nav-button {\n      & {\n        color: '{{warn-100}}';\n      }\n      &.md-active, &.md-focused {\n        color: '{{warn-contrast}}';\n      }\n      &.md-focused {\n        background: '{{warn-contrast-0.1}}';\n      }\n    }\n  }\n}\n\n@mixin md-nav-bar-accent {\n  > .md-nav-bar {\n    background-color: '{{accent-color}}';\n    .md-button._md-nav-button {\n      & {\n        color: '{{accent-A100}}';\n      }\n      &.md-active, &.md-focused {\n        color: '{{accent-contrast}}';\n      }\n      &.md-focused {\n        background: '{{accent-contrast-0.1}}';\n      }\n    }\n    md-nav-ink-bar {\n      color: '{{primary-600-1}}';\n      background: '{{primary-600-1}}';\n    }\n  }\n}\n\nmd-nav-bar.md-THEME_NAME-theme {\n\n  .md-nav-bar {\n    background-color: transparent;\n    border-color: '{{foreground-4}}';\n  }\n\n  .md-button._md-nav-button {\n    &.md-unselected {\n      color: '{{foreground-2}}';\n    }\n    &[disabled] {\n      color: '{{foreground-3}}';\n    }\n  }\n\n  md-nav-ink-bar {\n    color: '{{accent-color}}';\n    background: '{{accent-color}}';\n  }\n\n  &.md-accent {\n    @include md-nav-bar-accent();\n  }\n\n  &.md-warn {\n    @include md-nav-bar-warn();\n  }\n\n  &.md-primary {\n    @include md-nav-bar-primary();\n  }\n}\n\nmd-toolbar > md-nav-bar.md-THEME_NAME-theme {\n  @include md-nav-bar-primary();\n}\nmd-toolbar.md-accent > md-nav-bar.md-THEME_NAME-theme {\n  @include md-nav-bar-accent();\n}\nmd-toolbar.md-warn > md-nav-bar.md-THEME_NAME-theme {\n  @include md-nav-bar-warn();\n}"
  },
  {
    "path": "src/components/navBar/navBar.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.navBar\n */\nangular.module('material.components.navBar', ['material.core'])\n    .controller('MdNavBarController', MdNavBarController)\n    .directive('mdNavBar', MdNavBar)\n    .controller('MdNavItemController', MdNavItemController)\n    .directive('mdNavItem', MdNavItem);\n\n/**\n * @ngdoc directive\n * @name mdNavBar\n * @module material.components.navBar\n *\n * @restrict E\n *\n * @description\n * The `<md-nav-bar>` directive renders a list of material tabs that can be used\n * for top-level page navigation. Unlike `<md-tabs>`, it has no concept of a tab\n * body and no bar pagination.\n *\n * Because it deals with page navigation, certain routing concepts are built-in.\n * Route changes via `ng-href`, `ui-sref`, or `ng-click` events are supported.\n * Alternatively, the user could simply watch the value of `md-selected-nav-item`\n * (`currentNavItem` in the below example) for changes.\n *\n * Accessibility functionality is implemented as a\n * <a href=\"https://www.w3.org/TR/wai-aria-1.0/complete#tablist\">\n *   tablist</a> with\n * <a href=\"https://www.w3.org/TR/wai-aria-1.0/complete#tab\">tabs</a>.\n * We've kept the `role=\"navigation\"` on the `<nav>`, for backwards compatibility, even though\n *  it is not required in the\n * <a href=\"https://www.w3.org/TR/wai-aria-practices/#aria_lh_navigation\">\n *   latest Working Group Note from December 2017</a>.\n *\n * <h3>Keyboard Navigation</h3>\n * - `Tab`/`Shift+Tab` moves the focus to the next/previous interactive element on the page\n * - `Enter`/`Space` selects the focused nav item and navigates to display the item's contents\n * - `Right`/`Down` moves focus to the next nav item, wrapping at the end\n * - `Left`/`Up` moves focus to the previous nav item, wrapping at the end\n * - `Home`/`End` moves the focus to the first/last nav item\n *\n * @param {string=} md-selected-nav-item The name of the current tab; this must\n *     match the `name` attribute of `<md-nav-item>`.\n * @param {boolean=} md-no-ink-bar If set to true, the ink bar will be hidden.\n * @param {string=} nav-bar-aria-label An `aria-label` applied to the `md-nav-bar`'s tablist\n * for accessibility.\n *\n * @usage\n * <hljs lang=\"html\">\n *  <md-nav-bar md-selected-nav-item=\"currentNavItem\">\n *    <md-nav-item md-nav-click=\"goto('page1')\" name=\"page1\">\n *      Page One\n *    </md-nav-item>\n *    <md-nav-item md-nav-href=\"#page2\" name=\"page3\">Page Two</md-nav-item>\n *    <md-nav-item md-nav-sref=\"page3\" name=\"page2\">Page Three</md-nav-item>\n *    <md-nav-item\n *      md-nav-sref=\"app.page4\"\n *      sref-opts=\"{reload: true, notify: true}\"\n *      name=\"page4\">\n *      Page Four\n *    </md-nav-item>\n *  </md-nav-bar>\n *</hljs>\n * <hljs lang=\"js\">\n * (function() {\n *   'use strict';\n *\n *    $rootScope.$on('$routeChangeSuccess', function(event, current) {\n *      $scope.currentLink = getCurrentLinkFromRoute(current);\n *    });\n * });\n * </hljs>\n */\n/**\n * @param $mdAria\n * @param $mdTheming\n * @param $window\n * @param $mdUtil\n * @constructor\n * @ngInject\n */\nfunction MdNavBar($mdAria, $mdTheming, $window, $mdUtil) {\n  return {\n    restrict: 'E',\n    transclude: true,\n    controller: MdNavBarController,\n    controllerAs: 'ctrl',\n    bindToController: true,\n    scope: {\n      'mdSelectedNavItem': '=?',\n      'mdNoInkBar': '=?',\n      'navBarAriaLabel': '@?',\n    },\n    template:\n      '<div class=\"md-nav-bar\">' +\n        '<nav role=\"navigation\">' +\n          '<ul class=\"_md-nav-bar-list\" ng-transclude role=\"tablist\" ' +\n            'ng-focus=\"ctrl.onFocus()\" ' + // Deprecated but kept for now in order to not break tests\n            'aria-label=\"{{ctrl.navBarAriaLabel}}\">' +\n          '</ul>' +\n        '</nav>' +\n        '<md-nav-ink-bar ng-hide=\"ctrl.mdNoInkBar\"></md-nav-ink-bar>' +\n      '</div>',\n    link: function(scope, element, attrs, ctrl) {\n\n      ctrl.width = $window.innerWidth;\n\n      function onResize() {\n        if (ctrl.width !== $window.innerWidth) {\n          ctrl.updateSelectedTabInkBar();\n          ctrl.width = $window.innerWidth;\n          scope.$digest();\n        }\n      }\n\n      function cleanUp() {\n        angular.element($window).off('resize', onResize);\n      }\n\n      angular.element($window).on('resize', $mdUtil.debounce(onResize, 300));\n      scope.$on('$destroy', cleanUp);\n\n      $mdTheming(element);\n      if (!ctrl.navBarAriaLabel) {\n        $mdAria.expectAsync(element, 'aria-label', angular.noop);\n      }\n    },\n  };\n}\n\n/**\n * Controller for the nav-bar component.\n * Accessibility functionality is implemented as a tablist\n * (https://www.w3.org/TR/wai-aria-1.0/complete#tablist) and\n * tabs (https://www.w3.org/TR/wai-aria-1.0/complete#tab).\n *\n * @param {!JQLite} $element\n * @param {!IScope} $scope\n * @param {!ITimeoutService} $timeout\n * @param {!Object} $mdConstant\n * @constructor\n * @final\n * @ngInject\n */\nfunction MdNavBarController($element, $scope, $timeout, $mdConstant) {\n  // Injected variables\n  /**\n   * @private @const\n   * @type {!ITimeoutService}\n   */\n  this._$timeout = $timeout;\n\n  /**\n   * @private @const\n   * @type {!IScope}\n   */\n  this._$scope = $scope;\n\n  /**\n   * @private @const\n   * @type {!Object}\n   */\n  this._$mdConstant = $mdConstant;\n\n  // Data-bound variables.\n  /** @type {?string} */\n  this.mdSelectedNavItem;\n\n  /** @type {?string} */\n  this.navBarAriaLabel;\n\n  // State variables.\n  /** @type {?HTMLElement} */\n  this._navBarEl = $element[0];\n\n  /** @type {?JQLite} */\n  this._inkbar;\n\n  var self = this;\n  // need to wait for transcluded content to be available\n  var deregisterTabWatch = this._$scope.$watch(function() {\n    return self._navBarEl.querySelectorAll('._md-nav-button').length;\n  },\n  function(newLength) {\n    if (newLength > 0) {\n      self._initTabs();\n      deregisterTabWatch();\n    }\n  });\n}\n\n/**\n * Initializes the tab components once they exist.\n * @private\n */\nMdNavBarController.prototype._initTabs = function() {\n  this._inkbar = angular.element(this._navBarEl.querySelector('md-nav-ink-bar'));\n\n  var self = this;\n  this._$timeout(function() {\n    self._updateTabs(self.mdSelectedNavItem, null);\n  });\n\n  this._$scope.$watch('ctrl.mdSelectedNavItem', function(newValue, oldValue) {\n    // Wait a digest before update tabs for products doing\n    // anything dynamic in the template.\n    self._$timeout(function() {\n      self._updateTabs(newValue, oldValue);\n    });\n  });\n};\n\n/**\n * Set the current tab to be selected.\n * @param {string|undefined} newValue New current tab name.\n * @param {string|undefined|null} oldValue Previous tab name.\n * @private\n */\nMdNavBarController.prototype._updateTabs = function(newValue, oldValue) {\n  var self = this;\n  var tabs = this._getTabs();\n  var sameTab = newValue === oldValue;\n\n  // this._getTabs can return null if nav-bar has not yet been initialized\n  if (!tabs) return;\n\n  var newIndex = -1;\n  var newTab = this._getTabByName(newValue);\n  var oldTab = this._getTabByName(oldValue);\n\n  if (oldTab) {\n    oldTab.setSelected(false);\n  }\n\n  if (newTab) {\n    newTab.setSelected(true);\n    newIndex = tabs.indexOf(newTab);\n  }\n\n  this._$timeout(function() {\n    self._updateInkBarStyles(newTab, newIndex);\n    // Don't change focus when there is no newTab, the new and old tabs are the same, or when\n    // called from MdNavBarController._initTabs() which would have no oldTab defined.\n    if (newTab && oldTab && !sameTab) {\n      self._moveFocus(oldTab, newTab);\n    }\n  });\n};\n\n/**\n * Repositions the ink bar to the selected tab.\n * @param {MdNavItemController} tab the nav item that should have ink bar styles applied\n * @param {number=} newIndex the index of the newly selected nav item\n * @private\n */\nMdNavBarController.prototype._updateInkBarStyles = function(tab, newIndex) {\n  this._inkbar.css({display: newIndex < 0 ? 'none' : ''});\n\n  if (tab) {\n    var tabEl = tab.getButtonEl();\n    var left = tabEl.offsetLeft;\n    var tabWidth = tabEl.offsetWidth;\n    var navBarWidth = this._navBarEl.getBoundingClientRect().width;\n    var scale = tabWidth / navBarWidth;\n    var translate = left / navBarWidth * 100;\n\n    this._inkbar.css({ transform: 'translateX(' + translate + '%) scaleX(' + scale + ')' });\n  }\n};\n\n/**\n * Updates ink bar to match current tab.\n */\nMdNavBarController.prototype.updateSelectedTabInkBar = function() {\n  this._updateInkBarStyles(this._getSelectedTab());\n};\n\n/**\n * Returns an array of the current tabs.\n * @return {Array<!MdNavItemController>}\n * @private\n */\nMdNavBarController.prototype._getTabs = function() {\n  var controllers = Array.prototype.slice.call(\n    this._navBarEl.querySelectorAll('.md-nav-item'))\n    .map(function(el) {\n      return angular.element(el).controller('mdNavItem');\n    });\n  return controllers.indexOf(undefined) ? controllers : [];\n};\n\n/**\n * Returns the tab with the specified name.\n * @param {string} name The name of the tab, found in its name attribute.\n * @return {MdNavItemController}\n * @private\n */\nMdNavBarController.prototype._getTabByName = function(name) {\n  return this._findTab(function(tab) {\n    return tab.getName() === name;\n  });\n};\n\n/**\n * Returns the selected tab.\n * @return {MdNavItemController}\n * @private\n */\nMdNavBarController.prototype._getSelectedTab = function() {\n  return this._findTab(function(tab) {\n    return tab.isSelected();\n  });\n};\n\n/**\n * Returns the focused tab.\n * @return {MdNavItemController}\n */\nMdNavBarController.prototype.getFocusedTab = function() {\n  return this._findTab(function(tab) {\n    return tab.hasFocus();\n  });\n};\n\n/**\n * Find a tab that matches the specified function, starting from the first tab.\n * @param {Function} fn\n * @param {number=} startIndex index to start at. Defaults to 0.\n * @returns {MdNavItemController|null}\n * @private\n */\nMdNavBarController.prototype._findTab = function(fn, startIndex) {\n  var tabs = this._getTabs(), i;\n  if (startIndex == null) {\n    startIndex = 0;\n  }\n  for (i = startIndex; i < tabs.length; i++) {\n    if (fn(tabs[i])) {\n      return tabs[i];\n    }\n  }\n  return null;\n};\n\n/**\n * Find a tab that matches the specified function, going backwards from the end of the list.\n * @param {Function} fn\n * @param {number=} startIndex index to start at. Defaults to tabs.length - 1.\n * @returns {MdNavItemController}\n * @private\n */\nMdNavBarController.prototype._findTabReverse = function(fn, startIndex) {\n  var tabs = this._getTabs();\n  if (startIndex === undefined || startIndex === null) {\n    startIndex = tabs.length - 1;\n  }\n  for (var i = startIndex; i >= 0 ; i--) {\n    if (fn(tabs[i])) {\n      return tabs[i];\n    }\n  }\n  return null;\n};\n\n/**\n * Direct focus to the selected tab when focus enters the nav bar.\n */\nMdNavBarController.prototype.onFocus = function() {\n  var tab = this._getSelectedTab();\n  if (tab && !tab.isFocused) {\n    tab.setFocused(true);\n  }\n};\n\n/**\n * Move focus from oldTab to newTab.\n * @param {!MdNavItemController} oldTab\n * @param {!MdNavItemController} newTab\n * @private\n */\nMdNavBarController.prototype._moveFocus = function(oldTab, newTab) {\n  oldTab.setFocused(false);\n  newTab.setFocused(true);\n};\n\n/**\n * Focus the first tab.\n * @private\n */\nMdNavBarController.prototype._focusFirstTab = function() {\n  var tabs = this._getTabs();\n  if (!tabs) return;\n  var tabToFocus = this._findTab(function(tab) {\n    return tab._isEnabled();\n  });\n  if (tabToFocus) {\n    this._moveFocus(this.getFocusedTab(), tabToFocus);\n  }\n};\n\n/**\n * Focus the last tab.\n * @private\n */\nMdNavBarController.prototype._focusLastTab = function() {\n  var tabs = this._getTabs();\n  if (!tabs) return;\n  var tabToFocus = this._findTabReverse(function(tab) {\n    return tab._isEnabled();\n  });\n  if (tabToFocus) {\n    this._moveFocus(this.getFocusedTab(), tabToFocus);\n  }\n};\n\n/**\n * Focus the next non-disabled tab.\n * @param {number} focusedTabIndex the index of the currently focused tab\n * @private\n */\nMdNavBarController.prototype._focusNextTab = function(focusedTabIndex) {\n  var tabs = this._getTabs();\n  if (!tabs) return;\n  var tabToFocus = this._findTab(function(tab) {\n    return tab._isEnabled();\n  }, focusedTabIndex + 1);\n  if (tabToFocus) {\n    this._moveFocus(this.getFocusedTab(), tabToFocus);\n  } else {\n    this._focusFirstTab();\n  }\n};\n\n/**\n * Focus the previous non-disabled tab.\n * @param {number} focusedTabIndex the index of the currently focused tab\n * @private\n */\nMdNavBarController.prototype._focusPreviousTab = function(focusedTabIndex) {\n  var tabs = this._getTabs();\n  if (!tabs) return;\n  var tabToFocus = this._findTabReverse(function(tab) {\n    return tab._isEnabled();\n  }, focusedTabIndex - 1);\n  if (tabToFocus) {\n    this._moveFocus(this.getFocusedTab(), tabToFocus);\n  } else {\n    this._focusLastTab();\n  }\n};\n\n/**\n * Responds to keydown events.\n * Calls to preventDefault() stop the page from scrolling when changing focus in the nav-bar.\n * @param {!KeyboardEvent} e\n */\nMdNavBarController.prototype.onKeydown = function(e) {\n  var keyCodes = this._$mdConstant.KEY_CODE;\n  var tabs = this._getTabs();\n  var focusedTab = this.getFocusedTab();\n  if (!focusedTab || !tabs) return;\n\n  var focusedTabIndex = tabs.indexOf(focusedTab);\n\n  // use arrow keys to navigate between tabs\n  switch (e.keyCode) {\n    case keyCodes.UP_ARROW:\n    case keyCodes.LEFT_ARROW:\n      e.preventDefault();\n      this._focusPreviousTab(focusedTabIndex);\n      break;\n    case keyCodes.DOWN_ARROW:\n    case keyCodes.RIGHT_ARROW:\n      e.preventDefault();\n      this._focusNextTab(focusedTabIndex);\n      break;\n    case keyCodes.SPACE:\n    case keyCodes.ENTER:\n      // timeout to avoid a \"digest already in progress\" console error\n      this._$timeout(function() {\n        focusedTab.getButtonEl().click();\n      });\n      break;\n    case keyCodes.HOME:\n      e.preventDefault();\n      this._focusFirstTab();\n      break;\n    case keyCodes.END:\n      e.preventDefault();\n      this._focusLastTab();\n      break;\n  }\n};\n\n/**\n * @ngdoc directive\n * @name mdNavItem\n * @module material.components.navBar\n *\n * @restrict E\n *\n * @description\n * `<md-nav-item>` describes a page navigation link within the `<md-nav-bar>` component.\n * It renders an `<md-button>` as the actual link.\n *\n * Exactly one of the `md-nav-click`, `md-nav-href`, or `md-nav-sref` attributes are required\n * to be specified.\n *\n * @param {string=} nav-item-aria-label Allows setting or overriding the label that is announced by\n *     a screen reader for the nav item's button. If this is not set, the nav item's transcluded\n *     content will be announced. Make sure to set this if the nav item's transcluded content does\n *     not include descriptive text, for example only an icon.\n * @param {expression=} md-nav-click Expression which will be evaluated when the\n *     link is clicked to change the page. Renders as an `ng-click`.\n * @param {string=} md-nav-href url to transition to when this link is clicked.\n *     Renders as an `ng-href`.\n * @param {string=} md-nav-sref UI-Router state to transition to when this link is\n *     clicked. Renders as a `ui-sref`.\n * @param {string} name The name of this link. Used by the nav bar to know\n *     which link is currently selected.\n * @param {!object=} sref-opts UI-Router options that are passed to the `$state.go()` function. See\n *     the <a ng-href=\"https://ui-router.github.io/docs/latest/interfaces/transition.transitionoptions.html\"\n *     target=\"_blank\">UI-Router documentation for details</a>.\n *\n * @usage\n * See <a ng-href=\"api/directive/mdNavBar\">md-nav-bar</a> for usage.\n */\n/**\n * @param $mdAria\n * @param $$rAF\n * @param $mdUtil\n * @param $window\n * @constructor\n * @ngInject\n */\nfunction MdNavItem($mdAria, $$rAF, $mdUtil, $window) {\n  return {\n    restrict: 'E',\n    require: ['mdNavItem', '^mdNavBar'],\n    controller: MdNavItemController,\n    bindToController: true,\n    controllerAs: 'ctrl',\n    replace: true,\n    transclude: true,\n    template: function(tElement, tAttrs) {\n      var hasNavClick = tAttrs.mdNavClick;\n      var hasNavHref = tAttrs.mdNavHref;\n      var hasNavSref = tAttrs.mdNavSref;\n      var hasSrefOpts = tAttrs.srefOpts;\n      var navigationAttribute;\n      var navigationOptions;\n      var buttonTemplate;\n\n      // Cannot specify more than one nav attribute\n      if ((hasNavClick ? 1 : 0) + (hasNavHref ? 1 : 0) + (hasNavSref ? 1 : 0) > 1) {\n        throw Error(\n          'Please do not specify more than one of the md-nav-click, md-nav-href, ' +\n          'or md-nav-sref attributes per nav-item directive.'\n        );\n      }\n\n      if (hasNavClick !== undefined && hasNavClick !== null) {\n        navigationAttribute = 'ng-click=\"ctrl.mdNavClick()\"';\n      } else if (hasNavHref !== undefined && hasNavHref !== null) {\n        navigationAttribute = 'ng-href=\"{{ctrl.mdNavHref}}\"';\n      } else if (hasNavSref !== undefined && hasNavSref !== null) {\n        navigationAttribute = 'ui-sref=\"{{ctrl.mdNavSref}}\"';\n      } else {\n        throw Error(\n          'Please specify at least one of the md-nav-click, md-nav-href, or md-nav-sref ' +\n          'attributes per nav-item directive.');\n      }\n\n      navigationOptions = hasSrefOpts ? 'ui-sref-opts=\"{{ctrl.srefOpts}}\" ' : '';\n\n      if (navigationAttribute) {\n        buttonTemplate = '' +\n          '<md-button class=\"_md-nav-button md-accent\" ' +\n            'ng-class=\"ctrl.getNgClassMap()\" ' +\n            'ng-blur=\"ctrl.setFocused(false)\" ' +\n            'ng-disabled=\"ctrl.disabled\" ' +\n            'tabindex=\"-1\" ' +\n            'role=\"tab\" ' +\n            'ng-attr-aria-label=\"{{ctrl.navItemAriaLabel ? ctrl.navItemAriaLabel : undefined}}\" ' +\n            'aria-selected=\"{{ctrl.isSelected()}}\" ' +\n            navigationOptions +\n            navigationAttribute + '>' +\n            '<span ng-transclude class=\"_md-nav-button-text\"></span>' +\n          '</md-button>';\n      }\n\n      return '' +\n        '<li class=\"md-nav-item\" ' +\n          'role=\"presentation\">' +\n          (buttonTemplate || '') +\n        '</li>';\n    },\n    scope: {\n      'mdNavClick': '&?',\n      'mdNavHref': '@?',\n      'mdNavSref': '@?',\n      'srefOpts': '=?',\n      'name': '@',\n      'navItemAriaLabel': '@?',\n    },\n    link: function(scope, element, attrs, controllers) {\n      var disconnect;\n      var mdNavItem;\n      var mdNavBar;\n      var navButton;\n\n      // When accessing the element's contents synchronously, they\n      // may not be defined yet because of transclusion. There is a higher\n      // chance that it will be accessible if we wait one frame.\n      $$rAF(function() {\n        mdNavItem = controllers[0];\n        mdNavBar = controllers[1];\n        navButton = angular.element(element[0].querySelector('._md-nav-button'));\n\n        if (!mdNavItem.name) {\n          mdNavItem.name = angular.element(element[0]\n              .querySelector('._md-nav-button-text')).text().trim();\n        }\n\n        navButton.on('keydown', function($event) {\n          mdNavBar.onKeydown($event);\n        });\n\n        navButton.on('focus', function() {\n          mdNavItem._focused = true;\n        });\n\n        navButton.on('click', function() {\n          // This triggers a watcher on mdNavBar.mdSelectedNavItem which calls\n          // MdNavBarController._updateTabs() after a $timeout. That function calls\n          // MdNavItemController.setSelected() for the old tab with false and the new tab with true.\n          mdNavBar.mdSelectedNavItem = mdNavItem.name;\n          scope.$apply();\n        });\n\n        // Get the disabled attribute value first, then setup observing of value changes\n        mdNavItem.disabled = $mdUtil.parseAttributeBoolean(attrs['disabled'], false);\n        if ('MutationObserver' in $window) {\n          var config = {attributes: true, attributeFilter: ['disabled']};\n          var targetNode = element[0];\n          var mutationCallback = function(mutationList) {\n            $mdUtil.nextTick(function() {\n              mdNavItem.disabled = $mdUtil.parseAttributeBoolean(attrs[mutationList[0].attributeName], false);\n            });\n          };\n          var observer = new MutationObserver(mutationCallback);\n          observer.observe(targetNode, config);\n          disconnect = observer.disconnect.bind(observer);\n        } else {\n          attrs.$observe('disabled', function (value) {\n            mdNavItem.disabled = $mdUtil.parseAttributeBoolean(value, false);\n          });\n        }\n\n        if (!mdNavItem.navItemAriaLabel) {\n          $mdAria.expectWithText(navButton, 'aria-label');\n        }\n      });\n\n      scope.$on('destroy', function() {\n        navButton.off('keydown');\n        navButton.off('focus');\n        navButton.off('click');\n        disconnect();\n      });\n    }\n  };\n}\n\n/**\n * Controller for the nav-item component.\n * @param {!JQLite} $element\n * @constructor\n * @final\n * @ngInject\n */\nfunction MdNavItemController($element) {\n\n  /**\n   * @private @const\n   * @type {!JQLite}\n   */\n  this._$element = $element;\n\n  // Data-bound variables\n\n  /**\n   * @const\n   * @type {?Function}\n   */\n  this.mdNavClick;\n\n  /**\n   * @const\n   * @type {?string}\n   */\n  this.mdNavHref;\n\n  /**\n   * @const\n   * @type {?string}\n   */\n  this.mdNavSref;\n  /**\n   * @const\n   * @type {?Object}\n   */\n  this.srefOpts;\n  /**\n   * @const\n   * @type {?string}\n   */\n  this.name;\n\n  /**\n   * @const\n   * @type {string}\n   */\n  this.navItemAriaLabel;\n\n  // State variables\n  /**\n   * @private\n   * @type {boolean}\n   */\n  this._selected = false;\n\n  /**\n   * @type {boolean}\n   */\n  this.isFocused = false;\n}\n\n/**\n * Returns a map of class names and values for use by ng-class.\n * @return {!Object<string,boolean>}\n */\nMdNavItemController.prototype.getNgClassMap = function() {\n  return {\n    'md-active': this._selected,\n    'md-primary': this._selected,\n    'md-unselected': !this._selected,\n    'md-focused': this.isFocused,\n  };\n};\n\n/**\n * Get the name attribute of the tab.\n * @return {string}\n */\nMdNavItemController.prototype.getName = function() {\n  return this.name;\n};\n\n/**\n * Get the button element associated with the tab.\n * @return {!Element}\n */\nMdNavItemController.prototype.getButtonEl = function() {\n  return this._$element[0].querySelector('._md-nav-button');\n};\n\n/**\n * Set the selected state of the tab and updates the tabindex.\n * This function is called for the oldTab and newTab when selection changes.\n * @param {boolean} isSelected true to select the tab, false to deselect the tab\n */\nMdNavItemController.prototype.setSelected = function(isSelected) {\n  this._selected = isSelected;\n  if (isSelected) {\n    // https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-2/tabs.html suggests that we call\n    // removeAttribute('tabindex') here, but that causes our unit tests to fail due to\n    // document.activeElement staying set to the body instead of the focused nav button.\n    this.getButtonEl().setAttribute('tabindex', '0');\n  } else {\n    this.getButtonEl().setAttribute('tabindex', '-1');\n  }\n};\n\n/**\n * @return {boolean}\n */\nMdNavItemController.prototype.isSelected = function() {\n  return this._selected;\n};\n\n/**\n * Set the focused state of the tab.\n * @param {boolean} isFocused\n */\nMdNavItemController.prototype.setFocused = function(isFocused) {\n  this.isFocused = isFocused;\n\n  if (isFocused) {\n    this.getButtonEl().focus();\n  }\n};\n\n/**\n * @return {boolean} true if the tab has focus, false if not.\n */\nMdNavItemController.prototype.hasFocus = function() {\n  return this.isFocused;\n};\n\n/**\n * @return {boolean} true if the tab is enabled, false if disabled.\n * @private\n */\nMdNavItemController.prototype._isEnabled = function() {\n  return !this._$element.attr('disabled');\n};\n"
  },
  {
    "path": "src/components/navBar/navBar.scss",
    "content": "/** Matches \"md-tabs md-tabs-wrapper\" style. */\n$md-nav-bar-height: 48px;\n\n.md-nav-bar {\n  border-style: solid;\n  border-width: 0 0 1px;\n  height: $md-nav-bar-height;\n  position: relative;\n}\n\n._md-nav-bar-list {\n  outline: none;\n  list-style: none;\n  margin: 0;\n  padding: 0;\n\n  // Layout [layout='row']\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: row;\n}\n\n.md-nav-item:first-of-type {\n  margin-left: 8px;\n}\n\n// override button styles to look more like tabs\n.md-button._md-nav-button {\n  line-height: 24px;\n  margin: 0 4px;\n  padding: 12px 16px;\n  transition: background-color 0.35s $swift-ease-in-out-timing-function;\n\n  &:focus {\n    outline: none;\n  }\n}\n\nmd-nav-ink-bar {\n  $duration: $swift-ease-in-out-duration * 0.5;\n  $multiplier: 0.5;\n  background-color: black;\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 2px;\n  transform-origin: left top;\n  will-change: transform;\n  transition: transform ($duration * $multiplier) $swift-ease-in-out-timing-function;\n\n  // By default $ngAnimate looks for transition durations on the element, when using ng-hide, ng-if, ng-show.\n  // The ink bar has a transition duration applied, which means, that $ngAnimate delays the hide process.\n  // To avoid this, we need to reset the transition, when $ngAnimate looks for the duration.\n  &.ng-animate {\n    transition: none;\n  }\n\n}\n\nmd-nav-extra-content {\n  min-height: 48px;\n  padding-right: 12px;\n}\n"
  },
  {
    "path": "src/components/navBar/navBar.spec.js",
    "content": "describe('mdNavBar', function() {\n  var el, $compile, $scope, $timeout, ctrl, tabContainer, tabs, $material, $mdConstant;\n\n  /** @ngInject */\n  var injectLocals = function(\n      _$compile_, $rootScope, _$timeout_, _$material_, _$mdConstant_) {\n    $compile = _$compile_;\n    $scope = $rootScope.$new();\n    $timeout = _$timeout_;\n    $material = _$material_;\n    $mdConstant = _$mdConstant_;\n  };\n\n  beforeEach(function() {\n    module('material.components.navBar', 'ngAnimateMock');\n\n    inject(injectLocals);\n  });\n\n  afterEach(function() {\n    el && el.remove();\n  });\n\n  function create(template) {\n    el = $compile(template)($scope);\n    angular.element(document.body).append(el);\n    $scope.$apply();\n    ctrl = el.controller('mdNavBar');\n    tabContainer = angular.element(el[0].querySelector('._md-nav-bar-list'));\n    tabs = angular.element(el[0].querySelectorAll('._md-nav-button'));\n    $timeout.flush();\n    $material.flushOutstandingAnimations();\n  }\n\n  function createTabs() {\n    create(\n        '<md-nav-bar md-selected-nav-item=\"selectedTabRoute\" ' +\n        '            md-no-ink-bar=\"noInkBar\" ' +\n        '            nav-bar-aria-label=\"{{ariaLabel}}\">' +\n        '  <md-nav-item md-nav-href=\"#1\" name=\"tab1\">' +\n        '    tab1' +\n        '  </md-nav-item>' +\n        '  <md-nav-item md-nav-href=\"#2\" name=\"tab2\">' +\n        '    tab2' +\n        '  </md-nav-item>' +\n        '  <md-nav-item md-nav-href=\"#3\" name=\"tab3\" aria-label=\"foo\">' +\n        '    tab3' +\n        '  </md-nav-item>' +\n        '  <md-nav-item md-nav-href=\"#4\" name=\"tab4\" nav-item-aria-label=\"foo\">' +\n        '    tab4' +\n        '  </md-nav-item>' +\n        '</md-nav-bar>');\n  }\n\n  describe('tabs', function() {\n    it('shows current tab as selected', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      var tab1 = getTab('tab1');\n\n      expect(tab1).toHaveClass('md-active');\n      expect(tab1).toHaveClass('md-primary');\n    });\n\n    it('shows non-selected tabs as unselected', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      expect(getTab('tab2')).toHaveClass('md-unselected');\n      expect(getTab('tab3')).toHaveClass('md-unselected');\n    });\n\n    it('changes current tab when selectedTabRoute changes', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      updateSelectedTabRoute('tab2');\n\n      expect(getTab('tab2')).toHaveClass('md-active');\n      expect(getTab('tab2')).toHaveClass('md-primary');\n      expect(getTab('tab1')).not.toHaveClass('md-active');\n      expect(getTab('tab1')).not.toHaveClass('md-primary');\n    });\n\n    it('does not select tabs when selectedTabRoute is empty', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      updateSelectedTabRoute('');\n\n      expect(getTab('tab3')).not.toHaveClass('md-active');\n      expect(getTab('tab3')).not.toHaveClass('md-primary');\n      expect(getTab('tab2')).not.toHaveClass('md-active');\n      expect(getTab('tab2')).not.toHaveClass('md-primary');\n      expect(getTab('tab1')).not.toHaveClass('md-active');\n      expect(getTab('tab1')).not.toHaveClass('md-primary');\n\n      expect(getInkbarEl().style.display).toBe('none');\n\n      updateSelectedTabRoute('tab1');\n\n      expect(getTab('tab3')).not.toHaveClass('md-active');\n      expect(getTab('tab3')).not.toHaveClass('md-primary');\n      expect(getTab('tab2')).not.toHaveClass('md-active');\n      expect(getTab('tab2')).not.toHaveClass('md-primary');\n      expect(getTab('tab1')).toHaveClass('md-active');\n      expect(getTab('tab1')).toHaveClass('md-primary');\n\n      expect(getInkbarEl().style.display).toBe('');\n\n    });\n\n    it('requires navigation attribute to be present', function() {\n      expect(function() {\n        create('<md-nav-item name=\"fooo\">footab</md-nav-item>');\n      }).toThrow();\n    });\n\n    it('does not allow multiple navigation attributes', function() {\n      expect(function() {\n        create(\n            '<md-nav-item md-nav-href=\"a\" md-nav-sref=\"b\" name=\"fooo\">' +\n            'footab</md-nav-item>');\n      }).toThrow();\n    });\n\n    it('throws if no navigation attributes are specified on a md-nav-item', function() {\n      // be permissive; this helps with test writing\n      expect(function() {\n        create(\n          '<md-nav-bar>' +\n            '<md-nav-item name=\"fooo\">footab</md-nav-item>' +\n          '<md-nav-bar>');\n      }).toThrow();\n    });\n\n    it('allows empty md-nav-href navigation attribute', function() {\n      // be permissive; this helps with test writing\n      expect(function() {\n        create(\n          '<md-nav-bar>' +\n            '<md-nav-item md-nav-href=\"\" name=\"fooo\">footab</md-nav-item>' +\n          '<md-nav-bar>');\n      }).not.toThrow();\n    });\n\n    it('allows empty md-nav-sref navigation attribute', function() {\n      // be permissive; this helps with test writing\n      expect(function() {\n        create(\n          '<md-nav-bar>' +\n            '<md-nav-item md-nav-sref=\"\" name=\"fooo\">footab</md-nav-item>' +\n          '<md-nav-bar>');\n      }).not.toThrow();\n    });\n\n    it('uses nav item text for name if no name supplied', function() {\n      create(\n        '<md-nav-bar md-selected-nav-item=\"selectedTabRoute\" nav-bar-aria-label=\"{{ariaLabel}}\">' +\n        '  <md-nav-item md-nav-href=\"#1\">' +\n        '    footab ' +\n        '  </md-nav-item>' +\n        '  <md-nav-item md-nav-href=\"#2\" name=\"tab2\">' +\n        '    tab2' +\n        '  </md-nav-item>' +\n        '  <md-nav-item md-nav-href=\"#3\" name=\"tab3\">' +\n        '    tab3' +\n        '  </md-nav-item>' +\n        '</md-nav-bar>');\n\n      expect(getTab('footab').length).toBe(1);\n    });\n\n    it('updates md-selected-nav-item on tab change', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      var tab2Ctrl = getTabCtrl('tab2');\n      tab2Ctrl.getButtonEl().click();\n      $scope.$apply();\n\n      expect($scope.selectedTabRoute).toBe('tab2');\n    });\n\n    it('should add the md-focused class when focused', function () {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n      var tab2Ctrl = getTabCtrl('tab2');\n      angular.element(tab2Ctrl.getButtonEl()).triggerHandler('focus');\n      angular.element(tab2Ctrl.getButtonEl()).triggerHandler('click');\n      $scope.$apply();\n      $timeout.flush();\n      expect(tab2Ctrl.getButtonEl().classList.contains('md-focused')).toBe(true);\n    });\n\n    it('adds ui-sref-opts attribute to nav item when sref-opts attribute is ' +\n        'defined', function() {\n          create(\n            '<md-nav-bar md-selected-nav-item=\"selected\" nav-bar-aria-label=\"nav\">' +\n              '<md-nav-item md-nav-sref=\"page1\">' +\n                'tab1' +\n              '</md-nav-item>' +\n              '<md-nav-item md-nav-sref=\"page2\" sref-opts=\"{reload:true,notify:true}\">' +\n                'tab2' +\n              '</md-nav-item>' +\n            '</md-nav-bar>'\n          );\n\n          expect(getTab('tab2').attr('ui-sref-opts'))\n              .toBe('{\"reload\":true,\"notify\":true}');\n        });\n\n      it('should set the disabled attribute', function () {\n          create('<md-nav-bar>' +\n              '  <md-nav-item md-nav-href=\"#1\" name=\"tab1\">' +\n              '    tab1' +\n              '  </md-nav-item>' +\n              '  <md-nav-item md-nav-href=\"#2\" name=\"tab2\" disabled>' +\n              '    tab2' +\n              '  </md-nav-item>' +\n              '</md-nav-bar>');\n\n          var tabCtrl = getTabCtrl('tab2');\n          expect(tabCtrl.disabled).toBe(true);\n      });\n\n      it('should observe the disabled attribute', function () {\n          $scope.$apply('tabDisabled = false');\n          create('<md-nav-bar>' +\n              '  <md-nav-item md-nav-href=\"#1\" name=\"tab1\">' +\n              '    tab1' +\n              '  </md-nav-item>' +\n              '  <md-nav-item md-nav-href=\"#2\" name=\"tab2\" ng-disabled=\"tabDisabled\">' +\n              '    tab2' +\n              '  </md-nav-item>' +\n              '</md-nav-bar>');\n\n          var tabCtrl = getTabCtrl('tab2');\n          expect(tabCtrl.disabled).toBe(false);\n          $scope.$apply('tabDisabled = true');\n          $timeout(function() {\n            expect(tabCtrl.disabled).toBe(true);\n          });\n      });\n\n    it('does not update tabs if tab controller is undefined', function() {\n      $scope.selectedTabRoute = 'tab1';\n\n      spyOn(Object.getPrototypeOf(ctrl), '_updateInkBarStyles');\n      spyOn(Object.getPrototypeOf(ctrl), '_getTabs').and.returnValue(null);\n      createTabs();\n\n      expect(ctrl._updateInkBarStyles)\n        .not.toHaveBeenCalled();\n    });\n\n    it('does not update selected tab if controller is undefined', function() {\n      $scope.selectedTabRoute = 'tab1';\n\n      spyOn(Object.getPrototypeOf(ctrl), '_updateInkBarStyles');\n      spyOn(Object.getPrototypeOf(ctrl), '_findTab').and.returnValue(null);\n      createTabs();\n\n      expect(ctrl._updateInkBarStyles)\n      .toHaveBeenCalledWith(null, -1);\n    });\n  });\n\n  describe('inkbar', function() {\n    it('moves to new tab', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      var tabLeft = getTab('tab1')[0].offsetLeft;\n      var inkbarTranslate = parseFloat(getInkbarEl().style.transform.match(/\\d+\\.\\d+/g)[0]);\n      var elWidth = el[0].getBoundingClientRect().width;\n\n      var translate = tabLeft / elWidth * 100;\n      // b/c there is no css in the karma test, we have to interrogate the\n      //   inkbar style property directly\n      expect(inkbarTranslate)\n          .toBeCloseTo(translate, 1);\n\n      updateSelectedTabRoute('tab3');\n\n      tabLeft = getTab('tab3')[0].offsetLeft\n      inkbarTranslate = parseFloat(getInkbarEl().style.transform.match(/\\d+\\.\\d+/g)[0]);\n      elWidth = el[0].getBoundingClientRect().width;\n      translate = tabLeft / elWidth * 100;\n\n      expect(inkbarTranslate)\n          .toBeCloseTo(translate, 1);\n    });\n\n    it('should hide if md-no-ink-bar is enabled', function() {\n      $scope.noInkBar = false;\n      $scope.selectedTabRoute = 'tab1';\n\n      createTabs();\n\n      expect(getInkbarEl().offsetParent).toBeTruthy();\n\n      $scope.$apply('noInkBar = true');\n      expect(getInkbarEl().offsetParent).not.toBeTruthy();\n\n      $scope.$apply('noInkBar = false');\n      expect(getInkbarEl().offsetParent).toBeTruthy();\n    });\n  });\n\n  describe('a11y', function() {\n    it('sets aria-selected on the selected tab', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      expect(getTab('tab1').attr('aria-selected')).toBe('true');\n      expect(getTab('tab2').attr('aria-selected')).toBe('false');\n      expect(getTab('tab3').attr('aria-selected')).toBe('false');\n\n      updateSelectedTabRoute('tab3');\n\n      expect(getTab('tab1').attr('aria-selected')).toBe('false');\n      expect(getTab('tab2').attr('aria-selected')).toBe('false');\n      expect(getTab('tab3').attr('aria-selected')).toBe('true');\n    });\n\n    it('sets aria-label on the listbox', function() {\n      var label = 'top level navigation for my site';\n      $scope.ariaLabel = label;\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      expect(tabContainer[0].getAttribute('aria-label')).toBe(label);\n    });\n\n    it('sets focus on the selected tab when the navbar receives focus', function() {\n      $scope.selectedTabRoute = 'tab2';\n      createTabs();\n\n      expect(getTab('tab2')).not.toHaveClass('md-focused');\n      tabContainer.triggerHandler('focus');\n      $scope.$apply();\n\n      expect(getTab('tab2')).toHaveClass('md-focused');\n      expect(document.activeElement).toBe(getTab('tab2')[0]);\n    });\n\n    it('removes tab focus when the tab blurs', function() {\n      $scope.selectedTabRoute = 'tab2';\n      createTabs();\n\n      tabContainer.triggerHandler('focus');\n      expect(getTab('tab2')).toHaveClass('md-focused');\n\n      getTab('tab2').triggerHandler('blur');\n      expect(getTab('tab2')).not.toHaveClass('md-focused');\n    });\n\n    it('up/left moves focus back', function() {\n      $scope.selectedTabRoute = 'tab3';\n      createTabs();\n\n      tabContainer.triggerHandler('focus');\n      angular.element(tabs[2]).triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      angular.element(tabs[1]).triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n      });\n      $scope.$apply();\n\n      expect(getTab('tab1')).toHaveClass('md-focused');\n      expect(document.activeElement).toBe(getTab('tab1')[0]);\n      expect(getTab('tab2')).not.toHaveClass('md-focused');\n      expect(getTab('tab3')).not.toHaveClass('md-focused');\n    });\n\n    it('down/right moves focus forward', function() {\n      $scope.selectedTabRoute = 'tab1';\n      createTabs();\n\n      tabContainer.triggerHandler('focus');\n      angular.element(tabs[0]).triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      angular.element(tabs[1]).triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n      });\n      $scope.$apply();\n\n      expect(getTab('tab1')).not.toHaveClass('md-focused');\n      expect(getTab('tab2')).not.toHaveClass('md-focused');\n      expect(getTab('tab3')).toHaveClass('md-focused');\n      expect(document.activeElement).toBe(getTab('tab3')[0]);\n    });\n\n    it('enter selects a tab', function() {\n      $scope.selectedTabRoute = 'tab2';\n      createTabs();\n      var tab2Ctrl = getTabCtrl('tab2');\n      spyOn(tab2Ctrl.getButtonEl(), 'click');\n\n      tabContainer.triggerHandler('focus');\n      angular.element(tabs[1]).triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n\n      $scope.$apply();\n      $timeout.flush();\n\n      expect(tab2Ctrl.getButtonEl().click).toHaveBeenCalled();\n    });\n\n    it('automatically adds label to nav items', function() {\n      createTabs();\n      expect(getTab('tab1').attr('aria-label')).toBe('tab1');\n      expect(getTab('tab2').attr('aria-label')).toBe('tab2');\n    });\n\n    it('does not change aria-label on nav items', function() {\n      createTabs();\n      expect(getTab('tab3').parent().attr('aria-label')).toBe('foo');\n    });\n\n    it('does not change nav-item-aria-label on nav item buttons', function() {\n      createTabs();\n      expect(getTab('tab4').attr('aria-label')).toBe('foo');\n    });\n  });\n\n  function getTab(tabName) {\n    return angular.element(getTabCtrl(tabName).getButtonEl());\n  }\n\n  function getTabCtrl(tabName) {\n    return ctrl._getTabByName(tabName);\n  }\n\n  function getInkbarEl() {\n    return el.find('md-nav-ink-bar')[0];\n  }\n\n  function updateSelectedTabRoute(newRoute) {\n    $scope.selectedTabRoute = newRoute;\n    $scope.$apply();\n    $timeout.flush();\n  }\n});\n"
  },
  {
    "path": "src/components/panel/demoBasicUsage/index.html",
    "content": "<div class=\"md-padding\" ng-controller=\"BasicDemoCtrl as ctrl\">\n  <p>\n    A panel can be used to create dialogs, menus, and other overlays.\n  </p>\n  <h2>Options</h2>\n  <div flex=\"33\">\n    <md-checkbox ng-model=\"ctrl.disableParentScroll\">Disable Parent Scroll</md-checkbox>\n  </div>\n\n  <div class=\"demo-md-panel-content\">\n    <md-button class=\"md-primary md-raised demo-dialog-open-button\"\n               ng-click=\"ctrl.showDialog($event)\">\n      Dialog\n    </md-button>\n    <md-button class=\"md-primary md-raised demo-menu-open-button\"\n               ng-click=\"ctrl.showMenu($event)\">\n      Select Menu\n    </md-button>\n\n    <p>Your favorite dessert is: {{ ctrl.selected.favoriteDessert }}</p>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoBasicUsage/panel.tmpl.html",
    "content": "<div role=\"dialog\" aria-label=\"Eat me!\" layout=\"column\" layout-align=\"center center\">\n  <md-toolbar>\n    <div class=\"md-toolbar-tools\">\n      <h2>Surprise!</h2>\n    </div>\n  </md-toolbar>\n\n  <div class=\"demo-dialog-content\">\n    <p>\n      You hit the secret button. Here's a donut:\n    </p>\n\n    <div layout=\"row\" >\n      <img flex alt=\"Delicious donut\" src=\"img/donut.jpg\">\n    </div>\n  </div>\n\n  <div layout=\"row\" class=\"demo-dialog-button\">\n    <md-button md-autofocus flex class=\"md-primary\" ng-click=\"ctrl.closeDialog()\">\n      Close\n    </md-button>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoBasicUsage/script.js",
    "content": "(function() {\n'use strict';\n\nangular.module('panelDemo', ['ngMaterial'])\n    .controller('BasicDemoCtrl', BasicDemoCtrl)\n    .controller('PanelDialogCtrl', PanelDialogCtrl);\n\n\nfunction BasicDemoCtrl($mdPanel) {\n  this._mdPanel = $mdPanel;\n\n  this.desserts = [\n    'Apple Pie',\n    'Donut',\n    'Fudge',\n    'Cupcake',\n    'Ice Cream',\n    'Tiramisu'\n  ];\n\n  this.selected = {favoriteDessert: 'Donut'};\n  this.disableParentScroll = false;\n}\n\n\nBasicDemoCtrl.prototype.showDialog = function() {\n  var position = this._mdPanel.newPanelPosition()\n      .absolute()\n      .center();\n\n  var config = {\n    attachTo: angular.element(document.body),\n    controller: PanelDialogCtrl,\n    controllerAs: 'ctrl',\n    disableParentScroll: this.disableParentScroll,\n    templateUrl: 'panel.tmpl.html',\n    hasBackdrop: true,\n    panelClass: 'demo-dialog-example',\n    position: position,\n    trapFocus: true,\n    zIndex: 150,\n    clickOutsideToClose: true,\n    escapeToClose: true,\n    focusOnOpen: true\n  };\n\n  this._mdPanel.open(config);\n};\n\nBasicDemoCtrl.prototype.showMenu = function(ev) {\n  var position = this._mdPanel.newPanelPosition()\n      .relativeTo('.demo-menu-open-button')\n      .addPanelPosition(this._mdPanel.xPosition.ALIGN_START, this._mdPanel.yPosition.BELOW);\n\n  var config = {\n    attachTo: angular.element(document.body),\n    controller: PanelMenuCtrl,\n    controllerAs: 'ctrl',\n    template:\n        '<div class=\"demo-menu-example\" ' +\n        '     aria-label=\"Select your favorite dessert.\" ' +\n        '     role=\"listbox\">' +\n        '  <div class=\"demo-menu-item\" ' +\n        '       ng-class=\"{selected : dessert == ctrl.favoriteDessert}\" ' +\n        '       aria-selected=\"{{dessert == ctrl.favoriteDessert}}\" ' +\n        '       tabindex=\"-1\" ' +\n        '       role=\"option\" ' +\n        '       ng-repeat=\"dessert in ctrl.desserts\" ' +\n        '       ng-click=\"ctrl.selectDessert(dessert)\"' +\n        '       ng-keydown=\"ctrl.onKeydown($event, dessert)\">' +\n        '    {{ dessert }} ' +\n        '  </div>' +\n        '</div>',\n    panelClass: 'demo-menu-example',\n    position: position,\n    locals: {\n      'selected': this.selected,\n      'desserts': this.desserts\n    },\n    openFrom: ev,\n    clickOutsideToClose: true,\n    escapeToClose: true,\n    focusOnOpen: false,\n    zIndex: 2\n  };\n\n  this._mdPanel.open(config);\n};\n\n\nfunction PanelDialogCtrl(mdPanelRef) {\n  this._mdPanelRef = mdPanelRef;\n}\n\nPanelDialogCtrl.prototype.closeDialog = function() {\n  var panelRef = this._mdPanelRef;\n\n  panelRef && panelRef.close().then(function() {\n    angular.element(document.querySelector('.demo-dialog-open-button')).focus();\n    panelRef.destroy();\n  });\n};\n\nfunction PanelMenuCtrl(mdPanelRef, $timeout) {\n  this._mdPanelRef = mdPanelRef;\n  this.$timeout = $timeout;\n}\n\nPanelMenuCtrl.prototype.$onInit = function() {\n  this.favoriteDessert = this.selected.favoriteDessert;\n  this.$timeout(function() {\n    var selected = document.querySelector('.demo-menu-item.selected');\n    if (selected) {\n      angular.element(selected).focus();\n    } else {\n      angular.element(document.querySelectorAll('.demo-menu-item')[0]).focus();\n    }\n  });\n};\n\nPanelMenuCtrl.prototype.selectDessert = function(dessert) {\n  this.selected.favoriteDessert = dessert;\n  this._mdPanelRef && this._mdPanelRef.close().then(function() {\n    angular.element(document.querySelector('.demo-menu-open-button')).focus();\n  });\n};\n\n\nPanelMenuCtrl.prototype.onKeydown = function($event, dessert) {\n  var handled, els, index, prevIndex, nextIndex;\n  switch ($event.which) {\n    case 38: // Up Arrow.\n      els = document.querySelectorAll('.demo-menu-item');\n      index = indexOf(els, document.activeElement);\n      prevIndex = (index + els.length - 1) % els.length;\n      els[prevIndex].focus();\n      handled = true;\n      break;\n\n    case 40: // Down Arrow.\n      els = document.querySelectorAll('.demo-menu-item');\n      index = indexOf(els, document.activeElement);\n      nextIndex = (index + 1) % els.length;\n      els[nextIndex].focus();\n      handled = true;\n      break;\n\n    case 13: // Enter.\n    case 32: // Space.\n      this.selectDessert(dessert);\n      handled = true;\n      break;\n\n    case 9: // Tab.\n      this._mdPanelRef && this._mdPanelRef.close();\n  }\n\n  if (handled) {\n    $event.preventDefault();\n    $event.stopImmediatePropagation();\n  }\n\n  function indexOf(nodeList, element) {\n    for (var item, i = 0; item = nodeList[i]; i++) {\n      if (item === element) {\n        return i;\n      }\n    }\n    return -1;\n  }\n};\n\n})();\n"
  },
  {
    "path": "src/components/panel/demoBasicUsage/style.global.css",
    "content": ".demo-md-panel {\n  min-height: 500px;\n}\n\n.demo-dialog-example {\n  background: white;\n  border-radius: 4px;\n  box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2),\n      0 13px 19px 2px rgba(0, 0, 0, 0.14),\n      0 5px 24px 4px rgba(0, 0, 0, 0.12);\n  width: 500px;\n}\n\n.demo-dialog-content {\n  padding: 0 15px;\n  width: 100%;\n}\n\n.demo-dialog-content img {\n  height: 300px;\n  margin: auto;\n}\n\n.demo-dialog-button {\n  width: 100%;\n}\n\n.demo-menu-example {\n  background: white;\n  border-radius: 4px;\n  box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2),\n      0 13px 19px 2px rgba(0, 0, 0, 0.14),\n      0 5px 24px 4px rgba(0, 0, 0, 0.12);\n  width: 256px;\n}\n\n.demo-menu-item {\n  align-items: center;\n  cursor: pointer;\n  display: flex;\n  height: 48px;\n  padding: 0 16px;\n  position: relative;\n  transition: background 0.15s linear;\n  width: auto;\n}\n\n.demo-menu-item:hover,\n.demo-menu-item:focus {\n  background-color: rgb(238, 238, 238);\n}\n\n.demo-menu-item.selected {\n  color: rgb(16, 108, 200);\n}\n"
  },
  {
    "path": "src/components/panel/demoGroups/index.html",
    "content": "<div ng-controller=\"PanelGroupsCtrl as ctrl\" ng-cloak>\n\n  <md-toolbar class=\"md-accent\">\n    <div class=\"md-toolbar-tools\">\n      <md-button\n        class=\"md-icon-button\"\n        aria-label=\"Settings\"\n        ng-click=\"ctrl.showToolbarMenu($event, ctrl.settings)\">\n        <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n      </md-button>\n      <h2>Toolbar with grouped panels (Maximum open: 2)</h2>\n      <span flex></span>\n      <md-button\n        class=\"md-icon-button\"\n        aria-label=\"Favorite\"\n        ng-click=\"ctrl.showToolbarMenu($event, ctrl.favorite)\">\n        <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n      </md-button>\n      <md-button\n        class=\"md-icon-button\"\n        aria-label=\"More\"\n        ng-click=\"ctrl.showToolbarMenu($event, ctrl.more)\">\n        <md-icon md-svg-icon=\"img/icons/more_vert.svg\"></md-icon>\n      </md-button>\n    </div>\n  </md-toolbar>\n\n  <md-content layout-padding>\n    <p>\n      Panels can be added to a group. Groups are used to configure specific\n      behaviors on multiple panels. To add a panel to a group, use the\n      <code>$mdPanel.newPanelGroup</code> method, or simply add a group name\n      to the configuration object passed into the <code>$mdPanel.create</code>\n      method.\n    </p>\n    <p>\n      Grouping allows for methods to be applied to several panels at once, i.e.\n      closing all panels within the toolbar group, or destroying all panels\n      within a dialog group. With the <code>maxOpen</code> property, you can\n      also limit the number of panels allowed open within a specific group. This\n      can be useful in limiting the number of menu panels allowed open at a\n      time, etc.\n    </p>\n\n    <div layout=\"row\">\n      <div layout=\"column\" flex>\n        <h2>Multiple Groups</h2>\n        <p>\n          Panels can be added to multiple groups. The <code>groupName</code>\n          parameter in the panel configuration can be a string or an array of\n          strings. This allows for the functionality or constraints of multiple\n          groups to apply to each created panel.\n        </p>\n        <p>\n          To give an example, the menus within the toolbar above have been added\n          to the <strong>toolbar</strong> and <strong>menus</strong> groups.\n          The menus to the right have been added to the <strong>menus</strong>\n          group as well. The maximum number of open panels within the\n          <strong>toolbar</strong> group is <strong>2</strong>. Within the\n          <strong>menus</strong> group it is <strong>3</strong>. Opening the\n          menus to the right and more than one in the toolbar will result in\n          the first opened panel to the right to close.\n        </p>\n      </div>\n      <div style=\"width: 45px;\"></div>\n      <div layout=\"row\" flex=\"nogrow\">\n        <md-button\n          class=\"md-fab md-primary\"\n          aria-label=\"Tools\"\n          ng-click=\"ctrl.showContentMenu($event, ctrl.tools)\">\n          <md-icon md-svg-icon=\"img/icons/ic_build_24px.svg\"></md-icon>\n        </md-button>\n        <md-button\n          class=\"md-fab md-accent\"\n          aria-label=\"Code\"\n          ng-click=\"ctrl.showContentMenu($event, ctrl.code)\">\n          <md-icon md-svg-icon=\"img/icons/ic_code_24px.svg\"></md-icon>\n        </md-button>\n      </div>\n    </div>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/panel/demoGroups/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular\n    .module('panelGroupsDemo', ['ngMaterial'])\n    .controller('PanelGroupsCtrl', PanelGroupsCtrl)\n    .controller('PanelMenuCtrl', PanelMenuCtrl);\n\n  function PanelGroupsCtrl($mdPanel) {\n    this.settings = {\n      name: 'settings',\n      items: [\n        'Home',\n        'About',\n        'Contact'\n      ]\n    };\n    this.favorite = {\n      name: 'favorite',\n      items: [\n        'Add to Favorites'\n      ]\n    };\n    this.more = {\n      name: 'more',\n      items: [\n        'Account',\n        'Sign Out'\n      ]\n    };\n    this.tools = {\n      name: 'tools',\n      items: [\n        'Create',\n        'Delete'\n      ]\n    };\n    this.code = {\n      name: 'code',\n      items: [\n        'See Source',\n        'See Commits'\n      ]\n    };\n\n    this.menuTemplate = '' +\n        '<div class=\"menu-panel\" md-whiteframe=\"4\">' +\n        '  <div class=\"menu-content\">' +\n        '    <div class=\"menu-item\" ng-repeat=\"item in ctrl.items\">' +\n        '      <button class=\"md-button\">' +\n        '        <span>{{item}}</span>' +\n        '      </button>' +\n        '    </div>' +\n        '    <md-divider></md-divider>' +\n        '    <div class=\"menu-item\">' +\n        '      <button class=\"md-button\" ng-click=\"ctrl.closeMenu()\">' +\n        '        <span>Close Menu</span>' +\n        '      </button>' +\n        '    </div>' +\n        '  </div>' +\n        '</div>';\n\n    $mdPanel.newPanelGroup('toolbar', {\n      maxOpen: 2\n    });\n\n    $mdPanel.newPanelGroup('menus', {\n      maxOpen: 3\n    });\n\n    this.showToolbarMenu = function($event, menu) {\n      var template = this.menuTemplate;\n\n      var position = $mdPanel.newPanelPosition()\n          .relativeTo($event.target)\n          .addPanelPosition(\n            $mdPanel.xPosition.ALIGN_START,\n            $mdPanel.yPosition.BELOW\n          );\n\n      var config = {\n        id: 'toolbar_' + menu.name,\n        attachTo: angular.element(document.body),\n        controller: PanelMenuCtrl,\n        controllerAs: 'ctrl',\n        template: template,\n        position: position,\n        panelClass: 'menu-panel-container',\n        locals: {\n          items: menu.items\n        },\n        openFrom: $event,\n        focusOnOpen: false,\n        zIndex: 100,\n        propagateContainerEvents: true,\n        groupName: ['toolbar', 'menus']\n      };\n\n      $mdPanel.open(config);\n    };\n\n    this.showContentMenu = function($event, menu) {\n      var template = this.menuTemplate;\n\n      var position = $mdPanel.newPanelPosition()\n          .relativeTo($event.target)\n          .addPanelPosition(\n            $mdPanel.xPosition.ALIGN_START,\n            $mdPanel.yPosition.BELOW\n          );\n\n      var config = {\n        id: 'content_' + menu.name,\n        attachTo: angular.element(document.body),\n        controller: PanelMenuCtrl,\n        controllerAs: 'ctrl',\n        template: template,\n        position: position,\n        panelClass: 'menu-panel-container',\n        locals: {\n          items: menu.items\n        },\n        openFrom: $event,\n        focusOnOpen: false,\n        zIndex: 100,\n        propagateContainerEvents: true,\n        groupName: 'menus'\n      };\n\n      $mdPanel.open(config);\n    };\n  }\n\n  function PanelMenuCtrl(mdPanelRef) {\n    this.closeMenu = function() {\n      mdPanelRef && mdPanelRef.close();\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/panel/demoGroups/style.global.css",
    "content": ".menu-panel-container {\n  pointer-events: auto;\n}\n\n.menu-panel {\n  width: 256px;\n  background-color: #fff;\n  border-radius: 4px;\n}\n\n.menu-panel .menu-divider {\n  width: 100%;\n  height: 1px;\n  min-height: 1px;\n  max-height: 1px;\n  margin-top: 4px;\n  margin-bottom: 4px;\n  background-color: rgba(0, 0, 0, 0.11);\n}\n\n.menu-panel .menu-content {\n  display: flex;\n  flex-direction: column;\n  padding: 8px 0;\n  max-height: 305px;\n  overflow-y: auto;\n  min-width: 256px;\n}\n\n.menu-panel .menu-item {\n  display: flex;\n  flex-direction: row;\n  min-height: 48px;\n  height: 48px;\n  align-content: center;\n  justify-content: flex-start;\n}\n.menu-panel .menu-item > * {\n  width: 100%;\n  margin: auto 0;\n  padding-left: 16px;\n  padding-right: 16px;\n}\n.menu-panel .menu-item > a.md-button {\n  padding-top: 5px;\n}\n.menu-panel .menu-item > .md-button {\n  display: inline-block;\n  border-radius: 0;\n  margin: auto 0;\n  font-size: 15px;\n  text-transform: none;\n  font-weight: 400;\n  height: 100%;\n  padding-left: 16px;\n  padding-right: 16px;\n  width: 100%;\n  text-align: left;\n}\n.menu-panel .menu-item > .md-button::-moz-focus-inner {\n  padding: 0;\n  border: 0;\n}\n.menu-panel .menu-item > .md-button md-icon {\n  margin: auto 16px auto 0;\n}\n.menu-panel .menu-item > .md-button p {\n  display: inline-block;\n  margin: auto;\n}\n.menu-panel .menu-item > .md-button span {\n  margin-top: auto;\n  margin-bottom: auto;\n}\n.menu-panel .menu-item > .md-button .md-ripple-container {\n  border-radius: inherit;\n}\n"
  },
  {
    "path": "src/components/panel/demoPanelAnimations/index.html",
    "content": "<div class=\"demo-md-panel-animation md-padding\" ng-controller=\"AnimationCtrl as ctrl\">\n  <h2>Animations</h2>\n  <div layout=\"row\">\n    <div flex=\"25\">\n      <h3>OpenFrom:</h3>\n      <md-radio-group ng-model=\"ctrl.openFrom\">\n        <md-radio-button value=\"button\">Button</md-radio-button>\n        <md-radio-button value=\"corner\">Top/Left Corner</md-radio-button>\n        <md-radio-button value=\"bottom\">Bottom Center</md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <div flex=\"25\">\n      <h3>CloseTo:</h3>\n      <md-radio-group ng-model=\"ctrl.closeTo\">\n        <md-radio-button value=\"button\">Button</md-radio-button>\n        <md-radio-button value=\"corner\">Top/Left Corner</md-radio-button>\n        <md-radio-button value=\"bottom\">Bottom Center</md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <div flex=\"25\">\n      <h3>AnimationType:</h3>\n      <md-radio-group ng-model=\"ctrl.animationType\">\n        <md-radio-button value=\"none\">None</md-radio-button>\n        <md-radio-button value=\"slide\">Slide</md-radio-button>\n        <md-radio-button value=\"scale\">Scale</md-radio-button>\n        <md-radio-button value=\"fade\">Fade</md-radio-button>\n        <md-radio-button value=\"custom\">Custom</md-radio-button>\n      </md-radio-group>\n    </div>\n\n    <div flex=\"25\">\n      <h3>Duration:</h3>\n      <md-input-container>\n        <label>All animations</label>\n        <input\n          type=\"number\"\n          ng-model=\"ctrl.duration\"\n          ng-change=\"ctrl.separateDurations.open = ctrl.separateDurations.close = ctrl.duration\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>Open animation</label>\n        <input\n          type=\"number\"\n          ng-model=\"ctrl.separateDurations.open\"\n          ng-change=\"ctrl.duration = null\">\n      </md-input-container>\n\n      <md-input-container>\n        <label>Close animation</label>\n        <input\n          type=\"number\"\n          ng-model=\"ctrl.separateDurations.close\"\n          ng-change=\"ctrl.duration = null\">\n      </md-input-container>\n    </div>\n  </div>\n\n  <div class=\"demo-md-panel-content\">\n    <md-button class=\"animation-target md-primary md-raised\" ng-click=\"ctrl.showDialog($event)\">\n      Dialog\n    </md-button>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoPanelAnimations/panel.tmpl.html",
    "content": "<div role=\"dialog\" aria-label=\"Eat me!\" layout=\"column\" layout-align=\"center center\">\n  <md-toolbar>\n    <div class=\"md-toolbar-tools\">\n      <h2>Surprise!</h2>\n    </div>\n  </md-toolbar>\n\n  <div class=\"demo-dialog-content\">\n    <p>\n      You hit the secret button. Here's a donut:\n    </p>\n\n    <div layout=\"row\" >\n      <img flex alt=\"Delicious donut\" src=\"img/donut.jpg\">\n    </div>\n  </div>\n\n  <div layout=\"row\" class=\"demo-dialog-button\">\n    <md-button md-autofocus flex class=\"md-primary\" ng-click=\"ctrl.closeDialog()\">\n      Close\n    </md-button>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoPanelAnimations/script.js",
    "content": "(function() {\n'use strict';\n\nangular.module('panelAnimationsDemo', ['ngMaterial'])\n    .controller('AnimationCtrl', AnimationCtrl)\n    .controller('DialogCtrl', DialogCtrl);\n\n\nfunction AnimationCtrl($mdPanel) {\n  this._mdPanel = $mdPanel;\n  this.openFrom = 'button';\n  this.closeTo = 'button';\n  this.animationType = 'scale';\n  this.duration = 300;\n  this.separateDurations = {\n    open: this.duration,\n    close: this.duration\n  };\n}\n\n\nAnimationCtrl.prototype.showDialog = function() {\n  var position = this._mdPanel.newPanelPosition()\n      .absolute()\n      .right()\n      .top();\n\n  var animation = this._mdPanel.newPanelAnimation();\n\n  animation.duration(this.duration || this.separateDurations);\n\n  switch (this.openFrom) {\n    case 'button':\n      animation.openFrom('.animation-target');\n      break;\n    case 'corner':\n      animation.openFrom({top:0, left:0});\n      break;\n    case 'bottom':\n      animation.openFrom({\n        top: document.documentElement.clientHeight,\n        left: document.documentElement.clientWidth / 2 - 250\n      });\n  }\n  switch (this.closeTo) {\n    case 'button':\n      animation.closeTo('.animation-target');\n      break;\n    case 'corner':\n      animation.closeTo({top:0, left:0});\n      break;\n    case 'bottom':\n      animation.closeTo({\n        top: document.documentElement.clientHeight,\n        left: document.documentElement.clientWidth / 2 - 250\n      });\n  }\n\n  switch (this.animationType) {\n    case 'custom':\n      animation.withAnimation({\n        open: 'demo-dialog-custom-animation-open',\n        close: 'demo-dialog-custom-animation-close'\n      });\n      break;\n    case 'slide':\n      animation.withAnimation(this._mdPanel.animation.SLIDE);\n      break;\n    case 'scale':\n      animation.withAnimation(this._mdPanel.animation.SCALE);\n      break;\n    case 'fade':\n      animation.withAnimation(this._mdPanel.animation.FADE);\n      break;\n    case 'none':\n      animation = undefined;\n      break;\n  }\n\n  var config = {\n    animation: animation,\n    attachTo: angular.element(document.body),\n    controller: DialogCtrl,\n    controllerAs: 'ctrl',\n    templateUrl: 'panel.tmpl.html',\n    panelClass: 'demo-dialog-example',\n    position: position,\n    trapFocus: true,\n    zIndex: 150,\n    clickOutsideToClose: true,\n    clickEscapeToClose: true,\n    hasBackdrop: true,\n  };\n\n  this._mdPanel.open(config);\n};\n\nfunction DialogCtrl(mdPanelRef) {\n  this._mdPanelRef = mdPanelRef;\n}\n\nDialogCtrl.prototype.closeDialog = function() {\n  this._mdPanelRef && this._mdPanelRef.close();\n};\n\n})();\n"
  },
  {
    "path": "src/components/panel/demoPanelAnimations/style.global.css",
    "content": ".demo-md-panel {\n  min-height: 500px;\n}\n\n.demo-dialog-example {\n  background: white;\n  border-radius: 4px;\n  box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2),\n      0 13px 19px 2px rgba(0, 0, 0, 0.14),\n      0 5px 24px 4px rgba(0, 0, 0, 0.12);\n  width: 500px;\n}\n\n.demo-dialog-content {\n  padding: 0 15px;\n  width: 100%;\n}\n\n.demo-dialog-content img {\n  height: 300px;\n  margin: auto;\n}\n\n.demo-dialog-button {\n  width: 100%;\n}\n\n.demo-dialog-custom-animation-open {\n  opacity: 1;\n  transition: all 1s linear, opacity 1ms;\n  transform: rotate(390deg);\n}\n\n.demo-dialog-custom-animation-close {\n  opacity: 0;\n  transition: all 1s linear, opacity 1ms;\n  transform: rotate(0deg);\n}\n"
  },
  {
    "path": "src/components/panel/demoPanelProvider/index.html",
    "content": "<div ng-controller=\"PanelProviderCtrl as ctrl\" ng-cloak>\n\n  <md-content layout-padding>\n\n    <div layout=\"row\" layout-align=\"space-between center\" flex>\n      <md-button\n        class=\"md-fab md-primary\"\n        aria-label=\"Navigation\"\n        ng-click=\"ctrl.showMenu($event, ctrl.navigation)\">\n        <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n      </md-button>\n      <md-button\n        class=\"md-fab md-accent\"\n        aria-label=\"Favorites\"\n        ng-click=\"ctrl.showMenu($event, ctrl.favorites)\">\n        <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n      </md-button>\n      <md-button\n        class=\"md-fab md-background\"\n        aria-label=\"More\"\n        ng-click=\"ctrl.showMenu($event, ctrl.more)\">\n        <md-icon md-svg-icon=\"img/icons/more_vert.svg\"></md-icon>\n      </md-button>\n    </div>\n\n    <p>\n      Configuration preset for upcoming panel elements can be created at the\n      <code>.config</code> level of your AngularJS application. To create a\n      preset configuration object, use the <code>$mdPanelProvider</code>\n      dependency within a <code>.config</code> method and call\n      <code>$mdPanelProvider.definePreset</code> with the preset name and an\n      object containing the options needed for the configuration of a panel.\n      This object will be stored for you so that the next time you need to\n      <code>create</code> or <code>open</code> a panel, you can include the\n      preset name in the method request, <code>$mdPanel.create('name', {...})</code>,\n      to have the preset configuration options be added to the panel.\n    </p>\n    <p>\n      The configuration object takes all of the options found within the\n      <code>$mdPanel.create</code> method; however, it will not accept any\n      options that depend on user interaction, panel positioning, or panel\n      animation.\n    </p>\n    <p>\n      This will help you reduce the necessary lines of configuration code that\n      are required to create a panel when you are wanting to have multiple\n      panels that are largely the same.\n    </p>\n\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/panel/demoPanelProvider/script.js",
    "content": "(function() {\n  'use strict';\n\n  angular\n      .module('panelProviderDemo', ['ngMaterial'])\n      .config(PanelProviderConfig)\n      .controller('PanelProviderCtrl', PanelProviderCtrl)\n      .controller('PanelMenuCtrl', PanelMenuCtrl);\n\n  /**\n   * Configuration method that is used to define a preset for the upcoming panel\n   * element. Each parameter in the preset is an available parameter in the\n   * `$mdPanel.create` and `$mdPanel.open` methods. When the parameters are\n   * defined here, they overwrite the default parameters for any panel that the\n   * preset is requested for.\n   * @param {!MdPanelProvider} $mdPanelProvider Provider method of the MdPanel API.\n   */\n  function PanelProviderConfig($mdPanelProvider) {\n    $mdPanelProvider.definePreset('demoPreset', {\n      attachTo: angular.element(document.body),\n      controller: PanelMenuCtrl,\n      controllerAs: 'ctrl',\n      template: '' +\n          '<div class=\"menu-panel\" md-whiteframe=\"4\">' +\n          '  <div class=\"menu-content\">' +\n          '    <div class=\"menu-item\" ng-repeat=\"item in ctrl.items\">' +\n          '      <button class=\"md-button\">' +\n          '        <span>{{item}}</span>' +\n          '      </button>' +\n          '    </div>' +\n          '    <md-divider></md-divider>' +\n          '    <div class=\"menu-item\">' +\n          '      <button class=\"md-button\" ng-click=\"ctrl.closeMenu()\">' +\n          '        <span>Close Menu</span>' +\n          '      </button>' +\n          '    </div>' +\n          '  </div>' +\n          '</div>',\n      panelClass: 'menu-panel-container',\n      focusOnOpen: false,\n      zIndex: 100,\n      propagateContainerEvents: true,\n      groupName: 'menus'\n    });\n  }\n\n  function PanelProviderCtrl($mdPanel) {\n    this.navigation = {\n      name: 'navigation',\n      items: [\n        'Home',\n        'About',\n        'Contact'\n      ]\n    };\n    this.favorites = {\n      name: 'favorites',\n      items: [\n        'Add to Favorites'\n      ]\n    };\n    this.more = {\n      name: 'more',\n      items: [\n        'Account',\n        'Sign Out'\n      ]\n    };\n\n    $mdPanel.newPanelGroup('menus', {\n      maxOpen: 2\n    });\n\n    this.showMenu = function($event, menu) {\n      /**\n       * The request to open the panel has two arguments passed into it. The\n       * first is a preset name passed in as a string. This will request a\n       * cached preset and apply its configuration parameters. The second is an\n       * object containing parameters that can only be filled through a\n       * controller. These parameters represent configuration needs associated\n       * with user interaction, panel position, panel animation, and other\n       * miscellaneous needs.\n       */\n      $mdPanel.open('demoPreset', {\n        id: 'menu_' + menu.name,\n        position: $mdPanel.newPanelPosition()\n            .relativeTo($event.target)\n            .addPanelPosition(\n              $mdPanel.xPosition.ALIGN_START,\n              $mdPanel.yPosition.BELOW\n            ),\n        locals: {\n          items: menu.items\n        },\n        openFrom: $event\n      });\n    };\n  }\n\n  function PanelMenuCtrl(mdPanelRef) {\n    this.closeMenu = function() {\n      mdPanelRef && mdPanelRef.close();\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/panel/demoPanelProvider/style.global.css",
    "content": ".menu-panel-container {\n  pointer-events: auto;\n}\n\n.menu-panel {\n  width: 256px;\n  background-color: #fff;\n  border-radius: 4px;\n}\n\n.menu-panel .menu-divider {\n  width: 100%;\n  height: 1px;\n  min-height: 1px;\n  max-height: 1px;\n  margin-top: 4px;\n  margin-bottom: 4px;\n  background-color: rgba(0, 0, 0, 0.11);\n}\n\n.menu-panel .menu-content {\n  display: flex;\n  flex-direction: column;\n  padding: 8px 0;\n  max-height: 305px;\n  overflow-y: auto;\n  min-width: 256px;\n}\n\n.menu-panel .menu-item {\n  display: flex;\n  flex-direction: row;\n  min-height: 48px;\n  height: 48px;\n  align-content: center;\n  justify-content: flex-start;\n}\n.menu-panel .menu-item > * {\n  width: 100%;\n  margin: auto 0;\n  padding-left: 16px;\n  padding-right: 16px;\n}\n.menu-panel .menu-item > a.md-button {\n  padding-top: 5px;\n}\n.menu-panel .menu-item > .md-button {\n  display: inline-block;\n  border-radius: 0;\n  margin: auto 0;\n  font-size: 15px;\n  text-transform: none;\n  font-weight: 400;\n  height: 100%;\n  padding-left: 16px;\n  padding-right: 16px;\n  width: 100%;\n  text-align: left;\n}\n.menu-panel .menu-item > .md-button::-moz-focus-inner {\n  padding: 0;\n  border: 0;\n}\n.menu-panel .menu-item > .md-button md-icon {\n  margin: auto 16px auto 0;\n}\n.menu-panel .menu-item > .md-button p {\n  display: inline-block;\n  margin: auto;\n}\n.menu-panel .menu-item > .md-button span {\n  margin-top: auto;\n  margin-bottom: auto;\n}\n.menu-panel .menu-item > .md-button .md-ripple-container {\n  border-radius: inherit;\n}\n"
  },
  {
    "path": "src/components/panel/demoReuse/index.html",
    "content": "<div class=\"md-padding\" ng-controller=\"ReuseDemoCtrl as ctrl\">\n  <p>\n    Panels can be reused to avoid re-creating resources.\n  </p>\n\n  <div flex=\"25\">\n    <h3>AnimationType:</h3>\n    <md-radio-group ng-model=\"ctrl.animationType\">\n      <md-radio-button value=\"slide\">Slide</md-radio-button>\n      <md-radio-button value=\"scale\">Scale</md-radio-button>\n      <md-radio-button value=\"fade\">Fade</md-radio-button>\n      <md-radio-button value=\"custom\">Custom</md-radio-button>\n    </md-radio-group>\n  </div>\n\n  <div>\n    <md-button class=\"md-primary md-raised demo-dialog-reuse-button\"\n               ng-click=\"ctrl.showDialog($event, 'Ahoi')\">\n      Open Dialog\n    </md-button>\n    <md-button class=\"md-accent md-raised demo-dialog-reuse-button\"\n               ng-click=\"ctrl.showDialog($event, 'Hello')\">\n      Also open Dialog\n    </md-button>\n    <md-button class=\"md-warning md-raised demo-dialog-reuse-button\"\n               ng-click=\"ctrl.showDialog($event, 'Greetings')\">\n      Open Here\n    </md-button>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoReuse/panel.tmpl.html",
    "content": "<div role=\"dialog\" aria-label=\"Eat me!\" layout=\"column\" layout-align=\"center center\">\n  <md-toolbar>\n    <div class=\"md-toolbar-tools\">\n      <h2>Surprise!</h2>\n    </div>\n  </md-toolbar>\n\n  <div class=\"demo-dialog-content\">\n    <p>{{ctrl.text}}</p>\n\n    <div layout=\"row\" >\n      <img flex alt=\"Delicious donut\" src=\"img/donut.jpg\">\n    </div>\n  </div>\n\n  <div layout=\"row\" class=\"demo-dialog-button\">\n    <md-button md-autofocus flex class=\"md-primary\" ng-click=\"ctrl.closeDialog()\">\n      Close\n    </md-button>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/panel/demoReuse/script.js",
    "content": "(function() {\n'use strict';\n\nangular.module('panelReuseDemo', ['ngMaterial'])\n    .controller('ReuseDemoCtrl', ReuseDemoCtrl)\n    .controller('ReusePanelCtrl', ReusePanelCtrl);\n\nfunction ReuseDemoCtrl($mdPanel) {\n  this._mdPanel = $mdPanel;\n\n  this.animationType = 'scale';\n\n  var position = this._mdPanel.newPanelPosition()\n    .absolute()\n    .center();\n\n  var animation = this._mdPanel.newPanelAnimation()\n    .openFrom('.demo-dialog-reuse-button')\n    .duration(300)\n    .withAnimation(this._mdPanel.animation.SCALE);\n\n  var config = {\n    attachTo: angular.element(document.body),\n    controller: ReusePanelCtrl,\n    controllerAs: 'ctrl',\n    disableParentScroll: this.disableParentScroll,\n    templateUrl: 'panel.tmpl.html',\n    hasBackdrop: true,\n    panelClass: 'demo-dialog-example',\n    position: position,\n    animation: animation,\n    trapFocus: true,\n    zIndex: 150,\n    clickOutsideToClose: false,\n    escapeToClose: false,\n    focusOnOpen: true,\n    locals: {\n      _demoCtrl: this\n    }\n  };\n\n  this._mdPanelRef = this._mdPanel.create(config);\n  this._mdPanelRef.attach();\n}\n\nReuseDemoCtrl.prototype.showDialog = function($event, text) {\n  var position = this._mdPanel.newPanelPosition()\n    .absolute()\n    .center();\n\n  this._mdPanelRef.updatePosition(position);\n\n  var animation = this._mdPanel.newPanelAnimation()\n    .openFrom($event)\n    .duration(300);\n\n  switch (this.animationType) {\n    case 'custom':\n      animation.withAnimation({\n        open: 'demo-dialog-custom-animation-open',\n        close: 'demo-dialog-custom-animation-close'\n      });\n      break;\n    case 'slide':\n      animation.withAnimation(this._mdPanel.animation.SLIDE);\n      break;\n    case 'scale':\n      animation.withAnimation(this._mdPanel.animation.SCALE);\n      break;\n    case 'fade':\n      animation.withAnimation(this._mdPanel.animation.FADE);\n      break;\n  }\n\n  this._mdPanelRef.updateAnimation(animation);\n\n  this._mdPanelRefCtrl.text = text;\n  this._mdPanelRef.show();\n};\n\n\nfunction ReusePanelCtrl(mdPanelRef) {\n  this._mdPanelRef = mdPanelRef;\n}\n\nReusePanelCtrl.prototype.$onInit = function() {\n  // Register the controller for this panel with the parent controller.\n  this._demoCtrl._mdPanelRefCtrl = this;\n};\n\nReusePanelCtrl.prototype.closeDialog = function() {\n  this._mdPanelRef && this._mdPanelRef.hide();\n};\n\n})();\n"
  },
  {
    "path": "src/components/panel/demoReuse/style.global.css",
    "content": ".demo-dialog-content {\n  padding: 0 15px;\n  width: 100%;\n}\n\n.demo-dialog-content img {\n  height: 300px;\n  margin: auto;\n}\n\n.demo-dialog-button {\n  width: 100%;\n}\n"
  },
  {
    "path": "src/components/panel/panel-theme.scss",
    "content": "._md-panel-backdrop.md-THEME_NAME-theme {\n  background-color: '{{background-900-1.0}}';\n}\n"
  },
  {
    "path": "src/components/panel/panel.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.panel\n */\nangular\n  .module('material.components.panel', [\n    'material.core',\n    'material.components.backdrop'\n  ])\n  .provider('$mdPanel', MdPanelProvider);\n\n\n/*****************************************************************************\n *                            PUBLIC DOCUMENTATION                           *\n *****************************************************************************/\n\n\n/**\n * @ngdoc service\n * @name $mdPanelProvider\n * @module material.components.panel\n *\n * @description\n * `$mdPanelProvider` allows users to create configuration presets that will be\n * stored within a cached presets object. When the configuration is needed, the\n * user can request the preset by passing it as the first parameter in the\n * `$mdPanel.create` or `$mdPanel.open` methods.\n *\n * @usage\n * <hljs lang=\"js\">\n * (function(angular, undefined) {\n *   'use strict';\n *\n *   angular\n *       .module('demoApp', ['ngMaterial'])\n *       .config(DemoConfig)\n *       .controller('DemoCtrl', DemoCtrl)\n *       .controller('DemoMenuCtrl', DemoMenuCtrl);\n *\n *   function DemoConfig($mdPanelProvider) {\n *     $mdPanelProvider.definePreset('demoPreset', {\n *       attachTo: angular.element(document.body),\n *       controller: DemoMenuCtrl,\n *       controllerAs: 'ctrl',\n *       template: '' +\n *           '<div class=\"menu-panel\" md-whiteframe=\"4\">' +\n *           '  <div class=\"menu-content\">' +\n *           '    <div class=\"menu-item\" ng-repeat=\"item in ctrl.items\">' +\n *           '      <button class=\"md-button\">' +\n *           '        <span>{{item}}</span>' +\n *           '      </button>' +\n *           '    </div>' +\n *           '    <md-divider></md-divider>' +\n *           '    <div class=\"menu-item\">' +\n *           '      <button class=\"md-button\" ng-click=\"ctrl.closeMenu()\">' +\n *           '        <span>Close Menu</span>' +\n *           '      </button>' +\n *           '    </div>' +\n *           '  </div>' +\n *           '</div>',\n *       panelClass: 'menu-panel-container',\n *       focusOnOpen: false,\n *       zIndex: 100,\n *       propagateContainerEvents: true,\n *       groupName: 'menus'\n *     });\n *   }\n *\n *   function PanelProviderCtrl($mdPanel) {\n *     this.navigation = {\n *       name: 'navigation',\n *       items: [\n *         'Home',\n *         'About',\n *         'Contact'\n *       ]\n *     };\n *     this.favorites = {\n *       name: 'favorites',\n *       items: [\n *         'Add to Favorites'\n *       ]\n *     };\n *     this.more = {\n *       name: 'more',\n *       items: [\n *         'Account',\n *         'Sign Out'\n *       ]\n *     };\n *\n *     $mdPanel.newPanelGroup('menus', {\n *       maxOpen: 2\n *     });\n *\n *     this.showMenu = function($event, menu) {\n *       $mdPanel.open('demoPreset', {\n *         id: 'menu_' + menu.name,\n *         position: $mdPanel.newPanelPosition()\n *             .relativeTo($event.target)\n *             .addPanelPosition(\n *               $mdPanel.xPosition.ALIGN_START,\n *               $mdPanel.yPosition.BELOW\n *             ),\n *         locals: {\n *           items: menu.items\n *         },\n *         openFrom: $event\n *       });\n *     };\n *   }\n *\n *   function PanelMenuCtrl(mdPanelRef) {\n *     // 'mdPanelRef' is injected in the controller.\n *     this.closeMenu = function() {\n *       if (mdPanelRef) {\n *         mdPanelRef.close();\n *       }\n *     };\n *   }\n * })(angular);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdPanelProvider#definePreset\n * @description\n * Takes the passed in preset name and preset configuration object and adds it\n * to the `_presets` object of the provider. This `_presets` object is then\n * passed along to the `$mdPanel` service.\n *\n * @param {string} name Preset name.\n * @param {!Object} preset Specific configuration object that can contain any\n *     and all of the parameters available within the `$mdPanel.create` method.\n *     However, parameters that pertain to id, position, animation, and user\n *     interaction are not allowed and will be removed from the preset\n *     configuration.\n */\n\n\n/*****************************************************************************\n *                               MdPanel Service                             *\n *****************************************************************************/\n\n\n/**\n * @ngdoc service\n * @name $mdPanel\n * @module material.components.panel\n *\n * @description\n * `$mdPanel` is a robust, low-level service for creating floating panels on\n * the screen. It can be used to implement tooltips, dialogs, pop-ups, etc.\n *\n * The following types, referenced below, have separate documentation:\n * - <a ng-href=\"api/type/MdPanelAnimation\">MdPanelAnimation</a> from `$mdPanel.newPanelAnimation()`\n * - <a ng-href=\"api/type/MdPanelPosition\">MdPanelPosition</a> from `$mdPanel.newPanelPosition()`\n * - <a ng-href=\"api/type/MdPanelRef\">MdPanelRef</a> from the `$mdPanel.open()` Promise or\n * injected in the panel's controller\n *\n * @usage\n * <hljs lang=\"js\">\n * (function(angular, undefined) {\n *   'use strict';\n *\n *   angular\n *       .module('demoApp', ['ngMaterial'])\n *       .controller('DemoDialogController', DialogController)\n *       .controller('DemoCtrl', function($mdPanel) {\n *\n *     var panelRef;\n *\n *     function showPanel($event) {\n *       var panelPosition = $mdPanel.newPanelPosition()\n *           .absolute()\n *           .top('50%')\n *           .left('50%');\n *\n *       var panelAnimation = $mdPanel.newPanelAnimation()\n *           .openFrom($event)\n *           .duration(200)\n *           .closeTo('.show-button')\n *           .withAnimation($mdPanel.animation.SCALE);\n *\n *       var config = {\n *         attachTo: angular.element(document.body),\n *         controller: DialogController,\n *         controllerAs: 'ctrl',\n *         position: panelPosition,\n *         animation: panelAnimation,\n *         targetEvent: $event,\n *         templateUrl: 'dialog-template.html',\n *         clickOutsideToClose: true,\n *         escapeToClose: true,\n *         focusOnOpen: true\n *       };\n *\n *       $mdPanel.open(config)\n *           .then(function(result) {\n *             panelRef = result;\n *           });\n *     }\n *   }\n *\n *   function DialogController(MdPanelRef) {\n *     function closeDialog() {\n *       if (MdPanelRef) MdPanelRef.close();\n *     }\n *   }\n * })(angular);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#create\n * @description\n * Creates a panel with the specified options.\n *\n * @param {!Object=} config Specific configuration object that may contain the\n *     following properties:\n *\n *   - `id` - `{string=}`: An ID to track the panel by. When an ID is provided,\n *     the created panel is added to a tracked panels object. Any subsequent\n *     requests made to create a panel with that ID are ignored. This is useful\n *     in having the panel service not open multiple panels from the same user\n *     interaction when there is no backdrop and events are propagated. Defaults\n *     to an arbitrary string that is not tracked.\n *   - `template` - `{string=}`: HTML template to show in the panel. This\n *     **must** be trusted HTML with respect to AngularJS’s\n *     [$sce service](https://docs.angularjs.org/api/ng/service/$sce).\n *   - `templateUrl` - `{string=}`: The URL that will be used as the content of\n *     the panel.\n *   - `contentElement` - `{(string|!JQLite|!Element)=}`: Pre-compiled\n *     element to be used as the panel's content.\n *   - `controller` - `{(function|string)=}`: The controller to associate with\n *     the panel. The controller can inject a reference to the returned\n *     panelRef, which allows the panel to be closed, hidden, and shown. Any\n *     fields passed in through locals or resolve will be bound to the\n *     controller.\n *   - `controllerAs` - `{string=}`: An alias to assign the controller to on\n *     the scope.\n *   - `bindToController` - `{boolean=}`: Binds locals to the controller\n *     instead of passing them in. Defaults to true, as this is a best\n *     practice.\n *   - `locals` - `{Object=}`: An object containing key/value pairs. The keys\n *     will be used as names of values to inject into the controller. For\n *     example, `locals: {three: 3}` would inject `three` into the controller,\n *     with the value 3. 'mdPanelRef' is a reserved key, and will always\n *     be set to the created `MdPanelRef` instance.\n *   - `resolve` - `{Object=}`: Similar to locals, except it takes promises as\n *     values. The panel will not open until all of the promises resolve.\n *   - `attachTo` - `{(string|!JQLite|!Element)=}`: The element to\n *     attach the panel to. Defaults to appending to the root element of the\n *     application.\n *   - `propagateContainerEvents` - `{boolean=}`: Whether pointer or touch\n *     events should be allowed to propagate 'go through' the container, aka the\n *     wrapper, of the panel. Defaults to false.\n *   - `panelClass` - `{string=}`: A css class to apply to the panel element.\n *     This class should define any borders, box-shadow, etc. for the panel.\n *   - `zIndex` - `{number=}`: The z-index to place the panel at.\n *     Defaults to 80.\n *   - `position` - `{MdPanelPosition=}`: An MdPanelPosition object that\n *     specifies the alignment of the panel. For more information, see\n *     `MdPanelPosition`.\n *   - `clickOutsideToClose` - `{boolean=}`: Whether the user can click\n *     outside the panel to close it. Defaults to false.\n *   - `escapeToClose` - `{boolean=}`: Whether the user can press escape to\n *     close the panel. Defaults to false.\n *   - `onCloseSuccess` - `{function(!panelRef, string)=}`: Function that is\n *     called after the close successfully finishes. The first parameter passed\n *     into this function is the current panelRef and the 2nd is an optional\n *     string explaining the close reason. The currently supported closeReasons\n *     can be found in the `MdPanelRef.closeReasons` enum. These are by default\n *     passed along by the panel.\n *   - `trapFocus` - `{boolean=}`: Whether focus should be trapped within the\n *     panel. If `trapFocus` is true, the user will not be able to interact\n *     with the rest of the page until the panel is dismissed. Defaults to\n *     false.\n *   - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on\n *     open. Only disable if focusing some other way, as focus management is\n *     required for panels to be accessible. Defaults to true.\n *   - `fullscreen` - `{boolean=}`: Whether the panel should be full screen.\n *     Applies the class `._md-panel-fullscreen` to the panel on open. Defaults\n *     to false.\n *   - `animation` - `{MdPanelAnimation=}`: An MdPanelAnimation object that\n *     specifies the animation of the panel. For more information, see\n *     `MdPanelAnimation`.\n *   - `hasBackdrop` - `{boolean=}`: Whether there should be an opaque backdrop\n *     behind the panel. Defaults to false.\n *   - `disableParentScroll` - `{boolean=}`: Whether the user can scroll the\n *     page behind the panel. Defaults to false.\n *   - `onDomAdded` - `{function=}`: Callback function used to announce when\n *     the panel is added to the DOM.\n *   - `onOpenComplete` - `{function=}`: Callback function used to announce\n *     when the open() action is finished.\n *   - `onRemoving` - `{function=}`: Callback function used to announce the\n *     close/hide() action is starting.\n *   - `onDomRemoved` - `{function=}`: Callback function used to announce when\n *     the panel is removed from the DOM.\n *   - `origin` - `{(string|!JQLite|!Element)=}`: The element to focus\n *     on when the panel closes. This is commonly the element which triggered\n *     the opening of the panel. If you do not use `origin`, you need to control\n *     the focus manually.\n *   - `groupName` - `{(string|!Array<string>)=}`: A group name or an array of\n *     group names. The group name is used for creating a group of panels. The\n *     group is used for configuring the number of open panels and identifying\n *     specific behaviors for groups. For instance, all tooltips could be\n *     identified using the same groupName.\n *\n * @returns {!MdPanelRef} panelRef\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#open\n * @description\n * Calls the create method above, then opens the panel. This is a shortcut for\n * creating and then calling open manually. If custom methods need to be\n * called when the panel is added to the DOM or opened, do not use this method.\n * Instead create the panel, chain promises on the domAdded and openComplete\n * methods, and call open from the returned panelRef.\n *\n * @param {!Object=} config Specific configuration object that may contain\n *     the properties defined in `$mdPanel.create`.\n * @returns {!Q.IPromise<!MdPanelRef>} panelRef A promise that resolves\n *     to an instance of the panel.\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#newPanelPosition\n * @description\n * Returns a new instance of the MdPanelPosition object. Use this to create\n * the position config object.\n *\n * @returns {!MdPanelPosition} panelPosition\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#newPanelAnimation\n * @description\n * Returns a new instance of the MdPanelAnimation object. Use this to create\n * the animation config object.\n *\n * @returns {!MdPanelAnimation} panelAnimation\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#setGroupMaxOpen\n * @description\n * Sets the maximum number of panels in a group that can be opened at a given\n * time.\n *\n * @param {string} groupName The name of the group to configure.\n * @param {number} maxOpen The maximum number of panels that can be\n *     opened. Infinity can be passed in to remove the maxOpen limit.\n */\n\n\n/*****************************************************************************\n *                                 MdPanelRef                                *\n *****************************************************************************/\n\n\n/**\n * @ngdoc type\n * @name MdPanelRef\n * @module material.components.panel\n * @description\n * A reference to a created panel. This reference contains a unique id for the\n * panel, along with the following properties:\n *\n *   - `id` - `{string}`: The unique id for the panel. This id is used to track\n *     when a panel was interacted with.\n *   - `config` - `{!Object=}`: The entire config object that was used in\n *     create.\n *   - `isAttached` - `{boolean}`: Whether the panel is attached to the DOM.\n *     Visibility to the user does not factor into isAttached.\n *   - `panelContainer` - `{JQLite}`: The wrapper element containing the\n *     panel. This property is added in order to have access to the `addClass`,\n *     `removeClass`, `toggleClass`, etc methods.\n *   - `panelEl` - `{JQLite}`: The panel element. This property is added\n *     in order to have access to the `addClass`, `removeClass`, `toggleClass`,\n *     etc methods.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#open\n * @description\n * Attaches and shows the panel.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel is\n *     opened.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#close\n * @description\n * Hides and detaches the panel. Note that this will **not** destroy the panel.\n * If you don't intend on using the panel again, call the {@link #destroy\n * destroy} method afterwards.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel is\n *     closed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#attach\n * @description\n * Create the panel elements and attach them to the DOM. The panel will be\n * hidden by default.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel is\n *     attached.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#detach\n * @description\n * Removes the panel from the DOM. This will NOT hide the panel before removing\n * it.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel is\n *     detached.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#show\n * @description\n * Shows the panel.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel has\n *     shown and animations are completed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#hide\n * @description\n * Hides the panel.\n *\n * @returns {!Q.IPromise} A promise that is resolved when the panel has\n *     hidden and animations are completed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#destroy\n * @description\n * Destroys the panel. The panel cannot be opened again after this is called.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#updatePosition\n * @description\n * Updates the position configuration of a panel. Use this to update the\n * position of a panel that is open, without having to close and re-open the\n * panel.\n *\n * @param {!MdPanelPosition} position\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#addToGroup\n * @description\n * Adds a panel to a group if the panel does not exist within the group already.\n * A panel can only exist within a single group.\n *\n * @param {string} groupName The name of the group to add the panel to.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#removeFromGroup\n * @description\n * Removes a panel from a group if the panel exists within that group. The group\n * must be created ahead of time.\n *\n * @param {string} groupName The name of the group.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#registerInterceptor\n * @description\n * Registers an interceptor with the panel. The callback should return a promise,\n * which will allow the action to continue when it gets resolved, or will\n * prevent an action if it is rejected. The interceptors are called sequentially\n * and it reverse order. `type` must be one of the following\n * values available on `$mdPanel.interceptorTypes`:\n * * `CLOSE` - Gets called before the panel begins closing.\n *\n * @param {string} type Type of interceptor.\n * @param {!Q.IPromise<any>} callback Callback to be registered.\n * @returns {!MdPanelRef}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#removeInterceptor\n * @description\n * Removes a registered interceptor.\n *\n * @param {string} type Type of interceptor to be removed.\n * @param {function(): !Q.IPromise<any>} callback Interceptor to be removed.\n * @returns {!MdPanelRef}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#removeAllInterceptors\n * @description\n * Removes all interceptors. If a type is supplied, only the\n * interceptors of that type will be cleared.\n *\n * @param {string=} type Type of interceptors to be removed.\n * @returns {!MdPanelRef}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#updateAnimation\n * @description\n * Updates the animation configuration for a panel. You can use this to change\n * the panel's animation without having to re-create it.\n *\n * @param {!MdPanelAnimation} animation\n */\n\n\n/*****************************************************************************\n *                               MdPanelPosition                            *\n *****************************************************************************/\n\n\n/**\n * @ngdoc type\n * @name MdPanelPosition\n * @module material.components.panel\n * @description\n *\n * Object for configuring the position of the panel.\n *\n * @usage\n *\n * #### Centering the panel\n *\n * <hljs lang=\"js\">\n * new MdPanelPosition().absolute().center();\n * </hljs>\n *\n * #### Overlapping the panel with an element\n *\n * <hljs lang=\"js\">\n * new MdPanelPosition()\n *     .relativeTo(someElement)\n *     .addPanelPosition(\n *       $mdPanel.xPosition.ALIGN_START,\n *       $mdPanel.yPosition.ALIGN_TOPS\n *     );\n * </hljs>\n *\n * #### Aligning the panel with the bottom of an element\n *\n * <hljs lang=\"js\">\n * new MdPanelPosition()\n *     .relativeTo(someElement)\n *     .addPanelPosition($mdPanel.xPosition.CENTER, $mdPanel.yPosition.BELOW);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#absolute\n * @description\n * Positions the panel absolutely relative to the parent element. If the parent\n * is document.body, this is equivalent to positioning the panel absolutely\n * within the viewport.\n *\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#relativeTo\n * @description\n * Positions the panel relative to a specific element.\n *\n * @param {string|!Element|!JQLite} element Query selector, DOM element,\n *     or angular element to position the panel with respect to.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#top\n * @description\n * Sets the value of `top` for the panel. Clears any previously set vertical\n * position.\n *\n * @param {string=} top Value of `top`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#bottom\n * @description\n * Sets the value of `bottom` for the panel. Clears any previously set vertical\n * position.\n *\n * @param {string=} bottom Value of `bottom`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#start\n * @description\n * Sets the panel to the start of the page - `left` if `ltr` or `right` for\n * `rtl`. Clears any previously set horizontal position.\n *\n * @param {string=} start Value of position. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#end\n * @description\n * Sets the panel to the end of the page - `right` if `ltr` or `left` for `rtl`.\n * Clears any previously set horizontal position.\n *\n * @param {string=} end Value of position. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#left\n * @description\n * Sets the value of `left` for the panel. Clears any previously set\n * horizontal position.\n *\n * @param {string=} left Value of `left`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#right\n * @description\n * Sets the value of `right` for the panel. Clears any previously set\n * horizontal position.\n *\n * @param {string=} right Value of `right`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#centerHorizontally\n * @description\n * Centers the panel horizontally in the viewport. Clears any previously set\n * horizontal position.\n *\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#centerVertically\n * @description\n * Centers the panel vertically in the viewport. Clears any previously set\n * vertical position.\n *\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#center\n * @description\n * Centers the panel horizontally and vertically in the viewport. This is\n * equivalent to calling both `centerHorizontally` and `centerVertically`.\n * Clears any previously set horizontal and vertical positions.\n *\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#addPanelPosition\n * @description\n * Sets the x and y position for the panel relative to another element. Can be\n * called multiple times to specify an ordered list of panel positions. The\n * first position which allows the panel to be completely on-screen will be\n * chosen; the last position will be chose whether it is on-screen or not.\n *\n * xPosition must be one of the following values available on\n * $mdPanel.xPosition:\n *\n *\n * CENTER | ALIGN_START | ALIGN_END | OFFSET_START | OFFSET_END\n *\n * <pre>\n *    *************\n *    *           *\n *    *   PANEL   *\n *    *           *\n *    *************\n *   A B    C    D E\n *\n * A: OFFSET_START (for LTR displays)\n * B: ALIGN_START (for LTR displays)\n * C: CENTER\n * D: ALIGN_END (for LTR displays)\n * E: OFFSET_END (for LTR displays)\n * </pre>\n *\n * yPosition must be one of the following values available on\n * $mdPanel.yPosition:\n *\n * CENTER | ALIGN_TOPS | ALIGN_BOTTOMS | ABOVE | BELOW\n *\n * <pre>\n *   F\n *   G *************\n *     *           *\n *   H *   PANEL   *\n *     *           *\n *   I *************\n *   J\n *\n * F: BELOW\n * G: ALIGN_TOPS\n * H: CENTER\n * I: ALIGN_BOTTOMS\n * J: ABOVE\n * </pre>\n *\n * @param {string} xPosition\n * @param {string} yPosition\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#withOffsetX\n * @description\n * Sets the value of the offset in the x-direction.\n *\n * @param {string|number} offsetX\n * @returns {!MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#withOffsetY\n * @description\n * Sets the value of the offset in the y-direction.\n *\n * @param {string|number} offsetY\n * @returns {!MdPanelPosition}\n */\n\n\n/*****************************************************************************\n *                               MdPanelAnimation                            *\n *****************************************************************************/\n\n\n/**\n * @ngdoc type\n * @name MdPanelAnimation\n * @module material.components.panel\n * @description\n * Animation configuration object. To use, create an MdPanelAnimation with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * @usage\n *\n * <hljs lang=\"js\">\n * var panelAnimation = new MdPanelAnimation()\n *     .openFrom(myButtonEl)\n *     .duration(1337)\n *     .closeTo('.my-button')\n *     .withAnimation($mdPanel.animation.SCALE);\n *\n * $mdPanel.create({\n *   animation: panelAnimation\n * });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#openFrom\n * @description\n * Specifies where to start the open animation. `openFrom` accepts a\n * click event object, query selector, DOM element, or a Rect object that\n * is used to determine the bounds. When passed a click event, the location\n * of the click will be used as the position to start the animation.\n *\n * @param {string|!Element|!Event|{top: number, left: number}}\n * @returns {!MdPanelAnimation}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#closeTo\n * @description\n * Specifies where to animate the panel close. `closeTo` accepts a\n * query selector, DOM element, or a Rect object that is used to determine\n * the bounds.\n *\n * @param {string|!Element|{top: number, left: number}}\n * @returns {!MdPanelAnimation}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#withAnimation\n * @description\n * Specifies the animation class.\n *\n * There are several default animations that can be used: `$mdPanel.animation.`\n *  - `SLIDE`: The panel slides in and out from the specified\n *       elements. It will not fade in or out.\n *  - `SCALE`: The panel scales in and out. Slide and fade are\n *       included in this animation.\n *  - `FADE`: The panel fades in and out.\n *\n * Custom classes will by default fade in and out unless\n * `transition: opacity 1ms` is added to the to custom class.\n *\n * @param {string|{open: string, close: string}} cssClass\n * @returns {!MdPanelAnimation}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#duration\n * @description\n * Specifies the duration of the animation in milliseconds. The `duration`\n * method accepts either a number or an object with separate open and close\n * durations.\n *\n * @param {number|{open: number, close: number}} duration\n * @returns {!MdPanelAnimation}\n */\n\n\n/*****************************************************************************\n *                            PUBLIC DOCUMENTATION                           *\n *****************************************************************************/\n\n\nvar MD_PANEL_Z_INDEX = 80;\nvar MD_PANEL_HIDDEN = '_md-panel-hidden';\nvar FOCUS_TRAP_TEMPLATE;\n\nvar _presets = {};\n\n\n/**\n * A provider that is used for creating presets for the panel API.\n * @final @constructor @ngInject\n */\nfunction MdPanelProvider() {\n  return {\n    'definePreset': definePreset,\n    'getAllPresets': getAllPresets,\n    'clearPresets': clearPresets,\n    '$get': $getProvider()\n  };\n}\n\n\n/**\n * Takes the passed in panel configuration object and adds it to the `_presets`\n * object at the specified name.\n * @param {string} name Name of the preset to set.\n * @param {!Object} preset Specific configuration object that can contain any\n *     and all of the parameters available within the `$mdPanel.create` method.\n *     However, parameters that pertain to id, position, animation, and user\n *     interaction are not allowed and will be removed from the preset\n *     configuration.\n */\nfunction definePreset(name, preset) {\n  if (!name || !preset) {\n    throw new Error('mdPanelProvider: The panel preset definition is ' +\n        'malformed. The name and preset object are required.');\n  } else if (_presets.hasOwnProperty(name)) {\n    throw new Error('mdPanelProvider: The panel preset you have requested ' +\n        'has already been defined.');\n  }\n\n  // Delete any property on the preset that is not allowed.\n  delete preset.id;\n  delete preset.position;\n  delete preset.animation;\n\n  _presets[name] = preset;\n}\n\n\n/**\n * Gets a clone of the `_presets`.\n * @return {!Object}\n */\nfunction getAllPresets() {\n  return angular.copy(_presets);\n}\n\n\n/**\n * Clears all of the stored presets.\n */\nfunction clearPresets() {\n  _presets = {};\n}\n\n\n/**\n * Represents the `$get` method of the AngularJS provider. From here, a new\n * reference to the MdPanelService is returned where the needed arguments are\n * passed in including the MdPanelProvider `_presets`.\n * @param {!Object} _presets\n * @param {!JQLite} $rootElement\n * @param {!angular.Scope} $rootScope\n * @param {!IInjectorService} $injector\n * @param {!IWindowService} $window\n */\nfunction $getProvider() {\n  return [\n    '$rootElement', '$rootScope', '$injector', '$window',\n    function($rootElement, $rootScope, $injector, $window) {\n      return new MdPanelService(_presets, $rootElement, $rootScope,\n          $injector, $window);\n    }\n  ];\n}\n\n/**\n * @param {string|[]} value\n * @returns {[]} the input string wrapped in an Array or the original Array\n */\nfunction coerceToArray(value) {\n  if (angular.isString(value)) {\n    value = [value];\n  }\n  return value;\n}\n\n/*****************************************************************************\n *                               MdPanel Service                             *\n *****************************************************************************/\n\n\n/**\n * A service that is used for controlling/displaying panels on the screen.\n * @param {!Object} presets\n * @param {!JQLite} $rootElement\n * @param {!angular.Scope} $rootScope\n * @param {!IInjectorService} $injector\n * @param {!IWindowService} $window\n * @final @constructor @ngInject\n */\nfunction MdPanelService(presets, $rootElement, $rootScope, $injector, $window) {\n  /**\n   * Default config options for the panel.\n   * Anything angular related needs to be done later. Therefore\n   *     scope: $rootScope.$new(true),\n   *     attachTo: $rootElement,\n   * are added later.\n   * @private {!Object}\n   */\n  this._defaultConfigOptions = {\n    bindToController: true,\n    clickOutsideToClose: false,\n    disableParentScroll: false,\n    escapeToClose: false,\n    focusOnOpen: true,\n    fullscreen: false,\n    hasBackdrop: false,\n    propagateContainerEvents: false,\n    transformTemplate: angular.bind(this, this._wrapTemplate),\n    trapFocus: false,\n    zIndex: MD_PANEL_Z_INDEX\n  };\n\n  /** @private {!Object} */\n  this._config = {};\n\n  /** @private {!Object} */\n  this._presets = presets;\n\n  /** @private @const */\n  this._$rootElement = $rootElement;\n\n  /** @private @const */\n  this._$rootScope = $rootScope;\n\n  /** @private @const */\n  this._$injector = $injector;\n\n  /** @private @const */\n  this._$window = $window;\n\n  /** @private @const */\n  this._$mdUtil = this._$injector.get('$mdUtil');\n\n  /** @private {!Object<string, !MdPanelRef>} */\n  this._trackedPanels = {};\n\n  /**\n   * @private {!Object<string,\n   *     {panels: !Array<!MdPanelRef>,\n   *     openPanels: !Array<!MdPanelRef>,\n   *     maxOpen: number}>}\n   */\n  this._groups = Object.create(null);\n\n  /**\n   * Default animations that can be used within the panel.\n   * @type {enum}\n   */\n  this.animation = MdPanelAnimation.animation;\n\n  /**\n   * Possible values of xPosition for positioning the panel relative to\n   * another element.\n   * @type {enum}\n   */\n  this.xPosition = MdPanelPosition.xPosition;\n\n  /**\n   * Possible values of yPosition for positioning the panel relative to\n   * another element.\n   * @type {enum}\n   */\n  this.yPosition = MdPanelPosition.yPosition;\n\n  /**\n   * Possible values for the interceptors that can be registered on a panel.\n   * @type {enum}\n   */\n  this.interceptorTypes = MdPanelRef.interceptorTypes;\n\n  /**\n   * Possible values for closing of a panel.\n   * @type {enum}\n   */\n  this.closeReasons = MdPanelRef.closeReasons;\n\n  /**\n   * Possible values of absolute position.\n   * @type {enum}\n   */\n  this.absPosition = MdPanelPosition.absPosition;\n}\n\n\n/**\n * Creates a panel with the specified options.\n * @param {string|Object=} preset Name of a preset configuration that can be used to\n *     extend the panel configuration.\n * @param {!Object=} config Configuration object for the panel.\n * @returns {!MdPanelRef}\n */\nMdPanelService.prototype.create = function(preset, config) {\n  if (typeof preset === 'string') {\n    preset = this._getPresetByName(preset);\n  } else if (typeof preset === 'object' &&\n      (angular.isUndefined(config) || !config)) {\n    config = preset;\n    preset = {};\n  }\n\n  preset = preset || {};\n  config = config || {};\n\n  // If the passed-in config contains an ID and the ID is within _trackedPanels,\n  // return the tracked panel after updating its config with the passed-in\n  // config.\n  if (angular.isDefined(config.id) && this._trackedPanels[config.id]) {\n    var trackedPanel = this._trackedPanels[config.id];\n    angular.extend(trackedPanel.config, config);\n    return trackedPanel;\n  }\n\n  // Combine the passed-in config, the _defaultConfigOptions, and the preset\n  // configuration into the `_config`.\n  this._config = angular.extend({\n    // If no ID is set within the passed-in config, then create an arbitrary ID.\n    id: config.id || 'panel_' + this._$mdUtil.nextUid(),\n    scope: this._$rootScope.$new(true),\n    attachTo: this._$rootElement\n  }, this._defaultConfigOptions, config, preset);\n\n  // Create the panelRef and add it to the `_trackedPanels` object.\n  var panelRef = new MdPanelRef(this._config, this._$injector);\n  this._trackedPanels[this._config.id] = panelRef;\n\n  // Add the panel to each of its requested groups.\n  if (this._config.groupName) {\n    this._config.groupName = coerceToArray(this._config.groupName);\n    angular.forEach(this._config.groupName, function(group) {\n      panelRef.addToGroup(group);\n    });\n  }\n\n  this._config.scope.$on('$destroy', angular.bind(panelRef, panelRef.detach));\n\n  return panelRef;\n};\n\n\n/**\n * Creates and opens a panel with the specified options.\n * @param {string=} preset Name of a preset configuration that can be used to\n *     extend the panel configuration.\n * @param {!Object=} config Configuration object for the panel.\n * @returns {!Q.IPromise<!MdPanelRef>} The panel created from create.\n */\nMdPanelService.prototype.open = function(preset, config) {\n  var panelRef = this.create(preset, config);\n  return panelRef.open().then(function() {\n    return panelRef;\n  });\n};\n\n\n/**\n * Gets a specific preset configuration object saved within `_presets`.\n * @param {string} preset Name of the preset to search for.\n * @returns {!Object} The preset configuration object.\n */\nMdPanelService.prototype._getPresetByName = function(preset) {\n  if (!this._presets[preset]) {\n    throw new Error('mdPanel: The panel preset configuration that you ' +\n        'requested does not exist. Use the $mdPanelProvider to create a ' +\n        'preset before requesting one.');\n  }\n  return this._presets[preset];\n};\n\n\n/**\n * Returns a new instance of the MdPanelPosition. Use this to create the\n * positioning object.\n * @returns {!MdPanelPosition}\n */\nMdPanelService.prototype.newPanelPosition = function() {\n  return new MdPanelPosition(this._$injector);\n};\n\n\n/**\n * Returns a new instance of the MdPanelAnimation. Use this to create the\n * animation object.\n * @returns {!MdPanelAnimation}\n */\nMdPanelService.prototype.newPanelAnimation = function() {\n  return new MdPanelAnimation(this._$injector);\n};\n\n\n/**\n * @ngdoc method\n * @name $mdPanel#newPanelGroup\n * @description\n * Creates a panel group and adds it to a tracked list of panel groups.\n * @param {string} groupName Name of the group to create.\n * @param {{maxOpen: number}=} config Configuration object that may contain the following\n *  properties:\n *\n *   - `maxOpen`: The maximum number of panels that are allowed open within a defined panel group.\n *\n * @returns {!{panels: !Array<!MdPanelRef>, openPanels: !Array<!MdPanelRef>, maxOpen: number}}\n *  the new panel group\n */\nMdPanelService.prototype.newPanelGroup = function(groupName, config) {\n  if (!this._groups[groupName]) {\n    config = config || {};\n    this._groups[groupName] = {\n      panels: [],\n      openPanels: [],\n      maxOpen: config.maxOpen > 0 ? config.maxOpen : Infinity\n    };\n  }\n  return this._groups[groupName];\n};\n\n\n/**\n * Sets the maximum number of panels in a group that can be opened at a given\n * time.\n * @param {string} groupName The name of the group to configure.\n * @param {number} maxOpen The maximum number of panels that can be\n *     opened. Infinity can be passed in to remove the maxOpen limit.\n */\nMdPanelService.prototype.setGroupMaxOpen = function(groupName, maxOpen) {\n  if (this._groups[groupName]) {\n    this._groups[groupName].maxOpen = maxOpen;\n  } else {\n    throw new Error('mdPanel: Group does not exist yet. Call newPanelGroup().');\n  }\n};\n\n\n/**\n * Determines if the current number of open panels within a group exceeds the\n * limit of allowed open panels.\n * @param {string} groupName The name of the group to check.\n * @returns {boolean} true if open count does exceed maxOpen and false if not.\n * @private\n */\nMdPanelService.prototype._openCountExceedsMaxOpen = function(groupName) {\n  if (this._groups[groupName]) {\n    var group = this._groups[groupName];\n    return group.maxOpen > 0 && group.openPanels.length > group.maxOpen;\n  }\n  return false;\n};\n\n\n/**\n * Closes the first open panel within a specific group.\n * @param {string} groupName The name of the group.\n * @private\n */\nMdPanelService.prototype._closeFirstOpenedPanel = function(groupName) {\n  var group = this._groups[groupName];\n  if (group && group.openPanels.length) {\n    group.openPanels[0].close();\n  }\n};\n\n\n/**\n * Wraps the user's template in three elements:\n * - md-panel-outer-wrapper - covers the entire `attachTo` element.\n * - md-panel-inner-wrapper - handles the positioning.\n * - md-panel - contains the user's content and deals with the animations.\n * @param {string} origTemplate The original template.\n * @returns {string} The wrapped template.\n * @private\n */\nMdPanelService.prototype._wrapTemplate = function(origTemplate) {\n  var template = origTemplate || '';\n\n  // The panel should be initially rendered offscreen so we can calculate\n  // height and width for positioning.\n  return '' +\n      '<div class=\"md-panel-outer-wrapper\">' +\n        '<div class=\"md-panel-inner-wrapper _md-panel-offscreen\">' +\n          '<div class=\"md-panel _md-panel-offscreen\">' + template + '</div>' +\n        '</div>' +\n      '</div>';\n};\n\n\n/**\n * Wraps a content element in a `md-panel-outer-wrapper`, as well as\n * a `md-panel-inner-wrapper`, and positions it off-screen. Allows for\n * proper control over positioning and animations.\n * @param {!JQLite} contentElement Element to be wrapped.\n * @return {!JQLite} Wrapper element.\n * @private\n */\nMdPanelService.prototype._wrapContentElement = function(contentElement) {\n  var outerWrapper = angular.element(\n    '<div class=\"md-panel-outer-wrapper\">' +\n      '<div class=\"md-panel-inner-wrapper _md-panel-offscreen\"></div>' +\n    '</div>'\n  );\n\n  contentElement.addClass('md-panel _md-panel-offscreen');\n  outerWrapper.children().eq(0).append(contentElement);\n\n  return outerWrapper;\n};\n\n\n/*****************************************************************************\n *                                 MdPanelRef                                *\n *****************************************************************************/\n\n\n/**\n * A reference to a created panel. This reference contains a unique id for the\n * panel, along with properties/functions used to control the panel.\n * @param {!Object} config\n * @param {!IInjectorService} $injector\n * @final @constructor\n */\nfunction MdPanelRef(config, $injector) {\n  // Injected variables.\n  /** @private @const {!IQService} */\n  this._$q = $injector.get('$q');\n\n  /** @private @const {!angular.$mdCompiler} */\n  this._$mdCompiler = $injector.get('$mdCompiler');\n\n  /** @private @const {!angular.$mdConstant} */\n  this._$mdConstant = $injector.get('$mdConstant');\n\n  /** @private @const {!angular.$mdUtil} */\n  this._$mdUtil = $injector.get('$mdUtil');\n\n  /** @private @const {!angular.$mdTheming} */\n  this._$mdTheming = $injector.get('$mdTheming');\n\n  /** @private @const {!IRootScopeService} */\n  this._$rootScope = $injector.get('$rootScope');\n\n  /** @private @const {!angular.$animate} */\n  this._$animate = $injector.get('$animate');\n\n  /** @private @const {!MdPanelRef} */\n  this._$mdPanel = $injector.get('$mdPanel');\n\n  /** @private @const {!ILogService} */\n  this._$log = $injector.get('$log');\n\n  /** @private @const {!IWindowService} */\n  this._$window = $injector.get('$window');\n\n  /** @private @const {!Function} */\n  this._$$rAF = $injector.get('$$rAF');\n\n  // Public variables.\n  /**\n   * Unique id for the panelRef.\n   * @type {string}\n   */\n  this.id = config.id;\n\n  /** @type {!Object} */\n  this.config = config;\n\n  /** @type {!JQLite|undefined} */\n  this.panelContainer = undefined;\n\n  /** @type {!JQLite|undefined} */\n  this.panelEl = undefined;\n\n  /** @type {!JQLite|undefined} */\n  this.innerWrapper = undefined;\n\n  /**\n   * Whether the panel is attached. This is synchronous. When attach is called,\n   * isAttached is set to true. When detach is called, isAttached is set to\n   * false.\n   * @type {boolean}\n   */\n  this.isAttached = false;\n\n  // Private variables.\n  /** @private {Array<function()>} */\n  this._removeListeners = [];\n\n  /** @private {!JQLite|undefined} */\n  this._topFocusTrap = undefined;\n\n  /** @private {!JQLite|undefined} */\n  this._bottomFocusTrap = undefined;\n\n  /** @private {!$mdPanel|undefined} */\n  this._backdropRef = undefined;\n\n  /** @private {Function?} */\n  this._restoreScroll = null;\n\n  /**\n   * Keeps track of all the panel interceptors.\n   * @private {!Object}\n   */\n  this._interceptors = Object.create(null);\n\n  /**\n   * Cleanup function, provided by `$mdCompiler` and assigned after the element\n   * has been compiled. When `contentElement` is used, the function is used to\n   * restore the element to it's proper place in the DOM.\n   * @private {Function|null}\n   */\n  this._compilerCleanup = null;\n\n  /**\n   * Cache for saving and restoring element inline styles, CSS classes etc.\n   * @type {{styles: string, classes: string}}\n   */\n  this._restoreCache = {\n    styles: '',\n    classes: ''\n  };\n}\n\n\nMdPanelRef.interceptorTypes = {\n  CLOSE: 'onClose'\n};\n\n\n/**\n * Opens an already created and configured panel. If the panel is already\n * visible, does nothing.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel is opened and animations finish.\n */\nMdPanelRef.prototype.open = function() {\n  var self = this;\n  return this._$q(function(resolve, reject) {\n    var done = self._done(resolve, self);\n    var show = self._simpleBind(self.show, self);\n    var checkGroupMaxOpen = function() {\n      if (self.config.groupName) {\n        self.config.groupName = coerceToArray(self.config.groupName);\n        angular.forEach(self.config.groupName, function(group) {\n          if (self._$mdPanel._openCountExceedsMaxOpen(group)) {\n            self._$mdPanel._closeFirstOpenedPanel(group);\n          }\n        });\n      }\n    };\n\n    self.attach()\n        .then(show)\n        .then(checkGroupMaxOpen)\n        .then(done)\n        .catch(reject);\n  });\n};\n\n\n/**\n * Closes the panel.\n * @param {string} closeReason The event type that triggered the close.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel is closed and animations finish.\n */\nMdPanelRef.prototype.close = function(closeReason) {\n  var self = this;\n\n  return this._$q(function(resolve, reject) {\n    self._callInterceptors(MdPanelRef.interceptorTypes.CLOSE).then(function() {\n      var done = self._done(resolve, self);\n      var detach = self._simpleBind(self.detach, self);\n      var onCloseSuccess = self.config['onCloseSuccess'] || angular.noop;\n      onCloseSuccess = angular.bind(self, onCloseSuccess, self, closeReason);\n\n      self.hide()\n          .then(detach)\n          .then(done)\n          .then(onCloseSuccess)\n          .catch(reject);\n    }, reject);\n  });\n};\n\n\n/**\n * Attaches the panel. The panel will be hidden afterwards.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel is attached.\n */\nMdPanelRef.prototype.attach = function() {\n  if (this.isAttached && this.panelEl) {\n    return this._$q.when(this);\n  }\n\n  var self = this;\n  return this._$q(function(resolve, reject) {\n    var done = self._done(resolve, self);\n    var onDomAdded = self.config['onDomAdded'] || angular.noop;\n    var addListeners = function(response) {\n      self.isAttached = true;\n      self._addEventListeners();\n      return response;\n    };\n\n    self._$q.all([\n        self._createBackdrop(),\n        self._createPanel()\n            .then(addListeners)\n            .catch(reject)\n    ]).then(onDomAdded)\n      .then(done)\n      .catch(reject);\n  });\n};\n\n\n/**\n * Only detaches the panel. Will NOT hide the panel first.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel is detached.\n */\nMdPanelRef.prototype.detach = function() {\n  if (!this.isAttached) {\n    return this._$q.when(this);\n  }\n\n  var self = this;\n  var onDomRemoved = self.config['onDomRemoved'] || angular.noop;\n\n  var detachFn = function() {\n    self._removeEventListeners();\n\n    // Remove the focus traps that we added earlier for keeping focus within\n    // the panel.\n    if (self._topFocusTrap && self._topFocusTrap.parentNode) {\n      self._topFocusTrap.parentNode.removeChild(self._topFocusTrap);\n    }\n\n    if (self._bottomFocusTrap && self._bottomFocusTrap.parentNode) {\n      self._bottomFocusTrap.parentNode.removeChild(self._bottomFocusTrap);\n    }\n\n    if (self._restoreCache.classes) {\n      self.panelEl[0].className = self._restoreCache.classes;\n    }\n\n    // Either restore the saved styles or clear the ones set by mdPanel.\n    self.panelEl[0].style.cssText = self._restoreCache.styles || '';\n\n    self._compilerCleanup();\n    self.panelContainer.remove();\n    self.isAttached = false;\n    return self._$q.when(self);\n  };\n\n  if (this._restoreScroll) {\n    this._restoreScroll();\n    this._restoreScroll = null;\n  }\n\n  return this._$q(function(resolve, reject) {\n    var done = self._done(resolve, self);\n\n    self._$q.all([\n      detachFn(),\n      self._backdropRef ? self._backdropRef.detach() : true\n    ]).then(onDomRemoved)\n      .then(done)\n      .catch(reject);\n  });\n};\n\n\n/**\n * Destroys the panel. The Panel cannot be opened again after this.\n */\nMdPanelRef.prototype.destroy = function() {\n  var self = this;\n  if (this.config.groupName) {\n    this.config.groupName = coerceToArray(this.config.groupName);\n    angular.forEach(this.config.groupName, function(group) {\n      self.removeFromGroup(group);\n    });\n  }\n  this.config.scope.$destroy();\n  this.config.locals = null;\n  this.config.onDomAdded = null;\n  this.config.onDomRemoved = null;\n  this.config.onRemoving = null;\n  this.config.onOpenComplete = null;\n  this._interceptors = undefined;\n};\n\n\n/**\n * Shows the panel.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel has shown and animations finish.\n */\nMdPanelRef.prototype.show = function() {\n  if (!this.panelContainer) {\n    return this._$q(function(resolve, reject) {\n      reject('mdPanel: Panel does not exist yet. Call open() or attach().');\n    });\n  }\n\n  if (!this.panelContainer.hasClass(MD_PANEL_HIDDEN)) {\n    return this._$q.when(this);\n  }\n\n  var self = this;\n  var animatePromise = function() {\n    self.panelContainer.removeClass(MD_PANEL_HIDDEN);\n    return self._animateOpen();\n  };\n\n  return this._$q(function(resolve, reject) {\n    var done = self._done(resolve, self);\n    var onOpenComplete = self.config['onOpenComplete'] || angular.noop;\n    var addToGroupOpen = function() {\n      if (self.config.groupName) {\n        self.config.groupName = coerceToArray(self.config.groupName);\n        angular.forEach(self.config.groupName, function(group) {\n          group = self._$mdPanel._groups[group];\n          if (group) {\n            group.openPanels.push(self);\n          }\n        });\n      }\n    };\n\n    self._$q.all([\n      self._backdropRef ? self._backdropRef.show() : self,\n      animatePromise().then(function() { self._focusOnOpen(); }, reject)\n    ]).then(onOpenComplete)\n      .then(addToGroupOpen)\n      .then(done)\n      .catch(reject);\n  });\n};\n\n\n/**\n * Hides the panel.\n * @returns {!Q.IPromise<!MdPanelRef>} A promise that is resolved when\n *     the panel has hidden and animations finish.\n */\nMdPanelRef.prototype.hide = function() {\n  if (!this.panelContainer) {\n    return this._$q(function(resolve, reject) {\n      reject('mdPanel: Panel does not exist yet. Call open() or attach().');\n    });\n  }\n\n  if (this.panelContainer.hasClass(MD_PANEL_HIDDEN)) {\n    return this._$q.when(this);\n  }\n\n  var self = this;\n\n  return this._$q(function(resolve, reject) {\n    var done = self._done(resolve, self);\n    var onRemoving = self.config['onRemoving'] || angular.noop;\n    var hidePanel = function() {\n      self.panelContainer.addClass(MD_PANEL_HIDDEN);\n    };\n    var removeFromGroupOpen = function() {\n      if (self.config.groupName) {\n        var index;\n        self.config.groupName = coerceToArray(self.config.groupName);\n        angular.forEach(self.config.groupName, function(group) {\n          group = self._$mdPanel._groups[group];\n          index = group.openPanels.indexOf(self);\n          if (index > -1) {\n            group.openPanels.splice(index, 1);\n          }\n        });\n      }\n    };\n    var focusOnOrigin = function() {\n      var origin = self.config['origin'];\n      if (origin) {\n        getElement(origin).focus();\n      }\n    };\n\n    self._$q.all([\n      self._backdropRef ? self._backdropRef.hide() : self,\n      self._animateClose()\n          .then(onRemoving)\n          .then(hidePanel)\n          .then(removeFromGroupOpen)\n          .then(focusOnOrigin)\n          .catch(reject)\n    ]).then(done, reject);\n  });\n};\n\n/**\n * Compiles the panel, according to the passed in config and appends it to\n * the DOM. Helps normalize differences in the compilation process between\n * using a string template and a content element.\n * @returns {!Q.IPromise<!MdPanelRef>} Promise that is resolved when\n *     the element has been compiled and added to the DOM.\n * @private\n */\nMdPanelRef.prototype._compile = function() {\n  var self = this;\n\n  // Compile the element via $mdCompiler. Note that when using a\n  // contentElement, the element isn't actually being compiled, rather the\n  // compiler saves it's place in the DOM and provides a way of restoring it.\n  return self._$mdCompiler.compile(self.config).then(function(compileData) {\n    var config = self.config;\n\n    if (config.contentElement) {\n      var panelEl = compileData.element;\n\n      // Since mdPanel modifies the inline styles and CSS classes, we need\n      // to save them in order to be able to restore on close.\n      self._restoreCache.styles = panelEl[0].style.cssText;\n      self._restoreCache.classes = panelEl[0].className;\n\n      self.panelContainer = self._$mdPanel._wrapContentElement(panelEl);\n      self.panelEl = panelEl;\n    } else {\n      self.panelContainer = compileData.link(config['scope']);\n      self.panelEl = angular.element(\n        self.panelContainer[0].querySelector('.md-panel')\n      );\n    }\n\n    // Save a reference to the inner wrapper.\n    self.innerWrapper = angular.element(\n      self.panelContainer[0].querySelector('.md-panel-inner-wrapper')\n    );\n\n    // Save a reference to the cleanup function from the compiler.\n    self._compilerCleanup = compileData.cleanup;\n\n    // Attach the panel to the proper place in the DOM.\n    getElement(self.config['attachTo']).append(self.panelContainer);\n\n    return self;\n  });\n};\n\n\n/**\n * Creates a panel and adds it to the dom.\n * @returns {!Q.IPromise} A promise that is resolved when the panel is\n *     created.\n * @private\n */\nMdPanelRef.prototype._createPanel = function() {\n  var self = this;\n\n  return this._$q(function(resolve, reject) {\n    if (!self.config.locals) {\n      self.config.locals = {};\n    }\n\n    self.config.locals.mdPanelRef = self;\n\n    self._compile().then(function() {\n      if (self.config['disableParentScroll']) {\n        self._restoreScroll = self._$mdUtil.disableScrollAround(\n          null,\n          self.panelContainer,\n          { disableScrollMask: true }\n        );\n      }\n\n      // Add a custom CSS class to the panel element.\n      if (self.config['panelClass']) {\n        self.panelEl.addClass(self.config['panelClass']);\n      }\n\n      // Handle click and touch events for the panel container.\n      if (self.config['propagateContainerEvents']) {\n        self.panelContainer.css('pointer-events', 'none');\n        self.panelEl.css('pointer-events', 'all');\n      }\n\n      // Panel may be outside the $rootElement, tell ngAnimate to animate\n      // regardless.\n      if (self._$animate.pin) {\n        self._$animate.pin(\n          self.panelContainer,\n          getElement(self.config['attachTo'])\n        );\n      }\n\n      self._configureTrapFocus();\n      self._addStyles().then(function() {\n        resolve(self);\n      }, reject);\n    }, reject);\n\n  });\n};\n\n\n/**\n * Adds the styles for the panel, such as positioning and z-index. Also,\n * themes the panel element and panel container using `$mdTheming`.\n * @returns {!Q.IPromise<!MdPanelRef>}\n * @private\n */\nMdPanelRef.prototype._addStyles = function() {\n  var self = this;\n  return this._$q(function(resolve) {\n    self.panelContainer.css('z-index', self.config['zIndex']);\n    self.innerWrapper.css('z-index', self.config['zIndex'] + 1);\n\n    var hideAndResolve = function() {\n      // Theme the element and container.\n      self._setTheming();\n\n      // Remove offscreen classes and add hidden class.\n      self.panelEl.removeClass('_md-panel-offscreen');\n      self.innerWrapper.removeClass('_md-panel-offscreen');\n      self.panelContainer.addClass(MD_PANEL_HIDDEN);\n\n      resolve(self);\n    };\n\n    if (self.config['fullscreen']) {\n      self.panelEl.addClass('_md-panel-fullscreen');\n      hideAndResolve();\n      return; // Don't setup positioning.\n    }\n\n    var positionConfig = self.config['position'];\n    if (!positionConfig) {\n      hideAndResolve();\n      return; // Don't setup positioning.\n    }\n\n    // Wait for angular to finish processing the template\n    self._$rootScope['$$postDigest'](function() {\n      // Position it correctly. This is necessary so that the panel will have a\n      // defined height and width.\n      self._updatePosition(true);\n\n      // Theme the element and container.\n      self._setTheming();\n\n      resolve(self);\n    });\n  });\n};\n\n\n/**\n * Sets the `$mdTheming` classes on the `panelContainer` and `panelEl`.\n * @private\n */\nMdPanelRef.prototype._setTheming = function() {\n  this._$mdTheming(this.panelEl);\n  this._$mdTheming(this.panelContainer);\n};\n\n\n/**\n * Updates the position configuration of a panel\n * @param {!MdPanelPosition} position\n */\nMdPanelRef.prototype.updatePosition = function(position) {\n  if (!this.panelContainer) {\n    throw new Error(\n        'mdPanel: Panel does not exist yet. Call open() or attach().');\n  }\n\n  this.config['position'] = position;\n  this._updatePosition();\n};\n\n\n/**\n * Calculates and updates the position of the panel.\n * @param {boolean=} init\n * @private\n */\nMdPanelRef.prototype._updatePosition = function(init) {\n  var positionConfig = this.config['position'];\n\n  if (positionConfig) {\n    positionConfig._setPanelPosition(this.innerWrapper);\n\n    // Hide the panel now that position is known.\n    if (init) {\n      this.panelEl.removeClass('_md-panel-offscreen');\n      this.innerWrapper.removeClass('_md-panel-offscreen');\n      this.panelContainer.addClass(MD_PANEL_HIDDEN);\n    }\n\n    this.innerWrapper.css(\n      MdPanelPosition.absPosition.TOP,\n      positionConfig.getTop()\n    );\n    this.innerWrapper.css(\n      MdPanelPosition.absPosition.BOTTOM,\n      positionConfig.getBottom()\n    );\n    this.innerWrapper.css(\n      MdPanelPosition.absPosition.LEFT,\n      positionConfig.getLeft()\n    );\n    this.innerWrapper.css(\n      MdPanelPosition.absPosition.RIGHT,\n      positionConfig.getRight()\n    );\n  }\n};\n\n\n/**\n * Focuses on the panel or the first focus target.\n * @private\n */\nMdPanelRef.prototype._focusOnOpen = function() {\n  if (this.config['focusOnOpen']) {\n    // Wait for the template to finish rendering to guarantee md-autofocus has\n    // finished adding the class md-autofocus, otherwise the focusable element\n    // isn't available to focus.\n    var self = this;\n    this._$rootScope['$$postDigest'](function() {\n      var target = self._$mdUtil.findFocusTarget(self.panelEl) ||\n          self.panelEl;\n      target.focus();\n    });\n  }\n};\n\n\n/**\n * Shows the backdrop.\n * @returns {!Q.IPromise} A promise that is resolved when the backdrop\n *     is created and attached.\n * @private\n */\nMdPanelRef.prototype._createBackdrop = function() {\n  if (this.config.hasBackdrop) {\n    if (!this._backdropRef) {\n      var backdropAnimation = this._$mdPanel.newPanelAnimation()\n          .openFrom(this.config.attachTo)\n          .withAnimation({\n            open: '_md-opaque-enter',\n            close: '_md-opaque-leave'\n          });\n\n      if (this.config.animation) {\n        backdropAnimation.duration(this.config.animation._rawDuration);\n      }\n\n      var backdropConfig = {\n        animation: backdropAnimation,\n        attachTo: this.config.attachTo,\n        focusOnOpen: false,\n        panelClass: '_md-panel-backdrop',\n        zIndex: this.config.zIndex - 1\n      };\n\n      this._backdropRef = this._$mdPanel.create(backdropConfig);\n    }\n    if (!this._backdropRef.isAttached) {\n      return this._backdropRef.attach();\n    }\n  }\n};\n\n\n/**\n * Listen for escape keys and outside clicks to auto close.\n * @private\n */\nMdPanelRef.prototype._addEventListeners = function() {\n  this._configureEscapeToClose();\n  this._configureClickOutsideToClose();\n  this._configureScrollListener();\n};\n\n\n/**\n * Remove event listeners added in _addEventListeners.\n * @private\n */\nMdPanelRef.prototype._removeEventListeners = function() {\n  this._removeListeners && this._removeListeners.forEach(function(removeFn) {\n    removeFn();\n  });\n  this._removeListeners = [];\n};\n\n\n/**\n * Setup the escapeToClose event listeners.\n * @private\n */\nMdPanelRef.prototype._configureEscapeToClose = function() {\n  if (this.config['escapeToClose']) {\n    var parentTarget = getElement(this.config['attachTo']);\n    var self = this;\n\n    var keyHandlerFn = function(ev) {\n      if (ev.keyCode === self._$mdConstant.KEY_CODE.ESCAPE) {\n        ev.stopPropagation();\n        ev.preventDefault();\n\n        self.close(MdPanelRef.closeReasons.ESCAPE);\n      }\n    };\n\n    // Add keydown listeners\n    this.panelContainer.on('keydown', keyHandlerFn);\n    parentTarget.on('keydown', keyHandlerFn);\n\n    // Queue remove listeners function\n    this._removeListeners.push(function() {\n      self.panelContainer.off('keydown', keyHandlerFn);\n      parentTarget.off('keydown', keyHandlerFn);\n    });\n  }\n};\n\n\n/**\n * Setup the clickOutsideToClose event listeners.\n * @private\n */\nMdPanelRef.prototype._configureClickOutsideToClose = function() {\n  if (this.config['clickOutsideToClose']) {\n    var target = this.config['propagateContainerEvents'] ?\n        angular.element(document.body) :\n        this.panelContainer;\n    var sourceEl;\n\n    // Keep track of the element on which the mouse originally went down\n    // so that we can only close the backdrop when the 'click' started on it.\n    // A simple 'click' handler does not work, it sets the target object as the\n    // element the mouse went down on.\n    var mousedownHandler = function(ev) {\n      sourceEl = ev.target;\n    };\n\n    // We check if our original element and the target is the backdrop\n    // because if the original was the backdrop and the target was inside the\n    // panel we don't want to panel to close.\n    var self = this;\n    var mouseupHandler = function(ev) {\n      if (self.config['propagateContainerEvents']) {\n\n        // We check if the sourceEl of the event is the panel element or one\n        // of it's children. If it is not, then close the panel.\n        if (sourceEl !== self.panelEl[0] && !self.panelEl[0].contains(sourceEl)) {\n          self.close();\n        }\n\n      } else if (sourceEl === target[0] && ev.target === target[0]) {\n        ev.stopPropagation();\n        ev.preventDefault();\n\n        self.close(MdPanelRef.closeReasons.CLICK_OUTSIDE);\n      }\n    };\n\n    // Add listeners\n    target.on('mousedown', mousedownHandler);\n    target.on('mouseup', mouseupHandler);\n\n    // Queue remove listeners function\n    this._removeListeners.push(function() {\n      target.off('mousedown', mousedownHandler);\n      target.off('mouseup', mouseupHandler);\n    });\n  }\n};\n\n\n/**\n * Configures the listeners for updating the panel position on scroll.\n * @private\n*/\nMdPanelRef.prototype._configureScrollListener = function() {\n  // No need to bind the event if scrolling is disabled.\n  if (!this.config['disableParentScroll']) {\n    var updatePosition = angular.bind(this, this._updatePosition);\n    var debouncedUpdatePosition = this._$$rAF.throttle(updatePosition);\n    var self = this;\n\n    var onScroll = function() {\n      debouncedUpdatePosition();\n    };\n\n    // Add listeners.\n    this._$window.addEventListener('scroll', onScroll, true);\n\n    // Queue remove listeners function.\n    this._removeListeners.push(function() {\n      self._$window.removeEventListener('scroll', onScroll, true);\n    });\n  }\n};\n\n\n/**\n * Setup the focus traps. These traps will wrap focus when tabbing past the\n * panel. When shift-tabbing, the focus will stick in place.\n * @private\n */\nMdPanelRef.prototype._configureTrapFocus = function() {\n  // Focus doesn't remain inside of the panel without this.\n  this.panelEl.attr('tabIndex', '-1');\n  if (this.config['trapFocus']) {\n    var element = this.panelEl;\n    // Set up elements before and after the panel to capture focus and\n    // redirect back into the panel.\n    if (!FOCUS_TRAP_TEMPLATE) {\n      var template = document.createElement('div');\n      template.className = '_md-panel-focus-trap';\n      template.tabIndex = 0;\n      FOCUS_TRAP_TEMPLATE = angular.element(template);\n    }\n    this._topFocusTrap = FOCUS_TRAP_TEMPLATE.clone()[0];\n    this._bottomFocusTrap = FOCUS_TRAP_TEMPLATE.clone()[0];\n\n    // When focus is about to move out of the panel, we want to intercept it\n    // and redirect it back to the panel element.\n    var focusHandler = function() {\n      element.focus();\n    };\n    this._topFocusTrap.addEventListener('focus', focusHandler);\n    this._bottomFocusTrap.addEventListener('focus', focusHandler);\n\n    // Queue remove listeners function\n    this._removeListeners.push(this._simpleBind(function() {\n      this._topFocusTrap.removeEventListener('focus', focusHandler);\n      this._bottomFocusTrap.removeEventListener('focus', focusHandler);\n    }, this));\n\n    // The top focus trap inserted immediately before the md-panel element (as\n    // a sibling). The bottom focus trap inserted immediately after the\n    // md-panel element (as a sibling).\n    element[0].parentNode.insertBefore(this._topFocusTrap, element[0]);\n    element.after(this._bottomFocusTrap);\n  }\n};\n\n\n/**\n * Updates the animation of a panel.\n * @param {!MdPanelAnimation} animation\n */\nMdPanelRef.prototype.updateAnimation = function(animation) {\n  this.config['animation'] = animation;\n\n  if (this._backdropRef) {\n    this._backdropRef.config.animation.duration(animation._rawDuration);\n  }\n};\n\n\n/**\n * Animate the panel opening.\n * @returns {!Q.IPromise} A promise that is resolved when the panel has\n *     animated open.\n * @private\n */\nMdPanelRef.prototype._animateOpen = function() {\n  this.panelContainer.addClass('md-panel-is-showing');\n  var animationConfig = this.config['animation'];\n  if (!animationConfig) {\n    // Promise is in progress, return it.\n    this.panelContainer.addClass('_md-panel-shown');\n    return this._$q.when(this);\n  }\n\n  var self = this;\n  return this._$q(function(resolve) {\n    var done = self._done(resolve, self);\n    var warnAndOpen = function() {\n      self._$log.warn(\n          'mdPanel: MdPanel Animations failed. ' +\n          'Showing panel without animating.');\n      done();\n    };\n\n    animationConfig.animateOpen(self.panelEl)\n        .then(done, warnAndOpen);\n  });\n};\n\n\n/**\n * Animate the panel closing.\n * @returns {!Q.IPromise} A promise that is resolved when the panel has animated closed.\n * @private\n */\nMdPanelRef.prototype._animateClose = function() {\n  var self = this;\n  var animationConfig = this.config['animation'];\n\n  if (!animationConfig) {\n    this.panelContainer.removeClass('md-panel-is-showing');\n    this.panelContainer.removeClass('_md-panel-shown');\n    return this._$q.when(this);\n  } else {\n    return this._$q(function (resolve) {\n      var done = function () {\n        self.panelContainer.removeClass('md-panel-is-showing');\n        // Remove the transform so that re-used panels don't accumulate transforms.\n        self.panelEl.css('transform', '');\n        resolve(self);\n      };\n      var warnAndClose = function () {\n        self._$log.warn(\n          'mdPanel: MdPanel Animations failed. Hiding panel without animating.');\n        done();\n      };\n\n      animationConfig.animateClose(self.panelEl).then(done, warnAndClose);\n    });\n  }\n};\n\n\n/**\n * Registers a interceptor with the panel. The callback should return a promise,\n * which will allow the action to continue when it gets resolved, or will\n * prevent an action if it is rejected.\n * @param {string} type Type of interceptor.\n * @param {!Q.IPromise<!any>} callback Callback to be registered.\n * @returns {!MdPanelRef}\n */\nMdPanelRef.prototype.registerInterceptor = function(type, callback) {\n  var error = null;\n\n  if (!angular.isString(type)) {\n    error = 'Interceptor type must be a string, instead got ' + typeof type;\n  } else if (!angular.isFunction(callback)) {\n    error = 'Interceptor callback must be a function, instead got ' + typeof callback;\n  }\n\n  if (error) {\n    throw new Error('MdPanel: ' + error);\n  }\n\n  var interceptors = this._interceptors[type] = this._interceptors[type] || [];\n\n  if (interceptors.indexOf(callback) === -1) {\n    interceptors.push(callback);\n  }\n\n  return this;\n};\n\n\n/**\n * Removes a registered interceptor.\n * @param {string} type Type of interceptor to be removed.\n * @param {Function} callback Interceptor to be removed.\n * @returns {!MdPanelRef}\n */\nMdPanelRef.prototype.removeInterceptor = function(type, callback) {\n  var index = this._interceptors[type] ?\n    this._interceptors[type].indexOf(callback) : -1;\n\n  if (index > -1) {\n    this._interceptors[type].splice(index, 1);\n  }\n\n  return this;\n};\n\n\n/**\n * Removes all interceptors.\n * @param {string=} type Type of interceptors to be removed.\n *     If ommited, all interceptors types will be removed.\n * @returns {!MdPanelRef}\n */\nMdPanelRef.prototype.removeAllInterceptors = function(type) {\n  if (type) {\n    this._interceptors[type] = [];\n  } else {\n    this._interceptors = Object.create(null);\n  }\n\n  return this;\n};\n\n\n/**\n * Invokes all the interceptors of a certain type sequantially in\n *     reverse order. Works in a similar way to `$q.all`, except it\n *     respects the order of the functions.\n * @param {string} type Type of interceptors to be invoked.\n * @returns {!Q.IPromise<!MdPanelRef>}\n * @private\n */\nMdPanelRef.prototype._callInterceptors = function(type) {\n  var self = this;\n  var $q = self._$q;\n  var interceptors = self._interceptors && self._interceptors[type] || [];\n\n  return interceptors.reduceRight(function(promise, interceptor) {\n    var isPromiseLike = interceptor && angular.isFunction(interceptor.then);\n    var response = isPromiseLike ? interceptor : null;\n\n    /**\n    * For interceptors to reject/cancel subsequent portions of the chain, simply\n    * return a `$q.reject(<value>)`\n    */\n    return promise.then(function() {\n      if (!response) {\n        try {\n          response = interceptor(self);\n        } catch (e) {\n          response = $q.reject(e);\n        }\n      }\n\n     return response;\n    });\n  }, $q.resolve(self));\n};\n\n\n/**\n * Faster, more basic than angular.bind\n * http://jsperf.com/angular-bind-vs-custom-vs-native\n * @param {function} callback\n * @param {!Object} self\n * @return {function} Callback function with a bound self.\n */\nMdPanelRef.prototype._simpleBind = function(callback, self) {\n  return function(value) {\n    return callback.apply(self, value);\n  };\n};\n\n\n/**\n * @param {function|IQResolveReject} callback\n * @param {!Object} self\n * @return {function} Callback function with a self param.\n */\nMdPanelRef.prototype._done = function(callback, self) {\n  return function() {\n    callback(self);\n  };\n};\n\n\n/**\n * Adds a panel to a group if the panel does not exist within the group already.\n * A panel can only exist within a single group.\n * @param {string} groupName The name of the group.\n */\nMdPanelRef.prototype.addToGroup = function(groupName) {\n  if (!this._$mdPanel._groups[groupName]) {\n    this._$mdPanel.newPanelGroup(groupName);\n  }\n\n  var group = this._$mdPanel._groups[groupName];\n  var index = group.panels.indexOf(this);\n\n  if (index < 0) {\n    group.panels.push(this);\n  }\n};\n\n\n/**\n * Removes a panel from a group if the panel exists within that group. The group\n * must be created ahead of time.\n * @param {string} groupName The name of the group.\n */\nMdPanelRef.prototype.removeFromGroup = function(groupName) {\n  if (!this._$mdPanel._groups[groupName]) {\n    throw new Error('mdPanel: The group ' + groupName + ' does not exist.');\n  }\n\n  var group = this._$mdPanel._groups[groupName];\n  var index = group.panels.indexOf(this);\n\n  if (index > -1) {\n    group.panels.splice(index, 1);\n  }\n};\n\n\n/**\n * Possible default closeReasons for the close function.\n * @enum {string}\n */\nMdPanelRef.closeReasons = {\n  CLICK_OUTSIDE: 'clickOutsideToClose',\n  ESCAPE: 'escapeToClose',\n};\n\n\n/*****************************************************************************\n *                               MdPanelPosition                             *\n *****************************************************************************/\n\n\n/**\n * Position configuration object. To use, create an MdPanelPosition with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * Example:\n *\n * var panelPosition = new MdPanelPosition()\n *     .relativeTo(myButtonEl)\n *     .addPanelPosition(\n *       $mdPanel.xPosition.CENTER,\n *       $mdPanel.yPosition.ALIGN_TOPS\n *     );\n *\n * $mdPanel.create({\n *   position: panelPosition\n * });\n *\n * @param {!IInjectorService} $injector\n * @final @constructor\n */\nfunction MdPanelPosition($injector) {\n  /** @private @const {!IWindowService} */\n  this._$window = $injector.get('$window');\n\n  /** @private {boolean} */\n  this._isRTL = $injector.get('$mdUtil').isRtl();\n\n  /** @private @const {!angular.$mdConstant} */\n  this._$mdConstant = $injector.get('$mdConstant');\n\n  /** @private {boolean} */\n  this._absolute = false;\n\n  /** @private {!JQLite} */\n  this._relativeToEl = undefined;\n\n  /** @private {string} */\n  this._top = '';\n\n  /** @private {string} */\n  this._bottom = '';\n\n  /** @private {string} */\n  this._left = '';\n\n  /** @private {string} */\n  this._right = '';\n\n  /** @private {!Array<string>} */\n  this._translateX = [];\n\n  /** @private {!Array<string>} */\n  this._translateY = [];\n\n  /** @private {!Array<{x:string, y:string}>} */\n  this._positions = [];\n\n  /** @private {?{x:string, y:string}} */\n  this._actualPosition = undefined;\n}\n\n\n/**\n * Possible values of xPosition.\n * @enum {string}\n */\nMdPanelPosition.xPosition = {\n  CENTER: 'center',\n  ALIGN_START: 'align-start',\n  ALIGN_END: 'align-end',\n  OFFSET_START: 'offset-start',\n  OFFSET_END: 'offset-end'\n};\n\n\n/**\n * Possible values of yPosition.\n * @enum {string}\n */\nMdPanelPosition.yPosition = {\n  CENTER: 'center',\n  ALIGN_TOPS: 'align-tops',\n  ALIGN_BOTTOMS: 'align-bottoms',\n  ABOVE: 'above',\n  BELOW: 'below'\n};\n\n\n/**\n * Possible values of absolute position.\n * @enum {string}\n */\nMdPanelPosition.absPosition = {\n  TOP: 'top',\n  RIGHT: 'right',\n  BOTTOM: 'bottom',\n  LEFT: 'left'\n};\n\n/**\n * Margin between the edges of a panel and the viewport.\n * @const {number}\n */\nMdPanelPosition.viewportMargin = 8;\n\n\n/**\n * Sets absolute positioning for the panel.\n * @return {!MdPanelPosition}\n */\nMdPanelPosition.prototype.absolute = function() {\n  this._absolute = true;\n  return this;\n};\n\n\n/**\n * Sets the value of a position for the panel. Clears any previously set\n * position.\n * @param {string} position Position to set\n * @param {string=} value Value of the position. Defaults to '0'.\n * @returns {!MdPanelPosition}\n * @private\n */\nMdPanelPosition.prototype._setPosition = function(position, value) {\n  if (position === MdPanelPosition.absPosition.RIGHT ||\n      position === MdPanelPosition.absPosition.LEFT) {\n    this._left = this._right = '';\n  } else if (\n      position === MdPanelPosition.absPosition.BOTTOM ||\n      position === MdPanelPosition.absPosition.TOP) {\n    this._top = this._bottom = '';\n  } else {\n    var positions = Object.keys(MdPanelPosition.absPosition).join()\n        .toLowerCase();\n\n    throw new Error('mdPanel: Position must be one of ' + positions + '.');\n  }\n\n  this['_' +  position] = angular.isString(value) ? value : '0';\n\n  return this;\n};\n\n\n/**\n * Sets the value of `top` for the panel. Clears any previously set vertical\n * position.\n * @param {string=} top Value of `top`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.top = function(top) {\n  return this._setPosition(MdPanelPosition.absPosition.TOP, top);\n};\n\n\n/**\n * Sets the value of `bottom` for the panel. Clears any previously set vertical\n * position.\n * @param {string=} bottom Value of `bottom`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.bottom = function(bottom) {\n  return this._setPosition(MdPanelPosition.absPosition.BOTTOM, bottom);\n};\n\n\n/**\n * Sets the panel to the start of the page - `left` if `ltr` or `right` for\n * `rtl`. Clears any previously set horizontal position.\n * @param {string=} start Value of position. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.start = function(start) {\n  var position = this._isRTL ? MdPanelPosition.absPosition.RIGHT : MdPanelPosition.absPosition.LEFT;\n  return this._setPosition(position, start);\n};\n\n\n/**\n * Sets the panel to the end of the page - `right` if `ltr` or `left` for `rtl`.\n * Clears any previously set horizontal position.\n * @param {string=} end Value of position. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.end = function(end) {\n  var position = this._isRTL ? MdPanelPosition.absPosition.LEFT : MdPanelPosition.absPosition.RIGHT;\n  return this._setPosition(position, end);\n};\n\n\n/**\n * Sets the value of `left` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} left Value of `left`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.left = function(left) {\n  return this._setPosition(MdPanelPosition.absPosition.LEFT, left);\n};\n\n\n/**\n * Sets the value of `right` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} right Value of `right`. Defaults to '0'.\n * @returns {!MdPanelPosition}\n*/\nMdPanelPosition.prototype.right = function(right) {\n  return this._setPosition(MdPanelPosition.absPosition.RIGHT, right);\n};\n\n\n/**\n * Centers the panel horizontally in the viewport. Clears any previously set\n * horizontal position.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.centerHorizontally = function() {\n  this._left = '50%';\n  this._right = '';\n  this._translateX = ['-50%'];\n  return this;\n};\n\n\n/**\n * Centers the panel vertically in the viewport. Clears any previously set\n * vertical position.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.centerVertically = function() {\n  this._top = '50%';\n  this._bottom = '';\n  this._translateY = ['-50%'];\n  return this;\n};\n\n\n/**\n * Centers the panel horizontally and vertically in the viewport. This is\n * equivalent to calling both `centerHorizontally` and `centerVertically`.\n * Clears any previously set horizontal and vertical positions.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.center = function() {\n  return this.centerHorizontally().centerVertically();\n};\n\n\n/**\n * Sets element for relative positioning.\n * @param {string|!Element|!JQLite} element Query selector, DOM element,\n *     or angular element to set the panel relative to.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.relativeTo = function(element) {\n  this._absolute = false;\n  this._relativeToEl = getElement(element);\n  return this;\n};\n\n\n/**\n * Sets the x and y positions for the panel relative to another element.\n * @param {string} xPosition must be one of the MdPanelPosition.xPosition\n *     values.\n * @param {string} yPosition must be one of the MdPanelPosition.yPosition\n *     values.\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.addPanelPosition = function(xPosition, yPosition) {\n  if (!this._relativeToEl) {\n    throw new Error('mdPanel: addPanelPosition can only be used with ' +\n        'relative positioning. Set relativeTo first.');\n  }\n\n  validatePosition(MdPanelPosition.xPosition, xPosition);\n  validatePosition(MdPanelPosition.yPosition, yPosition);\n\n  this._positions.push({\n    x: xPosition,\n    y: yPosition\n  });\n\n  return this;\n};\n\n\n/**\n * Sets the value of the offset in the x-direction. This will add to any\n * previously set offsets.\n * @param {string|number|function(MdPanelPosition): string} offsetX\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.withOffsetX = function(offsetX) {\n  this._translateX.push(addUnits(offsetX));\n  return this;\n};\n\n\n/**\n * Sets the value of the offset in the y-direction. This will add to any\n * previously set offsets.\n * @param {string|number|function(MdPanelPosition): string} offsetY\n * @returns {!MdPanelPosition}\n */\nMdPanelPosition.prototype.withOffsetY = function(offsetY) {\n  this._translateY.push(addUnits(offsetY));\n  return this;\n};\n\n\n/**\n * Gets the value of `top` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getTop = function() {\n  return this._top;\n};\n\n\n/**\n * Gets the value of `bottom` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getBottom = function() {\n  return this._bottom;\n};\n\n\n/**\n * Gets the value of `left` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getLeft = function() {\n  return this._left;\n};\n\n\n/**\n * Gets the value of `right` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getRight = function() {\n  return this._right;\n};\n\n\n/**\n * Gets the value of `transform` for the panel.\n * @returns {string} representation of the translateX and translateY rules and values\n */\nMdPanelPosition.prototype.getTransform = function() {\n  var translateX = this._reduceTranslateValues('translateX', this._translateX);\n  var translateY = this._reduceTranslateValues('translateY', this._translateY);\n\n  // It's important to trim the result, because the browser will ignore the set\n  // operation if the string contains only whitespace.\n  return (translateX + ' ' + translateY).trim();\n};\n\n\n/**\n * Sets the `transform` value for an element.\n * @param {!JQLite} el\n * @returns {!JQLite}\n * @private\n */\nMdPanelPosition.prototype._setTransform = function(el) {\n  return el.css(this._$mdConstant.CSS.TRANSFORM, this.getTransform());\n};\n\n\n/**\n * True if the panel is completely on-screen with this positioning; false\n * otherwise.\n * @param {!JQLite} el\n * @return {boolean}\n * @private\n */\nMdPanelPosition.prototype._isOnscreen = function(el) {\n  // this works because we always use fixed positioning for the panel,\n  // which is relative to the viewport.\n  var left = parseInt(this.getLeft());\n  var top = parseInt(this.getTop());\n\n  if (this._translateX.length || this._translateY.length) {\n    var prefixedTransform = this._$mdConstant.CSS.TRANSFORM;\n    var offsets = getComputedTranslations(el, prefixedTransform);\n    left += offsets.x;\n    top += offsets.y;\n  }\n\n  var right = left + el[0].offsetWidth;\n  var bottom = top + el[0].offsetHeight;\n\n  return (left >= 0) &&\n    (top >= 0) &&\n    (bottom <= this._$window.innerHeight) &&\n    (right <= this._$window.innerWidth);\n};\n\n\n/**\n * Gets the first x/y position that can fit on-screen.\n * @returns {{x: string, y: string}}\n */\nMdPanelPosition.prototype.getActualPosition = function() {\n  return this._actualPosition;\n};\n\n\n/**\n * Reduces a list of translate values to a string that can be used within\n * transform.\n * @param {string} translateFn\n * @param {!Array<string>} values\n * @returns {string}\n * @private\n */\nMdPanelPosition.prototype._reduceTranslateValues =\n    function(translateFn, values) {\n      return values.map(function(translation) {\n        var translationValue = angular.isFunction(translation) ?\n            addUnits(translation(this)) : translation;\n        return translateFn + '(' + translationValue + ')';\n      }, this).join(' ');\n    };\n\n\n/**\n * Sets the panel position based on the created panel element and best x/y\n * positioning.\n * @param {!JQLite} el\n * @private\n */\nMdPanelPosition.prototype._setPanelPosition = function(el) {\n  // Remove the class in case it has been added before.\n  el.removeClass('_md-panel-position-adjusted');\n\n  // Only calculate the position if necessary.\n  if (this._absolute) {\n    this._setTransform(el);\n    return;\n  }\n\n  if (this._actualPosition) {\n    this._calculatePanelPosition(el, this._actualPosition);\n    this._setTransform(el);\n    this._constrainToViewport(el);\n    return;\n  }\n\n  for (var i = 0; i < this._positions.length; i++) {\n    this._actualPosition = this._positions[i];\n    this._calculatePanelPosition(el, this._actualPosition);\n    this._setTransform(el);\n\n    if (this._isOnscreen(el)) {\n      return;\n    }\n  }\n\n  this._constrainToViewport(el);\n};\n\n\n/**\n * Constrains a panel's position to the viewport.\n * @param {!JQLite} el\n * @private\n */\nMdPanelPosition.prototype._constrainToViewport = function(el) {\n  var margin = MdPanelPosition.viewportMargin;\n  var initialTop = this._top;\n  var initialLeft = this._left;\n\n  if (this.getTop()) {\n    var top = parseInt(this.getTop());\n    var bottom = el[0].offsetHeight + top;\n    var viewportHeight = this._$window.innerHeight;\n\n    if (top < margin) {\n      this._top = margin + 'px';\n    } else if (bottom > viewportHeight) {\n      this._top = top - (bottom - viewportHeight + margin) + 'px';\n    }\n  }\n\n  if (this.getLeft()) {\n    var left = parseInt(this.getLeft());\n    var right = el[0].offsetWidth + left;\n    var viewportWidth = this._$window.innerWidth;\n\n    if (left < margin) {\n      this._left = margin + 'px';\n    } else if (right > viewportWidth) {\n      this._left = left - (right - viewportWidth + margin) + 'px';\n    }\n  }\n\n  // Class that can be used to re-style the panel if it was repositioned.\n  el.toggleClass(\n    '_md-panel-position-adjusted',\n    this._top !== initialTop || this._left !== initialLeft\n  );\n};\n\n\n/**\n * Switches between 'start' and 'end'.\n * @param {string} position Horizontal position of the panel\n * @returns {string} Reversed position\n * @private\n */\nMdPanelPosition.prototype._reverseXPosition = function(position) {\n  if (position === MdPanelPosition.xPosition.CENTER) {\n    return position;\n  }\n\n  var start = 'start';\n  var end = 'end';\n\n  return position.indexOf(start) > -1 ? position.replace(start, end) : position.replace(end, start);\n};\n\n\n/**\n * Handles horizontal positioning in rtl or ltr environments.\n * @param {string} position Horizontal position of the panel\n * @returns {string} The correct position according the page direction\n * @private\n */\nMdPanelPosition.prototype._bidi = function(position) {\n  return this._isRTL ? this._reverseXPosition(position) : position;\n};\n\n\n/**\n * Calculates the panel position based on the created panel element and the\n * provided positioning.\n * @param {!JQLite} el\n * @param {!{x:string, y:string}} position\n * @private\n */\nMdPanelPosition.prototype._calculatePanelPosition = function(el, position) {\n\n  var panelBounds = el[0].getBoundingClientRect();\n  var panelWidth = Math.max(panelBounds.width, el[0].clientWidth);\n  var panelHeight = Math.max(panelBounds.height, el[0].clientHeight);\n\n  var targetBounds = this._relativeToEl[0].getBoundingClientRect();\n\n  var targetLeft = targetBounds.left;\n  var targetRight = targetBounds.right;\n  var targetWidth = targetBounds.width;\n\n  switch (this._bidi(position.x)) {\n    case MdPanelPosition.xPosition.OFFSET_START:\n      this._left = targetLeft - panelWidth + 'px';\n      break;\n    case MdPanelPosition.xPosition.ALIGN_END:\n      this._left = targetRight - panelWidth + 'px';\n      break;\n    case MdPanelPosition.xPosition.CENTER:\n      var left = targetLeft + (0.5 * targetWidth) - (0.5 * panelWidth);\n      this._left = left + 'px';\n      break;\n    case MdPanelPosition.xPosition.ALIGN_START:\n      this._left = targetLeft + 'px';\n      break;\n    case MdPanelPosition.xPosition.OFFSET_END:\n      this._left = targetRight + 'px';\n      break;\n  }\n\n  var targetTop = targetBounds.top;\n  var targetBottom = targetBounds.bottom;\n  var targetHeight = targetBounds.height;\n\n  switch (position.y) {\n    case MdPanelPosition.yPosition.ABOVE:\n      this._top = targetTop - panelHeight + 'px';\n      break;\n    case MdPanelPosition.yPosition.ALIGN_BOTTOMS:\n      this._top = targetBottom - panelHeight + 'px';\n      break;\n    case MdPanelPosition.yPosition.CENTER:\n      var top = targetTop + (0.5 * targetHeight) - (0.5 * panelHeight);\n      this._top = top + 'px';\n      break;\n    case MdPanelPosition.yPosition.ALIGN_TOPS:\n      this._top = targetTop + 'px';\n      break;\n    case MdPanelPosition.yPosition.BELOW:\n      this._top = targetBottom + 'px';\n      break;\n  }\n};\n\n\n/*****************************************************************************\n *                               MdPanelAnimation                            *\n *****************************************************************************/\n\n\n/**\n * Animation configuration object. To use, create an MdPanelAnimation with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * Example:\n *\n * var panelAnimation = new MdPanelAnimation()\n *     .openFrom(myButtonEl)\n *     .closeTo('.my-button')\n *     .withAnimation($mdPanel.animation.SCALE);\n *\n * $mdPanel.create({\n *   animation: panelAnimation\n * });\n *\n * @param {!IInjectorService} $injector\n * @final @constructor\n */\nfunction MdPanelAnimation($injector) {\n  /** @private @const {!angular.$mdUtil} */\n  this._$mdUtil = $injector.get('$mdUtil');\n\n  /**\n   * @private {{element: !JQLite|undefined, bounds: !DOMRect}|\n   *     undefined}\n   */\n  this._openFrom;\n\n  /**\n   * @private {{element: !JQLite|undefined, bounds: !DOMRect}|\n   *     undefined}\n   */\n  this._closeTo;\n\n  /** @private {string|{open: string, close: string}} */\n  this._animationClass = '';\n\n  /** @private {number} */\n  this._openDuration;\n\n  /** @private {number} */\n  this._closeDuration;\n\n  /** @private {number|{open: number, close: number}} */\n  this._rawDuration;\n}\n\n\n/**\n * Possible default animations.\n * @enum {string}\n */\nMdPanelAnimation.animation = {\n  SLIDE: 'md-panel-animate-slide',\n  SCALE: 'md-panel-animate-scale',\n  FADE: 'md-panel-animate-fade'\n};\n\n\n/**\n * Specifies where to start the open animation. `openFrom` accepts a\n * click event object, query selector, DOM element, or a Rect object that\n * is used to determine the bounds. When passed a click event, the location\n * of the click will be used as the position to start the animation.\n * @param {string|!Element|!Event|{top: number, left: number}} openFrom\n * @returns {!MdPanelAnimation}\n */\nMdPanelAnimation.prototype.openFrom = function(openFrom) {\n  // Check if 'openFrom' is an Event.\n  openFrom = openFrom.target ? openFrom.target : openFrom;\n\n  this._openFrom = this._getPanelAnimationTarget(openFrom);\n\n  if (!this._closeTo) {\n    this._closeTo = this._openFrom;\n  }\n  return this;\n};\n\n\n/**\n * Specifies where to animate the panel close. `closeTo` accepts a\n * query selector, DOM element, or a Rect object that is used to determine\n * the bounds.\n * @param {string|!Element|{top: number, left: number}} closeTo\n * @returns {!MdPanelAnimation}\n */\nMdPanelAnimation.prototype.closeTo = function(closeTo) {\n  this._closeTo = this._getPanelAnimationTarget(closeTo);\n  return this;\n};\n\n\n/**\n * Specifies the duration of the animation in milliseconds.\n * @param {number|{open: number, close: number}} duration\n * @returns {!MdPanelAnimation}\n */\nMdPanelAnimation.prototype.duration = function(duration) {\n  if (duration) {\n    if (angular.isNumber(duration)) {\n      this._openDuration = this._closeDuration = toSeconds(duration);\n    } else if (angular.isObject(duration)) {\n      this._openDuration = toSeconds(duration.open);\n      this._closeDuration = toSeconds(duration.close);\n    }\n  }\n\n  // Save the original value so it can be passed to the backdrop.\n  this._rawDuration = duration;\n\n  return this;\n\n  function toSeconds(value) {\n    if (angular.isNumber(value)) return value / 1000;\n  }\n};\n\n\n/**\n * Returns the element and bounds for the animation target.\n * @param {string|!Element|{top: number, left: number}} location\n * @returns {{element: !JQLite|undefined, bounds: !DOMRect}}\n * @private\n */\nMdPanelAnimation.prototype._getPanelAnimationTarget = function(location) {\n  if (angular.isDefined(location.top) || angular.isDefined(location.left)) {\n    return {\n      element: undefined,\n      bounds: {\n        top: location.top || 0,\n        left: location.left || 0\n      }\n    };\n  } else {\n    return this._getBoundingClientRect(getElement(location));\n  }\n};\n\n\n/**\n * Specifies the animation class.\n *\n * There are several default animations that can be used:\n * (MdPanelAnimation.animation)\n *   SLIDE: The panel slides in and out from the specified\n *        elements.\n *   SCALE: The panel scales in and out.\n *   FADE: The panel fades in and out.\n *\n * @param {string|{open: string, close: string}} cssClass\n * @returns {!MdPanelAnimation}\n */\nMdPanelAnimation.prototype.withAnimation = function(cssClass) {\n  this._animationClass = cssClass;\n  return this;\n};\n\n\n/**\n * Animate the panel open.\n * @param {!JQLite} panelEl\n * @returns {!Q.IPromise} A promise that is resolved when the open\n *     animation is complete.\n */\nMdPanelAnimation.prototype.animateOpen = function(panelEl) {\n  var animator = this._$mdUtil.dom.animator;\n\n  this._fixBounds(panelEl);\n  var animationOptions = {};\n\n  // Include the panel transformations when calculating the animations.\n  var panelTransform = panelEl[0].style.transform || '';\n\n  var openFrom = animator.toTransformCss(panelTransform);\n  var openTo = animator.toTransformCss(panelTransform);\n\n  switch (this._animationClass) {\n    case MdPanelAnimation.animation.SLIDE:\n      // Slide should start with opacity: 1.\n      panelEl.css('opacity', '1');\n\n      animationOptions = {\n        transitionInClass: '_md-panel-animate-enter',\n        transitionOutClass: '_md-panel-animate-leave',\n      };\n\n      var openSlide = animator.calculateSlideToOrigin(\n              panelEl, this._openFrom) || '';\n      openFrom = animator.toTransformCss(openSlide + ' ' + panelTransform);\n      break;\n\n    case MdPanelAnimation.animation.SCALE:\n      animationOptions = {\n        transitionInClass: '_md-panel-animate-enter'\n      };\n\n      var openScale = animator.calculateZoomToOrigin(\n              panelEl, this._openFrom) || '';\n      openFrom = animator.toTransformCss(panelTransform + ' ' + openScale);\n      break;\n\n    case MdPanelAnimation.animation.FADE:\n      animationOptions = {\n        transitionInClass: '_md-panel-animate-enter'\n      };\n      break;\n\n    default:\n      if (angular.isString(this._animationClass)) {\n        animationOptions = {\n          transitionInClass: this._animationClass\n        };\n      } else {\n        animationOptions = {\n          transitionInClass: this._animationClass['open'],\n          transitionOutClass: this._animationClass['close'],\n        };\n      }\n  }\n\n  animationOptions.duration = this._openDuration;\n\n  return animator\n      .translate3d(panelEl, openFrom, openTo, animationOptions);\n};\n\n\n/**\n * Animate the panel close.\n * @param {!JQLite} panelEl\n * @returns {!Q.IPromise} A promise that resolves when the close animation is complete.\n */\nMdPanelAnimation.prototype.animateClose = function(panelEl) {\n  var animator = this._$mdUtil.dom.animator;\n  var reverseAnimationOptions = {};\n\n  // Include the panel transformations when calculating the animations.\n  var panelTransform = panelEl[0].style.transform || '';\n\n  var closeFrom = animator.toTransformCss(panelTransform);\n  var closeTo = animator.toTransformCss(panelTransform);\n\n  switch (this._animationClass) {\n    case MdPanelAnimation.animation.SLIDE:\n      // Slide should start with opacity: 1.\n      panelEl.css('opacity', '1');\n      reverseAnimationOptions = {\n        transitionInClass: '_md-panel-animate-leave',\n        transitionOutClass: '_md-panel-animate-enter _md-panel-animate-leave'\n      };\n\n      var closeSlide = animator.calculateSlideToOrigin(panelEl, this._closeTo) || '';\n      closeTo = animator.toTransformCss(closeSlide + ' ' + panelTransform);\n      break;\n\n    case MdPanelAnimation.animation.SCALE:\n      reverseAnimationOptions = {\n        transitionInClass: '_md-panel-animate-scale-out _md-panel-animate-leave',\n        transitionOutClass: '_md-panel-animate-scale-out _md-panel-animate-enter _md-panel-animate-leave'\n      };\n\n      var closeScale = animator.calculateZoomToOrigin(panelEl, this._closeTo) || '';\n      closeTo = animator.toTransformCss(panelTransform + ' ' + closeScale);\n      break;\n\n    case MdPanelAnimation.animation.FADE:\n      reverseAnimationOptions = {\n        transitionInClass: '_md-panel-animate-fade-out _md-panel-animate-leave',\n        transitionOutClass: '_md-panel-animate-fade-out _md-panel-animate-enter _md-panel-animate-leave'\n      };\n      break;\n\n    default:\n      if (angular.isString(this._animationClass)) {\n        reverseAnimationOptions = {\n          transitionOutClass: this._animationClass\n        };\n      } else {\n        reverseAnimationOptions = {\n          transitionInClass: this._animationClass['close'],\n          transitionOutClass: this._animationClass['open']\n        };\n      }\n  }\n\n  reverseAnimationOptions.duration = this._closeDuration;\n\n  return animator\n      .translate3d(panelEl, closeFrom, closeTo, reverseAnimationOptions);\n};\n\n\n/**\n * Set the height and width to match the panel if not provided.\n * @param {!JQLite} panelEl\n * @private\n */\nMdPanelAnimation.prototype._fixBounds = function(panelEl) {\n  var panelWidth = panelEl[0].offsetWidth;\n  var panelHeight = panelEl[0].offsetHeight;\n\n  if (this._openFrom && this._openFrom.bounds.height == null) {\n    this._openFrom.bounds.height = panelHeight;\n  }\n  if (this._openFrom && this._openFrom.bounds.width == null) {\n    this._openFrom.bounds.width = panelWidth;\n  }\n  if (this._closeTo && this._closeTo.bounds.height == null) {\n    this._closeTo.bounds.height = panelHeight;\n  }\n  if (this._closeTo && this._closeTo.bounds.width == null) {\n    this._closeTo.bounds.width = panelWidth;\n  }\n};\n\n\n/**\n * Identify the bounding RECT for the target element.\n * @param {!JQLite} element\n * @returns {{element: !JQLite|undefined, bounds: !DOMRect}}\n * @private\n */\nMdPanelAnimation.prototype._getBoundingClientRect = function(element) {\n  if (element instanceof angular.element) {\n    return {\n      element: element,\n      bounds: element[0].getBoundingClientRect()\n    };\n  }\n};\n\n\n/*****************************************************************************\n *                                Util Methods                               *\n *****************************************************************************/\n\n\n/**\n * Returns the angular element associated with a css selector or element.\n * @param el {string|!JQLite|!Element}\n * @returns {!JQLite}\n */\nfunction getElement(el) {\n  var queryResult = angular.isString(el) ?\n      document.querySelector(el) : el;\n  return angular.element(queryResult);\n}\n\n/**\n * Gets the computed values for an element's translateX and translateY in px.\n * @param {!JQLite|!Element} el the element to evaluate\n * @param {string} property\n * @return {{x: number, y: number}} an element's translateX and translateY in px\n */\nfunction getComputedTranslations(el, property) {\n  // The transform being returned by `getComputedStyle` is in the format:\n  // `matrix(a, b, c, d, translateX, translateY)` if defined and `none`\n  // if the element doesn't have a transform.\n  var transform = getComputedStyle(el[0] || el)[property];\n  var openIndex = transform.indexOf('(');\n  var closeIndex = transform.lastIndexOf(')');\n  var output = { x: 0, y: 0 };\n\n  if (openIndex > -1 && closeIndex > -1) {\n    var parsedValues = transform\n      .substring(openIndex + 1, closeIndex)\n      .split(', ')\n      .slice(-2);\n\n    output.x = parseInt(parsedValues[0]);\n    output.y = parseInt(parsedValues[1]);\n  }\n\n  return output;\n}\n\n/*\n * Ensures that a value is a valid position name. Throw an exception if not.\n * @param {Object} positionMap Object against which the value will be checked.\n * @param {string} value\n */\nfunction validatePosition(positionMap, value) {\n  // empty is ok\n  if (value === null || angular.isUndefined(value)) {\n    return;\n  }\n\n  var positionKeys = Object.keys(positionMap);\n  var positionValues = [];\n\n  for (var key, i = 0; key = positionKeys[i]; i++) {\n    var position = positionMap[key];\n    positionValues.push(position);\n\n    if (position === value) {\n      return;\n    }\n  }\n\n  throw new Error('Panel position only accepts the following values:\\n' +\n    positionValues.join(' | '));\n}\n\n/**\n * Adds units to a number value.\n * @param {string|number} value\n * @return {string}\n */\nfunction addUnits(value) {\n  return angular.isNumber(value) ? value + 'px' : value;\n}\n"
  },
  {
    "path": "src/components/panel/panel.scss",
    "content": ".md-panel-outer-wrapper {\n  height: 100%;\n  left: 0;\n  position: absolute;\n  top: 0;\n  width: 100%;\n}\n\n.md-panel-inner-wrapper {\n  position: fixed;\n}\n\n._md-panel-offscreen {\n  left: -9999px;\n}\n\n._md-panel-hidden {\n  display: none;\n}\n\n// Only used when no animations are present.\n._md-panel-shown .md-panel {\n  opacity: 1;\n  transition: none;\n}\n\n.md-panel {\n  opacity: 0;\n  position: relative;\n\n  &._md-panel-shown {\n    // Only used when custom animations are present.\n    // Overridden by the default animations.\n    opacity: 1;\n    transition: none;\n  }\n\n  &._md-panel-animate-enter {\n    opacity: 1;\n    transition: $material-enter;\n  }\n\n  &._md-panel-animate-leave {\n    opacity: 1;\n    transition: $material-leave;\n  }\n\n  &._md-panel-animate-scale-out,\n  &._md-panel-animate-fade-out {\n    opacity: 0;\n  }\n\n  &._md-panel-backdrop {\n    height: 100%;\n    position: fixed;\n    width: 100%;\n  }\n\n  &._md-opaque-enter {\n    opacity: .48;\n    transition: opacity $material-enter-duration $material-enter-timing-function;\n  }\n\n  &._md-opaque-leave {\n    transition: opacity $material-leave-duration $material-leave-timing-function;\n  }\n}\n\n._md-panel-fullscreen {\n  border-radius: 0;\n  left: 0;\n  min-height: 100%;\n  min-width: 100%;\n  position: fixed;\n  top: 0;\n}\n"
  },
  {
    "path": "src/components/panel/panel.spec.js",
    "content": "describe('$mdPanel', function() {\n  var $mdPanelProvider, $mdPanel, $rootScope, $rootEl, $templateCache, $q,\n      $material, $mdConstant, $mdUtil, $animate, $$rAF, $window;\n  var panelRef;\n  var attachedElements = [];\n  var PANEL_WRAPPER = '.md-panel-outer-wrapper';\n  var PANEL_WRAPPER_CLASS = 'md-panel-outer-wrapper';\n  var PANEL_EL = '.md-panel';\n  var PANEL_EL_CLASS = 'md-panel';\n  var INNER_WRAPPER = '.md-panel-inner-wrapper';\n  var INNER_WRAPPER_CLASS = 'md-panel-inner-wrapper';\n  var HIDDEN_CLASS = '_md-panel-hidden';\n  var FOCUS_TRAPS_CLASS = '._md-panel-focus-trap';\n  var FULLSCREEN_CLASS = '_md-panel-fullscreen';\n  var BACKDROP_CLASS = '._md-panel-backdrop';\n  var DEFAULT_TEMPLATE = '<div>Hello World!</div>';\n  var DEFAULT_CONFIG = { template: DEFAULT_TEMPLATE };\n  var PANEL_ID_PREFIX = 'panel_';\n  var SCROLL_MASK_CLASS = '.md-scroll-mask';\n  var ADJUSTED_CLASS = '_md-panel-position-adjusted';\n  var VIEWPORT_MARGIN = 8;\n\n  /**\n   * @param {!IInjectorService} $injector\n   * @ngInject\n   */\n  var injectLocals = function($injector) {\n    $mdPanel = $injector.get('$mdPanel');\n    $rootScope = $injector.get('$rootScope');\n    $rootEl = $injector.get('$rootElement');\n    $templateCache = $injector.get('$templateCache');\n    $q = $injector.get('$q');\n    $material = $injector.get('$material');\n    $mdConstant = $injector.get('$mdConstant');\n    $mdUtil = $injector.get('$mdUtil');\n    $animate = $injector.get('$animate');\n    $window = $injector.get('$window');\n    $$rAF = $injector.get('$$rAF');\n  };\n\n  beforeEach(function() {\n    module('material.components.panel', 'ngSanitize');\n    module(['$mdPanelProvider', function(_$mdPanelProvider) {\n      $mdPanelProvider = _$mdPanelProvider;\n    }]);\n\n    inject(injectLocals);\n    $animate.enabled(false);\n\n    // By default, the panel is attached to $rootElement, so add it to the DOM.\n    attachToBody($rootEl);\n  });\n\n  // Add custom matchers.\n  beforeEach(function() {\n    jasmine.addMatchers({\n      /**\n       * Asserts that two values are within a range of each other. This is\n       * used for testing relative positioning. If no range is set, defaults\n       * to 1.\n       *\n       * Example Use:\n       * expect(panelTop).toBeApproximately(buttonTop, 1);\n       */\n      toBeApproximately: function() {\n        return {\n          compare: function(actual, expected, opt_epsilon) {\n            var epsilon = opt_epsilon || 1;\n\n            var actualNumber = parseFloat(actual);\n            var expectedNumber = parseFloat(expected);\n\n            var pass = Math.abs(expectedNumber - actualNumber) < epsilon;\n            var not = pass ? 'not ' : '';\n\n            return {\n              pass: pass,\n              message: 'Expected ' + expected + not + ' to be within ' +\n              epsilon + ' of ' + actual\n            };\n          }\n        };\n      }\n    });\n  });\n\n  afterEach(function() {\n    attachedElements.forEach(function(el) {\n      el.remove();\n    });\n    attachedElements = [];\n\n    if (panelRef && panelRef.isAttached) {\n      panelRef.close();\n    }\n\n    // TODO(ErinCoughlan) - Remove when close destroys.\n    panelRef = null;\n    $animate.enabled(true);\n  });\n\n  describe('provider logic', function() {\n    var preset = {\n      panelClass: 'preset-container',\n      template: DEFAULT_TEMPLATE\n    };\n    var preset2 = {\n      panelClass: 'preset2-container',\n      template: DEFAULT_TEMPLATE\n    };\n    var preset3 = {\n      panelClass: 'preset-container',\n      template: '<div>This is cool!</div>'\n    };\n\n    afterEach(function() {\n      $mdPanelProvider.clearPresets();\n    });\n\n    it('should have the $mdPanelProvider available', function() {\n      var provider = $mdPanelProvider;\n\n      expect(provider).toBeDefined();\n    });\n\n    it('should allow for a custom preset configuration object to be defined ' +\n        'and stored in the $mdPanelProvider', function() {\n      $mdPanelProvider.definePreset('testPreset', preset);\n\n      expect(Object.keys($mdPanelProvider.getAllPresets()).length).toBe(1);\n    });\n\n    it('should allow for more than one custom preset configuration objects ' +\n        'to be defined and stored in the $mdPanelProvider', function() {\n      $mdPanelProvider.definePreset('testPreset', preset);\n      $mdPanelProvider.definePreset('testPreset2', preset2);\n\n      expect(Object.keys($mdPanelProvider.getAllPresets()).length).toBe(2);\n    });\n\n    it('should throw if a custom preset configuration object doesn\\'t have ' +\n        'a preset name or proper preset config object', function() {\n      var expression;\n\n      expression = function() {\n        $mdPanelProvider.definePreset(preset);\n      };\n\n      expect(expression).toThrow();\n\n      expression = function() {\n        $mdPanelProvider.definePreset('testPreset');\n      };\n\n      expect(expression).toThrow();\n    });\n\n    it('should throw if requesting to define an already defined preset',\n        function() {\n      $mdPanelProvider.definePreset('testPreset', preset);\n\n      var expression = function() {\n        $mdPanelProvider.definePreset('testPreset', preset);\n      };\n\n      expect(expression).toThrow();\n    });\n\n    it('should retrieve and apply a preset when the preset name is provided ' +\n        'during the create or open method', function() {\n      $mdPanelProvider.definePreset('testPreset', preset);\n\n      openPanel('testPreset');\n\n      expect(PANEL_EL + '.preset-container').toContainHtml('Hello World!');\n    });\n\n    it('should throw if trying to retrieve a preset during the create or ' +\n        'open method that has not been created', function() {\n      var expression = function() {\n        $mdPanel.create('testPreset');\n      };\n\n      expect(expression).toThrow();\n\n      expression = function() {\n        $mdPanel.open('testPreset');\n      };\n\n      expect(expression).toThrow();\n    });\n  });\n\n  it('should create and open a basic panel', function() {\n    openPanel(DEFAULT_CONFIG);\n\n    expect(PANEL_EL).toExist();\n    expect(panelRef.isAttached).toEqual(true);\n\n    closePanel();\n\n    expect(PANEL_EL).not.toExist();\n    expect(panelRef.isAttached).toEqual(false);\n  });\n\n  it('should add and remove a panel from the DOM', function() {\n    expect(PANEL_EL).not.toExist();\n\n    openPanel(DEFAULT_CONFIG);\n\n    expect(PANEL_EL).toExist();\n\n    closePanel();\n\n    expect(PANEL_EL).not.toExist();\n  });\n\n  it('should remove a panel from the DOM when the scope is destroyed', function() {\n    openPanel();\n\n    expect(PANEL_EL).toExist();\n\n    panelRef.config.scope.$destroy();\n\n    expect(PANEL_EL).not.toExist();\n  });\n\n  it('should hide and show a panel in the DOM', function() {\n    openPanel(DEFAULT_CONFIG);\n\n    expect(PANEL_EL).toExist();\n    expect(PANEL_WRAPPER).not.toHaveClass(HIDDEN_CLASS);\n\n    hidePanel();\n\n    expect(PANEL_EL).toExist();\n    expect(PANEL_WRAPPER).toHaveClass(HIDDEN_CLASS);\n\n    showPanel();\n\n    expect(PANEL_EL).toExist();\n    expect(PANEL_WRAPPER).not.toHaveClass(HIDDEN_CLASS);\n  });\n\n  it('destroy should clear the config locals on the panelRef', function () {\n    openPanel(DEFAULT_CONFIG);\n\n    expect(panelRef.config.locals).not.toEqual(null);\n\n    panelRef.destroy();\n\n    expect(panelRef.config.locals).toEqual(null);\n  });\n\n  it('destroy should destroy the panel scope', function () {\n    openPanel(DEFAULT_CONFIG);\n\n    expect(panelRef.config.scope.$$destroyed).toBe(false);\n\n    panelRef.destroy();\n\n    expect(panelRef.config.scope.$$destroyed).toBe(true);\n  });\n\n  describe('promises logic:', function() {\n    var config;\n\n    beforeEach(function() {\n      config = {\n        animation: $mdPanel.newPanelAnimation().withAnimation($mdPanel.animation.FADE)\n      };\n\n      panelRef = $mdPanel.create(config);\n      expect(panelRef.isAttached).toEqual(false);\n    });\n\n    it('should resolve when opening/closing', function() {\n      var openResolved = false;\n      var closeResolved = false;\n\n      expect(panelRef.id).toBeDefined();\n      expect(panelRef.open).toBeOfType('function');\n      expect(panelRef.close).toBeOfType('function');\n\n      panelRef.open().then(function() { openResolved = true; });\n      flushPanel();\n\n      expect(openResolved).toBe(true);\n      expect(PANEL_WRAPPER).toExist();\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n      expect(panelRef.isAttached).toEqual(true);\n\n      panelRef.close().then(function() { closeResolved = true; });\n      flushPanel();\n\n      expect(closeResolved).toBe(true);\n      expect(panelRef.isAttached).toEqual(false);\n      expect(PANEL_WRAPPER).not.toExist();\n    });\n\n    it('should reject on create when opening', function() {\n      var openRejected = false;\n\n      panelRef._createPanel = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.open().catch(function() { openRejected = true; });\n      flushPanel();\n\n      expect(openRejected).toBe(true);\n      expect(panelRef.isAttached).toEqual(false);\n    });\n\n    it('should reject on attach when opening', function() {\n      var openRejected = false;\n\n      panelRef.attach = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.open().catch(function() { openRejected = true; });\n      flushPanel();\n\n      expect(openRejected).toBe(true);\n      expect(panelRef.isAttached).toEqual(false);\n    });\n\n    it('should resolve on animate failure when opening', function() {\n      var openResolved = false;\n\n      panelRef.config.animation.animateOpen = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.open().then(function() { openResolved = true; });\n      flushPanel();\n\n      expect(openResolved).toBe(true);\n      expect(panelRef.isAttached).toEqual(true);\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n    });\n\n    it('should reject on show when opening', function() {\n      var openRejected = false;\n\n      panelRef.show = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.open().catch(function() { openRejected = true; });\n      flushPanel();\n\n      expect(openRejected).toBe(true);\n      expect(panelRef.isAttached).toEqual(true);\n      expect(panelRef.panelContainer).toHaveClass(HIDDEN_CLASS);\n    });\n\n    it('should reject on hide when closing', function() {\n      var closeRejected = false;\n\n      openPanel();\n\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n      expect(panelRef.isAttached).toEqual(true);\n\n      panelRef.hide = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.close().catch(function() { closeRejected = true; });\n      flushPanel();\n\n      expect(closeRejected).toBe(true);\n      expect(panelRef.isAttached).toEqual(true);\n    });\n\n    it('should resolve on animate failure when closing', function() {\n      var closeResolved = false;\n\n      openPanel();\n\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n      expect(panelRef.isAttached).toEqual(true);\n\n      panelRef.config.animation.animateClose = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.close().then(function() { closeResolved = true; });\n      flushPanel();\n\n      expect(closeResolved).toBe(true);\n      expect(panelRef.isAttached).toEqual(false);\n      expect(panelRef.panelContainer).toHaveClass(HIDDEN_CLASS);\n    });\n\n    it('should reject on detach when closing', function() {\n      var closeRejected = false;\n\n      openPanel();\n\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n      expect(panelRef.isAttached).toEqual(true);\n\n      panelRef.detach = function() {\n        return panelRef._$q.reject();\n      };\n\n      panelRef.close().catch(function() { closeRejected = true; });\n      flushPanel();\n\n      expect(closeRejected).toBe(true);\n      expect(panelRef.isAttached).toEqual(true);\n    });\n\n    it('should handle calling open multiple times', function() {\n      var resolve1 = false;\n      var resolve2 = false;\n      var resolve3 = false;\n\n      // Test twice in a row before flushing.\n      panelRef.open().then(function() { resolve1 = true; });\n      panelRef.open().then(function() { resolve2 = true; });\n\n      flushPanel();\n\n      // Test again after a flush.\n      panelRef.open().then(function() { resolve3 = true; });\n\n      flushPanel();\n\n      expect(resolve1).toBe(true);\n      expect(resolve2).toBe(true);\n      expect(resolve3).toBe(true);\n      expect(panelRef.isAttached).toEqual(true);\n    });\n  });\n\n  describe('config options:', function() {\n\n    it('should not recreate a panel that is tracked by a user-defined id',\n        function() {\n      var config = {\n        id: 'custom-id'\n      };\n\n      var panel1 = $mdPanel.create(config);\n      panel1.open();\n      flushPanel();\n\n      var panels = document.querySelectorAll(PANEL_EL);\n      expect(panels.length).toEqual(1);\n\n      var panel2 = $mdPanel.create(config);\n      panel2.open();\n      flushPanel();\n\n      panels = document.querySelectorAll(PANEL_EL);\n      expect(panels.length).toEqual(1);\n\n      expect(panel1).toEqual(panel2);\n\n      panel1.close();\n    });\n\n    it('should update the config of a panel that is tracked by a ' +\n        'user-defined id when attempting to create the panel more ' +\n        'than one time', function() {\n      var config;\n\n      config = {\n        id: 'custom-id',\n        panelClass: 'custom-class'\n      };\n\n      openPanel(config);\n\n      expect(panelRef.panelEl).toHaveClass('custom-class');\n\n      closePanel();\n      panelRef = undefined;\n\n      config = {\n        id: 'custom-id',\n        panelClass: 'custom-class-2'\n      };\n\n      openPanel(config);\n\n      expect(panelRef.panelEl).toHaveClass('custom-class-2');\n    });\n\n    it('should allow multiple panels', function() {\n      var customClass = 'custom-class';\n\n      var config1 = {\n        panelClass: customClass,\n        template: DEFAULT_TEMPLATE\n      };\n\n      var panel1 = $mdPanel.create(config1);\n      var panel2 = $mdPanel.create(DEFAULT_CONFIG);\n\n      panel1.open();\n      panel2.open();\n      flushPanel();\n\n      var panels = document.querySelectorAll(PANEL_EL);\n      expect(panels[0]).toHaveClass(customClass);\n      expect(panels[1]).not.toHaveClass(customClass);\n\n      panel1.close();\n      panel2.close();\n    });\n\n    describe('should attach panel to a specific element', function() {\n      var parentEl;\n\n      beforeEach(function() {\n        parentEl = document.createElement('div');\n        parentEl.id = 'parent';\n        attachToBody(parentEl);\n      });\n\n      it('using an Element', function() {\n        var config = {\n          attachTo: parentEl,\n          template: DEFAULT_TEMPLATE\n        };\n\n        openPanel(config);\n\n        var panelWrapperEl = document.querySelector(PANEL_WRAPPER);\n        expect(panelWrapperEl.parentElement).toBe(parentEl);\n\n        closePanel();\n\n        expect(parentEl.childElementCount).toEqual(0);\n      });\n\n      it('using an JQLite Object', function() {\n        var config = {\n          attachTo: angular.element(parentEl),\n          template: DEFAULT_TEMPLATE\n        };\n\n        openPanel(config);\n\n        var panelWrapperEl = document.querySelector(PANEL_WRAPPER);\n        expect(panelWrapperEl.parentElement).toBe(parentEl);\n\n        closePanel();\n\n        expect(parentEl.childElementCount).toEqual(0);\n      });\n\n      it('using a query selector', function() {\n        var config = {\n          attachTo: '#parent',\n          template: DEFAULT_TEMPLATE\n        };\n\n        openPanel(config);\n\n        var panelWrapperEl = document.querySelector(PANEL_WRAPPER);\n        expect(panelWrapperEl.parentElement).toBe(parentEl);\n\n        closePanel();\n\n        expect(parentEl.childElementCount).toEqual(0);\n      });\n    });\n\n    describe('should cause the propagation of events', function() {\n      var config, wrapper;\n\n      it('to be stopped when propagateContainerEvents=false', function() {\n        config = {\n          propagateContainerEvents: false,\n          template: DEFAULT_TEMPLATE\n        };\n\n        openPanel(config);\n\n        wrapper = angular.element(document.querySelector(PANEL_WRAPPER));\n        expect(wrapper.css('pointer-events')).not.toEqual('none');\n      });\n\n      it('to NOT be stopped when propagateContainerEvents=true', function() {\n        config = {\n          propagateContainerEvents: true,\n          template: DEFAULT_TEMPLATE\n        };\n\n        openPanel(config);\n\n        wrapper = angular.element(document.querySelector(PANEL_WRAPPER));\n        expect(wrapper.css('pointer-events')).toEqual('none');\n      });\n    });\n\n    it('should apply a custom css class to the panel', function() {\n      var customClass = 'custom-class';\n\n      var config = {\n        panelClass: customClass,\n        template: DEFAULT_TEMPLATE\n      };\n\n      openPanel(config);\n\n      expect('.custom-class').toExist();\n      expect(PANEL_EL).toHaveClass(customClass);\n    });\n\n    it('should set the z-index on the panel-container', function() {\n      var zIndex = '150';\n\n      var config = {\n        template: DEFAULT_TEMPLATE,\n        zIndex: zIndex\n      };\n\n      openPanel(config);\n\n      // We have to use `toMatch` here, because IE11 is sometimes returning an integer instead of\n      // an string.\n      expect(document.querySelector(PANEL_WRAPPER).style.zIndex)\n          .toMatch(zIndex);\n    });\n\n    it('should set z-index to 0', function() {\n      var zIndex = '0';\n\n      var config = {\n        template: DEFAULT_TEMPLATE,\n        zIndex: zIndex\n      };\n\n      openPanel(config);\n\n      // We have to use `toMatch` here, because IE11 is sometimes returning an integer instead of\n      // an string.\n      expect(document.querySelector(PANEL_WRAPPER).style.zIndex)\n          .toMatch(zIndex);\n    });\n\n    it('should not close when clickOutsideToClose set to false', function() {\n      openPanel();\n\n      clickPanelContainer();\n\n      expect(PANEL_EL).toExist();\n    });\n\n    it('should close when clickOutsideToClose set to true', function() {\n      var config = {\n        clickOutsideToClose: true\n      };\n\n      openPanel(config);\n\n      clickPanelContainer();\n\n      // TODO(ErinCoughlan) - Add this when destroy is added.\n      // expect(panelRef).toBeUndefined();\n      expect(PANEL_EL).not.toExist();\n    });\n\n    it('should close when clickOutsideToClose set to true and ' +\n        'propagateContainerEvents is also set to true', function() {\n          var config = {\n            propagateContainerEvents: true,\n            clickOutsideToClose: true\n          };\n\n          openPanel(config);\n\n          clickPanelContainer(getElement('body'));\n\n          expect(PANEL_EL).not.toExist();\n        });\n\n    it('should not close when escapeToClose set to false', function() {\n      openPanel();\n\n      pressEscape();\n\n      expect(PANEL_EL).toExist();\n    });\n\n    it('should close when escapeToClose set to true', function() {\n      var config = {\n        escapeToClose: true\n      };\n\n      openPanel(config);\n\n      pressEscape();\n\n      // TODO(ErinCoughlan) - Add this when destroy is added.\n      // expect(panelRef).toBeUndefined();\n      expect(PANEL_EL).not.toExist();\n    });\n\n    it('should call onCloseSuccess if provided after the panel finishes ' +\n        'closing', function() {\n          var closeReason, closePanelRef;\n          var onCloseSuccessCalled = false;\n\n          var onCloseSuccess = function(panelRef, reason) {\n            closePanelRef = panelRef;\n            closeReason = reason;\n            onCloseSuccessCalled = true;\n            return $q.when(this);\n          };\n\n          var config = angular.extend(\n              {'onCloseSuccess': onCloseSuccess }, DEFAULT_CONFIG);\n\n          openPanel(config);\n          closePanel();\n\n          expect(onCloseSuccessCalled).toBe(true);\n          expect(closeReason).toBe(undefined);\n          expect(closePanelRef).toBe(panelRef);\n    });\n\n    it('should call onCloseSuccess with \"clickOutsideToClose\" if close ' +\n        'is triggered by clicking on the panel container', function() {\n          var closeReason, closePanelRef;\n          var onCloseSuccessCalled = false;\n\n          var onCloseSuccess = function(panelRef, reason) {\n            closePanelRef = panelRef;\n            closeReason = reason;\n            onCloseSuccessCalled = true;\n            return $q.when(this);\n          };\n\n          var config = angular.extend({'onCloseSuccess': onCloseSuccess,\n              clickOutsideToClose: true, }, DEFAULT_CONFIG);\n\n          openPanel(config);\n          clickPanelContainer();\n\n          expect(onCloseSuccessCalled).toBe(true);\n          expect(closeReason).toBe($mdPanel.closeReasons.CLICK_OUTSIDE);\n          expect(closePanelRef).toBe(panelRef);\n    });\n\n    it('should call onCloseSuccess with \"escapeToClose\" if close ' +\n        'is triggered by pressing escape', function() {\n          var closePanelRef, closeReason;\n          var onCloseSuccessCalled = false;\n\n          var onCloseSuccess = function(panelRef, reason) {\n            closePanelRef = panelRef;\n            closeReason = reason;\n            onCloseSuccessCalled = true;\n            return $q.when(this);\n          };\n\n          var config = angular.extend({'onCloseSuccess': onCloseSuccess,\n              escapeToClose: true }, DEFAULT_CONFIG);\n\n          openPanel(config);\n          pressEscape();\n\n          expect(onCloseSuccessCalled).toBe(true);\n          expect(closeReason).toBe($mdPanel.closeReasons.ESCAPE);\n          expect(closePanelRef).toBe(panelRef);\n    });\n\n    it('should create and cleanup focus traps', function() {\n      var config = { template: DEFAULT_TEMPLATE, trapFocus: true };\n\n      openPanel(config);\n\n      // It should add two focus traps to the document around the panel content.\n      var focusTraps = document.querySelectorAll(FOCUS_TRAPS_CLASS);\n      expect(focusTraps.length).toBe(2);\n\n      var topTrap = focusTraps[0];\n      var bottomTrap = focusTraps[1];\n\n      var panel = panelRef.panelEl;\n      var isPanelFocused = false;\n      panel[0].addEventListener('focus', function() {\n        isPanelFocused = true;\n      });\n\n      // Both of the focus traps should be in the normal tab order.\n      expect(topTrap.tabIndex).toBe(0);\n      expect(bottomTrap.tabIndex).toBe(0);\n\n      // TODO(KarenParker): Find a way to test that focusing the traps redirects focus to the\n      // md-dialog element. Firefox is problematic here, as calling element.focus() inside of\n      // a focus event listener seems not to immediately update the document.activeElement.\n      // This is a behavior better captured by an e2e test.\n\n      closePanel();\n\n      // All of the focus traps should be removed when the dialog is closed.\n      focusTraps = document.querySelectorAll(FOCUS_TRAPS_CLASS);\n      expect(focusTraps.length).toBe(0);\n    });\n\n    it('should not create focus traps when trapFocus=false', function() {\n      openPanel(DEFAULT_CONFIG);\n\n      // It should add two focus traps to the document around the panel content.\n      var focusTraps = document.querySelectorAll(FOCUS_TRAPS_CLASS);\n      expect(focusTraps.length).toBe(0);\n    });\n\n    it('should focus on open', function() {\n      var template = '<button  id=\"donuts\" md-autofocus>Donuts</button>';\n      var config = { template: template };\n\n      openPanel(config);\n\n      expect(angular.element(document.activeElement).attr('id')).toBe('donuts');\n    });\n\n    it('should not focus on open when focusOnOpen=false', function() {\n      var template = '<button id=\"donuts\" md-autofocus>Donuts</button>';\n      var config = {\n        focusOnOpen: false,\n        template: template\n      };\n\n      openPanel(config);\n\n      expect(angular.element(document.activeElement).attr('id')).not.toBe('donuts');\n    });\n\n    it('should not be fullscreen by default', function() {\n      openPanel();\n      expect(PANEL_EL).not.toHaveClass(FULLSCREEN_CLASS);\n    });\n\n    it('should be fullscreen when fullscreen=true', function() {\n      var config = { fullscreen: true };\n\n      openPanel(config);\n      expect(PANEL_EL).toHaveClass(FULLSCREEN_CLASS);\n    });\n\n    it('should default backdrop to false', function() {\n      openPanel(DEFAULT_CONFIG);\n      expect(BACKDROP_CLASS).not.toExist();\n    });\n\n    it('should show backdrop when hasBackdrop=true', function() {\n      var config = { template: DEFAULT_TEMPLATE, hasBackdrop: true };\n\n      openPanel(config);\n      expect(BACKDROP_CLASS).toExist();\n\n      closePanel();\n      expect(BACKDROP_CLASS).not.toExist();\n    });\n\n    it('should close when clickOutsideToClose and hasBackdrop are set to true',\n        function() {\n          var config = {\n            template: DEFAULT_TEMPLATE,\n            clickOutsideToClose: true,\n            hasBackdrop: true\n          };\n\n          openPanel(config);\n\n          expect(PANEL_EL).toExist();\n          expect(BACKDROP_CLASS).toExist();\n\n          // Can't access the closePromise so mock it out.\n          var closeCalled = false;\n          panelRef.close = function() {\n            closeCalled = true;\n            return panelRef._$q.when(self);\n          };\n\n          clickPanelContainer();\n\n          expect(closeCalled).toBe(true);\n        });\n\n    it('should disable scrolling when disableParentScroll is true', function() {\n      var config = {\n        template: DEFAULT_TEMPLATE,\n        disableParentScroll: true,\n      };\n      spyOn($mdUtil, 'disableScrollAround').and.callThrough();\n\n      openPanel(config);\n      expect(PANEL_EL).toExist();\n      expect(SCROLL_MASK_CLASS).not.toExist();\n      closePanel();\n\n      expect($mdUtil.disableScrollAround).toHaveBeenCalled();\n    });\n\n    describe('animation hooks: ', function() {\n      it('should call onDomAdded if provided when adding the panel to the DOM',\n          function() {\n            var onDomAddedCalled = false;\n            var onDomAdded = function() {\n              onDomAddedCalled = true;\n              return $q.when(this);\n            };\n            var config = angular.extend(\n                {'onDomAdded': onDomAdded}, DEFAULT_CONFIG);\n\n            panelRef = $mdPanel.create(config);\n            panelRef.attach();\n            flushPanel();\n\n            expect(onDomAddedCalled).toBe(true);\n            expect(PANEL_EL).toExist();\n            expect(PANEL_WRAPPER).toHaveClass(HIDDEN_CLASS);\n          });\n\n      it('should continue resolving when onDomAdded resolves', function() {\n        var attachResolved = false;\n        var onDomAddedCalled = false;\n        var onDomAdded = function() {\n          onDomAddedCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend(\n            {'onDomAdded': onDomAdded}, DEFAULT_CONFIG);\n\n        expect(PANEL_EL).not.toExist();\n\n        panelRef = $mdPanel.create(config);\n        panelRef.open().then(function() {\n          attachResolved = true;\n        });\n        flushPanel();\n\n        expect(onDomAddedCalled).toBe(true);\n        expect(PANEL_EL).toExist();\n        expect(attachResolved).toBe(true);\n        expect(panelRef.isAttached).toEqual(true);\n        expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n      });\n\n      it('should reject open when onDomAdded rejects', function() {\n        var openRejected = false;\n        var onDomAddedCalled = false;\n        var onDomAdded = function() {\n          onDomAddedCalled = true;\n          return $q.reject();\n        };\n        var config = angular.extend(\n            {'onDomAdded': onDomAdded}, DEFAULT_CONFIG);\n\n        panelRef = $mdPanel.create(config);\n        panelRef.open().catch(function() {\n          openRejected = true;\n        });\n        flushPanel();\n\n        expect(onDomAddedCalled).toBe(true);\n        expect(openRejected).toBe(true);\n        expect(panelRef.isAttached).toEqual(true);\n        expect(panelRef.panelContainer).toHaveClass(HIDDEN_CLASS);\n      });\n\n      it('should call onOpenComplete if provided after adding the panel to the ' +\n          'DOM and animating', function() {\n            var onOpenCompleteCalled = false;\n            var onOpenComplete = function() {\n              onOpenCompleteCalled = true;\n              return $q.when(this);\n            };\n            var config = angular.extend(\n                {'onOpenComplete': onOpenComplete}, DEFAULT_CONFIG);\n\n            openPanel(config);\n\n            expect(onOpenCompleteCalled).toBe(true);\n            expect(PANEL_EL).toExist();\n            expect(PANEL_WRAPPER).not.toHaveClass(HIDDEN_CLASS);\n          });\n\n      it('should call onRemoving if provided after hiding the panel but before ' +\n          'the panel is removed', function() {\n            var onRemovingCalled = false;\n            var onDomRemovedCalled = false;\n            var onRemoving = function() {\n              onRemovingCalled = true;\n              return $q.when(this);\n            };\n            var onDomRemoved = function() {\n              onDomRemovedCalled = true;\n              return $q.when(this);\n            };\n            var config = angular.extend({'onRemoving': onRemoving,\n              'onDomRemoved': onDomRemoved}, DEFAULT_CONFIG);\n\n            openPanel(config);\n            hidePanel();\n\n            expect(onRemovingCalled).toBe(true);\n            expect(onDomRemovedCalled).toBe(false);\n            expect(PANEL_EL).toExist();\n          });\n\n      it('should continue resolving when onRemoving resolves', function() {\n        var hideResolved = false;\n        var onRemovingCalled = false;\n        var onRemoving = function() {\n          onRemovingCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend({'onRemoving': onRemoving},\n            DEFAULT_CONFIG);\n\n        openPanel(config);\n        panelRef.hide().then(function() {\n          hideResolved = true;\n        });\n        flushPanel();\n\n        expect(onRemovingCalled).toBe(true);\n        expect(PANEL_EL).toExist();\n        expect(hideResolved).toBe(true);\n        expect(PANEL_WRAPPER).toHaveClass(HIDDEN_CLASS);\n      });\n\n      it('should reject hide when onRemoving rejects', function() {\n        var hideRejected = false;\n        var onRemoving = function() {\n          return $q.reject();\n        };\n        var config = angular.extend(\n            {'onRemoving': onRemoving}, DEFAULT_CONFIG);\n\n        openPanel(config);\n        panelRef.hide().catch(function() {\n          hideRejected = true;\n        });\n        flushPanel();\n\n        expect(hideRejected).toBe(true);\n        expect(PANEL_EL).toExist();\n        expect(PANEL_WRAPPER).not.toHaveClass(HIDDEN_CLASS);\n      });\n\n      it('should call onRemoving on escapeToClose', function() {\n        var onRemovingCalled = false;\n        var onRemoving = function() {\n          onRemovingCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend({\n          'onRemoving': onRemoving, escapeToClose: true},\n          DEFAULT_CONFIG);\n\n        openPanel(config);\n        pressEscape();\n\n        expect(PANEL_EL).not.toExist();\n        expect(onRemovingCalled).toBe(true);\n      });\n\n      it('should call onRemoving on clickOutsideToClose', function() {\n        var onRemovingCalled = false;\n        var onRemoving = function() {\n          onRemovingCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend({\n          'onRemoving': onRemoving, clickOutsideToClose: true},\n          DEFAULT_CONFIG);\n\n        openPanel(config);\n        clickPanelContainer();\n\n        expect(PANEL_EL).not.toExist();\n        expect(onRemovingCalled).toBe(true);\n      });\n\n      it('should call onDomRemoved if provided when removing the panel from ' +\n          'the DOM', function() {\n            var onDomRemovedCalled = false;\n            var onDomRemoved = function() {\n              onDomRemovedCalled = true;\n              return $q.when(this);\n            };\n            var config = angular.extend(\n                {'onDomRemoved': onDomRemoved}, DEFAULT_CONFIG);\n\n            openPanel(config);\n            closePanel();\n\n            expect(onDomRemovedCalled).toBe(true);\n            expect(PANEL_EL).not.toExist();\n          });\n\n      it('should call onDomRemoved on escapeToClose', function() {\n        var onDomRemovedCalled = false;\n        var onDomRemoved = function() {\n          onDomRemovedCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend({\n          'onDomRemoved': onDomRemoved, escapeToClose: true},\n          DEFAULT_CONFIG);\n\n        openPanel(config);\n        pressEscape();\n\n        expect(PANEL_EL).not.toExist();\n        expect(onDomRemovedCalled).toBe(true);\n      });\n\n      it('should call onDomRemoved on clickOutsideToClose', function() {\n        var onDomRemovedCalled = false;\n        var onDomRemoved = function() {\n          onDomRemovedCalled = true;\n          return $q.when(this);\n        };\n        var config = angular.extend({\n          'onDomRemoved': onDomRemoved, clickOutsideToClose: true},\n          DEFAULT_CONFIG);\n\n        openPanel(config);\n        clickPanelContainer();\n\n        expect(PANEL_EL).not.toExist();\n        expect(onDomRemovedCalled).toBe(true);\n      });\n    });\n\n    describe('CSS class logic:', function() {\n      it('should add a class to the container/wrapper', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelContainer.addClass('my-class');\n\n        expect(PANEL_WRAPPER).toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n      });\n\n      it('should add a class to the element', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelEl.addClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).toHaveClass('my-class');\n      });\n\n      it('should remove a class from the container/wrapper', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelContainer.addClass('my-class');\n\n        expect(PANEL_WRAPPER).toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n\n        panelRef.panelContainer.removeClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n      });\n\n      it('should remove a class from the element', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelEl.addClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).toHaveClass('my-class');\n\n        panelRef.panelEl.removeClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n      });\n\n      it('should toggle a class on the container/wrapper', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelContainer.toggleClass('my-class');\n\n        expect(PANEL_WRAPPER).toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n\n        panelRef.panelContainer.toggleClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('my-class');\n      });\n\n      it('should toggle a class on the element', function() {\n        openPanel(DEFAULT_CONFIG);\n\n        panelRef.panelEl.toggleClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).toHaveClass('my-class');\n\n        panelRef.panelEl.toggleClass('my-class');\n\n        expect(PANEL_WRAPPER).not.toHaveClass('my-class');\n        expect(PANEL_EL).not.toHaveClass('n-class');\n      });\n    });\n\n    describe('should focus on the origin element on', function() {\n      var myButton;\n      var detachFocusConfig;\n      beforeEach(function() {\n        attachToBody('<button id=\"donuts\">Donuts</button>');\n\n        myButton = angular.element(document.querySelector('#donuts'));\n\n        detachFocusConfig = angular.extend({ origin: '#donuts' }, DEFAULT_CONFIG);\n      });\n\n      it('hide when provided', function () {\n        openPanel(detachFocusConfig);\n\n        expect(myButton).not.toBeFocused();\n\n        hidePanel();\n\n        expect(myButton).toBeFocused();\n      });\n\n      it('close when provided', function () {\n        openPanel(detachFocusConfig);\n\n        expect(myButton).not.toBeFocused();\n\n        closePanel();\n\n        expect(myButton).toBeFocused();\n      });\n\n      it('clickOutsideToClose', function() {\n        detachFocusConfig.clickOutsideToClose = true;\n\n        openPanel(detachFocusConfig);\n\n        expect(myButton).not.toBeFocused();\n\n        clickPanelContainer();\n\n        expect(myButton).toBeFocused();\n      });\n\n      it('escapeToClose', function() {\n        detachFocusConfig.escapeToClose = true;\n\n        openPanel(detachFocusConfig);\n\n        expect(myButton).not.toBeFocused();\n\n        pressEscape();\n\n        expect(myButton).toBeFocused();\n      });\n    });\n  });\n\n  describe('grouping logic:', function() {\n    it('should create a group using the newPanelGroup method', function() {\n      $mdPanel.newPanelGroup('test');\n\n      expect($mdPanel._groups['test']).toExist();\n    });\n\n    it('should create a group using the config option groupName when the ' +\n        'group hasn\\'t been created yet', function() {\n          var config = {\n            groupName: 'test'\n          };\n          var panel = $mdPanel.create(config);\n\n          expect($mdPanel._groups['test']).toExist();\n        });\n\n    it('should create multiple groups if an array is given for the config ' +\n        'option groupName', function() {\n          var config = {\n            groupName: ['test1', 'test2']\n          };\n          var panel = $mdPanel.create(config);\n\n          expect($mdPanel._groups['test1']).toExist();\n          expect($mdPanel._groups['test2']).toExist();\n        });\n\n    it('should only create a group once', function() {\n      var config = {\n        groupName: 'test'\n      };\n      var panel = $mdPanel.create(config);\n\n      expect(getNumberOfGroups()).toEqual(1);\n\n      $mdPanel.newPanelGroup('test');\n\n      expect(getNumberOfGroups()).toEqual(1);\n    });\n\n    it('should not create a group using the config option when the group is ' +\n        'already defined', function() {\n          $mdPanel.newPanelGroup('test');\n\n          expect(getNumberOfGroups()).toEqual(1);\n\n          var config = {\n            groupName: 'test'\n          };\n          var panel = $mdPanel.create(config);\n\n          expect(getNumberOfGroups()).toEqual(1);\n        });\n\n    it('should add a panel to a group using the addToGroup method', function() {\n      $mdPanel.newPanelGroup('test');\n      var panel = $mdPanel.create(DEFAULT_CONFIG);\n\n      panel.addToGroup('test');\n      expect(getGroupPanels('test')).toContain(panel);\n    });\n\n    it('should add a panel to a group using the config option groupName',\n        function() {\n          $mdPanel.newPanelGroup('test');\n\n          var config = {\n            groupName: 'test'\n          };\n\n          var panel = $mdPanel.create(config);\n          expect(getGroupPanels('test')).toContain(panel);\n        });\n\n    it('should add a panel to multiple groups when an array is given for the ' +\n        'config option groupName', function() {\n          $mdPanel.newPanelGroup('test1');\n          $mdPanel.newPanelGroup('test2');\n\n          var config = {\n            groupName: ['test1', 'test2']\n          };\n\n          var panel = $mdPanel.create(config);\n          expect(getGroupPanels('test1')).toContain(panel);\n          expect(getGroupPanels('test2')).toContain(panel);\n        });\n\n    it('should remove a panel from a group using the removeFromGroup method',\n        function() {\n          $mdPanel.newPanelGroup('test');\n\n          var config = {\n            groupName: 'test'\n          };\n\n          var panel = $mdPanel.create(config);\n\n          panel.removeFromGroup('test');\n          expect(getGroupPanels('test')).not.toContain(panel);\n        });\n\n    it('should not remove a panel from every group that it is in using the ' +\n        'removeFromGroup method and only requesting one of the panel\\'s ' +\n        'groups', function() {\n          $mdPanel.newPanelGroup('test1');\n          $mdPanel.newPanelGroup('test2');\n\n          var config = {\n            groupName: ['test1', 'test2']\n          };\n\n          var panel = $mdPanel.create(config);\n\n          panel.removeFromGroup('test1');\n          expect(getGroupPanels('test1')).not.toContain(panel);\n          expect(getGroupPanels('test2')).toContain(panel);\n        });\n\n    it('should remove a panel from a group on panel destroy', function() {\n      $mdPanel.newPanelGroup('test');\n\n      var config = {\n        groupName: 'test'\n      };\n\n      var panel = $mdPanel.create(config);\n\n      panel.destroy();\n      expect(getGroupPanels('test')).not.toContain(panel);\n    });\n\n    it('should remove a panel from all of its groups on panel destroy',\n        function() {\n          $mdPanel.newPanelGroup('test1');\n          $mdPanel.newPanelGroup('test2');\n\n          var config = {\n            groupName: ['test1', 'test2']\n          };\n\n          var panel = $mdPanel.create(config);\n\n          panel.destroy();\n          expect(getGroupPanels('test1')).not.toContain(panel);\n          expect(getGroupPanels('test2')).not.toContain(panel);\n        });\n\n    it('should set the maximum number of panels allowed open within a group ' +\n        'using the newPanelGroup option', function() {\n          $mdPanel.newPanelGroup('test', {\n            maxOpen: 1\n          });\n\n          expect(getGroupMaxOpen('test')).toEqual(1);\n        });\n\n    it('should set the maximum number of panels allowed open within a group ' +\n        'using the setGroupMaxOpen method', function() {\n          $mdPanel.newPanelGroup('test');\n          $mdPanel.setGroupMaxOpen('test', 1);\n\n          expect(getGroupMaxOpen('test')).toEqual(1);\n        });\n\n    it('should throw if trying to set maxOpen on a group that doesn\\'t exist',\n        function() {\n          var expression = function() {\n            $mdPanel.setGroupMaxOpen('test', 1);\n          };\n\n          expect(expression).toThrow();\n        });\n\n    it('should update open panels when a panel is closed', function() {\n      $mdPanel.newPanelGroup('test');\n\n      var config = {\n        groupName: 'test'\n      };\n\n      openPanel(config);\n      flushPanel();\n      expect(getGroupOpenPanels('test')).toContain(panelRef);\n\n      closePanel();\n      expect(getGroupOpenPanels('test')).not.toContain(panelRef);\n    });\n\n    it('should update open panels of all of the panel\\'s groups when a panel ' +\n        'is closed', function() {\n          $mdPanel.newPanelGroup('test1');\n          $mdPanel.newPanelGroup('test2');\n\n          var config = {\n            groupName: ['test1', 'test2']\n          };\n\n          openPanel(config);\n          flushPanel();\n          expect(getGroupOpenPanels('test1')).toContain(panelRef);\n          expect(getGroupOpenPanels('test2')).toContain(panelRef);\n\n          closePanel();\n          expect(getGroupOpenPanels('test1')).not.toContain(panelRef);\n          expect(getGroupOpenPanels('test2')).not.toContain(panelRef);\n        });\n\n    it('should close the first open panel when more than the maximum number ' +\n        'of panels is opened', function() {\n          $mdPanel.newPanelGroup('test', {\n            maxOpen: 2\n          });\n\n          var config = {\n            groupName: 'test'\n          };\n\n          var panel1 = $mdPanel.create(config);\n          var panel2 = $mdPanel.create(config);\n          var panel3 = $mdPanel.create(config);\n\n          panel1.open();\n          flushPanel();\n          expect(panel1.isAttached).toEqual(true);\n\n          panel2.open();\n          panel3.open();\n          flushPanel();\n          expect(panel1.isAttached).toEqual(false);\n          expect(panel2.isAttached).toEqual(true);\n          expect(panel3.isAttached).toEqual(true);\n\n          panel2.close();\n          panel3.close();\n        });\n\n    it('should close the first open panel of any group that the panel is in ' +\n        'when more than the maxium number of panels is opened', function() {\n          $mdPanel.newPanelGroup('groupWithMaxOpen1', {\n            maxOpen: 1\n          });\n          $mdPanel.newPanelGroup('groupWithMaxOpen2', {\n            maxOpen: 2\n          });\n\n          var config1 = {\n            groupName: 'groupWithMaxOpen1'\n          };\n          var config2 = {\n            groupName: 'groupWithMaxOpen2'\n          };\n          var config3 = {\n            groupName: ['groupWithMaxOpen1', 'groupWithMaxOpen2']\n          };\n\n          var panelInGroupWithMaxOpen1 = $mdPanel.create(config1);\n          var panelInBothGroups = $mdPanel.create(config3);\n          var panelInGroupWithMaxOpen2 = $mdPanel.create(config2);\n          var panel2InGroupWithMaxOpen2 = $mdPanel.create(config2);\n\n          panelInGroupWithMaxOpen1.open();\n          flushPanel();\n          expect(panelInGroupWithMaxOpen1.isAttached).toEqual(true);\n          expect(getGroupOpenPanels('groupWithMaxOpen1'))\n              .toContain(panelInGroupWithMaxOpen1);\n\n          panelInBothGroups.open();\n          flushPanel();\n          expect(panelInGroupWithMaxOpen1.isAttached).toEqual(false);\n          expect(panelInBothGroups.isAttached).toEqual(true);\n          expect(getGroupOpenPanels('groupWithMaxOpen1'))\n              .not.toContain(panelInGroupWithMaxOpen1);\n          expect(getGroupOpenPanels('groupWithMaxOpen1'))\n              .toContain(panelInBothGroups);\n          expect(getGroupOpenPanels('groupWithMaxOpen2'))\n              .toContain(panelInBothGroups);\n\n          panelInGroupWithMaxOpen2.open();\n          panel2InGroupWithMaxOpen2.open();\n          flushPanel();\n          expect(panelInBothGroups.isAttached).toEqual(false);\n          expect(panelInGroupWithMaxOpen2.isAttached).toEqual(true);\n          expect(panel2InGroupWithMaxOpen2.isAttached).toEqual(true);\n          expect(getGroupOpenPanels('groupWithMaxOpen2'))\n              .not.toContain(panelInBothGroups);\n          expect(getGroupOpenPanels('groupWithMaxOpen2'))\n              .toContain(panelInGroupWithMaxOpen2);\n          expect(getGroupOpenPanels('groupWithMaxOpen2'))\n              .toContain(panel2InGroupWithMaxOpen2);\n\n          panelInGroupWithMaxOpen2.close();\n          panel2InGroupWithMaxOpen2.close();\n        });\n  });\n\n  describe('component logic: ', function() {\n    it('should allow templateUrl to specify content', function() {\n      var htmlContent = 'Puppies and Unicorns';\n      var template = '<div>' + htmlContent + '</div>';\n      $templateCache.put('template.html', template);\n\n      var config = { templateUrl: 'template.html' };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should allow template to specify content', function() {\n      var htmlContent = 'Ice cream';\n      var template = '<div>' + htmlContent + '</div>';\n      var config = { template: template };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should allow a controller to be specified', function() {\n      var htmlContent = 'Cotton candy';\n      var template = '<div>{{ content }}</div>';\n\n      var config = {\n        template: template,\n        controller: function Ctrl($scope) {\n          $scope['content'] = htmlContent;\n        }\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should allow controllerAs syntax', function() {\n      var htmlContent = 'Cupcakes';\n      var template = '<div>{{ ctrl.content }}</div>';\n\n      var config = {\n        template: template,\n        controller: function Ctrl() {\n          this.content = htmlContent;\n        },\n        controllerAs: 'ctrl'\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should wait for resolve before creating the panel', function() {\n      var htmlContent = 'Cheesecake';\n      var template = '<div>{{ ctrl.content }}</div>';\n\n      var deferred = $q.defer();\n\n      var config = {\n        template: template,\n        controller: function Ctrl(content) {\n          this.content = content;\n        },\n        controllerAs: 'ctrl',\n        resolve: {\n          content: function() {\n            return deferred.promise.then(function(content) {\n              return content;\n            });\n          }\n        }\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).not.toExist();\n\n      deferred.resolve(htmlContent);\n      flushPanel();\n\n      expect(PANEL_EL).toExist();\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should bind resolve to the controller', function() {\n      var htmlContent = 'Gummy bears';\n      var template = '<div>{{ ctrl.content }}</div>';\n\n      var config = {\n        template: template,\n        controller: function Ctrl() {\n          this.content; // Populated via bindToController.\n        },\n        controllerAs: 'ctrl',\n        resolve: {\n          content: function($q) {\n            return $q.when(htmlContent);\n          }\n        }\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n    });\n\n    it('should allow locals to be injected in the controller', function() {\n      var htmlContent = 'Tiramisu';\n      var template = '<div>{{ ctrl.content }} {{ ctrl.myPanel.id }}</div>';\n\n      var config = {\n        template: template,\n        controller: function Ctrl(content, mdPanelRef) {\n          this.content = content;\n          this.myPanel = mdPanelRef;\n        },\n        controllerAs: 'ctrl',\n        locals: { content: htmlContent },\n        bindToController: false,\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n      expect(PANEL_EL).toContainHtml(PANEL_ID_PREFIX);\n    });\n\n    it('should bind locals to the controller', function() {\n      var htmlContent = 'Apple Pie';\n      var template = '<div>{{ ctrl.content }} {{ ctrl.mdPanelRef.id }}</div>';\n\n      var config = {\n        template: template,\n        controller: function Ctrl() {\n          this.content; // Populated via bindToController.\n          this.mdPanelRef;\n        },\n        controllerAs: 'ctrl',\n        locals: { content: htmlContent }\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n      expect(PANEL_EL).toContainHtml(PANEL_ID_PREFIX);\n    });\n\n    it('should inject mdPanelRef to the controller', function() {\n      var htmlContent = 'Cupcake';\n      var template =\n          '<button ng-click=\"ctrl.closeSelf()\">{{ ctrl.content }}</button>';\n\n      function Ctrl() {\n        this.content; // Populated via bindToController.\n        this.mdPanelRef;\n      }\n\n      Ctrl.prototype.closeSelf = function() {\n        this.mdPanelRef.close();\n      };\n\n      var config = {\n        template: template,\n        controller: Ctrl,\n        controllerAs: 'ctrl',\n        locals: { content: htmlContent }\n      };\n\n      openPanel(config);\n\n      expect(PANEL_EL).toContainHtml(htmlContent);\n\n      document.querySelector(PANEL_EL + ' button').click();\n      expect(PANEL_EL).not.toExist();\n    });\n  });\n\n  describe('positioning logic: ', function() {\n    var config;\n    var mdPanelPosition;\n\n    function setRTL() {\n      mdPanelPosition._isRTL = true;\n    }\n\n    function disableRTL() {\n      mdPanelPosition._isRTL = false;\n    }\n\n    beforeEach(function() {\n      config = DEFAULT_CONFIG;\n      mdPanelPosition = $mdPanel.newPanelPosition();\n    });\n\n    afterEach(function () {\n      disableRTL();\n    });\n\n    describe('should update the position of an open panel', function() {\n      var xPosition, yPosition, myButton, myButtonRect;\n\n      beforeEach(function() {\n        xPosition = $mdPanel.xPosition;\n        yPosition = $mdPanel.yPosition;\n\n        myButton = '<button>myButton</button>';\n        attachToBody(myButton);\n        myButton = angular.element(document.querySelector('button'));\n        myButton.css('margin', '100px');\n        myButtonRect = myButton[0].getBoundingClientRect();\n      });\n\n      it('between two absolute positions', function() {\n        var top = '50px';\n        var left = '30px';\n        var position = $mdPanel.newPanelPosition()\n            .absolute()\n            .top(top)\n            .left(left);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(panelRect.top).toBeApproximately(parseInt(top));\n        expect(panelRect.left).toBeApproximately(parseInt(left));\n\n        var newTop = '500px';\n        var newLeft = '300px';\n        var newPosition = $mdPanel.newPanelPosition()\n            .absolute()\n            .top(newTop)\n            .left(newLeft);\n\n        panelRef.updatePosition(newPosition);\n\n        var newPanelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(newPanelRect.top).toBeApproximately(parseInt(newTop));\n        expect(newPanelRect.left).toBeApproximately(parseInt(newLeft));\n      });\n\n      it('between two relative positions', function() {\n        var position = $mdPanel.newPanelPosition()\n            .relativeTo(myButton[0])\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(panelRect.top).toBeApproximately(myButtonRect.top);\n        expect(panelRect.left).toBeApproximately(myButtonRect.left);\n\n\n        var newPosition = $mdPanel.newPanelPosition()\n            .relativeTo(myButton)\n            .addPanelPosition(null, yPosition.ABOVE);\n\n        panelRef.updatePosition(newPosition);\n\n        var newPanelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(newPanelRect.bottom).toBeApproximately(myButtonRect.top);\n      });\n\n      it('from an absolute to a relative position', function() {\n        var top = '250px';\n        var left = '400px';\n        var position = $mdPanel.newPanelPosition()\n            .absolute()\n            .top(top)\n            .left(left);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(panelRect.top).toBeApproximately(parseInt(top));\n        expect(panelRect.left).toBeApproximately(parseInt(left));\n\n        var newPosition = $mdPanel.newPanelPosition()\n            .relativeTo(myButton[0])\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        panelRef.updatePosition(newPosition);\n\n        var newPanelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        expect(newPanelRect.top).toBeApproximately(myButtonRect.top);\n        expect(newPanelRect.left).toBeApproximately(myButtonRect.left);\n      });\n    });\n\n    describe('should offset the panel', function() {\n      it('horizontally', function() {\n        var left = '50px';\n        var offset = '-15px';\n\n        var position = mdPanelPosition\n            .absolute()\n            .left(left)\n            .withOffsetX(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(panelRect.left)\n            .toBeApproximately(parseInt(left) + parseInt(offset));\n      });\n\n      it('horizontally with a function', function() {\n        var left = '50px';\n        var offset = '-15px';\n        var obj = {\n          getOffsetX: function() {\n            return offset;\n          }\n        };\n\n        spyOn(obj, 'getOffsetX').and.callThrough();\n\n        var position = mdPanelPosition\n            .absolute()\n            .left(left)\n            .withOffsetX(obj.getOffsetX);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(obj.getOffsetX).toHaveBeenCalledWith(position);\n        expect(panelRect.left)\n            .toBeApproximately(parseInt(left) + parseInt(offset));\n      });\n\n      it('horizontally with centering', function() {\n        var offset = '15px';\n\n        var position = mdPanelPosition\n            .absolute()\n            .centerHorizontally()\n            .withOffsetX(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var middleOfPage = 0.5 * window.innerWidth;\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        var middleOfPanel = panelRect.left + 0.5 * panelRect.width;\n\n        expect(middleOfPanel)\n            .toBeApproximately(middleOfPage + parseInt(offset));\n      });\n\n      it('horizontally with an integer value', function() {\n        var left = '50px';\n        var offset = -15;\n\n        var position = mdPanelPosition\n            .absolute()\n            .left(left)\n            .withOffsetX(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(panelRect.left)\n            .toBeApproximately(parseInt(left) + offset);\n      });\n\n      it('vertically', function() {\n        var top = '50px';\n        var offset = '-15px';\n\n        var position = mdPanelPosition\n            .absolute()\n            .top(top)\n            .withOffsetY(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(panelRect.top)\n            .toBeApproximately(parseInt(top) + parseInt(offset));\n      });\n\n      it('vertically with a function', function() {\n        var top = '50px';\n        var offset = '-15px';\n        var obj = {\n          getOffsetY: function() {\n            return offset;\n          }\n        };\n\n        spyOn(obj, 'getOffsetY').and.callThrough();\n\n        var position = mdPanelPosition\n            .absolute()\n            .top(top)\n            .withOffsetY(obj.getOffsetY);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(obj.getOffsetY).toHaveBeenCalledWith(position);\n        expect(panelRect.top)\n            .toBeApproximately(parseInt(top) + parseInt(offset));\n      });\n\n      it('vertically with centering', function() {\n        var offset = '15px';\n\n        var position = mdPanelPosition\n            .absolute()\n            .centerVertically()\n            .withOffsetY(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var middleOfPage = 0.5 * window.innerHeight;\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n        var middleOfPanel = panelRect.top + 0.5 * panelRect.height;\n\n        expect(middleOfPanel)\n            .toBeApproximately(middleOfPage + parseInt(offset));\n      });\n\n      it('vertically with an integer value', function() {\n        var top = '50px';\n        var offset = -15;\n\n        var position = mdPanelPosition\n            .absolute()\n            .top(top)\n            .withOffsetY(offset);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(panelRect.top)\n            .toBeApproximately(parseInt(top) + offset);\n      });\n\n      it('with a function that does not return units', function() {\n        var left = '50px';\n        var offset = -15;\n        var obj = {\n          getOffsetX: function() {\n            return offset;\n          }\n        };\n\n        var position = mdPanelPosition\n            .absolute()\n            .left(left)\n            .withOffsetX(obj.getOffsetX);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelRect = document.querySelector(PANEL_EL)\n            .getBoundingClientRect();\n\n        expect(panelRect.left).toBeApproximately(parseInt(left) + offset);\n      });\n\n      it('should apply offsets to the panel inner wrapper, instead of directly ' +\n        'on the panel element', function() {\n        var position = mdPanelPosition\n            .absolute()\n            .withOffsetX('-10px');\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var transform = $mdConstant.CSS.TRANSFORM;\n        var panelEl = document.querySelector(PANEL_EL);\n        var innerWrapper = document.querySelector(INNER_WRAPPER);\n\n        expect(panelEl.style[transform]).toBeFalsy();\n        expect(innerWrapper.style[transform]).toBeTruthy();\n        expect(panelEl.parentNode).toBe(innerWrapper);\n      });\n    });\n\n    describe('should absolutely position the panel at', function() {\n      it('top', function() {\n        var top = '50px';\n        var position = mdPanelPosition.absolute().top(top);\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.top).toEqual(top);\n      });\n\n      it('top with default 0', function() {\n        var position = mdPanelPosition.absolute().top();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.top).toEqual('0px');\n      });\n\n      it('top with clearing previous vertical positioning', function() {\n        var position = mdPanelPosition.absolute().bottom().top();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.bottom).toEqual('')\n        expect(panelCss.top).toEqual('0px');\n      });\n\n      it('bottom', function() {\n        var bottom = '50px';\n        var position = mdPanelPosition.absolute().bottom(bottom);\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.bottom).toEqual(bottom);\n      });\n\n      it('bottom with default 0', function() {\n        var position = mdPanelPosition.absolute().bottom();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.bottom).toEqual('0px');\n      });\n\n      it('bottom with clearing previous vertical positioning', function() {\n        var position = mdPanelPosition.absolute().top().bottom();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.top).toEqual('');\n        expect(panelCss.bottom).toEqual('0px');\n      });\n\n      it('left', function() {\n        var left = '50px';\n        var position = mdPanelPosition.absolute().left(left);\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toEqual(left);\n      });\n\n      it('left with default 0', function() {\n        var position = mdPanelPosition.absolute().left();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toEqual('0px');\n      });\n\n      it('left with clearing previous horizontal positioning', function() {\n        var position = mdPanelPosition.absolute().right().left();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.right).toEqual('');\n        expect(panelCss.left).toEqual('0px');\n      });\n\n      it('right', function() {\n        var right = '50px';\n        var position = mdPanelPosition.absolute().right(right);\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.right).toEqual(right);\n      });\n\n      it('right with default 0', function() {\n        var position = mdPanelPosition.absolute().right();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.right).toEqual('0px');\n      });\n\n      it('right with clearing previous horizontal positioning', function() {\n        var position = mdPanelPosition.absolute().left().right();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toEqual('');\n        expect(panelCss.right).toEqual('0px');\n      });\n\n      it('start in ltr', function() {\n        var start = '50px';\n        config['position'] = mdPanelPosition.absolute().start(start);\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toEqual(start);\n      });\n\n      it('start in rtl', function() {\n        setRTL();\n\n        var start = '50px';\n        config['position'] = mdPanelPosition.absolute().start(start);\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.right).toEqual(start);\n      });\n\n      it('end in ltr', function() {\n        var end = '50px';\n        config['position'] = mdPanelPosition.absolute().end(end);\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.right).toEqual(end);\n      });\n\n      it('end in rtl', function() {\n        setRTL();\n\n        var end = '50px';\n        config['position'] = mdPanelPosition.absolute().end(end);\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toEqual(end);\n      });\n\n      it('center horizontally', function() {\n        var position = mdPanelPosition.absolute().centerHorizontally();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var middleOfPage = 0.5 * window.innerWidth;\n\n        var panelRect = document.querySelector(INNER_WRAPPER)\n            .getBoundingClientRect();\n        var middleOfPanel = panelRect.left + 0.5 * panelRect.width;\n\n        expect(middleOfPanel).toBeApproximately(middleOfPage);\n      });\n\n      it('center vertically', function() {\n        var position = mdPanelPosition.absolute().centerVertically();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var middleOfPage = 0.5 * window.innerHeight;\n\n        var panelRect = document.querySelector(INNER_WRAPPER)\n            .getBoundingClientRect();\n        var middleOfPanel = panelRect.top + 0.5 * panelRect.height;\n\n        expect(middleOfPanel).toBeApproximately(middleOfPage);\n      });\n\n      it('center horizontally and vertically', function() {\n        var position = mdPanelPosition.absolute().center();\n        config['position'] = position;\n\n        openPanel(config);\n\n        var middleOfPageX = 0.5 * window.innerWidth;\n        var middleOfPageY = 0.5 * window.innerHeight;\n\n        var panelRect = document.querySelector(INNER_WRAPPER)\n            .getBoundingClientRect();\n        var middleOfPanelX = panelRect.left + 0.5 * panelRect.width;\n        var middleOfPanelY = panelRect.top + 0.5 * panelRect.height;\n\n        expect(middleOfPanelX).toBeApproximately(middleOfPageX);\n        expect(middleOfPanelY).toBeApproximately(middleOfPageY);\n      });\n    });\n\n    describe('should relatively position the panel', function() {\n      var myButton;\n      var myButtonRect;\n      var xPosition;\n      var yPosition;\n\n      beforeEach(function() {\n        myButton = '<button>myButton</button>';\n        attachToBody(myButton);\n        myButton = angular.element(document.querySelector('button'));\n        myButton.css('margin', '120px');\n        myButtonRect = myButton[0].getBoundingClientRect();\n\n        xPosition = $mdPanel.xPosition;\n        yPosition = $mdPanel.yPosition;\n      });\n\n      it('with respect to an element', function() {\n        var position = mdPanelPosition\n            .relativeTo(myButton[0])\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toBeApproximately(myButtonRect.left);\n        expect(panelCss.top).toBeApproximately(myButtonRect.top);\n      });\n\n      it('with respect to a query selector', function() {\n        var position = mdPanelPosition\n            .relativeTo('button')\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toBeApproximately(myButtonRect.left);\n        expect(panelCss.top).toBeApproximately(myButtonRect.top);\n      });\n\n      it('with respect to a JQLite object', function() {\n        var position = mdPanelPosition\n            .relativeTo(myButton)\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        config['position'] = position;\n\n        openPanel(config);\n\n        var panelCss = document.querySelector(INNER_WRAPPER).style;\n        expect(panelCss.left).toBeApproximately(myButtonRect.left);\n        expect(panelCss.top).toBeApproximately(myButtonRect.top);\n      });\n\n      describe('fallback positions', function() {\n        beforeEach(function() {\n          myButton.css('margin', 0);\n          myButtonRect = myButton[0].getBoundingClientRect();\n        });\n\n        it('rejects offscreen position left of target element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_START, yPosition.ALIGN_TOPS)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS,\n          });\n\n          var panelCss = document.querySelector(INNER_WRAPPER).style;\n          expect(panelCss.left).toBeApproximately(myButtonRect.left);\n          expect(panelCss.top).toBeApproximately(myButtonRect.top);\n        });\n\n        it('rejects offscreen position above target element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ABOVE)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS,\n          });\n        });\n\n        it('rejects offscreen position below target element', function() {\n          // reposition button at the bottom of the screen\n          $rootEl[0].style.height = \"100%\";\n          myButton[0].style.position = 'absolute';\n          myButton[0].style.bottom = '0px';\n          myButtonRect = myButton[0].getBoundingClientRect();\n\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.BELOW)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS,\n          });\n        });\n\n        it('rejects offscreen position right of target element', function() {\n          // reposition button at the bottom of the screen\n          $rootEl[0].style.width = \"100%\";\n          myButton[0].style.position = 'absolute';\n          myButton[0].style.right = '0px';\n          myButtonRect = myButton[0].getBoundingClientRect();\n\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_END, yPosition.ALIGN_TOPS)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS,\n          });\n        });\n\n        it('takes the x offset into account', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .withOffsetX(window.innerWidth + 'px')\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS)\n              .addPanelPosition(xPosition.ALIGN_END, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_END,\n            y: yPosition.ALIGN_TOPS\n          });\n        });\n\n        it('takes the y offset into account', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .withOffsetY(window.innerHeight + 'px')\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_BOTTOMS)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS\n          });\n        });\n\n        it('should choose last position if none are on-screen', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              // off-screen to the left\n              .addPanelPosition(xPosition.OFFSET_START, yPosition.ALIGN_TOPS)\n              // off-screen at the top\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          expect(position.getActualPosition()).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ALIGN_TOPS,\n          });\n        });\n      });\n\n      it('should have assigned the actual position by the time the offset' +\n        'methods have been called', function() {\n        var positionSnapshot = null;\n        var getOffsetX = function(mdPanelPosition) {\n          positionSnapshot = angular.copy(mdPanelPosition.getActualPosition());\n        };\n\n        var position = mdPanelPosition\n            .relativeTo(myButton[0])\n            .withOffsetX(getOffsetX)\n            .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n        config.position = position;\n\n        openPanel(config);\n        expect(positionSnapshot).toEqual({\n          x: xPosition.ALIGN_START,\n          y: yPosition.ALIGN_TOPS\n        });\n      });\n\n      it('should have assigned the actual position when using ' +\n        'multiple positions', function() {\n          var positionSnapshots = [];\n          var getOffsetX = function(mdPanelPosition) {\n            positionSnapshots.push(\n              angular.copy(mdPanelPosition.getActualPosition())\n            );\n          };\n          var position = mdPanelPosition\n              .relativeTo(myButton[0])\n              .addPanelPosition(xPosition.ALIGN_END, yPosition.BELOW)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ABOVE)\n              .withOffsetX(getOffsetX);\n\n          myButton.css({\n            position: 'absolute',\n            left: '100%',\n            top: '100%'\n          });\n\n          config.position = position;\n          openPanel(config);\n\n          expect(positionSnapshots[0]).toEqual({\n            x: xPosition.ALIGN_END,\n            y: yPosition.BELOW\n          });\n\n          expect(positionSnapshots[1]).toEqual({\n            x: xPosition.ALIGN_START,\n            y: yPosition.ABOVE\n          });\n      });\n\n      it('should keep the panel within the viewport on repeat openings',\n        function() {\n\n          config.position = mdPanelPosition\n            .relativeTo(myButton)\n            .addPanelPosition(xPosition.ALIGN_END, yPosition.ALIGN_TOPS);\n\n          var panelRef = $mdPanel.create(config);\n\n          myButton.css({\n            position: 'absolute',\n            left: '-100px',\n            margin: 0\n          });\n\n          panelRef.open();\n          flushPanel();\n\n          expect(panelRef.innerWrapper[0].offsetLeft).toBe(VIEWPORT_MARGIN);\n          expect(panelRef.innerWrapper).toHaveClass(ADJUSTED_CLASS);\n\n          panelRef.close();\n          flushPanel();\n\n          panelRef.open();\n          flushPanel();\n\n          expect(panelRef.innerWrapper[0].offsetLeft).toBe(VIEWPORT_MARGIN);\n          expect(panelRef.innerWrapper).toHaveClass(ADJUSTED_CLASS);\n\n          panelRef.destroy();\n        });\n\n      describe('vertically', function() {\n        it('above an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, yPosition.ABOVE);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.bottom).toBeApproximately(myButtonRect.top);\n        });\n\n        it('top aligned with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.top).toBeApproximately(myButtonRect.top);\n        });\n\n        it('centered with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, yPosition.CENTER);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var middleOfButton = myButtonRect.top + 0.5 * myButtonRect.height;\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          var middleOfPanel = panelRect.top + 0.5 * panelRect.height;\n\n          expect(middleOfPanel).toBeApproximately(middleOfButton);\n        });\n\n        it('bottom aligned with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, yPosition.ALIGN_BOTTOMS);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.bottom).toBeApproximately(myButtonRect.bottom);\n        });\n\n        it('below an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, yPosition.BELOW);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.top).toBeApproximately(myButtonRect.bottom);\n        });\n\n        it('element outside the left boundry of the viewport', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_END, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          myButton.css({\n            position: 'absolute',\n            left: '-100px',\n            margin: 0\n          });\n\n          openPanel(config);\n\n          var panel = document.querySelector(INNER_WRAPPER);\n\n          expect(panel.offsetLeft).toBe(VIEWPORT_MARGIN);\n          expect(panel).toHaveClass(ADJUSTED_CLASS);\n        });\n\n        it('element outside the right boundry of the viewport', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ALIGN_TOPS);\n\n          config['position'] = position;\n\n          myButton.css({\n            position: 'absolute',\n            right: '-100px',\n            margin: 0\n          });\n\n          openPanel(config);\n\n          var panel = document.querySelector(INNER_WRAPPER);\n          var panelRect = panel.getBoundingClientRect();\n\n          expect(panelRect.left + panelRect.width).toBeLessThan(window.innerWidth);\n          expect(panel).toHaveClass(ADJUSTED_CLASS);\n        });\n      });\n\n      describe('horizontally', function() {\n        it('offset to the left of an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_START, null);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.right).toBeApproximately(myButtonRect.left);\n        });\n\n        it('right aligned with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_END, null);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.right).toBeApproximately(myButtonRect.right);\n        });\n\n        it('centered with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.CENTER, null);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var middleOfButton = myButtonRect.left + 0.5 * myButtonRect.width;\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          var middleOfPanel = panelRect.left + 0.5 * panelRect.width;\n\n          expect(middleOfPanel).toBeApproximately(middleOfButton);\n        });\n\n        it('left aligned with an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, null);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.left).toBeApproximately(myButtonRect.left);\n        });\n\n        it('offset to the right of an element', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_END, null);\n\n          config['position'] = position;\n\n          openPanel(config);\n\n          var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n          expect(panelRect.left).toBeApproximately(myButtonRect.right);\n        });\n\n        it('element outside the top boundry of the viewport', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.ABOVE);\n\n          config['position'] = position;\n\n          myButton.css({\n            position: 'absolute',\n            top: 0,\n            margin: 0\n          });\n\n          openPanel(config);\n\n          var panel = document.querySelector(INNER_WRAPPER);\n\n          expect(panel.offsetTop).toBe(VIEWPORT_MARGIN);\n          expect(panel).toHaveClass(ADJUSTED_CLASS);\n        });\n\n        it('element outside the bottom boundry of the viewport', function() {\n          var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, yPosition.BELOW);\n\n          config['position'] = position;\n\n          myButton.css({\n            position: 'absolute',\n            bottom: 0,\n            margin: 0\n          });\n\n          openPanel(config);\n\n          var panel = document.querySelector(INNER_WRAPPER);\n          var panelRect = panel.getBoundingClientRect();\n\n          expect(panelRect.top + panelRect.height).toBeLessThan(window.innerHeight);\n          expect(panel).toHaveClass(ADJUSTED_CLASS);\n        });\n\n        describe('rtl', function () {\n          beforeEach(function () {\n            setRTL();\n          });\n\n          it('offset to the right of an element', function() {\n            var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_START, null);\n\n            config['position'] = position;\n\n            openPanel(config);\n\n            var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n            expect(panelRect.left).toBeApproximately(myButtonRect.right);\n          });\n\n          it('left aligned with an element', function() {\n            var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_END, null);\n\n            config['position'] = position;\n\n            openPanel(config);\n\n            var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n            expect(panelRect.left).toBeApproximately(myButtonRect.left);\n          });\n\n          it('right aligned with an element', function() {\n            var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.ALIGN_START, null);\n\n            config['position'] = position;\n\n            openPanel(config);\n\n            var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n            expect(panelRect.right).toBeApproximately(myButtonRect.right);\n          });\n\n          it('offset to the left of an element', function() {\n            var position = mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(xPosition.OFFSET_END, null);\n\n            config['position'] = position;\n\n            openPanel(config);\n\n            var panelRect = document.querySelector(INNER_WRAPPER)\n              .getBoundingClientRect();\n            expect(panelRect.right).toBeApproximately(myButtonRect.left);\n          });\n        });\n      });\n\n      it('should throw if xPosition is not valid', function() {\n        var expression = function() {\n          mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition('fake-x-position', null);\n        };\n\n        expect(expression).toThrow();\n      });\n\n      it('should throw if yPosition is not valid', function() {\n        var expression = function() {\n          mdPanelPosition\n              .relativeTo(myButton)\n              .addPanelPosition(null, 'fake-y-position');\n        };\n\n        expect(expression).toThrow();\n      });\n    });\n  });\n\n  describe('animation logic: ', function() {\n    var mdPanelAnimation;\n    var myButton;\n\n    beforeEach(function() {\n      mdPanelAnimation = $mdPanel.newPanelAnimation();\n\n      myButton = '<button>myButton</button>';\n      attachToBody(myButton);\n      myButton = angular.element(document.querySelector('button'));\n    });\n\n    it('should animate with default slide', function() {\n      var config = DEFAULT_CONFIG;\n      config['animation'] = mdPanelAnimation.openFrom('button')\n          .withAnimation('md-panel-animate-slide');\n\n      openPanel();\n      // If animation dies, panel doesn't unhide.\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n\n      closePanel();\n      // If animation dies, panel doesn't hide.\n      expect(panelRef.panelContainer).toHaveClass(HIDDEN_CLASS);\n    });\n\n    it('should animate with custom class', function() {\n      var config = DEFAULT_CONFIG;\n      config['animation'] = mdPanelAnimation.openFrom('button')\n          .withAnimation('myClass');\n\n      openPanel();\n      // If animation dies, panel doesn't unhide.\n      expect(panelRef.panelContainer).not.toHaveClass(HIDDEN_CLASS);\n\n      closePanel();\n      // If animation dies, panel doesn't hide.\n      expect(panelRef.panelContainer).toHaveClass(HIDDEN_CLASS);\n    });\n\n    it('should match the backdrop animation duration with the panel', function() {\n      mdPanelAnimation.duration(500);\n\n      openPanel({\n        hasBackdrop: true,\n        animation: mdPanelAnimation\n      });\n\n      var backdropAnimation = panelRef._backdropRef.config.animation;\n\n      expect(backdropAnimation._openDuration).toBe(mdPanelAnimation._openDuration);\n      expect(backdropAnimation._closeDuration).toBe(mdPanelAnimation._closeDuration);\n    });\n\n    describe('should add scale after the existing transform when', function () {\n      var animator;\n      var panelEl;\n\n      beforeEach(function () {\n        animator = mdPanelAnimation._$mdUtil.dom.animator;\n\n        var panelDiv = document.createElement('div');\n        panelDiv.id = 'mockPanel'\n        panelDiv.style.transform = 'translateX(-50%) translateY(-50%)'\n        attachToBody(panelDiv);\n        panelEl = angular.element(panelDiv);\n\n        spyOn(animator, 'translate3d');\n\n        spyOn(animator, 'calculateZoomToOrigin')\n          .and.returnValue('translate3d(0, 0, 0) scale(0.5, 0.5)');\n\n      });\n\n      it('opening with the SCALE animation', function () {\n        var animation = mdPanelAnimation.openFrom('button')\n          .withAnimation('md-panel-animate-scale')\n\n        animation.animateOpen(panelEl);\n\n       expect(animator.translate3d.calls.mostRecent().args[1].transform)\n          .toMatch(/^translateX.*scale\\(0\\.5, 0\\.5\\)$/g);\n\n      });\n\n      it('closing with the SCALE animation', function () {\n        var animation = mdPanelAnimation.openFrom('button')\n          .withAnimation('md-panel-animate-scale')\n\n        animation.animateClose(panelEl);\n\n        expect(animator.translate3d.calls.mostRecent().args[2].transform)\n          .toMatch(/^translateX.*scale\\(0\\.5, 0\\.5\\)$/g);\n\n      });\n    });\n\n    describe('should determine openFrom when', function() {\n      it('provided a selector', function() {\n        var animation = mdPanelAnimation.openFrom('button');\n\n        expect(animation._openFrom.element[0]).toEqual(myButton[0]);\n        expect(animation._openFrom.bounds).toEqual(myButton[0].getBoundingClientRect());\n      });\n\n      it('provided an element', function() {\n        var animation = mdPanelAnimation.openFrom(myButton[0]);\n\n        expect(animation._openFrom.element[0]).toEqual(myButton[0]);\n        expect(animation._openFrom.bounds).toEqual(myButton[0].getBoundingClientRect());\n      });\n\n      it('provided an event', function() {\n        var myEvent = { type: 'click', target: myButton };\n        var animation = mdPanelAnimation.openFrom(myEvent);\n\n        expect(animation._openFrom.element[0]).toEqual(myButton[0]);\n        expect(animation._openFrom.bounds).toEqual(myButton[0].getBoundingClientRect());\n      });\n\n      it('provided a bounding rect', function() {\n        var rect = myButton[0].getBoundingClientRect();\n        var inputRect = { top: rect.top, left: rect.left };\n        var animation = mdPanelAnimation.openFrom(inputRect);\n\n        expect(animation._openFrom.element).toBeUndefined();\n        expect(animation._openFrom.bounds).toEqual(inputRect);\n      });\n    });\n\n    describe('should determine closeTo when', function() {\n      it('provided a selector', function() {\n        var animation = mdPanelAnimation.closeTo('button');\n\n        expect(animation._closeTo.element).toEqual(myButton);\n        expect(animation._closeTo.bounds).toEqual(myButton[0].getBoundingClientRect());\n      });\n\n      it('provided an element', function() {\n        var animation = mdPanelAnimation.closeTo(myButton[0]);\n\n        expect(animation._closeTo.element).toEqual(myButton);\n        expect(animation._closeTo.bounds).toEqual(myButton[0].getBoundingClientRect());\n      });\n\n      it('provided a bounding rect', function() {\n        var rect = myButton[0].getBoundingClientRect();\n        var inputRect = { top: rect.top, left: rect.left };\n        var animation = mdPanelAnimation.closeTo(inputRect);\n\n        expect(animation._closeTo.element).toBeUndefined();\n        expect(animation._closeTo.bounds).toEqual(inputRect);\n      });\n    });\n\n    describe('should determine the animation duration when', function() {\n      it('provided a value in milliseconds', function() {\n        var animation = mdPanelAnimation.duration(1300);\n\n        expect(animation._openDuration).toBe(1.3);\n      });\n\n      it('provided a number', function() {\n        var animation = mdPanelAnimation.duration(2000);\n\n        expect(animation._openDuration).toEqual(animation._closeDuration);\n        expect(animation._openDuration).toBe(2);\n      });\n\n      it('provided an object', function() {\n        var animation = mdPanelAnimation.duration({\n          open: 1200,\n          close: 600\n        });\n\n        expect(animation._openDuration).toBe(1.2);\n        expect(animation._closeDuration).toBe(0.6);\n      });\n\n      it('provided an invalid value', function() {\n        var animation = mdPanelAnimation.duration('very fast');\n\n        expect(animation._openDuration).toBeFalsy();\n        expect(animation._closeDuration).toBeFalsy();\n      });\n    });\n\n    describe('updating the animation of a panel', function() {\n      it('should change the animation config of a panel', function() {\n        var newAnimation = $mdPanel.newPanelAnimation();\n\n        openPanel();\n\n        panelRef.updateAnimation(newAnimation);\n\n        expect(panelRef.config.animation).toBe(newAnimation);\n      });\n\n      it('should update the duration of the backdrop animation', function() {\n        var newAnimation = $mdPanel.newPanelAnimation().duration({\n          open: 1000,\n          close: 2000\n        });\n\n        openPanel({ hasBackdrop: true });\n\n        panelRef.updateAnimation(newAnimation);\n\n        var backdropAnimation = panelRef._backdropRef.config.animation;\n\n        expect(backdropAnimation._openDuration).toBe(newAnimation._openDuration);\n        expect(backdropAnimation._closeDuration).toBe(newAnimation._closeDuration);\n      });\n    });\n  });\n\n  describe('interceptor logic: ', function() {\n    var interceptorTypes;\n\n    beforeEach(function() {\n      interceptorTypes = $mdPanel.interceptorTypes;\n      openPanel();\n    });\n\n    it('should throw when registering an interceptor without a type', function() {\n      expect(function() {\n        panelRef.registerInterceptor();\n      }).toThrowError('MdPanel: Interceptor type must be a string, instead got undefined');\n    });\n\n    it('should throw when registering an interceptor without a callback', function() {\n      expect(function() {\n        panelRef.registerInterceptor(interceptorTypes.CLOSE);\n      }).toThrowError('MdPanel: Interceptor callback must be a function, instead got undefined');\n    });\n\n    it('should execute the registered interceptors', function() {\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, obj.callback);\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledWith(panelRef);\n    });\n\n    it('should execute the interceptors in reverse order', function() {\n      var results = [];\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(1));\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(2));\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(3));\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE).then(obj.callback);\n      flushPanel();\n\n      expect(results).toEqual([3, 2, 1]);\n      expect(obj.callback).toHaveBeenCalled();\n\n      function makePromise(value) {\n        return function() {\n          return $q.resolve().then(function() {\n            results.push(value);\n          });\n        };\n      }\n    });\n\n    it('should reject and break the chain if one of the promises is rejected', function() {\n      var results = [];\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(1, true));\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(2));\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, makePromise(3));\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE).catch(obj.callback);\n      flushPanel();\n\n      expect(results).toEqual([3, 2]);\n      expect(obj.callback).toHaveBeenCalled();\n\n      function makePromise(value, shouldFail) {\n        return function() {\n          return shouldFail ? $q.reject() : $q.resolve().then(function() {\n            results.push(value);\n          });\n        };\n      }\n    });\n\n    it('should reject if one of the interceptors throws', function() {\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, function() {\n        throw new Error('Something went wrong.');\n      });\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, function() {\n        return $q.resolve();\n      });\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE).catch(obj.callback);\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalled();\n    });\n\n    it('should resolve if the interceptor queue is empty', function() {\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE).then(obj.callback);\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalled();\n    });\n\n    it('should remove individual interceptors', function() {\n      var obj = { callback: function() {} };\n\n      spyOn(obj, 'callback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, obj.callback);\n      panelRef._callInterceptors(interceptorTypes.CLOSE)\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n\n      panelRef.removeInterceptor(interceptorTypes.CLOSE, obj.callback);\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n    });\n\n    it('should remove all interceptors', function() {\n      var obj = {\n        callback: function() {},\n        otherCallback: function() {}\n      };\n\n      spyOn(obj, 'callback');\n      spyOn(obj, 'otherCallback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, obj.callback);\n      panelRef.registerInterceptor('onOpen', obj.otherCallback);\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      panelRef._callInterceptors('onOpen');\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n      expect(obj.otherCallback).toHaveBeenCalledTimes(1);\n\n      panelRef.removeAllInterceptors();\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      panelRef._callInterceptors('onOpen');\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n      expect(obj.otherCallback).toHaveBeenCalledTimes(1);\n    });\n\n    it('should remove all interceptors of a certain type', function() {\n      var obj = {\n        callback: function() {},\n        otherCallback: function() {}\n      };\n\n      spyOn(obj, 'callback');\n      spyOn(obj, 'otherCallback');\n\n      panelRef.registerInterceptor(interceptorTypes.CLOSE, obj.callback);\n      panelRef.registerInterceptor('onOpen', obj.otherCallback);\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      panelRef._callInterceptors('onOpen');\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n      expect(obj.otherCallback).toHaveBeenCalledTimes(1);\n\n      panelRef.removeAllInterceptors(interceptorTypes.CLOSE);\n\n      panelRef._callInterceptors(interceptorTypes.CLOSE);\n      panelRef._callInterceptors('onOpen');\n      flushPanel();\n\n      expect(obj.callback).toHaveBeenCalledTimes(1);\n      expect(obj.otherCallback).toHaveBeenCalledTimes(2);\n    });\n\n    describe('CLOSE interceptor', function() {\n      it('should prevent the panel from closing when the handler is rejected',\n        function() {\n          panelRef.registerInterceptor(interceptorTypes.CLOSE, function() {\n            return $q.reject();\n          });\n\n          expect(panelRef.isAttached).toBe(true);\n\n          panelRef.close().catch(angular.noop);\n          flushPanel();\n\n          expect(panelRef.isAttached).toBe(true);\n        });\n\n      it('should allow the panel to close when the handler resolves', function() {\n        panelRef.registerInterceptor(interceptorTypes.CLOSE, function() {\n          return $q.when();\n        });\n\n        expect(panelRef.isAttached).toBe(true);\n\n        closePanel();\n\n        expect(panelRef.isAttached).toBe(false);\n      });\n    });\n  });\n\n  describe('contentElement support: ', function() {\n    var config;\n\n    beforeEach(function() {\n      config = {\n        contentElement: angular.element('<div>'),\n        position: $mdPanel.newPanelPosition().absolute().center()\n      };\n    });\n\n    it('should wrap the content element in the proper HTML and assign ' +\n      'the wrapper to the panel reference', function() {\n        openPanel(config);\n\n        expect(panelRef.panelEl.parent())\n          .toHaveClass(INNER_WRAPPER_CLASS);\n\n        expect(panelRef.panelEl.parent().parent())\n          .toHaveClass(PANEL_WRAPPER_CLASS);\n\n        expect(panelRef.innerWrapper[0]).toBe(config.contentElement.parent()[0]);\n        expect(panelRef.panelContainer[0]).toBe(config.contentElement.parent().parent()[0]);\n      });\n\n    it('should add the proper class to the panel element and assign ' +\n      'it to the panel reference', function() {\n        openPanel(config);\n\n        expect(panelRef.panelEl).toHaveClass(PANEL_EL_CLASS);\n        expect(panelRef.panelEl[0]).toBe(config.contentElement[0]);\n      });\n\n    it('should restore the inline styles and classes of the element on close',\n      function() {\n        var element = config.contentElement;\n\n        element.addClass('my-only-class');\n        element.css({ top: '42px', left: '1337px' });\n\n        openPanel(config);\n        closePanel();\n\n        expect(element.attr('class')).toBe('my-only-class');\n        expect(element.css('top')).toBe('42px');\n        expect(element.css('left')).toBe('1337px');\n      });\n\n    it('should clear out any panel-specific inline styles from the element',\n      function() {\n\n        config.contentElement.css('color', 'red');\n\n        var initialStyles = config.contentElement.attr('style');\n\n        openPanel(config);\n\n        closePanel();\n\n        expect(config.contentElement.attr('style')).toBe(initialStyles);\n      });\n\n    it('should clean up the panel via the cleanup function from the compiler',\n      function() {\n        openPanel(config);\n\n        spyOn(panelRef, '_compilerCleanup');\n\n        closePanel();\n\n        expect(panelRef._compilerCleanup).toHaveBeenCalled();\n      });\n  });\n\n  /**\n   * Attached an element to document.body. Keeps track of attached elements\n   * so that they can be removed in an afterEach.\n   * @param el\n   */\n  function attachToBody(el) {\n    var element = angular.element(el);\n    angular.element(document.body).append(element);\n    attachedElements.push(element);\n  }\n\n  /**\n   * Returns the angular element associated with a CSS selector or element.\n   * @param el {string|!angular.JQLite|!Element}\n   * @returns {!angular.JQLite}\n   */\n  function getElement(el) {\n    var queryResult = angular.isString(el) ? document.querySelector(el) : el;\n    return angular.element(queryResult);\n  }\n\n  function clickPanelContainer(container) {\n    if (!panelRef) {\n      return;\n    }\n\n    container = container || panelRef.panelContainer;\n\n    container.triggerHandler({\n      type: 'mousedown',\n      target: container[0]\n    });\n\n    container.triggerHandler({\n      type: 'mouseup',\n      target: container[0]\n    });\n\n    flushPanel();\n  }\n\n  function pressEscape() {\n    if (!panelRef) {\n      return;\n    }\n\n    var container = panelRef.panelContainer;\n\n    container.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.ESCAPE\n    });\n\n    flushPanel();\n  }\n\n  /**\n   * Opens the panel. If a config value is passed, creates a new panelRef\n   * using $mdPanel.open(config); Otherwise, called open on the panelRef,\n   * assuming one has already been created.\n   * @param {!Object=} opt_config\n   */\n  function openPanel(preset, opt_config) {\n    // TODO(ErinCoughlan): Investigate why panelRef.open() doesn't return\n    // panelRef.\n    var openPromise;\n\n    if (panelRef) {\n      openPromise = panelRef.open();\n    } else {\n      openPromise = $mdPanel.open(preset, opt_config);\n    }\n\n    openPromise.then(function(createdPanelRef) {\n      panelRef = createdPanelRef;\n      return panelRef;\n    });\n\n    flushPanel();\n  }\n\n  /**\n   * Closes the panel using an already created panelRef.\n   */\n  function closePanel() {\n    panelRef && panelRef.close();\n    flushPanel();\n  }\n\n  function showPanel() {\n    panelRef && panelRef.show();\n    flushPanel();\n  }\n\n  function hidePanel() {\n    panelRef && panelRef.hide();\n    flushPanel();\n  }\n\n  function flushPanel() {\n    $rootScope.$apply();\n    $material.flushOutstandingAnimations();\n  }\n\n  function getNumberOfGroups() {\n    return Object.keys($mdPanel._groups).length;\n  }\n\n  function getGroupPanels(groupName) {\n    return $mdPanel._groups[groupName].panels;\n  }\n\n  function getGroupOpenPanels(groupName) {\n    return $mdPanel._groups[groupName].openPanels;\n  }\n\n  function getGroupMaxOpen(groupName) {\n    return $mdPanel._groups[groupName].maxOpen;\n  }\n});\n"
  },
  {
    "path": "src/components/progressCircular/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as vm\" ng-cloak>\n  <md-content layout-padding>\n    <h4>Determinate</h4>\n\n    <p>For operations where the percentage of the operation completed can be determined, use a determinate indicator. They\n      give users a quick sense of how long an operation will take.</p>\n\n    <div layout=\"row\" layout-sm=\"column\" layout-align=\"space-around\">\n      <md-progress-circular md-mode=\"determinate\" value=\"{{vm.determinateValue}}\"></md-progress-circular>\n    </div>\n\n    <h4>Indeterminate</h4>\n\n    <p>For operations where the user is asked to wait a moment while something finishes up, and it's not necessary to\n      expose what's happening behind the scenes and how long it will take, use an indeterminate indicator.</p>\n\n    <div layout=\"row\" layout-sm=\"column\" layout-align=\"space-around\">\n      <md-progress-circular md-mode=\"indeterminate\"></md-progress-circular>\n    </div>\n\n    <h4>Theming</h4>\n\n    <p>\n      Your current theme colors can be used to easily colorize your progress indicator with `md-warn` or `md-accent`\n      colors.\n    </p>\n\n    <div layout=\"row\" layout-sm=\"column\" layout-align=\"space-around\">\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-hue-2\" md-diameter=\"20px\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-accent\" md-diameter=\"40\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-accent md-hue-1\" md-diameter=\"60\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-warn md-hue-3\" md-diameter=\"70\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" md-diameter=\"96\"></md-progress-circular>\n    </div>\n  </md-content>\n\n  <md-content md-theme=\"docs-dark\" layout-padding>\n    <h4>Dark theme</h4>\n\n    <p>\n      This is an example of the <b>&lt;md-progress-circular&gt;</b> component, with a dark theme.\n    </p>\n\n    <div layout=\"row\" layout-sm=\"column\" layout-align=\"space-around\">\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-hue-2\" md-diameter=\"20px\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-accent\" md-diameter=\"40\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-accent md-hue-1\" md-diameter=\"60\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" class=\"md-warn md-hue-3\" md-diameter=\"70\"></md-progress-circular>\n      <md-progress-circular ng-disabled=\"!vm.activated\" md-diameter=\"96\"></md-progress-circular>\n    </div>\n  </md-content>\n\n  <md-content layout=\"row\" layout-align=\"start center\" layout-padding>\n    <p>Progress Circular Indicators: </p>\n\n    <h5>Off</h5>\n    <md-switch\n        ng-model=\"vm.activated\"\n        aria-label=\"Toggle Progress Circular Indicators\">\n      <h5>On</h5>\n    </md-switch>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/progressCircular/demoBasicUsage/script.js",
    "content": "angular\n  .module('progressCircularDemo1', ['ngMaterial'], function($mdThemingProvider) {\n    $mdThemingProvider.theme('docs-dark', 'default')\n      .primaryPalette('yellow')\n      .dark();\n  })\n  .controller('AppCtrl', ['$interval',\n    function($interval) {\n      var self = this;\n\n      self.activated = true;\n      self.determinateValue = 30;\n\n      // Iterate every 100ms, non-stop and increment\n      // the Determinate loader.\n      $interval(function() {\n\n        self.determinateValue += 1;\n        if (self.determinateValue > 100) {\n          self.determinateValue = 30;\n        }\n\n      }, 100);\n    }\n  ]);\n"
  },
  {
    "path": "src/components/progressCircular/demoBasicUsage/style.css",
    "content": "body {\n  padding: 20px;\n}\n\nh4 {\n    margin: 10px 0;\n}\n\nmd-progress-circular {\n    margin-bottom:20px;\n}\n\n\n#loaders > md-switch {\n    margin:0;\n    margin-left: 10px;\n    margin-top: -10px;\n}\n\n#loaders > h5 {\n  margin-top: 0;\n}\n\n#loaders > p {\n  margin-right: 20px;\n  margin-bottom: 24px;\n}\n\n\np.small {\n  font-size: 0.8em;\n  margin-top: -18px;\n}\n\n\nhr {\n  width: 100%;\n  margin-top: 20px;\n  border-color: rgba(221, 221, 177, 0.1);\n}\n\np.small > code {\n    font-size: 0.8em;\n}\n\n\n.visible  {\n    border-color: rgba(221, 221, 177, 0);\n}\n"
  },
  {
    "path": "src/components/progressCircular/js/progressCircularDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name mdProgressCircular\n * @module material.components.progressCircular\n * @restrict E\n *\n * @description\n * The circular progress directive is used to make loading content in your app as delightful and\n * painless as possible by minimizing the amount of visual change a user sees before they can view\n * and interact with content.\n *\n * For operations where the percentage of the operation completed can be determined, use a\n * determinate indicator. They give users a quick sense of how long an operation will take.\n *\n * For operations where the user is asked to wait a moment while something finishes up, and it’s\n * not necessary to expose what's happening behind the scenes and how long it will take, use an\n * indeterminate indicator.\n *\n * @param {string} md-mode Select from one of two modes: **'determinate'** and **'indeterminate'**.\n *\n * Note: if the `md-mode` value is set as undefined or specified as not 1 of the two (2) valid modes, then **'indeterminate'**\n * will be auto-applied as the mode.\n *\n * Note: if not configured, the `md-mode=\"indeterminate\"` will be auto injected as an attribute.\n * If `value=\"\"` is also specified, however, then `md-mode=\"determinate\"` would be auto-injected instead.\n * @param {number=} value In determinate mode, this number represents the percentage of the\n *     circular progress. Default: 0\n * @param {number=} md-diameter This specifies the diameter of the circular progress. The value\n * should be a pixel-size value (eg '100'). If this attribute is\n * not present then a default value of '50px' is assumed.\n *\n * @param {boolean=} ng-disabled Determines whether to disable the progress element.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-progress-circular md-mode=\"determinate\" value=\"...\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"determinate\" ng-value=\"...\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"determinate\" value=\"...\" md-diameter=\"100\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"indeterminate\"></md-progress-circular>\n * </hljs>\n */\n\nangular\n  .module('material.components.progressCircular')\n  .directive('mdProgressCircular', MdProgressCircularDirective);\n\n/* @ngInject */\nfunction MdProgressCircularDirective($window, $mdProgressCircular, $mdTheming,\n                                     $mdUtil, $interval, $log) {\n\n  // Note that this shouldn't use use $$rAF, because it can cause an infinite loop\n  // in any tests that call $animate.flush.\n  var rAF = $window.requestAnimationFrame ||\n            $window.webkitRequestAnimationFrame ||\n            angular.noop;\n\n  var cAF = $window.cancelAnimationFrame ||\n            $window.webkitCancelAnimationFrame ||\n            $window.webkitCancelRequestAnimationFrame ||\n            angular.noop;\n\n  var MODE_DETERMINATE = 'determinate';\n  var MODE_INDETERMINATE = 'indeterminate';\n  var DISABLED_CLASS = '_md-progress-circular-disabled';\n  var INDETERMINATE_CLASS = 'md-mode-indeterminate';\n\n  return {\n    restrict: 'E',\n    scope: {\n      value: '@',\n      mdDiameter: '@',\n      mdMode: '@'\n    },\n    template:\n      '<svg xmlns=\"http://www.w3.org/2000/svg\">' +\n        '<path fill=\"none\"/>' +\n      '</svg>',\n    compile: function(element, attrs) {\n      element.attr({\n        'aria-valuemin': 0,\n        'aria-valuemax': 100,\n        'role': 'progressbar'\n      });\n\n      if (angular.isUndefined(attrs.mdMode)) {\n        var mode = attrs.hasOwnProperty('value') ? MODE_DETERMINATE : MODE_INDETERMINATE;\n        attrs.$set('mdMode', mode);\n      } else {\n        attrs.$set('mdMode', attrs.mdMode.trim());\n      }\n\n      return MdProgressCircularLink;\n    }\n  };\n\n  function MdProgressCircularLink(scope, element, attrs) {\n    var node = element[0];\n    var svg = angular.element(node.querySelector('svg'));\n    var path = angular.element(node.querySelector('path'));\n    var startIndeterminate = $mdProgressCircular.startIndeterminate;\n    var endIndeterminate = $mdProgressCircular.endIndeterminate;\n    var iterationCount = 0;\n    var lastAnimationId = 0;\n    var lastDrawFrame;\n    var interval;\n\n    $mdTheming(element);\n    element.toggleClass(DISABLED_CLASS, attrs.hasOwnProperty('disabled'));\n\n    // If the mode is indeterminate, it doesn't need to\n    // wait for the next digest. It can start right away.\n    if (scope.mdMode === MODE_INDETERMINATE){\n      startIndeterminateAnimation();\n    }\n\n    scope.$on('$destroy', function(){\n      cleanupIndeterminateAnimation();\n\n      if (lastDrawFrame) {\n        cAF(lastDrawFrame);\n      }\n    });\n\n    scope.$watchGroup(['value', 'mdMode', function() {\n      var isDisabled = node.disabled;\n\n      // Sometimes the browser doesn't return a boolean, in\n      // which case we should check whether the attribute is\n      // present.\n      if (isDisabled === true || isDisabled === false){\n        return isDisabled;\n      }\n\n      return angular.isDefined(element.attr('disabled'));\n    }], function(newValues, oldValues) {\n      var mode = newValues[1];\n      var isDisabled = newValues[2];\n      var wasDisabled = oldValues[2];\n      var diameter = 0;\n      var strokeWidth = 0;\n\n      if (isDisabled !== wasDisabled) {\n        element.toggleClass(DISABLED_CLASS, !!isDisabled);\n      }\n\n      if (isDisabled) {\n        cleanupIndeterminateAnimation();\n      } else {\n        if (mode !== MODE_DETERMINATE && mode !== MODE_INDETERMINATE) {\n          mode = MODE_INDETERMINATE;\n          attrs.$set('mdMode', mode);\n        }\n\n        if (mode === MODE_INDETERMINATE) {\n          if (oldValues[1] === MODE_DETERMINATE) {\n            diameter = getSize(scope.mdDiameter);\n            strokeWidth = getStroke(diameter);\n            path.attr('d', getSvgArc(diameter, strokeWidth, true));\n            path.attr('stroke-dasharray', getDashLength(diameter, strokeWidth, 75));\n          }\n          startIndeterminateAnimation();\n        } else {\n          var newValue = clamp(newValues[0]);\n          var oldValue = clamp(oldValues[0]);\n\n          cleanupIndeterminateAnimation();\n\n          if (oldValues[1] === MODE_INDETERMINATE) {\n            diameter = getSize(scope.mdDiameter);\n            strokeWidth = getStroke(diameter);\n            path.attr('d', getSvgArc(diameter, strokeWidth, false));\n            path.attr('stroke-dasharray', getDashLength(diameter, strokeWidth, 100));\n          }\n\n          element.attr('aria-valuenow', newValue);\n          renderCircle(oldValue, newValue);\n        }\n      }\n\n    });\n\n    // This is in a separate watch in order to avoid layout, unless\n    // the value has actually changed.\n    scope.$watch('mdDiameter', function(newValue) {\n      var diameter = getSize(newValue);\n      var strokeWidth = getStroke(diameter);\n      var value = clamp(scope.value);\n      var transformOrigin = (diameter / 2) + 'px';\n      var dimensions = {\n        width: diameter + 'px',\n        height: diameter + 'px'\n      };\n\n      // The viewBox has to be applied via setAttribute, because it is\n      // case-sensitive. If jQuery is included in the page, `.attr` lowercases\n      // all attribute names.\n      svg[0].setAttribute('viewBox', '0 0 ' + diameter + ' ' + diameter);\n\n      // Usually viewBox sets the dimensions for the SVG, however that doesn't\n      // seem to be the case on IE10.\n      // Important! The transform origin has to be set from here and it has to\n      // be in the format of \"Ypx Ypx Ypx\", otherwise the rotation wobbles in\n      // IE and Edge, because they don't account for the stroke width when\n      // rotating. Also \"center\" doesn't help in this case, it has to be a\n      // precise value.\n      svg\n        .css(dimensions)\n        .css('transform-origin', transformOrigin + ' ' + transformOrigin + ' ' + transformOrigin);\n\n      element.css(dimensions);\n\n      path.attr('stroke-width', strokeWidth);\n      path.attr('stroke-linecap', 'square');\n      if (scope.mdMode == MODE_INDETERMINATE) {\n        path.attr('d', getSvgArc(diameter, strokeWidth, true));\n        path.attr('stroke-dasharray', getDashLength(diameter, strokeWidth, 75));\n        path.attr('stroke-dashoffset', getDashOffset(diameter, strokeWidth, 1, 75));\n      } else {\n        path.attr('d', getSvgArc(diameter, strokeWidth, false));\n        path.attr('stroke-dasharray', getDashLength(diameter, strokeWidth, 100));\n        path.attr('stroke-dashoffset', getDashOffset(diameter, strokeWidth, 0, 100));\n        renderCircle(value, value);\n      }\n\n    });\n\n    function renderCircle(animateFrom, animateTo, easing, duration, iterationCount, maxValue) {\n      var id = ++lastAnimationId;\n      var startTime = $mdUtil.now();\n      var changeInValue = animateTo - animateFrom;\n      var diameter = getSize(scope.mdDiameter);\n      var strokeWidth = getStroke(diameter);\n      var ease = easing || $mdProgressCircular.easeFn;\n      var animationDuration = duration || $mdProgressCircular.duration;\n      var rotation = -90 * (iterationCount || 0);\n      var dashLimit = maxValue || 100;\n\n      // No need to animate it if the values are the same\n      if (animateTo === animateFrom) {\n        renderFrame(animateTo);\n      } else {\n        lastDrawFrame = rAF(function animation() {\n          var currentTime = $window.Math.max(0, $window.Math.min($mdUtil.now() - startTime, animationDuration));\n\n          renderFrame(ease(currentTime, animateFrom, changeInValue, animationDuration));\n\n          // Do not allow overlapping animations\n          if (id === lastAnimationId && currentTime < animationDuration) {\n            lastDrawFrame = rAF(animation);\n          }\n        });\n      }\n\n      function renderFrame(value) {\n        path.attr('stroke-dashoffset', getDashOffset(diameter, strokeWidth, value, dashLimit));\n        path.attr('transform','rotate(' + (rotation) + ' ' + diameter/2 + ' ' + diameter/2 + ')');\n      }\n    }\n\n    function animateIndeterminate() {\n      renderCircle(\n        startIndeterminate,\n        endIndeterminate,\n        $mdProgressCircular.easeFnIndeterminate,\n        $mdProgressCircular.durationIndeterminate,\n        iterationCount,\n        75\n      );\n\n      // The %4 technically isn't necessary, but it keeps the rotation\n      // under 360, instead of becoming a crazy large number.\n      iterationCount = ++iterationCount % 4;\n\n    }\n\n    function startIndeterminateAnimation() {\n      if (!interval) {\n        // Note that this interval isn't supposed to trigger a digest.\n        interval = $interval(\n          animateIndeterminate,\n          $mdProgressCircular.durationIndeterminate,\n          0,\n          false\n        );\n\n        animateIndeterminate();\n\n        element\n          .addClass(INDETERMINATE_CLASS)\n          .removeAttr('aria-valuenow');\n      }\n    }\n\n    function cleanupIndeterminateAnimation() {\n      if (interval) {\n        $interval.cancel(interval);\n        interval = null;\n        element.removeClass(INDETERMINATE_CLASS);\n      }\n    }\n  }\n\n  /**\n   * Returns SVG path data for progress circle\n   * Syntax spec: https://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands\n   *\n   * @param {number} diameter Diameter of the container.\n   * @param {number} strokeWidth Stroke width to be used when drawing circle\n   * @param {boolean} indeterminate Use if progress circle will be used for indeterminate\n   *\n   * @returns {string} String representation of an SVG arc.\n   */\n  function getSvgArc(diameter, strokeWidth, indeterminate) {\n    var radius = diameter / 2;\n    var offset = strokeWidth / 2;\n    var start = radius + ',' + offset; // ie: (25, 2.5) or 12 o'clock\n    var end = offset + ',' + radius;   // ie: (2.5, 25) or  9 o'clock\n    var arcRadius = radius - offset;\n    return 'M' + start\n         + 'A' + arcRadius + ',' + arcRadius + ' 0 1 1 ' + end // 75% circle\n         + (indeterminate ? '' : 'A' + arcRadius + ',' + arcRadius + ' 0 0 1 ' + start); // loop to start\n  }\n\n  /**\n   * Return stroke length for progress circle\n   *\n   * @param {number} diameter Diameter of the container.\n   * @param {number} strokeWidth Stroke width to be used when drawing circle\n   * @param {number} value Percentage of circle (between 0 and 100)\n   * @param {number} maxArcLength Maximum length of arc as a percentage of circle (between 0 and 100)\n   *\n   * @returns {number} Stroke length for progress circle\n   */\n  function getDashOffset(diameter, strokeWidth, value, maxArcLength) {\n    return getSpinnerCircumference(diameter, strokeWidth) * ((maxArcLength - value) / 100);\n  }\n\n  /**\n   * Limits a value between 0 and 100.\n   */\n  function clamp(value) {\n    return $window.Math.max(0, $window.Math.min(value || 0, 100));\n  }\n\n  /**\n   * Determines the size of a progress circle, based on the provided\n   * value in the following formats: `X`, `Ypx`, `Z%`.\n   */\n  function getSize(value) {\n    var defaultValue = $mdProgressCircular.progressSize;\n\n    if (value) {\n      var parsed = parseFloat(value);\n\n      if (value.lastIndexOf('%') === value.length - 1) {\n        parsed = (parsed / 100) * defaultValue;\n      }\n\n      return parsed;\n    }\n\n    return defaultValue;\n  }\n\n  /**\n   * Determines the circle's stroke width, based on\n   * the provided diameter.\n   */\n  function getStroke(diameter) {\n    return $mdProgressCircular.strokeWidth / 100 * diameter;\n  }\n\n  /**\n   * Return length of the dash\n   *\n   * @param {number} diameter Diameter of the container.\n   * @param {number} strokeWidth Stroke width to be used when drawing circle\n   * @param {number} value Percentage of circle (between 0 and 100)\n   *\n   * @returns {number} Length of the dash\n   */\n  function getDashLength(diameter, strokeWidth, value) {\n    return getSpinnerCircumference(diameter, strokeWidth) * (value / 100);\n  }\n\n  /**\n   * Return circumference of the spinner\n   *\n   * @param {number} diameter Diameter of the container.\n   * @param {number} strokeWidth Stroke width to be used when drawing circle\n   *\n   * @returns {number} Circumference of the spinner\n   */\n  function getSpinnerCircumference(diameter, strokeWidth) {\n    return ((diameter - strokeWidth) * $window.Math.PI);\n  }\n\n}\n"
  },
  {
    "path": "src/components/progressCircular/js/progressCircularProvider.js",
    "content": "/**\n * @ngdoc service\n * @name $mdProgressCircular\n * @module material.components.progressCircular\n *\n * @description\n * Allows the user to specify the default options for the `progressCircular` directive.\n *\n * @property {number} progressSize Diameter of the progress circle in pixels.\n * @property {number} strokeWidth Width of the circle's stroke as a percentage of the circle's size.\n * @property {number} duration Length of the circle animation in milliseconds.\n * @property {function} easeFn Default easing animation function.\n * @property {object} easingPresets Collection of pre-defined easing functions.\n *\n * @property {number} durationIndeterminate Duration of the indeterminate animation.\n * @property {number} startIndeterminate Indeterminate animation start point.\n * @property {number} endIndeterminate Indeterminate animation end point.\n * @property {function} easeFnIndeterminate Easing function to be used when animating\n * between the indeterminate values.\n *\n * @property {(function(object): object)} configure Used to modify the default options.\n *\n * @usage\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdProgressCircularProvider) {\n *\n *     // Example of changing the default progress options.\n *     $mdProgressCircularProvider.configure({\n *       progressSize: 100,\n *       strokeWidth: 20,\n *       duration: 800\n *     });\n * });\n * </hljs>\n *\n */\n\nangular\n  .module('material.components.progressCircular')\n  .provider(\"$mdProgressCircular\", MdProgressCircularProvider);\n\nfunction MdProgressCircularProvider() {\n  var progressConfig = {\n    progressSize: 50,\n    strokeWidth: 10,\n    duration: 100,\n    easeFn: linearEase,\n\n    durationIndeterminate: 1333,\n    startIndeterminate: 1,\n    endIndeterminate: 149,\n    easeFnIndeterminate: materialEase,\n\n    easingPresets: {\n      linearEase: linearEase,\n      materialEase: materialEase\n    }\n  };\n\n  return {\n    configure: function(options) {\n      progressConfig = angular.extend(progressConfig, options || {});\n      return progressConfig;\n    },\n    $get: function() { return progressConfig; }\n  };\n\n  function linearEase(t, b, c, d) {\n    return c * t / d + b;\n  }\n\n  function materialEase(t, b, c, d) {\n    // via http://www.timotheegroleau.com/Flash/experiments/easing_function_generator.htm\n    // with settings of [0, 0, 1, 1]\n    var ts = (t /= d) * t;\n    var tc = ts * t;\n    return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);\n  }\n}\n"
  },
  {
    "path": "src/components/progressCircular/progress-circular-theme.scss",
    "content": "md-progress-circular.md-THEME_NAME-theme {\n\n  path {\n    stroke: '{{primary-color}}';\n  }\n\n  &.md-warn {\n    path {\n      stroke: '{{warn-color}}';\n    }\n  }\n\n  &.md-accent {\n    path {\n      stroke: '{{accent-color}}';\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/components/progressCircular/progress-circular.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.progressCircular\n * @description Module for a circular progressbar\n */\n\nangular.module('material.components.progressCircular', ['material.core']);\n"
  },
  {
    "path": "src/components/progressCircular/progress-circular.scss",
    "content": "$progress-circular-indeterminate-duration: 1568.63ms !default;\n\n@keyframes indeterminate-rotate {\n    0%       { transform: rotate(0deg); }\n    100%     { transform: rotate(360deg); }\n}\n\n// Used to avoid unnecessary layout\nmd-progress-circular {\n    position: relative;\n    display: block;\n\n    @include rtl(transform, scale(1, 1), scale(-1, 1));\n\n    &._md-progress-circular-disabled {\n        visibility: hidden;\n    }\n\n    &.md-mode-indeterminate svg {\n        animation: indeterminate-rotate $progress-circular-indeterminate-duration linear infinite;\n    }\n\n    svg {\n        position: absolute;\n        overflow: visible;\n        top: 0;\n        left: 0;\n    }\n}\n"
  },
  {
    "path": "src/components/progressCircular/progress-circular.spec.js",
    "content": "describe('mdProgressCircular', function() {\n  var $compile, $rootScope, config, element;\n\n  beforeEach(module('material.components.progressCircular'));\n  beforeEach(inject(function(_$compile_, _$rootScope_, _$mdProgressCircular_) {\n    $compile = _$compile_;\n    $rootScope = _$rootScope_;\n    config = _$mdProgressCircular_;\n  }));\n\n  afterEach(function() {\n    if (element) {\n      element.remove();\n    }\n  });\n\n  it('should auto-set the md-mode to \"indeterminate\" if not specified', function() {\n    var progress = buildIndicator('<md-progress-circular></md-progress-circular>');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n      $rootScope.mode = \"\";\n    });\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should auto-set the md-mode to \"indeterminate\" if specified not as \"indeterminate\" or \"determinate\"', function() {\n    var progress = buildIndicator('<md-progress-circular md-mode=\"test\"></md-progress-circular>');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n      $rootScope.mode = \"\";\n    });\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should trim the md-mode value', function() {\n    var progress = buildIndicator('<md-progress-circular md-mode=\" indeterminate\"></md-progress-circular>');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n    });\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should auto-set the md-mode to \"determinate\" if not specified but has value', function() {\n    var progress = buildIndicator('<md-progress-circular value=\"{{progress}}\"></md-progress-circular>');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n      $rootScope.mode = \"\";\n    });\n\n    expect(progress.attr('md-mode')).toEqual('determinate');\n  });\n\n  it('should update aria-valuenow', function() {\n    var progress = buildIndicator('<md-progress-circular value=\"{{progress}}\"></md-progress-circular>');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n    });\n\n    expect(progress.attr('aria-valuenow')).toEqual('50');\n  });\n\n  it('should not set aria-valuenow in indeterminate mode', function() {\n    var progress = buildIndicator('<md-progress-circular md-mode=\"indeterminate\" value=\"100\"></md-progress-circular>');\n\n    expect(progress.attr('aria-valuenow')).toBeUndefined();\n  });\n\n  it('should set the size using percentage values',function() {\n    var progress = buildIndicator('<md-progress-circular md-diameter=\"50%\"></md-progress-circular>');\n    var expectedSize = config.progressSize / 2 + 'px';\n\n    expect(progress.css('width')).toBe(expectedSize);\n    expect(progress.css('height')).toBe(expectedSize);\n  });\n\n  it('should set the size using pixel values', function() {\n    var progress = buildIndicator('<md-progress-circular md-diameter=\"37px\"></md-progress-circular>');\n\n    expect(progress.css('width')).toBe('37px');\n    expect(progress.css('height')).toBe('37px');\n  });\n\n  it('should scale the stroke width as a percentage of the diameter', function() {\n    var ratio = config.strokeWidth;\n    var diameter = 25;\n    var path = buildIndicator(\n      '<md-progress-circular md-diameter=\"' + diameter + '\"></md-progress-circular>'\n    ).find('path').eq(0);\n\n    expect(parseFloat(path.attr('stroke-width'))).toBe(diameter / ratio);\n  });\n\n  it('should hide the element if is disabled', function() {\n    var element = buildIndicator(\n      '<md-progress-circular disabled></md-progress-circular>'\n    );\n\n    expect(element.hasClass('_md-progress-circular-disabled')).toBe(true);\n  });\n\n  it('should set the transform origin in all dimensions', function() {\n    var svg = buildIndicator('<md-progress-circular md-diameter=\"42px\"></md-progress-circular>').find('svg').eq(0);\n    expect(svg.css('transform-origin')).toBe('21px 21px 21px');\n  });\n\n  it('should adjust the element size when the diameter changes', function() {\n    $rootScope.diameter = 30;\n\n    var element = buildIndicator(\n      '<md-progress-circular value=\"50\" md-diameter=\"{{diameter}}\"></md-progress-circular>'\n    );\n\n    var path = element.find('path');\n    var initialPathDimensions = path.attr('d');\n\n    expect(element.css('width')).toBe('30px');\n    expect(element.css('height')).toBe('30px');\n    expect(initialPathDimensions).toBeTruthy();\n\n    $rootScope.$apply('diameter = 60');\n\n    expect(element.css('width')).toBe('60px');\n    expect(element.css('height')).toBe('60px');\n    expect(path.attr('d')).not.toBe(initialPathDimensions);\n  });\n\n  /**\n   * Build a progressCircular\n   */\n  function buildIndicator(template) {\n    element = $compile(template)($rootScope);\n    $rootScope.$digest();\n\n    return element;\n  }\n\n});\n\ndescribe('mdProgressCircularProvider', function() {\n    beforeEach(function() {\n        module('material.components.progressCircular', function($mdProgressCircularProvider) {\n          $mdProgressCircularProvider.configure({\n            progressSize: 1337,\n            strokeWidth: 42\n          });\n        });\n    });\n\n    it('should allow for the default options to be configured', inject(function($mdProgressCircular) {\n        expect($mdProgressCircular.progressSize).toBe(1337);\n        expect($mdProgressCircular.strokeWidth).toBe(42);\n    }));\n});\n"
  },
  {
    "path": "src/components/progressLinear/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as vm\" layout=\"column\" layout-margin style=\"padding:25px;\" ng-cloak>\n\n  <h2 class=\"md-title\">Determinate</h2>\n\n  <p>\n    For operations where the percentage of the operation completed can be determined, use a <b>determinate</b>\n    indicator.\n    They give users a quick sense of how long an operation will take.\n  </p>\n  <md-progress-linear md-mode=\"determinate\" value=\"{{vm.determinateValue}}\"></md-progress-linear>\n\n  <h4 class=\"md-title\">Indeterminate</h4>\n\n  <p>\n    For operations where the user is asked to wait a moment while something finishes up, and it's not\n    necessary to expose what's happening behind the scenes and how long it will take, use an\n    <b>indeterminate</b> indicator:\n  </p>\n  <md-progress-linear md-mode=\"indeterminate\"></md-progress-linear>\n\n  <h4 class=\"md-title\">Buffer</h4>\n\n  <p>\n    For operations where the user wants to indicate some activity or loading from the server,\n    use the <b>buffer</b> indicator:\n  </p>\n  <md-progress-linear class=\"md-warn\" md-mode=\"buffer\" value=\"{{vm.determinateValue}}\"\n                      md-buffer-value=\"{{vm.determinateValue2}}\"\n                      ng-disabled=\"!vm.showList[0]\"></md-progress-linear>\n\n  <h4 class=\"md-title\">Query</h4>\n\n  <p>\n    For situations where the user wants to indicate pre-loading (until the loading can actually be made),\n    use the <b>query</b> indicator:\n  </p>\n\n  <div class=\"container\" ng-class=\"{'visible' : !vm.activated}\">\n    <md-progress-linear md-mode=\"query\" ng-disabled=\"!vm.showList[1]\"></md-progress-linear>\n    <div class=\"bottom-block\">\n      <span>Loading application libraries...</span>\n    </div>\n  </div>\n\n  <hr ng-class=\"{'visible' : vm.activated}\">\n\n  <div id=\"loaders\" layout=\"row\" layout-align=\"start center\">\n\n    <p>Query and Buffer progress linear indicators: </p>\n\n    <h5>Off</h5>\n    <md-switch\n        ng-model=\"vm.activated\"\n        ng-change=\"vm.toggleActivation()\"\n        aria-label=\"Enable Indicators\">\n      <h5>On</h5>\n    </md-switch>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/progressLinear/demoBasicUsage/script.js",
    "content": "angular.module('progressLinearDemo1', ['ngMaterial'])\n  .config(function($mdThemingProvider) {\n  })\n  .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n    var self = this, j= 0, counter = 0;\n\n    self.mode = 'query';\n    self.activated = true;\n    self.determinateValue = 30;\n    self.determinateValue2 = 30;\n\n    self.showList = [];\n\n    /**\n     * Turn off or on the 5 themed loaders\n     */\n    self.toggleActivation = function() {\n        if (!self.activated) self.showList = [];\n        if (self.activated) {\n          j = counter = 0;\n          self.determinateValue = 30;\n          self.determinateValue2 = 30;\n        }\n    };\n\n    $interval(function() {\n      self.determinateValue += 1;\n      self.determinateValue2 += 1.5;\n\n      if (self.determinateValue > 100) self.determinateValue = 30;\n      if (self.determinateValue2 > 100) self.determinateValue2 = 30;\n\n        // Incrementally start animation the five (5) Indeterminate,\n        // themed progress circular bars\n\n        if ((j < 2) && !self.showList[j] && self.activated) {\n          self.showList[j] = true;\n        }\n        if (counter++ % 4 === 0) j++;\n\n        // Show the indicator in the \"Used within Containers\" after 200ms delay\n        if (j == 2) self.contained = \"indeterminate\";\n\n    }, 100, 0, true);\n\n    $interval(function() {\n      self.mode = (self.mode == 'query' ? 'determinate' : 'query');\n    }, 7200, 0, true);\n  }]);\n"
  },
  {
    "path": "src/components/progressLinear/demoBasicUsage/style.css",
    "content": "body {\n  padding: 20px;\n}\n\nh4 {\n  margin: 10px 0;\n}\n\nmd-progress-linear {\n  padding-top: 10px;\n  margin-bottom: 20px;\n}\n\n#loaders > md-switch {\n  margin: 0;\n  margin-left: 10px;\n  margin-top: -10px;\n}\n\n#loaders > h5 {\n  margin-top: 0;\n}\n\n#loaders > p {\n  margin-right: 20px;\n  margin-bottom: 24px;\n}\n\np.small {\n  font-size: 0.8em;\n  margin-top: -18px;\n}\n\nhr {\n  width: 100%;\n  margin-top: 20px;\n  border-color: rgba(221, 221, 177, 0.1);\n}\n\n\np.small > code {\n    font-size: 0.8em;\n}\n\n.visible  {\n    opacity: 0;\n    border: 2px solid white !important;\n}\n\n\n.container {\n  display: block;\n  position: relative;\n  width: 100%;\n  border: 2px solid rgb(170,209,249);\n  transition: opacity  0.1s linear;\n  border-top: 0px;\n}\n\n.bottom-block {\n  display: block;\n  position: relative;\n  background-color: rgba(255, 235, 169, 0.25);\n  height: 85px;\n  width: 100%;\n}\n\n.bottom-block > span {\n  display: inline-block;\n  margin-top:10px;\n  padding:25px;\n  font-size: 0.9em;\n}\n"
  },
  {
    "path": "src/components/progressLinear/progress-linear-theme.scss",
    "content": "md-progress-linear.md-THEME_NAME-theme {\n  .md-container {\n    background-color: '{{primary-100}}';\n  }\n\n  .md-bar {\n    background-color: '{{primary-color}}';\n  }\n\n  &.md-warn {\n    .md-container {\n      background-color: '{{warn-100}}';\n    }\n\n    .md-bar {\n      background-color: '{{warn-color}}';\n    }\n  }\n\n  &.md-accent {\n    .md-container {\n      background-color: '{{accent-100}}';\n    }\n\n    .md-bar {\n      background-color: '{{accent-color}}';\n    }\n  }\n\n  &[md-mode=buffer] {\n    &.md-primary {\n\t  .md-bar1 {\n        background-color: '{{primary-100}}';\n      }\n      .md-dashed:before {\n        background: radial-gradient('{{primary-100}}' 0%, '{{primary-100}}' 16%, transparent 42%);\n      } \n\t}\n    &.md-warn {\n      .md-bar1 {\n        background-color: '{{warn-100}}';\n      }\n      .md-dashed:before {\n        background: radial-gradient('{{warn-100}}' 0%, '{{warn-100}}' 16%, transparent 42%);\n      }\n    }\n    &.md-accent {\n      .md-bar1 {\n        background-color: '{{accent-100}}';\n      }\n      .md-dashed:before {\n        background: radial-gradient('{{accent-100}}' 0%, '{{accent-100}}' 16%, transparent 42%);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/progressLinear/progress-linear.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.progressLinear\n * @description Linear Progress module!\n */\nangular.module('material.components.progressLinear', [\n  'material.core'\n])\n  .directive('mdProgressLinear', MdProgressLinearDirective);\n\n/**\n * @ngdoc directive\n * @name mdProgressLinear\n * @module material.components.progressLinear\n * @restrict E\n *\n * @description\n * The linear progress directive is used to make loading content\n * in your app as delightful and painless as possible by minimizing\n * the amount of visual change a user sees before they can view\n * and interact with content.\n *\n * Each operation should only be represented by one activity indicator\n * For example: one refresh operation should not display both a\n * refresh bar and an activity circle.\n *\n * For operations where the percentage of the operation completed\n * can be determined, use a determinate indicator. They give users\n * a quick sense of how long an operation will take.\n *\n * For operations where the user is asked to wait a moment while\n * something finishes up, and it’s not necessary to expose what's\n * happening behind the scenes and how long it will take, use an\n * indeterminate indicator.\n *\n * @param {string} md-mode Select from one of four modes: determinate, indeterminate, buffer or query.\n *\n * Note: if the `md-mode` value is set as undefined or specified as 1 of the four (4) valid modes, then `indeterminate`\n * will be auto-applied as the mode.\n *\n * Note: if not configured, the `md-mode=\"indeterminate\"` will be auto injected as an attribute. If `value=\"\"` is also specified, however,\n * then `md-mode=\"determinate\"` would be auto-injected instead.\n * @param {number=} value In determinate and buffer modes, this number represents the percentage of the primary progress bar. Default: 0\n * @param {number=} md-buffer-value In the buffer mode, this number represents the percentage of the secondary progress bar. Default: 0\n * @param {boolean=} ng-disabled Determines whether to disable the progress element.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-progress-linear md-mode=\"determinate\" value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"determinate\" ng-value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"indeterminate\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"buffer\" value=\"...\" md-buffer-value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"query\"></md-progress-linear>\n * </hljs>\n */\nfunction MdProgressLinearDirective($mdTheming, $mdUtil, $log) {\n  var MODE_DETERMINATE = \"determinate\";\n  var MODE_INDETERMINATE = \"indeterminate\";\n  var MODE_BUFFER = \"buffer\";\n  var MODE_QUERY = \"query\";\n  var DISABLED_CLASS = \"_md-progress-linear-disabled\";\n\n  return {\n    restrict: 'E',\n    template: '<div class=\"md-container\">' +\n      '<div class=\"md-dashed\"></div>' +\n      '<div class=\"md-bar md-bar1\"></div>' +\n      '<div class=\"md-bar md-bar2\"></div>' +\n      '</div>',\n    compile: compile\n  };\n\n  function compile(tElement, tAttrs, transclude) {\n    tElement.attr('aria-valuemin', 0);\n    tElement.attr('aria-valuemax', 100);\n    tElement.attr('role', 'progressbar');\n\n    return postLink;\n  }\n  function postLink(scope, element, attr) {\n    $mdTheming(element);\n\n    var lastMode;\n    var isDisabled = attr.hasOwnProperty('disabled');\n    var toVendorCSS = $mdUtil.dom.animator.toCss;\n    var bar1 = angular.element(element[0].querySelector('.md-bar1'));\n    var bar2 = angular.element(element[0].querySelector('.md-bar2'));\n    var container = angular.element(element[0].querySelector('.md-container'));\n\n    element\n      .attr('md-mode', mode())\n      .toggleClass(DISABLED_CLASS, isDisabled);\n\n    validateMode();\n    watchAttributes();\n\n    /**\n     * Watch the value, md-buffer-value, and md-mode attributes\n     */\n    function watchAttributes() {\n      attr.$observe('value', function(value) {\n        var percentValue = clamp(value);\n        element.attr('aria-valuenow', percentValue);\n\n        if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);\n      });\n\n      attr.$observe('mdBufferValue', function(value) {\n        animateIndicator(bar1, clamp(value));\n      });\n\n      attr.$observe('disabled', function(value) {\n        if (value === true || value === false) {\n          isDisabled = !!value;\n        } else {\n          isDisabled = angular.isDefined(value);\n        }\n\n        element.toggleClass(DISABLED_CLASS, isDisabled);\n        container.toggleClass(lastMode, !isDisabled);\n      });\n\n      attr.$observe('mdMode', function(mode) {\n        if (lastMode) container.removeClass(lastMode);\n\n        switch (mode) {\n          case MODE_QUERY:\n          case MODE_BUFFER:\n          case MODE_DETERMINATE:\n          case MODE_INDETERMINATE:\n            container.addClass(lastMode = \"md-mode-\" + mode);\n            break;\n          default:\n            container.addClass(lastMode = \"md-mode-\" + MODE_INDETERMINATE);\n            break;\n        }\n      });\n    }\n\n    /**\n     * Auto-defaults the mode to either `determinate` or `indeterminate` mode; if not specified\n     */\n    function validateMode() {\n      if (angular.isUndefined(attr.mdMode)) {\n        var hasValue = angular.isDefined(attr.value);\n        var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;\n        var info = \"Auto-adding the missing md-mode='{0}' to the ProgressLinear element\";\n        element.attr(\"md-mode\", mode);\n        attr.mdMode = mode;\n      }\n    }\n\n    /**\n     * Is the md-mode a valid option?\n     */\n    function mode() {\n      var value = (attr.mdMode || \"\").trim();\n      if (value) {\n        switch (value) {\n          case MODE_DETERMINATE:\n          case MODE_INDETERMINATE:\n          case MODE_BUFFER:\n          case MODE_QUERY:\n            break;\n          default:\n            value = MODE_INDETERMINATE;\n            break;\n        }\n      }\n      return value;\n    }\n\n    /**\n     * Manually set CSS to animate the Determinate indicator based on the specified\n     * percentage value (0-100).\n     */\n    function animateIndicator(target, value) {\n      if (isDisabled || !mode()) return;\n\n      var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [(value-100)/2, value/100]);\n      var styles = toVendorCSS({ transform : to });\n      angular.element(target).css(styles);\n    }\n  }\n\n  /**\n   * Clamps the value to be between 0 and 100.\n   * @param {number} value The value to clamp.\n   * @returns {number}\n   */\n  function clamp(value) {\n    return Math.max(0, Math.min(value || 0, 100));\n  }\n}\n\n"
  },
  {
    "path": "src/components/progressLinear/progress-linear.scss",
    "content": "$progress-linear-bar-height: 5px !default;\n\nmd-progress-linear {\n  display: block;\n  position: relative;\n  width: 100%;\n  height: $progress-linear-bar-height;\n\n  padding-top: 0 !important;\n  margin-bottom: 0 !important;\n\n  @include rtl(transform, scale(1, 1), scale(-1, 1));\n\n  &._md-progress-linear-disabled {\n    visibility: hidden;\n  }\n\n  .md-container {\n    display:block;\n    position: relative;\n    overflow: hidden;\n\n    width:100%;\n    height: $progress-linear-bar-height;\n\n    transform: translate(0, 0) scale(1, 1);\n\n    .md-bar {\n      position: absolute;\n\n      left: 0;\n      top: 0;\n      bottom: 0;\n\n      width: 100%;\n      height: $progress-linear-bar-height;\n    }\n\n    .md-dashed:before {\n      content: \"\";\n      display: none;\n      position: absolute;\n\n      margin-top: 0;\n      height: $progress-linear-bar-height;\n      width: 100%;\n\n      background-color: transparent;\n      background-size: 10px 10px !important;\n      background-position: 0px -23px;\n    }\n\n    .md-bar1, .md-bar2 {\n\n      // Just set the transition information here.\n      // Note: the actual transform values are calculated in JS\n\n      transition: transform 0.2s linear;\n    }\n\n    // ************************************************************\n    // Animations for modes: Determinate, InDeterminate, and Query\n    // ************************************************************\n\n    &.md-mode-query {\n        .md-bar1 {\n          display: none;\n        }\n        .md-bar2 {\n          transition: all 0.2s linear;\n          animation: query .8s infinite cubic-bezier(0.390, 0.575, 0.565, 1.000);\n        }\n      }\n\n    &.md-mode-determinate {\n      .md-bar1 {\n        display: none;\n      }\n    }\n\n    &.md-mode-indeterminate {\n      .md-bar1 {\n        animation: md-progress-linear-indeterminate-scale-1 4s infinite,\n                   md-progress-linear-indeterminate-1 4s infinite;\n      }\n      .md-bar2 {\n        animation: md-progress-linear-indeterminate-scale-2 4s infinite,\n                   md-progress-linear-indeterminate-2 4s infinite;\n      }\n    }\n\n    &.ng-hide\n    ._md-progress-linear-disabled & {\n      animation: none;\n\n      .md-bar1 {\n        animation-name: none;\n      }\n      .md-bar2 {\n        animation-name: none;\n      }\n    }\n  }\n\n  // Special animations for the `buffer` mode\n\n  .md-container.md-mode-buffer {\n    background-color: transparent !important;\n\n    transition: all 0.2s linear;\n\n    .md-dashed:before {\n      display: block;\n      animation: buffer 3s infinite linear;\n    }\n  }\n}\n\n@keyframes query {\n  0% {\n    opacity: 1;\n    transform: translateX(35%) scale(.3, 1);\n  }\n  100% {\n    opacity: 0;\n    transform: translateX(-50%) scale(0, 1);\n  }\n}\n@keyframes buffer {\n  0% {\n    opacity: 1;\n    background-position: 0px -23px;\n  }\n  50% {\n    opacity: 0;\n  }\n  100% {\n    opacity: 1;\n    background-position: -200px -23px;\n  }\n}\n@keyframes md-progress-linear-indeterminate-scale-1 {\n  0% {\n    transform: scaleX(0.1);\n    animation-timing-function: linear;\n  }\n  36.6% {\n    transform: scaleX(0.1);\n    animation-timing-function: cubic-bezier(0.334731432, 0.124819821, 0.785843996, 1);\n  }\n  69.15% {\n    transform: scaleX(0.83);\n    animation-timing-function: cubic-bezier(0.225732004, 0, 0.233648906, 1.3709798);\n  }\n  100% {\n    transform: scaleX(0.1);\n  }\n}\n@keyframes md-progress-linear-indeterminate-1 {\n  0% {\n    left: math.div(-378.6 * 100%, 360);\n    animation-timing-function: linear;\n  }\n  20% {\n    left: math.div(-378.6 * 100%, 360);\n    animation-timing-function: cubic-bezier(0.5, 0, 0.701732, 0.495818703);\n  }\n  69.15% {\n    left: math.div(77.4 * 100%, 360);\n    animation-timing-function: cubic-bezier(0.302435, 0.38135197, 0.55, 0.956352125);\n  }\n  100% {\n    left: math.div(343.6 * 100%, 360);\n  }\n}\n@keyframes md-progress-linear-indeterminate-scale-2 {\n  0% {\n    transform: scaleX(0.1);\n    animation-timing-function: cubic-bezier(0.205028172, 0.057050836, 0.57660995, 0.453970841);\n  }\n  19.15% {\n    transform: scaleX(0.57);\n    animation-timing-function: cubic-bezier(0.152312994, 0.196431957, 0.648373778, 1.00431535);\n  }\n  44.15% {\n    transform: scaleX(0.91);\n    animation-timing-function: cubic-bezier(0.25775882, -0.003163357, 0.211761916, 1.38178961);\n  }\n  100% {\n    transform: scaleX(0.1);\n  }\n}\n@keyframes md-progress-linear-indeterminate-2 {\n  0% {\n    left: math.div(-197.6 * 100%, 360);\n    animation-timing-function: cubic-bezier(0.15, 0, 0.5150584, 0.409684966);\n  }\n  25% {\n    left: math.div(-62.1 * 100%, 360);\n    animation-timing-function: cubic-bezier(0.3103299, 0.284057684, 0.8, 0.733718979);\n  }\n  48.35% {\n    left: math.div(106.2 * 100%, 360);\n    animation-timing-function: cubic-bezier(0.4, 0.627034903, 0.6, 0.902025796);\n  }\n  100% {\n    left: math.div(422.6 * 100%, 360);\n  }\n}\n\n\n"
  },
  {
    "path": "src/components/progressLinear/progress-linear.spec.js",
    "content": "describe('mdProgressLinear', function() {\n\n  var element, $rootScope, $compile, $mdConstant;\n\n  function makeElement(attrs) {\n    element = $compile(\n      '<div>' +\n        '<md-progress-linear ' + (attrs || '') + '></md-progress-linear>' +\n      '</div>'\n    )($rootScope);\n\n    $rootScope.$digest();\n    return element;\n  }\n\n  beforeEach(function() {\n    module('material.components.progressLinear');\n\n    inject(function(_$compile_, _$rootScope_, _$mdConstant_) {\n      $rootScope = _$rootScope_;\n      $compile = _$compile_;\n      $mdConstant = _$mdConstant_;\n    });\n  });\n\n  afterEach(function() {\n    element && element.remove();\n  });\n\n  it('should auto-set the md-mode to \"indeterminate\" if not specified', function() {\n    var element = makeElement();\n    var progress = element.find('md-progress-linear');\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should auto-set the md-mode to \"indeterminate\" if specified a not valid mode', function() {\n    var element = makeElement('md-mode=\"test\"');\n    var progress = element.find('md-progress-linear');\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should trim the md-mode value', function() {\n    var element = makeElement('md-mode=\" indeterminate\"');\n    var progress = element.find('md-progress-linear');\n\n    expect(progress.attr('md-mode')).toEqual('indeterminate');\n  });\n\n  it('should auto-set the md-mode to \"determinate\" if not specified but has value', function() {\n    var element = makeElement('value=\"{{progress}}\"');\n    var progress = element.find('md-progress-linear');\n\n    $rootScope.$apply('progress = 50');\n\n    expect(progress.attr('md-mode')).toEqual('determinate');\n  });\n\n  it('should set not transform if mode is undefined', function() {\n    var element = makeElement('value=\"{{progress}}\" md-mode=\"{{mode}}\"');\n    var bar2 = element[0].querySelector('.md-bar2');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n      $rootScope.mode = '';\n    });\n\n    expect(bar2.style[$mdConstant.CSS.TRANSFORM]).toEqual('');\n  });\n\n  it('should set transform based on value', function() {\n    var element = makeElement('value=\"{{progress}}\" md-mode=\"determinate\"');\n    var bar2 = element[0].querySelector('.md-bar2');\n\n    $rootScope.$apply('progress = 50');\n    expect(bar2.style[$mdConstant.CSS.TRANSFORM]).toEqual('translateX(-25%) scale(0.5, 1)');\n  });\n\n  it('should update aria-valuenow', function() {\n    var element = makeElement('value=\"{{progress}}\"');\n    var progress = element.find('md-progress-linear');\n\n    $rootScope.$apply('progress = 50');\n    expect(progress.eq(0).attr('aria-valuenow')).toEqual('50');\n  });\n\n  it('should set transform based on buffer value', function() {\n    var element = makeElement('value=\"{{progress}}\" md-buffer-value=\"{{progress2}}\" md-mode=\"buffer\"');\n    var bar1 = element[0].querySelector('.md-bar1');\n\n    $rootScope.$apply(function() {\n      $rootScope.progress = 50;\n      $rootScope.progress2 = 75;\n    });\n\n    expect(bar1.style[$mdConstant.CSS.TRANSFORM]).toEqual('translateX(-12.5%) scale(0.75, 1)');\n  });\n\n  it('should not set transform in query mode', function() {\n    var element = makeElement('md-mode=\"query\" value=\"{{progress}}\"');\n    var bar2 = element[0].querySelector('.md-bar2');\n\n    $rootScope.$apply('progress = 80');\n    expect(bar2.style[$mdConstant.CSS.TRANSFORM]).toBeFalsy();\n  });\n\n  describe('disabled mode', function() {\n    it('should hide the element', function() {\n      var element = makeElement('disabled');\n      var progress = element.find('md-progress-linear').eq(0);\n      expect(progress.hasClass('_md-progress-linear-disabled')).toBe(true);\n    });\n\n    it('should toggle the mode on the container', function() {\n      var element = makeElement('md-mode=\"query\" ng-disabled=\"isDisabled\"');\n      var container = angular.element(element[0].querySelector('.md-container'));\n      var modeClass = 'md-mode-query';\n\n      expect(container.hasClass(modeClass)).toBe(true);\n\n      $rootScope.$apply('isDisabled = true');\n      expect(container.hasClass(modeClass)).toBe(false);\n\n      $rootScope.$apply('isDisabled = false');\n      expect(container.hasClass(modeClass)).toBe(true);\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/radioButton/demoBasicUsage/index.html",
    "content": "<div>\n  <form ng-submit=\"submit()\" ng-controller=\"AppCtrl\" ng-cloak>\n    <p>\n      <label id=\"favoriteFruit\">Favorite Fruit:</label> <span class=\"radioValue\">{{ data.group1 }}</span>\n    </p>\n    <md-radio-group ng-model=\"data.group1\" aria-labelledby=\"favoriteFruit\">\n      <md-radio-button value=\"Apple\" class=\"md-primary\">Apple</md-radio-button>\n      <md-radio-button value=\"Banana\">Banana</md-radio-button>\n      <md-radio-button value=\"Mango\">Mango</md-radio-button>\n    </md-radio-group>\n    <hr />\n\n    <p>\n      <label id=\"selectedValue\">Selected Value:</label> <span class=\"radioValue\">{{ data.group2 }}</span>\n    </p>\n    <md-radio-group ng-model=\"data.group2\" class=\"md-primary\" aria-labelledby=\"selectedValue\">\n        <md-radio-button ng-repeat=\"d in radioData\"\n                         ng-value=\"d.value\"\n                         ng-disabled=\" d.isDisabled \"\n                         ng-class=\"{'md-align-top-left': $index==1}\" >\n            {{ d.label }}<br/>\n          <span class=\"ipsum\"\n                ng-if=\"$index == 1\">\n            Duis placerat lectus et justo mollis, nec sodales orci congue. Vestibulum semper non urna ac suscipit.\n            Vestibulum tempor, ligula id laoreet hendrerit, massa augue iaculis magna,\n            sit amet dapibus tortor ligula non nibh.\n          </span>\n        </md-radio-button>\n    </md-radio-group>\n    <p>\n      <md-button class=\"md-raised\" ng-click=\"addItem()\" type=\"button\">Add</md-button>\n      <md-button class=\"md-raised\" ng-click=\"removeItem()\" type=\"button\">Remove</md-button>\n    </p>\n    <hr />\n\n    <p class=\"demo-description\">Graphic radio buttons need to be labeled with the <code>aria-label</code> attribute.</p>\n    <p>\n      <label id=\"selectedAvatar\">Selected Avatar:</label> <span class=\"radioValue\">{{ data.group3 }}</span>\n    </p>\n\n    <md-radio-group ng-model=\"data.group3\" aria-labelledby=\"selectedAvatar\">\n      <md-radio-button ng-repeat=\"it in avatarData\"\n                       ng-value=\"it.value\"\n                       aria-label=\"{{it.title}}\">\n          <md-icon md-svg-icon=\"{{it.id}}\"></md-icon>\n      </md-radio-button>\n    </md-radio-group>\n  </form>\n</div>\n"
  },
  {
    "path": "src/components/radioButton/demoBasicUsage/script.js",
    "content": "angular\n  .module('radioDemo1', ['ngMaterial'])\n  .controller('AppCtrl', function($scope) {\n\n    $scope.data = {\n      group1 : 'Banana',\n      group2 : '2',\n      group3 : 'avatar-1'\n    };\n\n    $scope.avatarData = [{\n        id: \"avatars:svg-1\",\n        title: 'avatar 1',\n        value: 'avatar-1'\n      },{\n        id: \"avatars:svg-2\",\n        title: 'avatar 2',\n        value: 'avatar-2'\n      },{\n        id: \"avatars:svg-3\",\n        title: 'avatar 3',\n        value: 'avatar-3'\n    }];\n\n    $scope.radioData = [\n      { label: '1', value: 1 },\n      { label: '2', value: 2 },\n      { label: '3', value: '3', isDisabled: true },\n      { label: '4', value: '4' }\n    ];\n\n    $scope.submit = function() {\n      alert('submit');\n    };\n\n    $scope.addItem = function() {\n      var r = Math.ceil(Math.random() * 1000);\n      $scope.radioData.push({ label: r, value: r });\n    };\n\n    $scope.removeItem = function() {\n      $scope.radioData.pop();\n    };\n\n  })\n  .config(function($mdIconProvider) {\n    $mdIconProvider.iconSet(\"avatars\", 'icons/avatar-icons.svg',128);\n  });\n"
  },
  {
    "path": "src/components/radioButton/demoBasicUsage/style.css",
    "content": "body {\n  padding: 20px;\n}\nhr {\n  margin-left: -20px;\n  opacity: 0.3;\n}\nmd-radio-group {\n  width: 150px;\n}\np:last-child {\n  padding-bottom: 50px;\n}\nform {\n  padding: 0 20px;\n}\n.radioValue {\n  margin-left: 5px;\n  color: #0f9d58;\n  font-weight: bold;\n}\nmd-icon {\n  margin: 0 20px 20px;\n  width: 128px;\n  height: 128px;\n}\n.ipsum {\n  color: saddlebrown;\n  font-size: 0.9em;\n}\n.demo-description {\n  margin-bottom: 0;\n}\n"
  },
  {
    "path": "src/components/radioButton/demoMultiColumn/index.html",
    "content": "<div ng-controller=\"ContactController as ctrl\" class=\"demo-bidi\">\n  <h2>Contact List</h2>\n  <md-divider></md-divider>\n\n  <md-radio-group ng-model=\"ctrl.selectedId\" aria-labelledby=\"selectedUser\">\n    <div ng-repeat=\"person in ctrl.contacts\" class=\"demo-row\">\n      <div flex layout=\"row\" layout-padding layout-align=\"start center\">\n\n        <div id=\"{{'demoTitle-' + person.id}}\" class=\"demo-title\">\n          {{person.title}}\n        </div>\n        <md-radio-button flex ng-value=\"person.id\" class=\"md-primary\" aria-describedby=\"{{'demoTitle-' + person.id}}\">\n          {{person.fullName}}\n        </md-radio-button>\n      </div>\n    </div>\n  </md-radio-group>\n\n  <md-divider></md-divider>\n  <p class=\"md-padding md-margin\">\n    <label id=\"selectedUser\">Selected User:</label> <span class=\"demo-checked\">{{ctrl.selectedUser()}}</span>\n  </p>\n</div>\n"
  },
  {
    "path": "src/components/radioButton/demoMultiColumn/script.js",
    "content": "angular\n  .module('radioMultiColumnDemo', ['ngMaterial'])\n  .controller('ContactController', function($scope, $filter) {\n    var self = this;\n\n    self.contacts = [{\n      'id': 1,\n      'fullName': 'María Guadalupe',\n      'lastName': 'Guadalupe',\n      'title': \"CEO, Found\"\n    }, {\n      'id': 2,\n      'fullName': 'Gabriel García Márquez',\n      'lastName': 'Márquez',\n      'title': \"VP Sales & Marketing\"\n    }, {\n      'id': 3,\n      'fullName': 'Miguel de Cervantes',\n      'lastName': 'Cervantes',\n      'title': \"Manager, Operations\"\n    }, {\n      'id': 4,\n      'fullName': 'Pacorro de Castel',\n      'lastName': 'Castel',\n      'title': \"Security\"\n    }];\n    self.selectedId = 2;\n    self.selectedUser = function() {\n      return $filter('filter')(self.contacts, { id: self.selectedId })[0].lastName;\n    };\n  });\n"
  },
  {
    "path": "src/components/radioButton/demoMultiColumn/style.css",
    "content": "h2 {\n  margin: 16px;\n}\n.demo-checked {\n  background-color: #ECFAFB;\n  border-radius: 2px;\n}\n.demo-row {\n  border-bottom: 1px dashed #ddd;\n}\n.demo-row:last-child {\n  border-bottom: 0px dashed #ddd;\n}\nlabel {\n  font-weight: bolder;\n}\n.demo-title {\n  flex: 0 1 200px;\n}\nhtml[dir=\"rtl\"] .demo-bidi {\n  padding-right: 20px;\n  padding-left: 0;\n}\n"
  },
  {
    "path": "src/components/radioButton/radio-button-theme.scss",
    "content": "\nmd-radio-button.md-THEME_NAME-theme {\n  .md-off {\n    border-color: '{{foreground-2}}';\n  }\n\n  .md-on {\n    background-color: '{{accent-color-0.87}}';\n  }\n  &.md-checked .md-off {\n    border-color: '{{accent-color-0.87}}';\n  }\n  &.md-checked .md-ink-ripple {\n    color: '{{accent-color-0.87}}';\n  }\n  .md-container .md-ripple {\n    color: '{{accent-A700}}';\n  }\n}\n\nmd-radio-group.md-THEME_NAME-theme,\nmd-radio-button.md-THEME_NAME-theme {\n\n  &:not([disabled]) {\n    .md-primary,\n    &.md-primary {\n      .md-on {\n        background-color: '{{primary-color-0.87}}';\n      }\n      .md-checked,\n      &.md-checked {\n        .md-off {\n          border-color: '{{primary-color-0.87}}';\n        }\n      }\n      .md-checked,\n      &.md-checked {\n        .md-ink-ripple {\n          color: '{{primary-color-0.87}}';\n        }\n      }\n      .md-container .md-ripple {\n        color: '{{primary-600}}';\n      }\n    }\n\n    .md-warn,\n    &.md-warn {\n      .md-on {\n        background-color: '{{warn-color-0.87}}';\n      }\n      .md-checked,\n      &.md-checked {\n        .md-off {\n          border-color: '{{warn-color-0.87}}';\n        }\n      }\n      .md-checked,\n      &.md-checked {\n        .md-ink-ripple {\n          color: '{{warn-color-0.87}}';\n        }\n      }\n      .md-container .md-ripple {\n        color: '{{warn-600}}';\n      }\n    }\n\n  }\n\n  &[disabled] {\n    color: '{{foreground-3}}';\n\n    .md-container .md-off {\n      border-color: '{{foreground-3}}';\n    }\n    .md-container .md-on {\n      border-color: '{{foreground-3}}';\n    }\n  }\n\n}\nmd-radio-group.md-THEME_NAME-theme {\n  .md-checked .md-ink-ripple {\n    color: '{{accent-color-0.26}}';\n  }\n  &.md-primary .md-checked:not([disabled]) .md-ink-ripple, .md-checked:not([disabled]).md-primary .md-ink-ripple {\n    color: '{{primary-color-0.26}}';\n  }\n}\n\nmd-radio-group.md-THEME_NAME-theme.md-focused.ng-empty>md-radio-button:first-child {\n  .md-container:before {\n    background-color: '{{foreground-3-0.26}}';\n  }\n}\n\nmd-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) {\n  .md-checked .md-container:before {\n    background-color: '{{accent-color-0.26}}';\n  }\n  &.md-primary .md-checked .md-container:before,\n  .md-checked.md-primary .md-container:before {\n    background-color: '{{primary-color-0.26}}';\n  }\n  &.md-warn .md-checked .md-container:before,\n  .md-checked.md-warn .md-container:before {\n    background-color: '{{warn-color-0.26}}';\n  }\n}\n"
  },
  {
    "path": "src/components/radioButton/radio-button.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.radioButton\n * @description radioButton module!\n */\nangular.module('material.components.radioButton', [\n  'material.core'\n])\n  .directive('mdRadioGroup', mdRadioGroupDirective)\n  .directive('mdRadioButton', mdRadioButtonDirective);\n\n/**\n * @type {Readonly<{NEXT: number, CURRENT: number, PREVIOUS: number}>}\n */\nvar incrementSelection = Object.freeze({PREVIOUS: -1, CURRENT: 0, NEXT: 1});\n\n/**\n * @ngdoc directive\n * @module material.components.radioButton\n * @name mdRadioGroup\n *\n * @restrict E\n *\n * @description\n * The `<md-radio-group>` directive identifies a grouping\n * container for the 1..n grouped radio buttons; specified using nested\n * `<md-radio-button>` elements.\n *\n * The radio button uses the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * Note: `<md-radio-group>` and `<md-radio-button>` handle `tabindex` differently\n * than the native `<input type=\"radio\">` controls. Whereas the native controls\n * force the user to tab through all the radio buttons, `<md-radio-group>`\n * is focusable and by default the `<md-radio-button>`s are not.\n *\n * @param {string} ng-model Assignable angular expression to data-bind to.\n * @param {string=} ng-change AngularJS expression to be executed when input changes due to user\n *    interaction.\n * @param {boolean=} md-no-ink If present, disables ink ripple effects.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-radio-group ng-model=\"selected\">\n *   <md-radio-button ng-repeat=\"item in items\"\n *                    ng-value=\"item.value\" aria-label=\"{{item.label}}\">\n *     {{ item.label }}\n *   </md-radio-button>\n * </md-radio-group>\n * </hljs>\n */\nfunction mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {\n  RadioGroupController.prototype = createRadioGroupControllerProto();\n\n  return {\n    restrict: 'E',\n    controller: ['$element', RadioGroupController],\n    require: ['mdRadioGroup', '?ngModel'],\n    link: { pre: linkRadioGroup }\n  };\n\n  function linkRadioGroup(scope, element, attr, controllers) {\n    // private md component indicator for styling\n    element.addClass('_md');\n    $mdTheming(element);\n\n    var radioGroupController = controllers[0];\n    var ngModelCtrl = controllers[1] || $mdUtil.fakeNgModel();\n\n    radioGroupController.init(ngModelCtrl);\n\n    scope.mouseActive = false;\n\n    element\n      .attr({\n        'role': 'radiogroup',\n        'tabIndex': element.attr('tabindex') || '0'\n      })\n      .on('keydown', keydownListener)\n      .on('mousedown', function() {\n        scope.mouseActive = true;\n        $timeout(function() {\n          scope.mouseActive = false;\n        }, 100);\n      })\n      .on('focus', function() {\n        if (scope.mouseActive === false) {\n          radioGroupController.$element.addClass('md-focused');\n        }\n      })\n      .on('blur', function() {\n        radioGroupController.$element.removeClass('md-focused');\n      });\n\n    // Initially set the first radio button as the aria-activedescendant. This will be overridden\n    // if a 'checked' radio button gets rendered. We need to wait for the nextTick here so that the\n    // radio buttons have their id values assigned.\n    $mdUtil.nextTick(function () {\n      var radioButtons = getRadioButtons(radioGroupController.$element);\n      if (radioButtons.count() &&\n          !radioGroupController.$element[0].hasAttribute('aria-activedescendant')) {\n        radioGroupController.setActiveDescendant(radioButtons.first().id);\n      }\n    });\n\n    /**\n     * Apply the md-focused class if it isn't already applied.\n     */\n    function setFocus() {\n      if (!element.hasClass('md-focused')) { element.addClass('md-focused'); }\n    }\n\n    /**\n     * @param {KeyboardEvent} keyboardEvent\n     */\n    function keydownListener(keyboardEvent) {\n      var keyCode = keyboardEvent.which || keyboardEvent.keyCode;\n\n      // Only listen to events that we originated ourselves\n      // so that we don't trigger on things like arrow keys in inputs.\n      if (keyCode !== $mdConstant.KEY_CODE.ENTER &&\n          keyboardEvent.currentTarget !== keyboardEvent.target) {\n        return;\n      }\n\n      switch (keyCode) {\n        case $mdConstant.KEY_CODE.LEFT_ARROW:\n        case $mdConstant.KEY_CODE.UP_ARROW:\n          keyboardEvent.preventDefault();\n          radioGroupController.selectPrevious();\n          setFocus();\n          break;\n\n        case $mdConstant.KEY_CODE.RIGHT_ARROW:\n        case $mdConstant.KEY_CODE.DOWN_ARROW:\n          keyboardEvent.preventDefault();\n          radioGroupController.selectNext();\n          setFocus();\n          break;\n\n        case $mdConstant.KEY_CODE.SPACE:\n          keyboardEvent.preventDefault();\n          radioGroupController.selectCurrent();\n          break;\n\n        case $mdConstant.KEY_CODE.ENTER:\n          var form = angular.element($mdUtil.getClosest(element[0], 'form'));\n          if (form.length > 0) {\n            form.triggerHandler('submit');\n          }\n          break;\n      }\n    }\n  }\n\n  /**\n   * @param {JQLite} $element\n   * @constructor\n   */\n  function RadioGroupController($element) {\n    this._radioButtonRenderFns = [];\n    this.$element = $element;\n  }\n\n  function createRadioGroupControllerProto() {\n    return {\n      init: function(ngModelCtrl) {\n        this._ngModelCtrl = ngModelCtrl;\n        this._ngModelCtrl.$render = angular.bind(this, this.render);\n      },\n      add: function(rbRender) {\n        this._radioButtonRenderFns.push(rbRender);\n      },\n      remove: function(rbRender) {\n        var index = this._radioButtonRenderFns.indexOf(rbRender);\n        if (index !== -1) {\n          this._radioButtonRenderFns.splice(index, 1);\n        }\n      },\n      render: function() {\n        this._radioButtonRenderFns.forEach(function(rbRender) {\n          rbRender();\n        });\n      },\n      setViewValue: function(value, eventType) {\n        this._ngModelCtrl.$setViewValue(value, eventType);\n        // update the other radio buttons as well\n        this.render();\n      },\n      getViewValue: function() {\n        return this._ngModelCtrl.$viewValue;\n      },\n      selectCurrent: function() {\n        return changeSelectedButton(this.$element, incrementSelection.CURRENT);\n      },\n      selectNext: function() {\n        return changeSelectedButton(this.$element, incrementSelection.NEXT);\n      },\n      selectPrevious: function() {\n        return changeSelectedButton(this.$element, incrementSelection.PREVIOUS);\n      },\n      setActiveDescendant: function (radioId) {\n        this.$element.attr('aria-activedescendant', radioId);\n      },\n      isDisabled: function() {\n        return this.$element[0].hasAttribute('disabled');\n      }\n    };\n  }\n\n  /**\n   * Coerce all child radio buttons into an array, then wrap them in an iterator.\n   * @param parent {!JQLite}\n   * @return {{add: add, next: (function()), last: (function(): any|null), previous: (function()), count: (function(): number), hasNext: (function(*=): Array.length|*|number|boolean), inRange: (function(*): boolean), remove: remove, contains: (function(*=): *|boolean), itemAt: (function(*=): any|null), findBy: (function(*, *): *[]), hasPrevious: (function(*=): Array.length|*|number|boolean), items: (function(): *[]), indexOf: (function(*=): number), first: (function(): any|null)}}\n   */\n  function getRadioButtons(parent) {\n    return $mdUtil.iterator(parent[0].querySelectorAll('md-radio-button'), true);\n  }\n\n  /**\n   * Change the radio group's selected button by a given increment.\n   * If no button is selected, select the first button.\n   * @param {JQLite} parent the md-radio-group\n   * @param {incrementSelection} increment enum that determines whether the next or\n   *  previous button is clicked. For current, only the first button is selected, otherwise the\n   *  current selection is maintained (by doing nothing).\n   */\n  function changeSelectedButton(parent, increment) {\n    var buttons = getRadioButtons(parent);\n    var target;\n\n    if (buttons.count()) {\n      var validate = function (button) {\n        // If disabled, then NOT valid\n        return !angular.element(button).attr(\"disabled\");\n      };\n\n      var selected = parent[0].querySelector('md-radio-button.md-checked');\n      if (!selected) {\n        target = buttons.first();\n      } else if (increment === incrementSelection.PREVIOUS ||\n                 increment === incrementSelection.NEXT) {\n        target = buttons[\n          increment === incrementSelection.PREVIOUS ? 'previous' : 'next'\n        ](selected, validate);\n      }\n\n      if (target) {\n        // Activate radioButton's click listener (triggerHandler won't create a real click event)\n        angular.element(target).triggerHandler('click');\n      }\n    }\n  }\n}\n\n/**\n * @ngdoc directive\n * @module material.components.radioButton\n * @name mdRadioButton\n *\n * @restrict E\n *\n * @description\n * The `<md-radio-button>`directive is the child directive required to be used within `<md-radio-group>` elements.\n *\n * While similar to the `<input type=\"radio\" ng-model=\"\" value=\"\">` directive,\n * the `<md-radio-button>` directive provides ink effects, ARIA support, and\n * supports use within named radio groups.\n *\n * One of `value` or `ng-value` must be set so that the `md-radio-group`'s model is set properly when the\n * `md-radio-button` is selected.\n *\n * @param {string} value The value to which the model should be set when selected.\n * @param {string} ng-value AngularJS expression which sets the value to which the model should\n *    be set when selected.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} aria-label Adds label to radio button for accessibility.\n *    Defaults to radio button's text. If no text content is available, a warning will be logged.\n *\n * @usage\n * <hljs lang=\"html\">\n *\n * <md-radio-button value=\"1\" aria-label=\"Label 1\">\n *   Label 1\n * </md-radio-button>\n *\n * <md-radio-button ng-value=\"specialValue\" aria-label=\"Green\">\n *   Green\n * </md-radio-button>\n *\n * </hljs>\n *\n */\nfunction mdRadioButtonDirective($mdAria, $mdUtil, $mdTheming) {\n\n  var CHECKED_CSS = 'md-checked';\n\n  return {\n    restrict: 'E',\n    require: '^mdRadioGroup',\n    transclude: true,\n    template: '<div class=\"md-container\" md-ink-ripple md-ink-ripple-checkbox>' +\n                '<div class=\"md-off\"></div>' +\n                '<div class=\"md-on\"></div>' +\n              '</div>' +\n              '<div ng-transclude class=\"md-label\"></div>',\n    link: link\n  };\n\n  function link(scope, element, attr, radioGroupController) {\n    var lastChecked;\n\n    $mdTheming(element);\n    configureAria(element);\n    element.addClass('md-auto-horizontal-margin');\n\n    // ngAria overwrites the aria-checked inside a $watch for ngValue.\n    // We should defer the initialization until all the watches have fired.\n    // This can also be fixed by removing the `lastChecked` check, but that'll\n    // cause more DOM manipulation on each digest.\n    if (attr.ngValue) {\n      $mdUtil.nextTick(initialize, false);\n    } else {\n      initialize();\n    }\n\n    /**\n     * Initializes the component.\n     */\n    function initialize() {\n      if (!radioGroupController) {\n        throw 'RadioButton: No RadioGroupController could be found.';\n      }\n\n      radioGroupController.add(render);\n      attr.$observe('value', render);\n\n      element\n        .on('click', listener)\n        .on('$destroy', function() {\n          radioGroupController.remove(render);\n        });\n    }\n\n    /**\n     * On click functionality.\n     */\n    function listener(ev) {\n      if (element[0].hasAttribute('disabled') || radioGroupController.isDisabled()) return;\n\n      scope.$apply(function() {\n        radioGroupController.setViewValue(attr.value, ev && ev.type);\n      });\n    }\n\n    /**\n     * Add or remove the `.md-checked` class from the RadioButton (and conditionally its parent).\n     * Update the `aria-activedescendant` attribute.\n     */\n    function render() {\n      var checked = radioGroupController.getViewValue() == attr.value;\n\n      if (checked === lastChecked) return;\n\n      if (element[0] && element[0].parentNode &&\n          element[0].parentNode.nodeName.toLowerCase() !== 'md-radio-group') {\n        // If the radioButton is inside a div, then add class so highlighting will work.\n        element.parent().toggleClass(CHECKED_CSS, checked);\n      }\n\n      if (checked) {\n        radioGroupController.setActiveDescendant(element.attr('id'));\n      }\n\n      lastChecked = checked;\n\n      element\n        .attr('aria-checked', checked)\n        .toggleClass(CHECKED_CSS, checked);\n    }\n\n    /**\n     * Inject ARIA-specific attributes appropriate for each radio button\n     */\n    function configureAria(element) {\n      element.attr({\n        id: attr.id || 'radio_' + $mdUtil.nextUid(),\n        role: 'radio',\n        'aria-checked': 'false'\n      });\n\n      $mdAria.expectWithText(element, 'aria-label');\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/radioButton/radio-button.scss",
    "content": "$radio-width: 20px !default;\n$radio-height: $radio-width !default;\n$radio-text-margin: 10px !default;\n$radio-top-left: 12px !default;\n$radio-margin: 16px !default;\n\n@mixin md-radio-button-disabled {\n  cursor: default;\n\n  .md-container {\n    cursor: default;\n  }\n}\n\nmd-radio-button {\n  box-sizing: border-box;\n  display: block;\n  margin-bottom: $radio-margin;\n  white-space: nowrap;\n  cursor: pointer;\n  position: relative;\n\n  // When the radio-button is disabled.\n  &[disabled] {\n    @include md-radio-button-disabled();\n  }\n\n  .md-container {\n    position: absolute;\n    top: 50%;\n    transform: translateY(-50%);\n    box-sizing: border-box;\n    display: inline-block;\n    width: $radio-width;\n    height: $radio-width;\n    cursor: pointer;\n    @include rtl(left, 0, auto);\n    @include rtl(right, auto, 0);\n\n    .md-ripple-container {\n      position: absolute;\n      display: block;\n      width: auto;\n      height: auto;\n      left: -15px;\n      top: -15px;\n      right: -15px;\n      bottom: -15px;\n    }\n\n    &:before {\n      box-sizing: border-box;\n      background-color: transparent;\n      border-radius: 50%;\n      content: '';\n      position: absolute;\n      display: block;\n      height: auto;\n      left: 0;\n      top: 0;\n      right: 0;\n      bottom: 0;\n      transition: all 0.5s;\n      width: auto;\n    }\n  }\n\n  &.md-align-top-left > div.md-container {\n     top: $radio-top-left;\n   }\n\n  .md-off {\n    box-sizing: border-box;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: $radio-width;\n    height: $radio-width;\n    border-style: solid;\n    border-width: 2px;\n    border-radius: 50%;\n    transition: border-color ease 0.28s;\n  }\n\n  .md-on {\n    box-sizing: border-box;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: $radio-width;\n    height: $radio-width;\n    border-radius: 50%;\n    transition: transform ease 0.28s;\n    transform: scale(0);\n  }\n\n  &.md-checked .md-on {\n    transform: scale(0.50);\n  }\n\n  .md-label {\n    box-sizing: border-box;\n    position: relative;\n    display: inline-block;\n\n    @include rtl(margin-left, $radio-text-margin + $radio-width, 0);\n    @include rtl(margin-right, 0, $radio-text-margin + $radio-width);\n\n    vertical-align: middle;\n    white-space: normal;\n    pointer-events: none;\n    width: auto;\n  }\n}\n\nmd-radio-group {\n  &:focus {\n    outline: none;\n  }\n\n  &.md-focused.ng-not-empty {\n    .md-checked .md-container:before {\n      left: -8px;\n      top: -8px;\n      right: -8px;\n      bottom: -8px;\n    }\n  }\n  &.md-focused.ng-empty>md-radio-button:first-child {\n    .md-container:before {\n      left: -8px;\n      top: -8px;\n      right: -8px;\n      bottom: -8px;\n    }\n  }\n\n  &[disabled] md-radio-button {\n    @include md-radio-button-disabled();\n  }\n}\n\n@include when-layout-row(md-radio-button) {\n  margin-bottom: 0;\n}\n\n.md-inline-form {\n  md-radio-group {\n    margin: $input-container-vertical-margin 0 $input-container-vertical-margin + 1px;\n    md-radio-button {\n      display: inline-block;\n      height: 30px;\n      padding: 2px 10px 2px 6px;\n      box-sizing: border-box;\n      margin-top: 0;\n      margin-bottom: 0;\n\n      .md-label {\n        top: 4px;\n      }\n      .md-container {\n        margin-top: 2px;\n      }\n    }\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-radio-button.md-default-theme .md-on {\n    background-color: #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/radioButton/radio-button.spec.js",
    "content": "describe('mdRadioButton component', function() {\n\n  var CHECKED_CSS = 'md-checked';\n\n  beforeEach(module('material.components.radioButton', 'ngAria'));\n\n  describe('md-radio-group', function() {\n\n    it('should have `._md` class indicator',inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      expect(element.hasClass('_md')).toBe(true);\n    }));\n\n    it('should correctly apply the checked class', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply('color = \"green\"');\n\n      var radioButtons = element.find('md-radio-button');\n\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toEqual(false);\n      expect(radioButtons.eq(1).hasClass(CHECKED_CSS)).toEqual(true);\n    }));\n\n    it('should support mixed values', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"value\">' +\n          '<md-radio-button value=\"1\"></md-radio-button>' +\n          '<md-radio-button value=\"2\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply('value = 1');\n\n      var radioButtons = element.find('md-radio-button');\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toEqual(true);\n    }));\n\n    it('should set the role attribute', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButton = element.find('md-radio-button').eq(0);\n\n      expect(element.eq(0).attr('role')).toEqual('radiogroup');\n      expect(radioButton.attr('role')).toEqual('radio');\n    }));\n\n    it('should apply aria state attributes', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply('color = \"green\"');\n\n      var radioButtons = element.find('md-radio-button');\n\n      expect(radioButtons.eq(0).attr('aria-checked')).toEqual('false');\n      expect(radioButtons.eq(1).attr('aria-checked')).toEqual('true');\n\n      expect(element.attr('aria-activedescendant')).toEqual(radioButtons.eq(1).attr('id'));\n      expect(element.attr('aria-activedescendant')).not.toEqual(radioButtons.eq(0).attr('id'));\n    }));\n\n    it('should warn developers if no label is specified', inject(function($compile, $rootScope, $log) {\n      spyOn($log, \"warn\");\n\n      $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should create an aria label from provided text', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\">Blue</md-radio-button>' +\n          '<md-radio-button value=\"green\">Green</md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButtons = element.find('md-radio-button');\n      expect(radioButtons.eq(0).attr('aria-label')).toEqual('Blue');\n    }));\n\n    it('should disable all child radio buttons', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\" ng-disabled=\"isDisabled\">' +\n          '<md-radio-button value=\"white\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButton = element.find('md-radio-button');\n\n      $rootScope.$apply('isDisabled = true');\n      $rootScope.$apply('color = null');\n      radioButton.triggerHandler('click');\n\n      expect($rootScope.color).toBe(null);\n\n      $rootScope.$apply('isDisabled = false');\n      radioButton.triggerHandler('click');\n\n      expect($rootScope.color).toBe('white');\n    }));\n\n    it('should preserve tabindex', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\" tabindex=\"3\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      expect(element.attr('tabindex')).toEqual('3');\n    }));\n\n    it('should be operable via arrow keys', inject(function($compile, $rootScope, $mdConstant) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply('color = \"blue\"');\n\n      element.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW,\n        currentTarget: element[0],\n        target: element[0]\n      });\n\n      expect($rootScope.color).toEqual('green');\n    }));\n\n    it('should not set focus state on mousedown', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply();\n      element.triggerHandler('mousedown');\n\n      expect(element).not.toHaveClass('md-focused');\n    }));\n\n    it('should apply focus class on focus and remove on blur', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply();\n      element.triggerHandler('focus');\n\n      expect(element[0]).toHaveClass('md-focused');\n\n      element.triggerHandler('blur');\n      expect(element[0]).not.toHaveClass('md-focused');\n    }));\n\n    it('should apply focus class on keyboard interaction', inject(function($compile, $rootScope, $mdConstant) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n          '<md-radio-button value=\"green\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $rootScope.$apply();\n\n      element.triggerHandler('mousedown');\n      element.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW,\n        currentTarget: element[0],\n        target: element[0]\n      });\n\n      expect(element[0]).toHaveClass('md-focused');\n    }));\n\n    it('should apply aria-checked properly when using ng-value', inject(function($compile, $rootScope, $timeout) {\n      $rootScope.color = 'blue';\n\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button ng-value=\"\\'red\\'\"></md-radio-button>' +\n          '<md-radio-button ng-value=\"\\'blue\\'\"></md-radio-button>' +\n          '<md-radio-button ng-value=\"\\'green\\'\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      $timeout.flush();\n\n      var checkedItems = element[0].querySelectorAll('[aria-checked=\"true\"]');\n      var uncheckedItems = element[0].querySelectorAll('[aria-checked=\"false\"]');\n\n      expect(checkedItems.length).toBe(1);\n      expect(uncheckedItems.length).toBe(2);\n      expect(checkedItems[0].getAttribute('value')).toBe($rootScope.color);\n    }));\n\n  });\n\n  describe('md-radio-button', function() {\n\n    it('should be static with no model', inject(function($compile, $rootScope) {\n      var element;\n      expect(function() {\n        element = $compile(\n          '<md-radio-group>' +\n            '<md-radio-button value=\"white\">' +\n          '</md-radio-group>')\n        ($rootScope);\n      }).not.toThrow();\n\n      var radioButtons = element.find('md-radio-button');\n\n      // Fire off the render function with no ngModel, make sure nothing\n      // goes unexpectedly.\n      expect(function() {\n        radioButtons.eq(0).triggerHandler('click');\n      }).not.toThrow();\n    }));\n\n    it('should update the model', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"white\"></md-radio-button>' +\n          '<md-radio-button value=\"red\"></md-radio-button>' +\n          '<md-radio-button value=\"blue\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButtons = element.find('md-radio-button');\n\n      $rootScope.$apply(\"color = 'white'\");\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toBe(true);\n      expect(radioButtons.eq(1).hasClass(CHECKED_CSS)).toBe(false);\n      expect(radioButtons.eq(2).hasClass(CHECKED_CSS)).toBe(false);\n\n      $rootScope.$apply(\"color = 'red'\");\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toBe(false);\n      expect(radioButtons.eq(1).hasClass(CHECKED_CSS)).toBe(true);\n      expect(radioButtons.eq(2).hasClass(CHECKED_CSS)).toBe(false);\n\n      radioButtons.eq(2).triggerHandler('click');\n\n      expect($rootScope.color).toBe('blue');\n    }));\n\n    it('should trigger a submit action', inject(function($compile, $rootScope, $mdConstant) {\n\n      $rootScope.testValue = false;\n\n      var element = $compile(\n        '<div>' +\n          '<form ng-submit=\"testValue = true\">' +\n            '<md-radio-group ng-model=\"color\">' +\n              '<md-radio-button value=\"white\"></md-radio-button>' +\n            '</md-radio-group>' +\n          '</form>' +\n        '</div>')\n      ($rootScope);\n\n      var radioGroupElement = element.find('md-radio-group');\n\n      expect($rootScope.testValue).toBeFalsy();\n\n      radioGroupElement.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ENTER\n      });\n\n      expect($rootScope.testValue).toBe(true);\n    }));\n\n    it('should correctly disable the button', inject(function($compile, $rootScope) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"white\" ng-disabled=\"isDisabled\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButton = element.find('md-radio-button');\n\n      $rootScope.$apply('isDisabled = true');\n      $rootScope.$apply('color = null');\n      radioButton.triggerHandler('click');\n\n      expect($rootScope.color).toBe(null);\n\n      $rootScope.$apply('isDisabled = false');\n      radioButton.triggerHandler('click');\n\n      expect($rootScope.color).toBe('white');\n    }));\n\n    it('should skip disabled on arrow key', inject(function($compile, $rootScope, $mdConstant) {\n      var element = $compile(\n        '<md-radio-group ng-model=\"color\">' +\n          '<md-radio-button value=\"red\"   ></md-radio-button>' +\n          '<md-radio-button value=\"white\" ng-disabled=\"isDisabled\"></md-radio-button>' +\n          '<md-radio-button value=\"blue\" ></md-radio-button>' +\n        '</md-radio-group>'\n      )($rootScope);\n\n      $rootScope.$apply('isDisabled = true');\n      $rootScope.$apply('color = \"red\"');\n      expect($rootScope.color).toBe(\"red\");\n\n\n      rightArrow();\n      expect($rootScope.color).toEqual('blue');\n\n      rightArrow();\n      expect($rootScope.color).toEqual('red');\n\n      rightArrow();\n      expect($rootScope.color).toEqual('blue');\n\n      $rootScope.$apply('isDisabled = false');\n\n      rightArrow();\n\n      rightArrow();\n      expect($rootScope.color).toEqual('white');\n\n      rightArrow();\n      expect($rootScope.color).toEqual('blue');\n\n      function rightArrow() {\n        element.triggerHandler({\n          type: 'keydown',\n          target: element[0],\n          currentTarget: element[0],\n          keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n        });\n      }\n    }));\n\n    it('should allow interpolation as a value', inject(function($compile, $rootScope) {\n      $rootScope.some = 11;\n\n      var element = $compile(\n        '<md-radio-group ng-model=\"value\">' +\n          '<md-radio-button value=\"{{some}}\"></md-radio-button>' +\n          '<md-radio-button value=\"{{other}}\"></md-radio-button>' +\n        '</md-radio-group>')\n      ($rootScope);\n\n      var radioButtons = element.find('md-radio-button');\n\n      $rootScope.$apply(function() {\n        $rootScope.value = 'blue';\n        $rootScope.some = 'blue';\n        $rootScope.other = 'red';\n      });\n\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toBe(true);\n      expect(radioButtons.eq(1).hasClass(CHECKED_CSS)).toBe(false);\n\n      radioButtons.eq(1).triggerHandler('click');\n      expect($rootScope.value).toBe('red');\n\n      $rootScope.$apply(\"other = 'non-red'\");\n\n      expect(radioButtons.eq(0).hasClass(CHECKED_CSS)).toBe(false);\n      expect(radioButtons.eq(1).hasClass(CHECKED_CSS)).toBe(false);\n    }));\n\n  });\n});\n"
  },
  {
    "path": "src/components/select/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" class=\"md-padding\" ng-cloak layout=\"column\">\n\n  <p>\n    The <code>&lt;md-select&gt;</code> component can be used within a\n    <code>&lt;md-input-container&gt;</code> or as a stand alone component by using the\n    <code>md-no-underline</code> class.\n  </p>\n\n  <md-card>\n    <md-card-title>\n      <md-card-title-text>\n        <span class=\"md-headline\">Account Preferences</span>\n        <span class=\"md-subhead\">Tell us a little about you.</span>\n      </md-card-title-text>\n    </md-card-title>\n\n    <md-card-content>\n      <div layout=\"row\">\n        <md-input-container>\n          <label>Street Name</label>\n          <input>\n        </md-input-container>\n\n        <md-input-container>\n          <label>City</label>\n          <input>\n        </md-input-container>\n\n        <md-input-container>\n          <label>State</label>\n          <md-select ng-model=\"ctrl.userState\">\n            <md-option><em>None</em></md-option>\n            <md-option ng-repeat=\"state in ctrl.states\" ng-value=\"state.abbrev\"\n                       ng-disabled=\"$index === 1\">\n              {{state.abbrev}}\n            </md-option>\n          </md-select>\n        </md-input-container>\n      </div>\n    </md-card-content>\n  </md-card>\n\n  <md-card>\n    <md-card-title>\n      <md-card-title-text>\n        <span class=\"md-headline\">Battle Preferences</span>\n        <span class=\"md-subhead\">Choose wisely if you want to win.</span>\n      </md-card-title-text>\n    </md-card-title>\n\n    <md-card-content>\n      <div layout=\"row\" layout-align=\"space-between center\">\n        <span>What is your favorite weapon?</span>\n        <md-select ng-model=\"weapon\" placeholder=\"Weapon\" class=\"md-no-underline\">\n          <md-option value=\"axe\">Axe</md-option>\n          <md-option value=\"sword\">Sword</md-option>\n          <md-option value=\"wand\">Wand</md-option>\n          <md-option value=\"pen\">Pen?</md-option>\n        </md-select>\n      </div>\n\n      <div layout=\"row\" layout-align=\"space-between center\">\n        <span>What armor do you wear?</span>\n        <md-select ng-model=\"armor\" placeholder=\"Armor\" class=\"md-no-underline\" required\n                   md-no-asterisk=\"false\">\n          <md-option value=\"cloth\">Cloth</md-option>\n          <md-option value=\"leather\">Leather</md-option>\n          <md-option value=\"chain\">Chainmail</md-option>\n          <md-option value=\"plate\">Plate</md-option>\n        </md-select>\n      </div>\n\n      <div layout=\"row\" layout-align=\"space-between center\">\n        <span>How do you refresh your magic?</span>\n        <md-select ng-model=\"drink\" placeholder=\"Drink\" class=\"md-no-underline\">\n          <md-option value=\"water\">Water</md-option>\n          <md-option value=\"juice\">Juice</md-option>\n          <md-option value=\"milk\">Milk</md-option>\n          <md-option value=\"wine\">Wine</md-option>\n          <md-option value=\"mead\">Mead</md-option>\n        </md-select>\n      </div>\n    </md-card-content>\n  </md-card>\n\n</div>\n"
  },
  {
    "path": "src/components/select/demoBasicUsage/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n  .module('selectDemoBasic', ['ngMaterial'])\n  .controller('AppCtrl', function() {\n    var ctrl = this;\n    ctrl.userState = '';\n    ctrl.states = ('AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS ' +\n      'MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI ' +\n      'WY').split(' ').map(function (state) { return { abbrev: state }; });\n  });\n})();\n"
  },
  {
    "path": "src/components/select/demoBasicUsage/style.css",
    "content": ""
  },
  {
    "path": "src/components/select/demoOptionGroups/index.html",
    "content": "<div ng-controller=\"SelectOptGroupController\" class=\"md-padding\" ng-cloak>\n  <div>\n    <h1 class=\"md-title\">Pick your pizza below</h1>\n    <div layout=\"row\">\n      <md-input-container style=\"margin-right: 10px;\">\n        <label>Size</label>\n        <md-select ng-model=\"size\">\n          <md-optgroup label=\"No Surcharge\">\n            <md-option ng-repeat=\"size in sizes | filter: {surcharge: 'none'}\"\n                       value=\"{{size.name}}\">{{size.name}}</md-option>\n          </md-optgroup>\n          <md-optgroup label=\"Additional Surcharge\">\n            <md-option ng-repeat=\"size in sizes | filter: {surcharge: 'extra'}\"\n                       value=\"{{size.name}}\">{{size.name}}</md-option>\n          </md-optgroup>\n        </md-select>\n      </md-input-container>\n      <md-input-container>\n        <label>Toppings</label>\n        <md-select ng-model=\"selectedToppings\" multiple>\n          <md-optgroup label=\"Meats\">\n            <md-option ng-value=\"topping.name\" ng-repeat=\"topping in toppings | filter: {category: 'meat'}\">\n              {{topping.name}}</md-option>\n          </md-optgroup>\n          <md-optgroup label=\"Veggies\">\n            <md-option ng-value=\"topping.name\" ng-repeat=\"topping in toppings | filter: {category: 'veg'}\">\n              {{topping.name}}</md-option>\n          </md-optgroup>\n        </md-select>\n      </md-input-container>\n    </div>\n    <p ng-if=\"selectedToppings\">You ordered a {{size.toLowerCase()}} pizza with\n    {{printSelectedToppings()}}.</p>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/select/demoOptionGroups/script.js",
    "content": "angular\n    .module('selectDemoOptGroups', ['ngMaterial'])\n    .controller('SelectOptGroupController', function($scope) {\n      $scope.sizes = [\n        { surcharge: 'none', name: \"small (12-inch)\" },\n        { surcharge: 'none', name: \"medium (14-inch)\" },\n        { surcharge: 'extra', name: \"large (16-inch)\" },\n        { surcharge: 'extra', name: \"giant (42-inch)\" }\n      ];\n      $scope.toppings = [\n        { category: 'meat', name: 'Pepperoni' },\n        { category: 'meat', name: 'Sausage' },\n        { category: 'meat', name: 'Ground Beef' },\n        { category: 'meat', name: 'Bacon' },\n        { category: 'veg', name: 'Mushrooms' },\n        { category: 'veg', name: 'Onion' },\n        { category: 'veg', name: 'Green Pepper' },\n        { category: 'veg', name: 'Green Olives' }\n      ];\n      $scope.selectedToppings = [];\n      $scope.printSelectedToppings = function printSelectedToppings() {\n        var numberOfToppings = this.selectedToppings.length;\n\n        // If there is more than one topping, we add an 'and'\n        // to be grammatically correct. If there are 3+ toppings,\n        // we also add an oxford comma.\n        if (numberOfToppings > 1) {\n          var needsOxfordComma = numberOfToppings > 2;\n          var lastToppingConjunction = (needsOxfordComma ? ',' : '') + ' and ';\n          var lastTopping = lastToppingConjunction +\n              this.selectedToppings[this.selectedToppings.length - 1];\n          return this.selectedToppings.slice(0, -1).join(', ') + lastTopping;\n        }\n\n        return this.selectedToppings.join('');\n      };\n    });\n"
  },
  {
    "path": "src/components/select/demoOptionsWithAsyncSearch/index.html",
    "content": "<div ng-controller=\"SelectAsyncController\" layout=\"column\" layout-align=\"center center\" style=\"padding:40px\" ng-cloak>\n  <p>Select can call an arbitrary function on show. If this function returns a promise, it will display a loading indicator while it is being resolved:</p>\n  <div layout=\"column\" layout-align=\"center center\">\n    <md-select placeholder=\"Assign to user\" ng-model=\"user\" md-on-open=\"loadUsers()\" style=\"min-width: 200px;\">\n      <md-option ng-value=\"user\" ng-repeat=\"user in users\">{{user.name}}</md-option>\n    </md-select>\n    <p class=\"md-caption\">You have assigned the task to: {{ user ? user.name : 'No one yet' }}</p>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/select/demoOptionsWithAsyncSearch/script.js",
    "content": "angular.module('selectDemoOptionsAsync', ['ngMaterial'])\n.controller('SelectAsyncController', function($timeout, $scope) {\n  $scope.user = null;\n  $scope.users = null;\n\n  $scope.loadUsers = function() {\n\n    // Use timeout to simulate a 650ms request.\n    return $timeout(function() {\n\n      $scope.users =  $scope.users  || [\n        { id: 1, name: 'Scooby Doo' },\n        { id: 2, name: 'Shaggy Rodgers' },\n        { id: 3, name: 'Fred Jones' },\n        { id: 4, name: 'Daphne Blake' },\n        { id: 5, name: 'Velma Dinkley' }\n      ];\n\n    }, 650);\n  };\n});\n"
  },
  {
    "path": "src/components/select/demoSelectHeader/index.html",
    "content": "<div ng-controller=\"SelectHeaderController\" class=\"md-padding\" ng-cloak>\n  <div>\n    <h1 class=\"md-title\">Pick a vegetable below</h1>\n    <div layout=\"row\">\n      <md-input-container>\n        <label>Vegetables</label>\n        <md-select ng-model=\"selectedVegetables\"\n                   md-on-close=\"clearSearchTerm()\"\n                   md-container-class=\"selectdemoSelectHeader\"\n                   multiple>\n          <md-select-header class=\"demo-select-header\">\n            <input ng-model=\"searchTerm\" aria-label=\"Vegetable filter\"\n                   type=\"search\" placeholder=\"Ex. Onions\"\n                   class=\"demo-header-searchbox md-text\">\n          </md-select-header>\n          <md-optgroup label=\"vegetables\">\n            <md-option ng-value=\"vegetable\" ng-repeat=\"vegetable in vegetables | filter:searchTerm\">\n              {{vegetable}}\n            </md-option>\n          </md-optgroup>\n        </md-select>\n      </md-input-container>\n    </div>\n </div>\n</div>\n"
  },
  {
    "path": "src/components/select/demoSelectHeader/script.js",
    "content": "(function () {\n  'use strict';\n  angular.module('selectDemoSelectHeader', ['ngMaterial'])\n  .controller('SelectHeaderController', function ($scope, $element) {\n    $scope.vegetables = ['Corn', 'Onions', 'Kale', 'Arugula', 'Peas', 'Zucchini'];\n    $scope.searchTerm = '';\n    $scope.clearSearchTerm = function () {\n      $scope.searchTerm = '';\n    };\n    // The md-select directive eats keydown events for some quick select\n    // logic. Since we have a search input here, we don't need that logic.\n    $element.find('input').on('keydown', function (ev) {\n      ev.stopPropagation();\n    });\n  });\n})();\n"
  },
  {
    "path": "src/components/select/demoSelectHeader/style.css",
    "content": "/* Please note: All these selectors are only applied to children of elements with the 'selectdemoSelectHeader' class */\n.demo-header-searchbox {\n  border: none;\n  outline: none;\n  height: 100%;\n  width: 100%;\n  padding: 0;\n}\n.demo-select-header {\n  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0,\n  0.14), 0 0 0 0 rgba(0, 0, 0, 0.12);\n  padding-left: 16px;\n  height: 48px;\n  cursor: pointer;\n  position: relative;\n  display: flex;\n  width: auto;\n}\nmd-content._md {\n  max-height: 240px;\n}\nmd-input-container {\n  min-width: 112px;\n}\n"
  },
  {
    "path": "src/components/select/demoSelectedText/index.html",
    "content": "<div ng-controller=\"SelectedTextController\" class=\"md-padding\" ng-cloak>\n  <h1 class=\"md-title\">Pick an item below</h1>\n  <div layout=\"row\">\n    <md-input-container>\n      <label>Items</label>\n      <md-select ng-model=\"selectedItem\" md-selected-text=\"getSelectedText()\">\n        <md-optgroup label=\"items\">\n          <md-option ng-repeat=\"item in items\" ng-value=\"item\">Item {{item}}</md-option>\n        </md-optgroup>\n      </md-select>\n    </md-input-container>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/select/demoSelectedText/script.js",
    "content": "angular\n  .module('selectDemoSelectedText', ['ngMaterial'])\n  .controller('SelectedTextController', function ($scope) {\n    $scope.items = [1, 2, 3, 4, 5, 6, 7];\n    $scope.selectedItem = undefined;\n\n    $scope.getSelectedText = function () {\n      if ($scope.selectedItem !== undefined) {\n        return \"You have selected: Item \" + $scope.selectedItem;\n      } else {\n        return \"Please select an item\";\n      }\n    };\n  });\n"
  },
  {
    "path": "src/components/select/demoTrackBy/index.html",
    "content": "<div class=\"md-padding\" ng-cloak>\n  <div layout=\"row\" layout-align=\"space-between\">\n    <div ng-controller=\"AppCtrl as ctrl\" layout=\"column\" flex=\"40\">\n      <div>\n        <h1 class=\"md-title\">Without trackBy</h1>\n        <div layout=\"row\">\n          <md-input-container>\n            <label>Items</label>\n            <md-select ng-model=\"ctrl.selectedItem\"\n              ng-change=\"ctrl.modelHasChanged = true\">\n              <md-option ng-repeat=\"item in ctrl.items\" ng-value=\"item\">\n                {{ item.name }}\n              </md-option>\n            </md-select>\n          </md-input-container>\n        </div>\n      </div>\n      <div layout=\"column\">\n        <h5>Initial model</h5>\n        <code><pre>{{ ::ctrl.selectedItem | json }}</pre></code>\n        <h5>Current model</h5>\n        <code><pre>{{ ctrl.selectedItem | json }}</pre></code>\n        <span ng-show=\"ctrl.modelHasChanged\">Model has changed</span>\n      </div>\n    </div>\n\n    <div ng-controller=\"AppCtrl as ctrl\" layout=\"column\" flex=\"40\">\n      <div>\n        <h1 class=\"md-title\">With trackBy</h1>\n        <div layout=\"row\">\n          <md-input-container>\n            <label>Items</label>\n            <md-select ng-model=\"ctrl.selectedItem\"\n              ng-change=\"ctrl.modelHasChanged = true\"\n              ng-model-options=\"{ trackBy: '$value.id' }\">\n              <md-option ng-repeat=\"item in ctrl.items\" ng-value=\"item\">\n                {{ item.name }}\n              </md-option>\n            </md-select>\n          </md-input-container>\n        </div>\n      </div>\n      <div layout=\"column\">\n        <h5>Initial model</h5>\n        <code><pre>{{ ::ctrl.selectedItem | json }}</pre></code>\n        <h5>Current model</h5>\n        <code><pre>{{ ctrl.selectedItem | json }}</pre></code>\n        <span ng-show=\"ctrl.modelHasChanged\">Model has changed</span>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/select/demoTrackBy/script.js",
    "content": "(function() {\n  'use strict';\n  angular\n    .module('selectDemoTrackBy', ['ngMaterial', 'ngMessages'])\n    .controller('AppCtrl', function() {\n      this.selectedItem = {\n        id: '5a61e00',\n        name: 'Bob',\n        randomAddedProperty: 123\n      };\n\n      this.items = [\n        {\n          id: '5a61e00',\n          name: 'Bob',\n        },\n        {\n          id: '5a61e01',\n          name: 'Max',\n        },\n        {\n          id: '5a61e02',\n          name: 'Alice',\n        },\n      ];\n    });\n})();\n"
  },
  {
    "path": "src/components/select/demoTrackBy/style.css",
    "content": "code {\n  display: block;\n  padding: 8px;\n} \n"
  },
  {
    "path": "src/components/select/demoValidations/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak layout=\"column\" layout-align=\"center center\" layout-padding>\n  <form name=\"myForm\">\n    <p>\n      Note that, similar to regular inputs, the invalid styling only applies if the select is both\n      invalid <em>and</em> touched, or the form has been submitted.\n    </p>\n\n    <div layout=\"row\" layout-align=\"start\" flex>\n      <md-input-container flex=\"50\">\n        <label>Quest</label>\n        <input type=\"text\" name=\"quest\" ng-model=\"quest\" required />\n      </md-input-container>\n\n      <md-input-container flex=\"50\">\n        <label>Favorite Color</label>\n        <md-select name=\"favoriteColor\" ng-model=\"favoriteColor\" required>\n          <md-option value=\"\"></md-option>\n          <md-option value=\"red\">Red</md-option>\n          <md-option value=\"blue\">Blue</md-option>\n          <md-option value=\"green\">Green</md-option>\n        </md-select>\n        <div class=\"errors\" ng-messages=\"myForm.favoriteColor.$error\">\n          <div ng-message=\"required\">Required</div>\n        </div>\n      </md-input-container>\n    </div>\n\n    <div layout=\"row\" layout-align=\"start\">\n      <md-checkbox ng-model=\"myForm.$invalid\" disabled>Form Invalid</md-checkbox>\n      <md-checkbox ng-model=\"myForm.$dirty\" disabled>Form Dirty</md-checkbox>\n      <md-checkbox ng-model=\"myForm.$submitted\" disabled>Form Submitted</md-checkbox>\n      <md-checkbox ng-model=\"myForm.favoriteColor.$touched\" disabled>Select Touched</md-checkbox>\n    </div>\n\n    <div layout=\"row\" layout-align=\"end\" flex>\n      <md-button ng-click=\"clearValue()\" ng-disabled=\"!(quest || favoriteColor)\">Clear</md-button>\n      <md-button ng-click=\"save()\" class=\"md-primary\">Save</md-button>\n    </div>\n  </form>\n</div>\n"
  },
  {
    "path": "src/components/select/demoValidations/script.js",
    "content": "angular.module('selectDemoValidation', ['ngMaterial', 'ngMessages'])\n.controller('AppCtrl', function($scope) {\n  $scope.clearValue = function() {\n    $scope.quest = undefined;\n    $scope.favoriteColor = undefined;\n    $scope.myForm.$setPristine();\n  };\n  $scope.save = function() {\n    if ($scope.myForm.$valid) {\n      $scope.myForm.$setSubmitted();\n      alert('Form was valid.');\n    } else {\n      alert('Form was invalid!');\n    }\n  };\n});\n"
  },
  {
    "path": "src/components/select/select-theme.scss",
    "content": "md-input-container {\n\n  // The asterisk of the select should always use the warn color.\n  md-select.md-THEME_NAME-theme .md-select-value {\n    span:first-child:after {\n      color: '{{warn-A700}}'\n    }\n  }\n\n  // When the select is blurred and not invalid then the asterisk should use the foreground color.\n  &:not(.md-input-focused):not(.md-input-invalid) {\n    md-select.md-THEME_NAME-theme .md-select-value {\n      span:first-child:after {\n        color: '{{foreground-3}}';\n      }\n    }\n  }\n\n  &.md-input-focused:not(.md-input-has-value) {\n    md-select.md-THEME_NAME-theme .md-select-value {\n      color: '{{primary-color}}';\n\n      &.md-select-placeholder {\n        color: '{{primary-color}}';\n      }\n    }\n  }\n\n  &.md-input-invalid {\n    md-select.md-THEME_NAME-theme .md-select-value {\n      color: '{{warn-A700}}' !important;\n      border-bottom-color: '{{warn-A700}}' !important;\n    }\n\n    md-select.md-THEME_NAME-theme.md-no-underline .md-select-value {\n      border-bottom-color: transparent !important;\n    }\n  }\n\n  &:not(.md-input-invalid) {\n    &.md-input-focused {\n      &.md-accent {\n        .md-select-value {\n          border-color: '{{accent-color}}';\n          span {\n            color: '{{accent-color}}';\n          }\n        }\n      }\n      &.md-warn {\n        .md-select-value {\n          border-color: '{{warn-A700}}';\n          span {\n            color: '{{warn-A700}}';\n          }\n        }\n      }\n    }\n  }\n\n}\n\nmd-select.md-THEME_NAME-theme {\n  &[disabled] .md-select-value {\n    border-bottom-color: transparent;\n    background-image: linear-gradient(to right, '{{foreground-3}}' 0%, '{{foreground-3}}' 33%, transparent 0%);\n    background-image: -ms-linear-gradient(left, transparent 0%, '{{foreground-3}}' 100%);\n  }\n\n  .md-select-value {\n    border-bottom-color: '{{foreground-4}}';\n\n    &.md-select-placeholder {\n      color: '{{foreground-3}}';\n    }\n\n    span:first-child:after {\n      color: '{{warn-A700}}'\n    }\n  }\n\n  &.md-no-underline .md-select-value {\n    border-bottom-color: transparent !important;\n  }\n\n  &.ng-invalid.ng-touched {\n    .md-select-value {\n      color: '{{warn-A700}}' !important;\n      border-bottom-color: '{{warn-A700}}' !important;\n    }\n\n    &.md-no-underline .md-select-value {\n      border-bottom-color: transparent !important;\n    }\n  }\n\n  &:not([disabled]):focus {\n    .md-select-value {\n      border-bottom-color: '{{primary-color}}';\n      color: '{{ foreground-1 }}';\n      &.md-select-placeholder {\n        color: '{{ foreground-1 }}';\n      }\n    }\n\n    &.md-no-underline .md-select-value {\n      border-bottom-color: transparent !important;\n    }\n\n    &.md-accent .md-select-value {\n      border-bottom-color: '{{accent-color}}';\n    }\n\n    &.md-warn .md-select-value {\n      border-bottom-color: '{{warn-color}}';\n    }\n  }\n\n  &[disabled] {\n    .md-select-value {\n      color: '{{foreground-3}}';\n\n      &.md-select-placeholder {\n        color: '{{foreground-3}}';\n      }\n    }\n\n    .md-select-icon {\n      color: '{{foreground-3}}';\n    }\n  }\n\n  .md-select-icon {\n    color: '{{foreground-2}}';\n  }\n}\n\nmd-select-menu.md-THEME_NAME-theme {\n  md-content {\n    background-color: '{{background-hue-1}}';\n\n    md-optgroup {\n      color: '{{foreground-2}}';\n    }\n\n    md-option {\n      color: '{{foreground-1}}';\n\n      &[disabled] {\n        .md-text {\n          color: '{{foreground-3}}';\n        }\n      }\n\n      &:not([disabled]) {\n        &:hover {\n          background-color: '{{background-500-0.10}}'\n        }\n        &:focus,\n        &.md-focused {\n          background-color: '{{background-500-0.18}}'\n        }\n      }\n\n      &[selected] {\n        color: '{{primary-500}}';\n        &:focus,\n        &.md-focused {\n          color: '{{primary-600}}';\n        }\n        &.md-accent {\n          color: '{{accent-color}}';\n          &:focus,\n          &.md-focused {\n            color: '{{accent-A700}}';\n          }\n        }\n      }\n    }\n  }\n}\n\n.md-checkbox-enabled.md-THEME_NAME-theme {\n  @include checkbox-primary('[selected]');\n\n  md-option .md-text {\n    color: '{{foreground-1}}';\n  }\n}\n"
  },
  {
    "path": "src/components/select/select.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.select\n */\n\n/***************************************************\n\n ### TODO ###\n - [ ] Abstract placement logic in $mdSelect service to $mdMenu service\n\n ***************************************************/\n\nvar SELECT_EDGE_MARGIN = 8;\nvar selectNextId = 0;\nvar CHECKBOX_SELECTION_INDICATOR;\n\nangular.module('material.components.select', [\n    'material.core',\n    'material.components.backdrop'\n  ])\n  .directive('mdSelect', SelectDirective)\n  .directive('mdSelectMenu', SelectMenuDirective)\n  .directive('mdOption', OptionDirective)\n  .directive('mdOptgroup', OptgroupDirective)\n  .directive('mdSelectHeader', SelectHeaderDirective)\n  .provider('$mdSelect', SelectProvider);\n\n/**\n * @ngdoc directive\n * @name mdSelect\n * @restrict E\n * @module material.components.select\n *\n * @description Displays a select box, bound to an `ng-model`. Selectable options are defined using\n * the <a ng-href=\"api/directive/mdOption\">md-option</a> element directive. Options can be grouped\n * using the <a ng-href=\"api/directive/mdOptgroup\">md-optgroup</a> element directive.\n *\n * When the select is required and uses a floating label, then the label will automatically contain\n * an asterisk (`*`). This behavior can be disabled by using the `md-no-asterisk` attribute.\n *\n * By default, the select will display with an underline to match other form elements. This can be\n * disabled by applying the `md-no-underline` CSS class.\n *\n * @param {expression} ng-model Assignable angular expression to data-bind to.\n * @param {expression=} ng-change Expression to be executed when the model value changes.\n * @param {boolean=} multiple When present, allows for more than one option to be selected.\n *  The model is an array with the selected choices. **Note:** This attribute is only evaluated\n *  once; it is not watched.\n * @param {expression=} md-on-close Expression to be evaluated when the select is closed.\n * @param {expression=} md-on-open Expression to be evaluated when opening the select.\n *  Will hide the select options and show a spinner until the evaluated promise resolves.\n * @param {expression=} md-selected-text Expression to be evaluated that will return a string\n *  to be displayed as a placeholder in the select input box when it is closed. The value\n *  will be treated as *text* (not html).\n * @param {expression=} md-selected-html Expression to be evaluated that will return a string\n *  to be displayed as a placeholder in the select input box when it is closed. The value\n *  will be treated as *html*. The value must either be explicitly marked as trustedHtml or\n *  the ngSanitize module must be loaded.\n * @param {string=} placeholder Placeholder hint text.\n * @param {boolean=} md-no-asterisk When set to true, an asterisk will not be appended to the\n *  floating label. **Note:** This attribute is only evaluated once; it is not watched.\n * @param {string=} aria-label Optional label for accessibility. Only necessary if no explicit label\n *  is present.\n * @param {string=} md-container-class Class list to get applied to the `.md-select-menu-container`\n *  element (for custom styling).\n * @param {string=} md-select-only-option If specified, a `<md-select>` will automatically select\n * it's first option, if it only has one.\n *\n * @usage\n * With a placeholder (label and aria-label are added dynamically)\n * <hljs lang=\"html\">\n *   <md-input-container>\n *     <md-select\n *       ng-model=\"someModel\"\n *       placeholder=\"Select a state\">\n *       <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n *     </md-select>\n *   </md-input-container>\n * </hljs>\n *\n * With an explicit label\n * <hljs lang=\"html\">\n *   <md-input-container>\n *     <label>State</label>\n *     <md-select\n *       ng-model=\"someModel\">\n *       <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n *     </md-select>\n *   </md-input-container>\n * </hljs>\n *\n * Using the `md-select-header` element directive\n *\n * When a developer needs to put more than just a text label in the `md-select-menu`, they should\n * use one or more `md-select-header`s. These elements can contain custom HTML which can be styled\n * as desired. Use cases for this element include a sticky search bar and custom option group\n * labels.\n *\n * <hljs lang=\"html\">\n *   <md-input-container>\n *     <md-select ng-model=\"someModel\">\n *       <md-select-header>\n *         <span> Neighborhoods - </span>\n *       </md-select-header>\n *       <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n *     </md-select>\n *   </md-input-container>\n * </hljs>\n *\n * ## Selects and object equality\n * When using a `md-select` to pick from a list of objects, it is important to realize how javascript handles\n * equality. Consider the following example:\n * <hljs lang=\"js\">\n * angular.controller('MyCtrl', function($scope) {\n *   $scope.users = [\n *     { id: 1, name: 'Bob' },\n *     { id: 2, name: 'Alice' },\n *     { id: 3, name: 'Steve' }\n *   ];\n *   $scope.selectedUser = { id: 1, name: 'Bob' };\n * });\n * </hljs>\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyCtrl\">\n *   <md-select ng-model=\"selectedUser\">\n *     <md-option ng-value=\"user\" ng-repeat=\"user in users\">{{ user.name }}</md-option>\n *   </md-select>\n * </div>\n * </hljs>\n *\n * At first one might expect that the select should be populated with \"Bob\" as the selected user.\n * However, this is not true. To determine whether something is selected,\n * `ngModelController` is looking at whether `$scope.selectedUser == (any user in $scope.users);`;\n *\n * Javascript's `==` operator does not check for deep equality (ie. that all properties\n * on the object are the same), but instead whether the objects are *the same object in memory*.\n * In this case, we have two instances of identical objects, but they exist in memory as unique\n * entities. Because of this, the select will have no value populated for a selected user.\n *\n * To get around this, `ngModelController` provides a `track by` option that allows us to specify a\n * different expression which will be used for the equality operator. As such, we can update our\n * `html` to make use of this by specifying the `ng-model-options=\"{trackBy: '$value.id'}\"` on the\n * `md-select` element. This converts our equality expression to be\n * `$scope.selectedUser.id == (any id in $scope.users.map(function(u) { return u.id; }));`\n * which results in Bob being selected as desired.\n *\n * **Note:** We do not support AngularJS's `track by` syntax. For instance\n *  `ng-options=\"user in users track by user.id\"` will not work with `md-select`.\n *\n * Working HTML:\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyCtrl\">\n *   <md-select ng-model=\"selectedUser\" ng-model-options=\"{trackBy: '$value.id'}\">\n *     <md-option ng-value=\"user\" ng-repeat=\"user in users\">{{ user.name }}</md-option>\n *   </md-select>\n * </div>\n * </hljs>\n */\nfunction SelectDirective($mdSelect, $mdUtil, $mdConstant, $mdTheming, $mdAria, $parse, $sce) {\n  return {\n    restrict: 'E',\n    require: ['^?mdInputContainer', 'mdSelect', 'ngModel', '?^form'],\n    compile: compile,\n    controller: function() {\n    } // empty placeholder controller to be initialized in link\n  };\n\n  /**\n   * @param {JQLite} tElement\n   * @param {IAttributes} tAttrs\n   * @return {postLink}\n   */\n  function compile(tElement, tAttrs) {\n    var isMultiple = $mdUtil.parseAttributeBoolean(tAttrs.multiple);\n    tElement.addClass('md-auto-horizontal-margin');\n\n    // add the select value that will hold our placeholder or selected option value\n    var valueEl = angular.element('<md-select-value><span></span></md-select-value>');\n    valueEl.append('<span class=\"md-select-icon\" aria-hidden=\"true\"></span>');\n    valueEl.addClass('md-select-value');\n    if (!valueEl[0].hasAttribute('id')) {\n      valueEl.attr('id', 'select_value_label_' + $mdUtil.nextUid());\n    }\n\n    // There's got to be an md-content inside. If there's not one, let's add it.\n    var mdContentEl = tElement.find('md-content');\n    if (!mdContentEl.length) {\n      tElement.append(angular.element('<md-content>').append(tElement.contents()));\n      mdContentEl = tElement.find('md-content');\n    }\n    mdContentEl.attr('role', 'listbox');\n    mdContentEl.attr('tabindex', '-1');\n\n    if (isMultiple) {\n      mdContentEl.attr('aria-multiselectable', 'true');\n    } else {\n      mdContentEl.attr('aria-multiselectable', 'false');\n    }\n\n    // Add progress spinner for md-options-loading\n    if (tAttrs.mdOnOpen) {\n\n      // Show progress indicator while loading async\n      // Use ng-hide for `display:none` so the indicator does not interfere with the options list\n      tElement\n        .find('md-content')\n        .prepend(angular.element(\n          '<div>' +\n          ' <md-progress-circular md-mode=\"indeterminate\" ng-if=\"$$loadingAsyncDone === false\"' +\n          ' md-diameter=\"25px\"></md-progress-circular>' +\n          '</div>'\n        ));\n\n      // Hide list [of item options] while loading async\n      tElement\n        .find('md-option')\n        .attr('ng-show', '$$loadingAsyncDone');\n    }\n\n    if (tAttrs.name) {\n      var autofillClone = angular.element('<select class=\"md-visually-hidden\"></select>');\n      autofillClone.attr({\n        'name': tAttrs.name,\n        'aria-hidden': 'true',\n        'tabindex': '-1'\n      });\n      var opts = tElement.find('md-option');\n      angular.forEach(opts, function(el) {\n        var newEl = angular.element('<option>' + el.innerHTML + '</option>');\n        if (el.hasAttribute('ng-value')) {\n          newEl.attr('ng-value', el.getAttribute('ng-value'));\n        }\n        else if (el.hasAttribute('value')) {\n          newEl.attr('value', el.getAttribute('value'));\n        }\n        autofillClone.append(newEl);\n      });\n\n      // Adds an extra option that will hold the selected value for the\n      // cases where the select is a part of a non-AngularJS form. This can be done with a ng-model,\n      // however if the `md-option` is being `ng-repeat`-ed, AngularJS seems to insert a similar\n      // `option` node, but with a value of `? string: <value> ?` which would then get submitted.\n      // This also goes around having to prepend a dot to the name attribute.\n      autofillClone.append(\n        '<option ng-value=\"' + tAttrs.ngModel + '\" selected></option>'\n      );\n\n      tElement.parent().append(autofillClone);\n    }\n\n    // Use everything that's left inside element.contents() as the contents of the menu\n    var multipleContent = isMultiple ? 'multiple' : '';\n    var ngModelOptions = tAttrs.ngModelOptions ? $mdUtil.supplant('ng-model-options=\"{0}\"', [tAttrs.ngModelOptions]) : '';\n    var selectTemplate = '' +\n      '<div class=\"md-select-menu-container\" aria-hidden=\"true\" role=\"presentation\">' +\n      '  <md-select-menu role=\"presentation\" {0} {1}>{2}</md-select-menu>' +\n      '</div>';\n\n    selectTemplate = $mdUtil.supplant(selectTemplate, [multipleContent, ngModelOptions,  tElement.html()]);\n    tElement.empty().append(valueEl);\n    tElement.append(selectTemplate);\n\n    if (!tAttrs.tabindex) {\n      tAttrs.$set('tabindex', 0);\n    }\n\n    return function postLink(scope, element, attrs, ctrls) {\n      var untouched = true;\n      var isDisabled;\n\n      var containerCtrl = ctrls[0];\n      var mdSelectCtrl = ctrls[1];\n      var ngModelCtrl = ctrls[2];\n      var formCtrl = ctrls[3];\n      // grab a reference to the select menu value label\n      var selectValueElement = element.find('md-select-value');\n      var isReadonly = angular.isDefined(attrs.readonly);\n      var disableAsterisk = $mdUtil.parseAttributeBoolean(attrs.mdNoAsterisk);\n      var stopMdMultipleWatch;\n      var userDefinedLabelledby = angular.isDefined(attrs.ariaLabelledby);\n      var listboxContentElement = element.find('md-content');\n      var initialPlaceholder = element.attr('placeholder');\n\n      if (disableAsterisk) {\n        element.addClass('md-no-asterisk');\n      }\n\n      if (containerCtrl) {\n        var isErrorGetter = containerCtrl.isErrorGetter || function() {\n          return ngModelCtrl.$invalid && (ngModelCtrl.$touched || (formCtrl && formCtrl.$submitted));\n        };\n\n        if (containerCtrl.input) {\n          // We ignore inputs that are in the md-select-header.\n          // One case where this might be useful would be adding as searchbox.\n          if (element.find('md-select-header').find('input')[0] !== containerCtrl.input[0]) {\n            throw new Error(\"<md-input-container> can only have *one* child <input>, <textarea>, or <select> element!\");\n          }\n        }\n\n        containerCtrl.input = element;\n        if (!containerCtrl.label) {\n          $mdAria.expect(element, 'aria-label', initialPlaceholder);\n          var selectLabel = element.attr('aria-label');\n          if (!selectLabel) {\n            selectLabel = initialPlaceholder;\n          }\n          listboxContentElement.attr('aria-label', selectLabel);\n        } else {\n          containerCtrl.label.attr('aria-hidden', 'true');\n          listboxContentElement.attr('aria-label', containerCtrl.label.text());\n          containerCtrl.setHasPlaceholder(!!initialPlaceholder);\n        }\n\n        var stopInvalidWatch = scope.$watch(isErrorGetter, containerCtrl.setInvalid);\n      }\n\n      var selectContainer, selectScope, selectMenuCtrl;\n\n      selectContainer = findSelectContainer();\n      $mdTheming(element);\n\n      var originalRender = ngModelCtrl.$render;\n      ngModelCtrl.$render = function() {\n        originalRender();\n        syncSelectValueText();\n        inputCheckValue();\n      };\n\n      var stopPlaceholderObserver = attrs.$observe('placeholder', ngModelCtrl.$render);\n\n      var stopRequiredObserver = attrs.$observe('required', function (value) {\n        if (containerCtrl && containerCtrl.label) {\n          // Toggle the md-required class on the input containers label, because the input container\n          // is automatically applying the asterisk indicator on the label.\n          containerCtrl.label.toggleClass('md-required', value && !disableAsterisk);\n        }\n        element.removeAttr('aria-required');\n        if (value) {\n          listboxContentElement.attr('aria-required', 'true');\n        } else {\n          listboxContentElement.removeAttr('aria-required');\n        }\n      });\n\n      /**\n       * Set the contents of the md-select-value element. This element's contents are announced by\n       * screen readers and used for displaying the value of the select in both single and multiple\n       * selection modes.\n       * @param {string=} text A sanitized and trusted HTML string or a pure text string from user\n       *  input.\n       */\n      mdSelectCtrl.setSelectValueText = function(text) {\n        var useDefaultText = text === undefined || text === '';\n        // Whether the select label has been given via user content rather than the internal\n        // template of <md-option>\n        var isSelectLabelFromUser = false;\n\n        mdSelectCtrl.setIsPlaceholder(!text);\n\n        if (attrs.mdSelectedText && attrs.mdSelectedHtml) {\n          throw Error('md-select cannot have both `md-selected-text` and `md-selected-html`');\n        }\n\n        if (attrs.mdSelectedText || attrs.mdSelectedHtml) {\n          text = $parse(attrs.mdSelectedText || attrs.mdSelectedHtml)(scope);\n          isSelectLabelFromUser = true;\n        } else if (useDefaultText) {\n          // Use placeholder attribute, otherwise fallback to the md-input-container label\n          var tmpPlaceholder = attrs.placeholder ||\n              (containerCtrl && containerCtrl.label ? containerCtrl.label.text() : '');\n\n          text = tmpPlaceholder || '';\n          isSelectLabelFromUser = true;\n        }\n\n        var target = selectValueElement.children().eq(0);\n\n        if (attrs.mdSelectedHtml) {\n          // Using getTrustedHtml will run the content through $sanitize if it is not already\n          // explicitly trusted. If the ngSanitize module is not loaded, this will\n          // *correctly* throw an sce error.\n          target.html($sce.getTrustedHtml(text));\n        } else if (isSelectLabelFromUser) {\n          target.text(text);\n        } else {\n          // If we've reached this point, the text is not user-provided.\n          target.html(text);\n        }\n\n        if (useDefaultText) {\n          // Avoid screen readers double announcing the label name when no value has been selected\n          selectValueElement.attr('aria-hidden', 'true');\n          if (!userDefinedLabelledby) {\n            element.removeAttr('aria-labelledby');\n          }\n        } else {\n          selectValueElement.removeAttr('aria-hidden');\n          if (!userDefinedLabelledby) {\n            element.attr('aria-labelledby', element[0].id + ' ' + selectValueElement[0].id);\n          }\n        }\n      };\n\n      /**\n       * @param {boolean} isPlaceholder true to mark the md-select-value element and\n       *  input container, if one exists, with classes for styling when a placeholder is present.\n       *  false to remove those classes.\n       */\n      mdSelectCtrl.setIsPlaceholder = function(isPlaceholder) {\n          if (isPlaceholder) {\n            selectValueElement.addClass('md-select-placeholder');\n            // Don't hide the floating label if the md-select has a placeholder.\n            if (containerCtrl && containerCtrl.label && !element.attr('placeholder')) {\n              containerCtrl.label.addClass('md-placeholder');\n            }\n          } else {\n            selectValueElement.removeClass('md-select-placeholder');\n            if (containerCtrl && containerCtrl.label && !element.attr('placeholder')) {\n              containerCtrl.label.removeClass('md-placeholder');\n            }\n          }\n      };\n\n      if (!isReadonly) {\n        var handleBlur = function(event) {\n          // Attach before ngModel's blur listener to stop propagation of blur event\n          // and prevent setting $touched.\n          if (untouched) {\n            untouched = false;\n            if (selectScope._mdSelectIsOpen) {\n              event.stopImmediatePropagation();\n            }\n          }\n\n          containerCtrl && containerCtrl.setFocused(false);\n          inputCheckValue();\n        };\n        var handleFocus = function() {\n          // Always focus the container (if we have one) so floating labels and other styles are\n          // applied properly\n          containerCtrl && containerCtrl.setFocused(true);\n        };\n\n        element.on('focus', handleFocus);\n        element.on('blur', handleBlur);\n      }\n\n      mdSelectCtrl.triggerClose = function() {\n        $parse(attrs.mdOnClose)(scope);\n      };\n\n      scope.$$postDigest(function() {\n        initAriaLabel();\n        syncSelectValueText();\n      });\n\n      function initAriaLabel() {\n        var labelText = element.attr('aria-label') || element.attr('placeholder');\n        if (!labelText && containerCtrl && containerCtrl.label) {\n          labelText = containerCtrl.label.text();\n        }\n        $mdAria.expect(element, 'aria-label', labelText);\n      }\n\n      var stopSelectedLabelsWatcher = scope.$watch(function() {\n        return selectMenuCtrl.getSelectedLabels();\n      }, syncSelectValueText);\n\n      function syncSelectValueText() {\n        selectMenuCtrl = selectMenuCtrl ||\n          selectContainer.find('md-select-menu').controller('mdSelectMenu');\n        mdSelectCtrl.setSelectValueText(selectMenuCtrl.getSelectedLabels());\n      }\n\n      // TODO add tests for mdMultiple\n      // TODO add docs for mdMultiple\n      var stopMdMultipleObserver = attrs.$observe('mdMultiple', function(val) {\n        if (stopMdMultipleWatch) {\n          stopMdMultipleWatch();\n        }\n        var parser = $parse(val);\n        stopMdMultipleWatch = scope.$watch(function() {\n          return parser(scope);\n        }, function(multiple, prevVal) {\n          var selectMenu = selectContainer.find('md-select-menu');\n          // assume compiler did a good job\n          if (multiple === undefined && prevVal === undefined) {\n            return;\n          }\n          if (multiple) {\n            var setMultipleAttrs = {'multiple': 'multiple'};\n            element.attr(setMultipleAttrs);\n            selectMenu.attr(setMultipleAttrs);\n          } else {\n            element.removeAttr('multiple');\n            selectMenu.removeAttr('multiple');\n          }\n          element.find('md-content').attr('aria-multiselectable', multiple ? 'true' : 'false');\n\n          if (selectContainer) {\n            selectMenuCtrl.setMultiple(Boolean(multiple));\n            originalRender = ngModelCtrl.$render;\n            ngModelCtrl.$render = function() {\n              originalRender();\n              syncSelectValueText();\n              inputCheckValue();\n            };\n            ngModelCtrl.$render();\n          }\n        });\n      });\n\n      var stopDisabledObserver = attrs.$observe('disabled', function(disabled) {\n        if (angular.isString(disabled)) {\n          disabled = true;\n        }\n        // Prevent click event being registered twice\n        if (isDisabled !== undefined && isDisabled === disabled) {\n          return;\n        }\n        isDisabled = disabled;\n        if (disabled) {\n          element\n            .attr({'aria-disabled': 'true'})\n            .removeAttr('tabindex')\n            .removeAttr('aria-expanded')\n            .removeAttr('aria-haspopup')\n            .off('click', openSelect)\n            .off('keydown', handleKeypress);\n        } else {\n          element\n            .attr({\n              'tabindex': attrs.tabindex,\n              'aria-haspopup': 'listbox'\n            })\n            .removeAttr('aria-disabled')\n            .on('click', openSelect)\n            .on('keydown', handleKeypress);\n        }\n      });\n\n      if (!attrs.hasOwnProperty('disabled') && !attrs.hasOwnProperty('ngDisabled')) {\n        element.attr({'aria-disabled': 'false'});\n        element.on('click', openSelect);\n        element.on('keydown', handleKeypress);\n      }\n\n      var ariaAttrs = {\n        role: 'button',\n        'aria-haspopup': 'listbox'\n      };\n\n      if (!element[0].hasAttribute('id')) {\n        ariaAttrs.id = 'select_' + $mdUtil.nextUid();\n      }\n\n      var containerId = 'select_container_' + $mdUtil.nextUid();\n      selectContainer.attr('id', containerId);\n      var listboxContentId = 'select_listbox_' + $mdUtil.nextUid();\n      selectContainer.find('md-content').attr('id', listboxContentId);\n      // Only add aria-owns if element ownership is NOT represented in the DOM.\n      if (!element.find('md-select-menu').length) {\n        ariaAttrs['aria-owns'] = listboxContentId;\n      }\n      element.attr(ariaAttrs);\n\n      scope.$on('$destroy', function() {\n        stopRequiredObserver && stopRequiredObserver();\n        stopDisabledObserver && stopDisabledObserver();\n        stopMdMultipleWatch && stopMdMultipleWatch();\n        stopMdMultipleObserver && stopMdMultipleObserver();\n        stopSelectedLabelsWatcher && stopSelectedLabelsWatcher();\n        stopPlaceholderObserver && stopPlaceholderObserver();\n        stopInvalidWatch && stopInvalidWatch();\n\n        element.off('focus');\n        element.off('blur');\n\n        $mdSelect\n          .destroy()\n          .finally(function() {\n            if (containerCtrl) {\n              containerCtrl.setFocused(false);\n              containerCtrl.setHasValue(false);\n              containerCtrl.input = null;\n            }\n            ngModelCtrl.$setTouched();\n          });\n      });\n\n      function inputCheckValue() {\n        // The select counts as having a value if one or more options are selected,\n        // or if the input's validity state says it has bad input (eg: string in a number input).\n        // We must do this on nextTick as the $render is sometimes invoked on nextTick.\n        $mdUtil.nextTick(function () {\n          containerCtrl && containerCtrl.setHasValue(\n            selectMenuCtrl.getSelectedLabels().length > 0 || (element[0].validity || {}).badInput);\n        });\n      }\n\n      function findSelectContainer() {\n        var selectContainer = angular.element(\n          element[0].querySelector('.md-select-menu-container')\n        );\n        selectScope = scope;\n        attrs.mdContainerClass && selectContainer.addClass(attrs.mdContainerClass);\n        selectMenuCtrl = selectContainer.find('md-select-menu').controller('mdSelectMenu');\n        selectMenuCtrl.init(ngModelCtrl, attrs);\n        element.on('$destroy', function() {\n          selectContainer.remove();\n        });\n        return selectContainer;\n      }\n\n      /**\n       * Determine if the select menu should be opened or an option in the select menu should be\n       * selected.\n       * @param {KeyboardEvent} e keyboard event to handle\n       */\n      function handleKeypress(e) {\n        if ($mdConstant.isNavigationKey(e)) {\n          // prevent page scrolling on interaction\n          e.preventDefault();\n          openSelect(e);\n        } else {\n          if (shouldHandleKey(e, $mdConstant)) {\n            e.preventDefault();\n\n            var node = selectMenuCtrl.optNodeForKeyboardSearch(e);\n            if (!node || node.hasAttribute('disabled')) {\n              return;\n            }\n            var optionCtrl = angular.element(node).controller('mdOption');\n            if (!selectMenuCtrl.isMultiple) {\n              angular.forEach(Object.keys(selectMenuCtrl.selected), function (key) {\n                selectMenuCtrl.deselect(key);\n              });\n            }\n            selectMenuCtrl.select(optionCtrl.hashKey, optionCtrl.value);\n            selectMenuCtrl.refreshViewValue();\n          }\n        }\n      }\n\n      function openSelect() {\n        selectScope._mdSelectIsOpen = true;\n        element.attr('aria-expanded', 'true');\n\n        $mdSelect.show({\n          scope: selectScope,\n          preserveScope: true,\n          skipCompile: true,\n          element: selectContainer,\n          target: element[0],\n          selectCtrl: mdSelectCtrl,\n          preserveElement: true,\n          hasBackdrop: true,\n          loadingAsync: attrs.mdOnOpen ? scope.$eval(attrs.mdOnOpen) || true : false\n        }).finally(function() {\n          selectScope._mdSelectIsOpen = false;\n          element.removeAttr('aria-expanded');\n          element.removeAttr('aria-activedescendant');\n          ngModelCtrl.$setTouched();\n        });\n      }\n\n    };\n  }\n}\n\nfunction SelectMenuDirective($parse, $mdUtil, $mdConstant, $mdTheming) {\n  // We want the scope to be set to 'false' so an isolated scope is not created\n  // which would interfere with the md-select-header's access to the\n  // parent scope.\n  return {\n    restrict: 'E',\n    require: ['mdSelectMenu'],\n    scope: false,\n    controller: SelectMenuController,\n    link: {pre: preLink}\n  };\n\n  // We use preLink instead of postLink to ensure that the select is initialized before\n  // its child options run postLink.\n  function preLink(scope, element, attrs, ctrls) {\n    var selectMenuCtrl = ctrls[0];\n\n    element.addClass('_md');     // private md component indicator for styling\n\n    $mdTheming(element);\n    element.on('click', clickListener);\n    element.on('keypress', keyListener);\n\n    /**\n     * @param {KeyboardEvent} keyboardEvent\n     */\n    function keyListener(keyboardEvent) {\n      if (keyboardEvent.keyCode === 13 || keyboardEvent.keyCode === 32) {\n        clickListener(keyboardEvent);\n      }\n    }\n\n    /**\n     * @param {Event} mouseEvent\n     * @return {void}\n     */\n    function clickListener(mouseEvent) {\n      var option = $mdUtil.getClosest(mouseEvent.target, 'md-option');\n      var optionCtrl = option && angular.element(option).data('$mdOptionController');\n\n      if (!option || !optionCtrl) {\n        // Avoid closing the menu when the select header's input is clicked\n        if (mouseEvent.target && mouseEvent.target.parentNode &&\n          mouseEvent.target.parentNode.tagName === 'MD-SELECT-HEADER') {\n          mouseEvent.stopImmediatePropagation();\n        }\n        return;\n      } else if (option.hasAttribute('disabled')) {\n        mouseEvent.stopImmediatePropagation();\n        return;\n      }\n\n      var optionHashKey = selectMenuCtrl.hashGetter(optionCtrl.value);\n      var isSelected = angular.isDefined(selectMenuCtrl.selected[optionHashKey]);\n\n      scope.$apply(function() {\n        if (selectMenuCtrl.isMultiple) {\n          if (isSelected) {\n            selectMenuCtrl.deselect(optionHashKey);\n          } else {\n            selectMenuCtrl.select(optionHashKey, optionCtrl.value);\n          }\n        } else {\n          if (!isSelected) {\n            angular.forEach(Object.keys(selectMenuCtrl.selected), function (key) {\n              selectMenuCtrl.deselect(key);\n            });\n            selectMenuCtrl.select(optionHashKey, optionCtrl.value);\n          }\n        }\n        selectMenuCtrl.refreshViewValue();\n      });\n    }\n  }\n\n  function SelectMenuController($scope, $attrs, $element) {\n    var self = this;\n    var defaultIsEmpty;\n    var searchStr = '';\n    var clearSearchTimeout, optNodes, optText;\n    var CLEAR_SEARCH_AFTER = 300;\n\n    self.isMultiple = angular.isDefined($attrs.multiple);\n    // selected is an object with keys matching all of the selected options' hashed values\n    self.selected = {};\n    // options is an object with keys matching every option's hash value,\n    // and values containing an instance of every option's controller.\n    self.options = {};\n\n    $scope.$watchCollection(function() {\n      return self.options;\n    }, function() {\n      self.ngModel.$render();\n      updateOptionSetSizeAndPosition();\n    });\n\n    /**\n     * @param {boolean} isMultiple\n     */\n    self.setMultiple = function(isMultiple) {\n      var ngModel = self.ngModel;\n      defaultIsEmpty = defaultIsEmpty || ngModel.$isEmpty;\n      self.isMultiple = isMultiple;\n\n      if (self.isMultiple) {\n        // We want to delay the render method so that the directive has a chance to load before\n        // rendering, this prevents the control being marked as dirty onload.\n        var loaded = false;\n        var delayedRender = function(val) {\n          if (!loaded) {\n            $mdUtil.nextTick(function () {\n              renderMultiple(val);\n              loaded = true;\n            });\n          } else {\n            renderMultiple(val);\n          }\n        };\n        ngModel.$validators['md-multiple'] = validateArray;\n        ngModel.$render = delayedRender;\n\n        // watchCollection on the model because by default ngModel only watches the model's\n        // reference. This allows the developer to also push and pop from their array.\n        $scope.$watchCollection(self.modelBinding, function(value) {\n          if (validateArray(value)) {\n            delayedRender(value);\n          }\n        });\n\n        ngModel.$isEmpty = function(value) {\n          return !value || value.length === 0;\n        };\n      } else {\n        delete ngModel.$validators['md-multiple'];\n        ngModel.$render = renderSingular;\n      }\n\n      function validateArray(modelValue, viewValue) {\n        // If a value is truthy but not an array, reject it.\n        // If value is undefined/falsy, accept that it's an empty array.\n        return angular.isArray(modelValue || viewValue || []);\n      }\n    };\n\n    /**\n     * @param {KeyboardEvent} keyboardEvent keyboard event to handle\n     * @return {Element|HTMLElement|undefined}\n     */\n    self.optNodeForKeyboardSearch = function(keyboardEvent) {\n      var search, i;\n      clearSearchTimeout && clearTimeout(clearSearchTimeout);\n      clearSearchTimeout = setTimeout(function() {\n        clearSearchTimeout = undefined;\n        searchStr = '';\n        optText = undefined;\n        optNodes = undefined;\n      }, CLEAR_SEARCH_AFTER);\n\n      searchStr += keyboardEvent.key;\n      search = new RegExp('^' + $mdUtil.sanitize(searchStr), 'i');\n      if (!optNodes) {\n        optNodes = $element.find('md-option');\n        optText = new Array(optNodes.length);\n        angular.forEach(optNodes, function(el, i) {\n          optText[i] = el.textContent.trim();\n        });\n      }\n\n      for (i = 0; i < optText.length; ++i) {\n        if (search.test(optText[i])) {\n          return optNodes[i];\n        }\n      }\n    };\n\n    self.init = function(ngModel, parentAttrs) {\n      self.ngModel = ngModel;\n      self.modelBinding = parentAttrs.ngModel;\n\n      // Setup a more robust version of isEmpty to ensure value is a valid option\n      self.ngModel.$isEmpty = function($viewValue) {\n        // We have to transform the viewValue into the hashKey, because otherwise the\n        // OptionCtrl may not exist. Developers may have specified a trackBy function.\n        var hashedValue = self.options[self.hashGetter($viewValue)] ? self.options[self.hashGetter($viewValue)].value : null;\n        // Base this check on the default AngularJS $isEmpty() function.\n        // eslint-disable-next-line no-self-compare\n        return !angular.isDefined(hashedValue) || hashedValue === null || hashedValue === '' || hashedValue !== hashedValue;\n      };\n\n      // Allow users to provide `ng-model=\"foo\" ng-model-options=\"{trackBy: '$value.id'}\"` so\n      // that we can properly compare objects set on the model to the available options\n      //\n      // If the user doesn't provide a trackBy, we automatically generate an id for every\n      // value passed in with the getId function\n      if ($attrs.ngModelOptions) {\n        self.hashGetter = function(value) {\n          var ngModelOptions = $parse($attrs.ngModelOptions)($scope);\n          var trackByOption = ngModelOptions && ngModelOptions.trackBy;\n\n          if (trackByOption) {\n            return $parse(trackByOption)($scope, { $value: value });\n          } else if (angular.isObject(value)) {\n            return getId(value);\n          }\n          return value;\n        };\n      } else {\n        self.hashGetter = getId;\n      }\n      self.setMultiple(self.isMultiple);\n\n      /**\n       * If the value is an object, get the unique, incremental id of the value.\n       * If it's not an object, the value will be converted to a string and then returned.\n       * @param value\n       * @returns {string}\n       */\n      function getId(value) {\n        if (angular.isObject(value) && !angular.isArray(value)) {\n          return 'object_' + (value.$$mdSelectId || (value.$$mdSelectId = ++selectNextId));\n        }\n        return value + '';\n      }\n\n      if (parentAttrs.hasOwnProperty('mdSelectOnlyOption')) {\n        $mdUtil.nextTick(function() {\n          var optionKeys = Object.keys(self.options);\n\n          if (optionKeys.length === 1) {\n            var option = self.options[optionKeys[0]];\n\n            self.deselect(Object.keys(self.selected)[0]);\n            self.select(self.hashGetter(option.value), option.value);\n            self.refreshViewValue();\n            self.ngModel.$setPristine();\n          }\n        }, false);\n      }\n    };\n\n    /**\n     * @param {string=} id\n     */\n    self.setActiveDescendant = function(id) {\n      if (angular.isDefined(id)) {\n        $element.find('md-content').attr('aria-activedescendant', id);\n      } else {\n        $element.find('md-content').removeAttr('aria-activedescendant');\n      }\n    };\n\n    /**\n     * @param {{mode: string}=} opts options object to allow specifying html (default) or aria mode.\n     * @return {string} comma separated set of selected values\n     */\n    self.getSelectedLabels = function(opts) {\n      opts = opts || {};\n      var mode = opts.mode || 'html';\n      var selectedOptionEls =\n        $mdUtil.nodesToArray($element[0].querySelectorAll('md-option[selected]'));\n\n      if (selectedOptionEls.length) {\n        var mapFn;\n\n        if (mode === 'html') {\n          // Map the given element to its innerHTML string. If the element has a child ripple\n          // container remove it from the HTML string, before returning the string.\n          mapFn = function(el) {\n            // If we do not have a `value` or `ng-value`, assume it is an empty option which clears\n            // the select.\n            if (el.hasAttribute('md-option-empty')) {\n              return '';\n            }\n\n            var html = el.innerHTML;\n\n            // Remove the ripple container from the selected option, copying it would cause a CSP\n            // violation.\n            var rippleContainer = el.querySelector('.md-ripple-container');\n            if (rippleContainer) {\n              html = html.replace(rippleContainer.outerHTML, '');\n            }\n\n            // Remove the checkbox container, because it will cause the label to wrap inside of the\n            // placeholder. It should be not displayed inside of the label element.\n            var checkboxContainer = el.querySelector('.md-container');\n            if (checkboxContainer) {\n              html = html.replace(checkboxContainer.outerHTML, '');\n            }\n\n            return html;\n          };\n        } else if (mode === 'aria') {\n          mapFn = function(el) {\n            return el.hasAttribute('aria-label') ? el.getAttribute('aria-label') : el.textContent;\n          };\n        }\n\n        // Ensure there are no duplicates; see https://github.com/angular/material/issues/9442\n        return $mdUtil.uniq(selectedOptionEls.map(mapFn)).join(', ');\n      } else {\n        return '';\n      }\n    };\n\n    /**\n     * Mark an option as selected\n     * @param {string} hashKey key within the SelectMenuController.options object, which is an\n     *  instance of OptionController.\n     * @param {OptionController} hashedValue value to associate with the key\n     */\n    self.select = function(hashKey, hashedValue) {\n      var option = self.options[hashKey];\n      option && option.setSelected(true, self.isMultiple);\n      self.selected[hashKey] = hashedValue;\n    };\n\n    /**\n     * Mark an option as not selected\n     * @param {string} hashKey key within the SelectMenuController.options object, which is an\n     *  instance of OptionController.\n     */\n    self.deselect = function(hashKey) {\n      var option = self.options[hashKey];\n      option && option.setSelected(false, self.isMultiple);\n      delete self.selected[hashKey];\n    };\n\n    /**\n     * Add an option to the select\n     * @param {string} hashKey key within the SelectMenuController.options object, which is an\n     *  instance of OptionController.\n     * @param {OptionController} optionCtrl instance to associate with the key\n     */\n    self.addOption = function(hashKey, optionCtrl) {\n      if (angular.isDefined(self.options[hashKey])) {\n        throw new Error('Duplicate md-option values are not allowed in a select. ' +\n          'Duplicate value \"' + optionCtrl.value + '\" found.');\n      }\n\n      self.options[hashKey] = optionCtrl;\n\n      // If this option's value was already in our ngModel, go ahead and select it.\n      if (angular.isDefined(self.selected[hashKey])) {\n        self.select(hashKey, optionCtrl.value);\n\n        // When the current $modelValue of the ngModel Controller is using the same hash as\n        // the current option, which will be added, then we can be sure, that the validation\n        // of the option has occurred before the option was added properly.\n        // This means, that we have to manually trigger a new validation of the current option.\n        if (angular.isDefined(self.ngModel.$$rawModelValue) &&\n            self.hashGetter(self.ngModel.$$rawModelValue) === hashKey) {\n          self.ngModel.$validate();\n        }\n\n        self.refreshViewValue();\n      }\n    };\n\n    /**\n     * Remove an option from the select\n     * @param {string} hashKey key within the SelectMenuController.options object, which is an\n     *  instance of OptionController.\n     */\n    self.removeOption = function(hashKey) {\n      delete self.options[hashKey];\n      // Don't deselect an option when it's removed - the user's ngModel should be allowed\n      // to have values that do not match a currently available option.\n    };\n\n    self.refreshViewValue = function() {\n      var values = [];\n      var option;\n      for (var hashKey in self.selected) {\n        // If this hashKey has an associated option, push that option's value to the model.\n        if ((option = self.options[hashKey])) {\n          values.push(option.value);\n        } else {\n          // Otherwise, the given hashKey has no associated option, and we got it\n          // from an ngModel value at an earlier time. Push the unhashed value of\n          // this hashKey to the model.\n          // This allows the developer to put a value in the model that doesn't yet have\n          // an associated option.\n          values.push(self.selected[hashKey]);\n        }\n      }\n\n      var newVal = self.isMultiple ? values : values[0];\n      var prevVal = self.ngModel.$modelValue;\n\n      if (!equals(prevVal, newVal)) {\n        self.ngModel.$setViewValue(newVal);\n        self.ngModel.$render();\n      }\n\n      function equals(prevVal, newVal) {\n        if (self.isMultiple) {\n          if (!angular.isArray(prevVal)) {\n            // newVal is always an array when self.isMultiple is true\n            // thus, if prevVal is not an array they are different\n            return false;\n          } else if (prevVal.length !== newVal.length) {\n            // they are different if they have different length\n            return false;\n          } else {\n            // if they have the same length, then they are different\n            // if an item in the newVal array can't be found in the prevVal\n            var prevValHashes = prevVal.map(function(prevValItem) {\n              return self.hashGetter(prevValItem);\n            });\n            return newVal.every(function(newValItem) {\n              var newValItemHash = self.hashGetter(newValItem);\n              return prevValHashes.some(function(prevValHash) {\n                return prevValHash === newValItemHash;\n              });\n            });\n          }\n        } else {\n          return self.hashGetter(prevVal) === self.hashGetter(newVal);\n        }\n      }\n    };\n\n    /**\n     * If the options include md-optgroups, then we need to apply aria-setsize and aria-posinset\n     * to help screen readers understand the indexes. When md-optgroups are not used, we save on\n     * perf and extra attributes by not applying these attributes as they are not needed by screen\n     * readers.\n     */\n    function updateOptionSetSizeAndPosition() {\n      var i, options;\n      var hasOptGroup = $element.find('md-optgroup');\n      if (!hasOptGroup.length) {\n        return;\n      }\n\n      options = $element.find('md-option');\n\n      for (i = 0; i < options.length; i++) {\n        options[i].setAttribute('aria-setsize', options.length);\n        options[i].setAttribute('aria-posinset', i + 1);\n      }\n    }\n\n    function renderMultiple() {\n      var newSelectedValues = self.ngModel.$modelValue || self.ngModel.$viewValue || [];\n      if (!angular.isArray(newSelectedValues)) {\n        return;\n      }\n\n      var oldSelected = Object.keys(self.selected);\n\n      var newSelectedHashes = newSelectedValues.map(self.hashGetter);\n      var deselected = oldSelected.filter(function(hash) {\n        return newSelectedHashes.indexOf(hash) === -1;\n      });\n\n      deselected.forEach(self.deselect);\n      newSelectedHashes.forEach(function(hashKey, i) {\n        self.select(hashKey, newSelectedValues[i]);\n      });\n    }\n\n    function renderSingular() {\n      var value = self.ngModel.$viewValue || self.ngModel.$modelValue;\n      Object.keys(self.selected).forEach(self.deselect);\n      self.select(self.hashGetter(value), value);\n    }\n  }\n}\n\n/**\n * @ngdoc directive\n * @name mdOption\n * @restrict E\n * @module material.components.select\n *\n * @description Displays an option in a <a ng-href=\"api/directive/mdSelect\">md-select</a> box's\n * dropdown menu. Options can be grouped using\n * <a ng-href=\"api/directive/mdOptgroup\">md-optgroup</a> element directives.\n *\n * ### Option Params\n *\n * When applied, `md-option-empty` will mark the option as \"empty\" allowing the option to clear the\n * select and put it back in it's default state. You may supply this attribute on any option you\n * wish, however, it is automatically applied to an option whose `value` or `ng-value` are not\n * defined.\n *\n * **Automatically Applied**\n *\n *  - `<md-option>`\n *  - `<md-option value>`\n *  - `<md-option value=\"\">`\n *  - `<md-option ng-value>`\n *  - `<md-option ng-value=\"\">`\n *\n * **NOT Automatically Applied**\n *\n *  - `<md-option ng-value=\"1\">`\n *  - `<md-option ng-value=\"''\">`\n *  - `<md-option ng-value=\"undefined\">`\n *  - `<md-option value=\"undefined\">` (this evaluates to the string `\"undefined\"`)\n *  - <code ng-non-bindable>&lt;md-option ng-value=\"{{someValueThatMightBeUndefined}}\"&gt;</code>\n *\n * **Note:** A value of `undefined` ***is considered a valid value*** (and does not auto-apply this\n * attribute) since you may wish this to be your \"Not Available\" or \"None\" option.\n *\n * **Note:** Using the\n * <a ng-href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#Attributes\">value</a>\n * attribute from the `<option>` element (as opposed to the `<md-option>` element's\n * <a ng-href=\"https://docs.angularjs.org/api/ng/directive/ngValue\">ng-value</a>) always evaluates\n * to a `string`. This means that `value=\"null\"` will cause a check against `myValue != \"null\"`\n * rather than `!myValue` or `myValue != null`.\n * Importantly, this also applies to `number` values. `value=\"1\"` will not match up with an\n * `ng-model` like `$scope.selectedValue = 1`. Use `ng-value=\"1\"` in this case and other cases where\n * you have values that are not strings.\n *\n * **Note:** Please see our <a ng-href=\"api/directive/mdSelect#selects-and-object-equality\">docs on\n * using objects with `md-select`</a> for additional guidance on using the `trackBy` option with\n * `ng-model-options`.\n *\n * @param {expression=} ng-value Binds the given expression to the value of the option.\n * @param {string=} value Attribute to set the value of the option.\n * @param {expression=} ng-repeat <a ng-href=\"https://docs.angularjs.org/api/ng/directive/ngRepeat\">\n *  AngularJS directive</a> that instantiates a template once per item from a collection.\n * @param {expression=} ng-selected <a ng-href=\"https://docs.angularjs.org/api/ng/directive/ngSelected\">\n *  AngularJS directive</a> that adds the `selected` attribute to the option when the expression\n *  evaluates as truthy.\n *\n *  **Note:** Unlike native `option` elements used with AngularJS, `md-option` elements\n *  watch their `selected` attributes for changes and trigger model value changes on `md-select`.\n * @param {boolean=} md-option-empty If the attribute exists, mark the option as \"empty\" allowing\n * the option to clear the select and put it back in it's default state. You may supply this\n * attribute on any option you wish, however, it is automatically applied to an option whose `value`\n * or `ng-value` are not defined.\n * @param {number=} tabindex The `tabindex` of the option. Defaults to `0`.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-select ng-model=\"currentState\" placeholder=\"Select a state\">\n *   <md-option ng-value=\"AL\">Alabama</md-option>\n *   <md-option ng-value=\"AK\">Alaska</md-option>\n *   <md-option ng-value=\"FL\">Florida</md-option>\n * </md-select>\n * </hljs>\n *\n * With `ng-repeat`:\n * <hljs lang=\"html\">\n * <md-select ng-model=\"currentState\" placeholder=\"Select a state\">\n *   <md-option ng-value=\"state\" ng-repeat=\"state in states\">{{ state }}</md-option>\n * </md-select>\n * </hljs>\n */\nfunction OptionDirective($mdButtonInkRipple, $mdUtil, $mdTheming) {\n\n  return {\n    restrict: 'E',\n    require: ['mdOption', '^^mdSelectMenu'],\n    controller: OptionController,\n    compile: compile\n  };\n\n  /**\n   * @param {JQLite} element\n   * @param {IAttributes} attrs\n   * @return {postLink}\n   */\n  function compile(element, attrs) {\n    // Manual transclusion to avoid the extra inner <span> that ng-transclude generates\n    element.append(angular.element('<div class=\"md-text\">').append(element.contents()));\n\n    element.attr('tabindex', attrs.tabindex || '0');\n\n    if (!hasDefinedValue(attrs)) {\n      element.attr('md-option-empty', '');\n    }\n\n    return postLink;\n  }\n\n  /**\n   * @param {Object} attrs list of attributes from the compile function\n   * @return {string|undefined|null} if defined and non-empty, return the value of the option's\n   *  value attribute, otherwise return the value of the option's ng-value attribute.\n   */\n  function hasDefinedValue(attrs) {\n    var value = attrs.value;\n    var ngValue = attrs.ngValue;\n\n    return value || ngValue;\n  }\n\n  function postLink(scope, element, attrs, ctrls) {\n    var optionCtrl = ctrls[0];\n    var selectMenuCtrl = ctrls[1];\n\n    $mdTheming(element);\n\n    if (selectMenuCtrl.isMultiple) {\n      element.addClass('md-checkbox-enabled');\n      if (!CHECKBOX_SELECTION_INDICATOR) {\n        var indicator = document.createElement('div');\n        indicator.className = 'md-container';\n        indicator.appendChild(document.createElement('div'));\n        indicator.firstChild.className = 'md-icon';\n        CHECKBOX_SELECTION_INDICATOR = angular.element(indicator);\n      }\n      element.prepend(CHECKBOX_SELECTION_INDICATOR.clone());\n    }\n\n    if (angular.isDefined(attrs.ngValue)) {\n      scope.$watch(attrs.ngValue, function (newValue, oldValue) {\n        setOptionValue(newValue, oldValue);\n        element.removeAttr('aria-checked');\n      });\n    } else if (angular.isDefined(attrs.value)) {\n      setOptionValue(attrs.value);\n    } else {\n      scope.$watch(function() {\n        return element.text().trim();\n      }, setOptionValue);\n    }\n\n    attrs.$observe('disabled', function(disabled) {\n      if (disabled) {\n        element.attr('tabindex', '-1');\n      } else {\n        element.attr('tabindex', '0');\n      }\n    });\n\n    scope.$$postDigest(function() {\n      attrs.$observe('selected', function(selected) {\n        if (!angular.isDefined(selected)) return;\n        if (typeof selected == 'string') selected = true;\n        if (selected) {\n          if (!selectMenuCtrl.isMultiple) {\n            selectMenuCtrl.deselect(Object.keys(selectMenuCtrl.selected)[0]);\n          }\n          selectMenuCtrl.select(optionCtrl.hashKey, optionCtrl.value);\n        } else {\n          selectMenuCtrl.deselect(optionCtrl.hashKey);\n        }\n        selectMenuCtrl.refreshViewValue();\n      });\n    });\n\n    $mdButtonInkRipple.attach(scope, element);\n    configureAria();\n\n    /**\n     * @param {*} newValue the option's new value\n     * @param {*=} oldValue the option's previous value\n     * @param {boolean=} prevAttempt true if this had to be attempted again due to an undefined\n     *  hashGetter on the selectMenuCtrl, undefined otherwise.\n     */\n    function setOptionValue(newValue, oldValue, prevAttempt) {\n      if (!selectMenuCtrl.hashGetter) {\n        if (!prevAttempt) {\n          scope.$$postDigest(function() {\n            setOptionValue(newValue, oldValue, true);\n          });\n        }\n        return;\n      }\n      var oldHashKey = selectMenuCtrl.hashGetter(oldValue, scope);\n      var newHashKey = selectMenuCtrl.hashGetter(newValue, scope);\n\n      optionCtrl.hashKey = newHashKey;\n      optionCtrl.value = newValue;\n\n      selectMenuCtrl.removeOption(oldHashKey, optionCtrl);\n      selectMenuCtrl.addOption(newHashKey, optionCtrl);\n    }\n\n    scope.$on('$destroy', function() {\n      selectMenuCtrl.removeOption(optionCtrl.hashKey, optionCtrl);\n    });\n\n    function configureAria() {\n      var ariaAttrs = {\n        'role': 'option'\n      };\n\n      // We explicitly omit the `aria-selected` attribute from single-selection, unselected\n      // options. Including the `aria-selected=\"false\"` attributes adds a significant amount of\n      // noise to screen-reader users without providing useful information.\n      if (selectMenuCtrl.isMultiple) {\n        ariaAttrs['aria-selected'] = 'false';\n      }\n\n      if (!element[0].hasAttribute('id')) {\n        ariaAttrs.id = 'select_option_' + $mdUtil.nextUid();\n      }\n      element.attr(ariaAttrs);\n    }\n  }\n}\n\n/**\n * @param {JQLite} $element\n * @constructor\n */\nfunction OptionController($element) {\n  /**\n   * @param {boolean} isSelected\n   * @param {boolean=} isMultiple\n   */\n  this.setSelected = function(isSelected, isMultiple) {\n    if (isSelected) {\n      $element.attr({\n        'selected': 'true',\n        'aria-selected': 'true'\n      });\n    } else if (!isSelected) {\n      $element.removeAttr('selected');\n\n      if (isMultiple) {\n        $element.attr('aria-selected', 'false');\n      } else {\n        // We explicitly omit the `aria-selected` attribute from single-selection, unselected\n        // options. Including the `aria-selected=\"false\"` attributes adds a significant amount of\n        // noise to screen-reader users without providing useful information.\n        $element.removeAttr('aria-selected');\n      }\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name mdOptgroup\n * @restrict E\n * @module material.components.select\n *\n * @description Displays a label separating groups of\n * <a ng-href=\"api/directive/mdOption\">md-option</a> element directives in a\n * <a ng-href=\"api/directive/mdSelect\">md-select</a> box's dropdown menu.\n *\n * **Note:** When using `md-select-header` element directives within a `md-select`, the labels that\n * would normally be added to the <a ng-href=\"api/directive/mdOptgroup\">md-optgroup</a> directives\n * are omitted, allowing the `md-select-header` to represent the option group label\n * (and possibly more).\n *\n * @usage\n * With label attributes\n * <hljs lang=\"html\">\n * <md-select ng-model=\"currentState\" placeholder=\"Select a state\">\n *   <md-optgroup label=\"Southern\">\n *     <md-option ng-value=\"AL\">Alabama</md-option>\n *     <md-option ng-value=\"FL\">Florida</md-option>\n *   </md-optgroup>\n *   <md-optgroup label=\"Northern\">\n *     <md-option ng-value=\"AK\">Alaska</md-option>\n *     <md-option ng-value=\"MA\">Massachusetts</md-option>\n *   </md-optgroup>\n * </md-select>\n * </hljs>\n *\n * With label elements\n * <hljs lang=\"html\">\n * <md-select ng-model=\"currentState\" placeholder=\"Select a state\">\n *   <md-optgroup>\n *     <label>Southern</label>\n *     <md-option ng-value=\"AL\">Alabama</md-option>\n *     <md-option ng-value=\"FL\">Florida</md-option>\n *   </md-optgroup>\n *   <md-optgroup>\n *     <label>Northern</label>\n *     <md-option ng-value=\"AK\">Alaska</md-option>\n *     <md-option ng-value=\"MA\">Massachusetts</md-option>\n *   </md-optgroup>\n * </md-select>\n * </hljs>\n *\n * @param {string=} label The option group's label.\n */\nfunction OptgroupDirective() {\n  return {\n    restrict: 'E',\n    compile: compile\n  };\n  function compile(element, attrs) {\n    // If we have a select header element, we don't want to add the normal label\n    // header.\n    if (!hasSelectHeader()) {\n      setupLabelElement();\n    }\n    element.attr('role', 'group');\n\n    function hasSelectHeader() {\n      return element.parent().find('md-select-header').length;\n    }\n\n    function setupLabelElement() {\n      var labelElement = element.find('label');\n      if (!labelElement.length) {\n        labelElement = angular.element('<label>');\n        element.prepend(labelElement);\n      }\n      labelElement.addClass('md-container-ignore');\n      labelElement.attr('aria-hidden', 'true');\n      if (attrs.label) {\n        labelElement.text(attrs.label);\n      }\n      element.attr('aria-label', labelElement.text());\n    }\n  }\n}\n\nfunction SelectHeaderDirective() {\n  return {\n    restrict: 'E',\n  };\n}\n\nfunction SelectProvider($$interimElementProvider) {\n  return $$interimElementProvider('$mdSelect')\n    .setDefaults({\n      methods: ['target'],\n      options: selectDefaultOptions\n    });\n\n  /* @ngInject */\n  function selectDefaultOptions($mdSelect, $mdConstant, $mdUtil, $window, $q, $$rAF, $animateCss, $animate, $document) {\n    var ERROR_TARGET_EXPECTED = \"$mdSelect.show() expected a target element in options.target but got '{0}'!\";\n    var animator = $mdUtil.dom.animator;\n    var keyCodes = $mdConstant.KEY_CODE;\n\n    return {\n      parent: 'body',\n      themable: true,\n      onShow: onShow,\n      onRemove: onRemove,\n      hasBackdrop: true,\n      disableParentScroll: true\n    };\n\n    /**\n     * Interim-element onRemove logic....\n     */\n    function onRemove(scope, element, opts) {\n      var animationRunner = null;\n      var destroyListener = scope.$on('$destroy', function() {\n        // Listen for the case where the element was destroyed while there was an\n        // ongoing close animation. If this happens, we need to end the animation\n        // manually.\n        animationRunner.end();\n      });\n\n      opts = opts || { };\n      opts.cleanupInteraction();\n      opts.cleanupResizing();\n      opts.hideBackdrop();\n\n      // For navigation $destroy events, do a quick, non-animated removal,\n      // but for normal closes (from clicks, etc) animate the removal\n      return (opts.$destroy === true) ? cleanElement() : animateRemoval().then(cleanElement);\n\n      /**\n       * For normal closes (eg clicks), animate the removal.\n       * For forced closes (like $destroy events from navigation),\n       * skip the animations.\n       */\n      function animateRemoval() {\n        animationRunner = $animateCss(element, {addClass: 'md-leave'});\n        return animationRunner.start();\n      }\n\n      /**\n       * Restore the element to a closed state\n       */\n      function cleanElement() {\n        destroyListener();\n\n        element\n          .removeClass('md-active')\n          .attr('aria-hidden', 'true')\n          .css({\n            'display': 'none',\n            'top': '',\n            'right': '',\n            'bottom': '',\n            'left': '',\n            'font-size': '',\n            'min-width': ''\n          });\n\n        announceClosed(opts);\n\n        if (!opts.$destroy) {\n          if (opts.restoreFocus) {\n            opts.target.focus();\n          } else {\n            // Make sure that the container's md-input-focused is removed on backdrop click.\n            $mdUtil.nextTick(function() {\n              opts.target.triggerHandler('blur');\n            }, true);\n          }\n        }\n      }\n    }\n\n    /**\n     * Interim-element onShow logic.\n     */\n    function onShow(scope, element, opts) {\n\n      watchAsyncLoad();\n      sanitizeAndConfigure(scope, opts);\n\n      opts.hideBackdrop = showBackdrop(scope, element, opts);\n\n      return showDropDown(scope, element, opts)\n        .then(function(response) {\n          element.attr('aria-hidden', 'false');\n          opts.alreadyOpen = true;\n          opts.cleanupInteraction = activateInteraction();\n          opts.cleanupResizing = activateResizing();\n          opts.contentEl[0].focus();\n\n          return response;\n        }, opts.hideBackdrop);\n\n      // ************************************\n      // Closure Functions\n      // ************************************\n\n      /**\n       * Attach the select DOM element(s) and animate to the correct positions and scale.\n       */\n      function showDropDown(scope, element, opts) {\n        if (opts.parent !== element.parent()) {\n          element.parent().attr('aria-owns', element.find('md-content').attr('id'));\n        }\n\n        opts.parent.append(element);\n\n        return $q(function(resolve, reject) {\n          try {\n            $animateCss(element, {removeClass: 'md-leave', duration: 0})\n              .start()\n              .then(positionAndFocusMenu)\n              .then(resolve);\n\n          } catch (e) {\n            reject(e);\n          }\n        });\n      }\n\n      /**\n       * Initialize container and dropDown menu positions/scale, then animate to show.\n       * @return {*} a Promise that resolves after the menu is animated in and an item is focused\n       */\n      function positionAndFocusMenu() {\n        return $q(function(resolve) {\n          if (opts.isRemoved) return $q.reject(false);\n\n          var info = calculateMenuPositions(scope, element, opts);\n\n          info.container.element.css(animator.toCss(info.container.styles));\n          info.dropDown.element.css(animator.toCss(info.dropDown.styles));\n\n          $$rAF(function() {\n            element.addClass('md-active');\n            info.dropDown.element.css(animator.toCss({transform: ''}));\n            autoFocus(opts.focusedNode);\n\n            resolve();\n          });\n\n        });\n      }\n\n      /**\n       * Show modal backdrop element.\n       */\n      function showBackdrop(scope, element, options) {\n\n        // If we are not within a dialog...\n        if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {\n          // !! DO this before creating the backdrop; since disableScrollAround()\n          //    configures the scroll offset; which is used by mdBackDrop postLink()\n          options.restoreScroll = $mdUtil.disableScrollAround(options.element, options.parent);\n        } else {\n          options.disableParentScroll = false;\n        }\n\n        if (options.hasBackdrop) {\n          // Override duration to immediately show invisible backdrop\n          options.backdrop = $mdUtil.createBackdrop(scope, \"md-select-backdrop md-click-catcher\");\n          $animate.enter(options.backdrop, $document[0].body, null, {duration: 0});\n        }\n\n        /**\n         * Hide modal backdrop element...\n         */\n        return function hideBackdrop() {\n          if (options.backdrop) options.backdrop.remove();\n          if (options.disableParentScroll) options.restoreScroll();\n\n          delete options.restoreScroll;\n        };\n      }\n\n      /**\n       * @param {Element|HTMLElement|null=} previousNode\n       * @param {Element|HTMLElement} node\n       * @param {SelectMenuController|Function|object=} menuController SelectMenuController instance\n       */\n      function focusOptionNode(previousNode, node, menuController) {\n        var listboxContentNode = opts.contentEl[0];\n\n        if (node) {\n          if (previousNode) {\n            previousNode.classList.remove('md-focused');\n          }\n\n          node.classList.add('md-focused');\n          if (menuController && menuController.setActiveDescendant) {\n            menuController.setActiveDescendant(node.id);\n          }\n\n          // Scroll the node into view if needed.\n          if (listboxContentNode.scrollHeight > listboxContentNode.clientHeight) {\n            var scrollBottom = listboxContentNode.clientHeight + listboxContentNode.scrollTop;\n            var nodeBottom = node.offsetTop + node.offsetHeight;\n            if (nodeBottom > scrollBottom) {\n              listboxContentNode.scrollTop = nodeBottom - listboxContentNode.clientHeight;\n            } else if (node.offsetTop < listboxContentNode.scrollTop) {\n              listboxContentNode.scrollTop = node.offsetTop;\n            }\n          }\n          opts.focusedNode = node;\n          if (menuController && menuController.refreshViewValue) {\n            menuController.refreshViewValue();\n          }\n        }\n      }\n\n      /**\n       * @param {Element|HTMLElement} nodeToFocus\n       */\n      function autoFocus(nodeToFocus) {\n        var selectMenuController;\n        if (nodeToFocus && !nodeToFocus.hasAttribute('disabled')) {\n          selectMenuController = opts.selectEl.controller('mdSelectMenu');\n          focusOptionNode(null, nodeToFocus, selectMenuController);\n        }\n      }\n\n      /**\n       * Check for valid opts and set some useful defaults\n       */\n      function sanitizeAndConfigure(scope, options) {\n        var selectMenuElement = element.find('md-select-menu');\n\n        if (!options.target) {\n          throw new Error($mdUtil.supplant(ERROR_TARGET_EXPECTED, [options.target]));\n        }\n\n        angular.extend(options, {\n          isRemoved: false,\n          target: angular.element(options.target), // make sure it's not a naked DOM node\n          parent: angular.element(options.parent),\n          selectEl: selectMenuElement,\n          contentEl: element.find('md-content'),\n          optionNodes: selectMenuElement[0].getElementsByTagName('md-option')\n        });\n      }\n\n      /**\n       * Configure various resize listeners for screen changes\n       */\n      function activateResizing() {\n        var debouncedOnResize = (function(scope, target, options) {\n\n          return function() {\n            if (options.isRemoved) return;\n\n            var updates = calculateMenuPositions(scope, target, options);\n            var container = updates.container;\n            var dropDown = updates.dropDown;\n\n            container.element.css(animator.toCss(container.styles));\n            dropDown.element.css(animator.toCss(dropDown.styles));\n          };\n\n        })(scope, element, opts);\n\n        var window = angular.element($window);\n        window.on('resize', debouncedOnResize);\n        window.on('orientationchange', debouncedOnResize);\n\n        // Publish deactivation closure...\n        return function deactivateResizing() {\n\n          // Disable resizing handlers\n          window.off('resize', debouncedOnResize);\n          window.off('orientationchange', debouncedOnResize);\n        };\n      }\n\n      /**\n       * If asynchronously loading, watch and update internal '$$loadingAsyncDone' flag.\n       */\n      function watchAsyncLoad() {\n        if (opts.loadingAsync && !opts.isRemoved) {\n          scope.$$loadingAsyncDone = false;\n\n          $q.when(opts.loadingAsync)\n            .then(function() {\n              scope.$$loadingAsyncDone = true;\n              delete opts.loadingAsync;\n            }).then(function() {\n              $$rAF(positionAndFocusMenu);\n            });\n        }\n      }\n\n      function activateInteraction() {\n        if (opts.isRemoved) {\n          return;\n        }\n\n        var dropDown = opts.selectEl;\n        var selectMenuController = dropDown.controller('mdSelectMenu') || {};\n\n        element.addClass('md-clickable');\n\n        // Close on backdrop click\n        opts.backdrop && opts.backdrop.on('click', onBackdropClick);\n\n        // Escape to close\n        // Cycling of options, and closing on enter\n        dropDown.on('keydown', onMenuKeyDown);\n        dropDown.on('click', checkCloseMenu);\n\n        return function cleanupInteraction() {\n          opts.backdrop && opts.backdrop.off('click', onBackdropClick);\n          dropDown.off('keydown', onMenuKeyDown);\n          dropDown.off('click', checkCloseMenu);\n\n          element.removeClass('md-clickable');\n          opts.isRemoved = true;\n        };\n\n        // ************************************\n        // Closure Functions\n        // ************************************\n\n        function onBackdropClick(e) {\n          e.preventDefault();\n          e.stopPropagation();\n          opts.restoreFocus = false;\n          $mdUtil.nextTick($mdSelect.hide, true);\n        }\n\n        function onMenuKeyDown(ev) {\n          ev.preventDefault();\n          ev.stopPropagation();\n\n          switch (ev.keyCode) {\n            case keyCodes.UP_ARROW:\n              return focusPrevOption();\n            case keyCodes.DOWN_ARROW:\n              return focusNextOption();\n            case keyCodes.SPACE:\n            case keyCodes.ENTER:\n              if (opts.focusedNode) {\n                dropDown.triggerHandler({\n                  type: 'click',\n                  target: opts.focusedNode\n                });\n                ev.preventDefault();\n              }\n              checkCloseMenu(ev);\n              break;\n            case keyCodes.TAB:\n            case keyCodes.ESCAPE:\n              ev.stopPropagation();\n              ev.preventDefault();\n              opts.restoreFocus = true;\n              $mdUtil.nextTick($mdSelect.hide, true);\n              break;\n            default:\n              if (shouldHandleKey(ev, $mdConstant)) {\n                var optNode = selectMenuController.optNodeForKeyboardSearch(ev);\n                if (optNode && !optNode.hasAttribute('disabled')) {\n                  focusOptionNode(opts.focusedNode, optNode, selectMenuController);\n                }\n              }\n          }\n        }\n\n        /**\n         * Change the focus to another option. If there is no focused option, focus the first\n         * option. If there is a focused option, then use the direction to determine if we should\n         * focus the previous or next option in the list.\n         * @param {'next'|'prev'} direction\n         */\n        function focusOption(direction) {\n          var optionsArray = $mdUtil.nodesToArray(opts.optionNodes);\n          var index = optionsArray.indexOf(opts.focusedNode);\n          var prevOption = optionsArray[index];\n          var newOption;\n\n          do {\n            if (index === -1) {\n              // We lost the previously focused element, reset to first option\n              index = 0;\n            } else if (direction === 'next' && index < optionsArray.length - 1) {\n              index++;\n            } else if (direction === 'prev' && index > 0) {\n              index--;\n            }\n            newOption = optionsArray[index];\n            if (newOption.hasAttribute('disabled')) {\n              newOption = null;\n            }\n          } while (!newOption && index < optionsArray.length - 1 && index > 0);\n\n          focusOptionNode(prevOption, newOption, selectMenuController);\n        }\n\n        function focusNextOption() {\n          focusOption('next');\n        }\n\n        function focusPrevOption() {\n          focusOption('prev');\n        }\n\n        /**\n         * @param {KeyboardEvent|MouseEvent} event\n         */\n        function checkCloseMenu(event) {\n          if (event && (event.type === 'click') && (event.currentTarget !== dropDown[0])) {\n            return;\n          }\n          if (mouseOnScrollbar()) {\n            return;\n          }\n\n          if (opts.focusedNode && opts.focusedNode.hasAttribute &&\n              !opts.focusedNode.hasAttribute('disabled')) {\n            event.preventDefault();\n            event.stopPropagation();\n            if (!selectMenuController.isMultiple) {\n              opts.restoreFocus = true;\n\n              $mdUtil.nextTick(function () {\n                $mdSelect.hide(selectMenuController.ngModel.$viewValue);\n                opts.focusedNode.classList.remove('md-focused');\n              }, true);\n            }\n          }\n\n          /**\n           * check if the mouseup event was on a scrollbar\n           */\n          function mouseOnScrollbar() {\n            var clickOnScrollbar = false;\n            if (event && (event.currentTarget.children.length > 0)) {\n              var child = event.currentTarget.children[0];\n              var hasScrollbar = child.scrollHeight > child.clientHeight;\n              if (hasScrollbar && child.children.length > 0) {\n                var relPosX = event.pageX - event.currentTarget.getBoundingClientRect().left;\n                if (relPosX > child.querySelector('md-option').offsetWidth)\n                  clickOnScrollbar = true;\n              }\n            }\n            return clickOnScrollbar;\n          }\n        }\n      }\n    }\n\n    /**\n     * To notify listeners that the Select menu has closed,\n     * trigger the [optional] user-defined expression\n     */\n    function announceClosed(opts) {\n      var mdSelect = opts.selectCtrl;\n      if (mdSelect) {\n        var menuController = opts.selectEl.controller('mdSelectMenu');\n        mdSelect.setSelectValueText(menuController ? menuController.getSelectedLabels() : '');\n        mdSelect.triggerClose();\n      }\n    }\n\n\n    /**\n     * Calculate the menu positions after an event like options changing, screen resizing, or\n     * animations finishing.\n     * @param {Object} scope\n     * @param element\n     * @param opts\n     * @return {{container: {styles: {top: number, left: number, 'font-size': *, 'min-width': number}, element: Object}, dropDown: {styles: {transform: string, transformOrigin: string}, element: Object}}}\n     */\n    function calculateMenuPositions(scope, element, opts) {\n      var\n        containerNode = element[0],\n        targetNode = opts.target[0].children[0], // target the label\n        parentNode = $document[0].body,\n        selectNode = opts.selectEl[0],\n        contentNode = opts.contentEl[0],\n        parentRect = parentNode.getBoundingClientRect(),\n        targetRect = targetNode.getBoundingClientRect(),\n        shouldOpenAroundTarget = false,\n        bounds = {\n          left: parentRect.left + SELECT_EDGE_MARGIN,\n          top: SELECT_EDGE_MARGIN,\n          bottom: parentRect.height - SELECT_EDGE_MARGIN,\n          right: parentRect.width - SELECT_EDGE_MARGIN - ($mdUtil.floatingScrollbars() ? 16 : 0)\n        },\n        spaceAvailable = {\n          top: targetRect.top - bounds.top,\n          left: targetRect.left - bounds.left,\n          right: bounds.right - (targetRect.left + targetRect.width),\n          bottom: bounds.bottom - (targetRect.top + targetRect.height)\n        },\n        maxWidth = parentRect.width - SELECT_EDGE_MARGIN * 2,\n        selectedNode = selectNode.querySelector('md-option[selected]'),\n        optionNodes = selectNode.getElementsByTagName('md-option'),\n        optgroupNodes = selectNode.getElementsByTagName('md-optgroup'),\n        isScrollable = calculateScrollable(element, contentNode),\n        centeredNode;\n\n      var loading = isPromiseLike(opts.loadingAsync);\n      if (!loading) {\n        // If a selected node, center around that\n        if (selectedNode) {\n          centeredNode = selectedNode;\n          // If there are option groups, center around the first option group\n        } else if (optgroupNodes.length) {\n          centeredNode = optgroupNodes[0];\n          // Otherwise - if we are not loading async - center around the first optionNode\n        } else if (optionNodes.length) {\n          centeredNode = optionNodes[0];\n          // In case there are no options, center on whatever's in there... (eg progress indicator)\n        } else {\n          centeredNode = contentNode.firstElementChild || contentNode;\n        }\n      } else {\n        // If loading, center on progress indicator\n        centeredNode = contentNode.firstElementChild || contentNode;\n      }\n\n      if (contentNode.offsetWidth > maxWidth) {\n        contentNode.style['max-width'] = maxWidth + 'px';\n      } else {\n        contentNode.style.maxWidth = null;\n      }\n      if (shouldOpenAroundTarget) {\n        contentNode.style['min-width'] = targetRect.width + 'px';\n      }\n\n      // Remove padding before we compute the position of the menu\n      if (isScrollable) {\n        selectNode.classList.add('md-overflow');\n      }\n\n      var focusedNode = centeredNode;\n      if ((focusedNode.tagName || '').toUpperCase() === 'MD-OPTGROUP') {\n        focusedNode = optionNodes[0] || contentNode.firstElementChild || contentNode;\n        centeredNode = focusedNode;\n      }\n      // Cache for autoFocus()\n      opts.focusedNode = focusedNode;\n\n      // Get the selectMenuRect *after* max-width is possibly set above\n      containerNode.style.display = 'block';\n      var selectMenuRect = selectNode.getBoundingClientRect();\n      var centeredRect = getOffsetRect(centeredNode);\n\n      if (centeredNode) {\n        var centeredStyle = $window.getComputedStyle(centeredNode);\n        centeredRect.paddingLeft = parseInt(centeredStyle.paddingLeft, 10) || 0;\n        centeredRect.paddingRight = parseInt(centeredStyle.paddingRight, 10) || 0;\n      }\n\n      if (isScrollable) {\n        var scrollBuffer = contentNode.offsetHeight / 2;\n        contentNode.scrollTop = centeredRect.top + centeredRect.height / 2 - scrollBuffer;\n\n        if (spaceAvailable.top < scrollBuffer) {\n          contentNode.scrollTop = Math.min(\n            centeredRect.top,\n            contentNode.scrollTop + scrollBuffer - spaceAvailable.top\n          );\n        } else if (spaceAvailable.bottom < scrollBuffer) {\n          contentNode.scrollTop = Math.max(\n            centeredRect.top + centeredRect.height - selectMenuRect.height,\n            contentNode.scrollTop - scrollBuffer + spaceAvailable.bottom\n          );\n        }\n      }\n\n      var left, top, transformOrigin, minWidth, fontSize;\n      if (shouldOpenAroundTarget) {\n        left = targetRect.left;\n        top = targetRect.top + targetRect.height;\n        transformOrigin = '50% 0';\n        if (top + selectMenuRect.height > bounds.bottom) {\n          top = targetRect.top - selectMenuRect.height;\n          transformOrigin = '50% 100%';\n        }\n      } else {\n        left = (targetRect.left + centeredRect.left - centeredRect.paddingLeft);\n        top = Math.floor(targetRect.top + targetRect.height / 2 - centeredRect.height / 2 -\n            centeredRect.top + contentNode.scrollTop) + 2;\n\n        transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +\n          (centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';\n\n        minWidth = Math.min(targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight, maxWidth);\n\n        fontSize = window.getComputedStyle(targetNode)['font-size'];\n      }\n\n      // Keep left and top within the window\n      var containerRect = containerNode.getBoundingClientRect();\n      var scaleX = Math.round(100 * Math.min(targetRect.width / selectMenuRect.width, 1.0)) / 100;\n      var scaleY = Math.round(100 * Math.min(targetRect.height / selectMenuRect.height, 1.0)) / 100;\n\n      return {\n        container: {\n          element: angular.element(containerNode),\n          styles: {\n            left: Math.floor(clamp(bounds.left, left, bounds.right - minWidth)),\n            top: Math.floor(clamp(bounds.top, top, bounds.bottom - containerRect.height)),\n            'min-width': minWidth,\n            'font-size': fontSize\n          }\n        },\n        dropDown: {\n          element: angular.element(selectNode),\n          styles: {\n            transformOrigin: transformOrigin,\n            transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : \"\"\n          }\n        }\n      };\n    }\n  }\n\n  function isPromiseLike(obj) {\n    return obj && angular.isFunction(obj.then);\n  }\n\n  function clamp(min, n, max) {\n    return Math.max(min, Math.min(n, max));\n  }\n\n  function getOffsetRect(node) {\n    return node ? {\n      left: node.offsetLeft,\n      top: node.offsetTop,\n      width: node.offsetWidth,\n      height: node.offsetHeight\n    } : {left: 0, top: 0, width: 0, height: 0};\n  }\n\n  function calculateScrollable(element, contentNode) {\n    var isScrollable = false;\n\n    try {\n      var oldDisplay = element[0].style.display;\n\n      // Set the element's display to block so that this calculation is correct\n      element[0].style.display = 'block';\n\n      isScrollable = contentNode.scrollHeight > contentNode.offsetHeight;\n\n      // Reset it back afterwards\n      element[0].style.display = oldDisplay;\n    } finally {\n      // Nothing to do\n    }\n    return isScrollable;\n  }\n}\n\nfunction shouldHandleKey(ev, $mdConstant) {\n  var char = String.fromCharCode(ev.keyCode);\n  var isNonUsefulKey = (ev.keyCode <= 31);\n\n  return (char && char.length && !isNonUsefulKey &&\n    !$mdConstant.isMetaKey(ev) && !$mdConstant.isFnLockKey(ev) && !$mdConstant.hasModifierKey(ev));\n}\n"
  },
  {
    "path": "src/components/select/select.scss",
    "content": "$select-checkbox-border-radius: 2px !default;\n$select-checkbox-border-width: 2px !default;\n$select-border-width-default: 1px !default;\n$select-checkbox-width: rem(1.4) !default;\n$select-option-height: 48px !default;\n$select-option-padding: 16px !default;\n$select-container-padding: 16px !default;\n$select-container-transition-duration: 350ms !default;\n$select-value-padding-top: 2px;\n$select-value-padding-bottom: 1px;\n\n$select-max-visible-options: 5 !default;\n\n$input-alignment: ($input-padding-top + $input-padding-bottom)\n                   - ($select-value-padding-top + $select-value-padding-bottom);\n$md-inline-alignment: ($input-container-vertical-margin + $input-container-padding)\n                      + ($input-padding-top + $input-padding-bottom)\n                      - ($select-value-padding-top + $select-value-padding-bottom);\n\n// Fixes the animations with the floating label when select is inside an input container\nmd-input-container {\n  &:not([md-no-float]) {\n    .md-select-placeholder span:first-child {\n      transition: transform $swift-ease-out-duration $swift-ease-out-timing-function;\n      @include rtl(transform-origin, left top, right top);\n    }\n  }\n  &.md-input-focused {\n    &:not([md-no-float]) {\n      md-select:not([placeholder]) .md-select-placeholder span:first-child {\n        transform: translate(-2px, -22px) scale(0.75);\n      }\n    }\n  }\n}\n\n.md-select-menu-container {\n  position: fixed;\n  left: 0;\n  top: 0;\n  z-index: $z-index-select;\n  opacity: 0;\n  display: none;\n\n  // Fix 1px alignment issue to line up with text inputs (and spec)\n  transform: translateY(-1px);\n\n  // Don't let the user select a new choice while it's animating\n  &:not(.md-clickable) {\n    pointer-events: none;\n  }\n\n  md-progress-circular {\n    display: table;\n    margin: 3*$baseline-grid auto !important;\n  }\n\n  // enter: md-select scales in, then options fade in.\n  &.md-active {\n    display: block;\n    opacity: 1;\n    md-select-menu {\n      transition: $swift-ease-out;\n      transition-duration: 150ms;\n      > * {\n        opacity: 1;\n        transition: $swift-ease-in;\n        transition-duration: 150ms;\n        transition-delay: 100ms;\n      }\n    }\n  }\n\n  // leave: the container fades out\n  &.md-leave {\n    opacity: 0;\n    transition: $swift-ease-in;\n    transition-duration: 250ms;\n  }\n}\n\n.md-inline-form md-select {\n  margin-top: $md-inline-alignment;\n}\n\nmd-input-container {\n  > md-select,\n  .md-inline-form & > md-select {\n    margin-top: $input-alignment;\n  }\n  > md-select {\n    order: 2;\n  }\n}\n\n// Show the asterisk on the placeholder if the element is required\n//\n// NOTE: When the input has a value and uses a floating label, the floating label will show the\n// asterisk denoting that it is required\nmd-input-container:not(.md-input-has-value) {\n  md-select[required]:not(.md-no-asterisk), md-select.ng-required:not(.md-no-asterisk) {\n    .md-select-value span:first-child:after {\n      content: ' *';\n      font-size: 13px;\n      vertical-align: top;\n    }\n  }\n}\n\nmd-input-container.md-input-invalid {\n  md-select {\n    .md-select-value {\n      border-bottom-style: solid;\n      padding-bottom: 1px;\n    }\n  }\n}\n\nmd-select {\n  display: flex;\n\n  &[required], &.ng-required {\n    &.ng-empty.ng-invalid:not(.md-no-asterisk) {\n      .md-select-value span:first-child:after {\n        content: ' *';\n        font-size: 13px;\n        vertical-align: top;\n      }\n    }\n  }\n\n  &[disabled] .md-select-value {\n    // This background-position was taken from the styling of disabled md-inputs.\n    // The negative border width offsets the dotted \"border\" so it's placed in the same place as the\n    // solid one before it.\n    background-position: bottom $select-border-width-default * -1 left 0;\n    // This background-size is coordinated with a linear-gradient set in select-theme.scss\n    // to create a dotted line under the input.\n    background-size: 4px 1px;\n    background-repeat: repeat-x;\n    // Add to padding-bottom to keep dotted line aligned with other bottom borders\n    // Sub from padding-top to keep height consistent\n    // Translate text 1px up to keep in alignment\n    padding-bottom: $select-value-padding-bottom + 1;\n    padding-top: $select-value-padding-top - 1;\n    transform: translateY(1px);\n  }\n\n  &:focus {\n    outline: none;\n  }\n  &[disabled]:hover {\n    cursor: default;\n  }\n  &:not([disabled]) {\n    &:hover {\n      cursor: pointer\n    }\n    &:focus {\n      .md-select-value {\n        border-bottom-style: solid;\n        border-bottom-width: $select-border-width-default + 1px;\n        padding-bottom: $select-value-padding-bottom - 1px;\n      }\n    }\n  }\n}\n\nmd-input-container md-select {\n  &:not([disabled]) {\n    &:focus {\n      .md-select-value {\n        border-bottom-width: $input-border-width-focused;\n      }\n    }\n  }\n  &[disabled] {\n    .md-select-value {\n      // This background-position was taken from and matches the styling of disabled md-inputs.\n      // The negative border width offsets the dotted \"border\" so it's placed in the same place as\n      // the solid one before it.\n      background-position: bottom $input-border-width-default * -1 left 0;\n    }\n  }\n  .md-select-value {\n    min-height: ($input-line-height + $input-padding-top * 2) - $input-border-width-focused - $input-border-width-default * 2;\n    border-bottom-width: $input-border-width-default;\n    padding-bottom: $input-border-width-focused - $input-border-width-default;\n    &.md-select-placeholder {\n      @include rtl(padding-left, 0, $input-container-padding);\n      @include rtl(padding-right, $input-container-padding, 0);\n    }\n  }\n}\n\n.md-select-value {\n  display: flex;\n  align-items: center;\n  padding-top: $select-value-padding-top;\n  padding-bottom: $select-value-padding-bottom;\n  @include rtl(padding-left, 0, $input-container-padding);\n  @include rtl(padding-right, $input-container-padding, 0);\n  border-bottom-width: $select-border-width-default;\n  border-bottom-style: solid;\n  background-color: rgba(0,0,0,0);\n  position: relative;\n  box-sizing: content-box;\n  min-width: 11 * $baseline-grid;\n  min-height: 26px;\n  margin-bottom: auto;\n  -ms-flex-item-align: start; // workaround for margin-bottom: auto\n  flex-grow: 1;\n\n  > span:not(.md-select-icon) {\n    max-width: 100%;\n    flex: 1 1 auto;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    overflow: hidden;\n\n    .md-text {\n      display: inline;\n    }\n  }\n\n  .md-select-icon {\n    display: block;\n    @include rtl(align-items, flex-end, flex-start);\n    @include rtl(text-align, right, left);\n    width: 3 * $baseline-grid;\n    transform: translateY(-2px);\n    font-size: 1.2rem;\n  }\n\n  .md-select-icon:after {\n    display: block;\n    content: '\\25BC';\n    position: relative;\n    top: 2px;\n    @include rtl(right, -4px, auto);\n    @include rtl(left, auto, -4px);\n    speak: none;\n    font-size: 13px;\n    transform: scaleY(0.5);\n  }\n\n  &.md-select-placeholder {\n    display: flex;\n    order: 1;\n    pointer-events: none;\n    -webkit-font-smoothing: antialiased;\n    z-index: 1;\n  }\n}\n\nmd-select-menu {\n  display: flex;\n  flex-direction: column;\n  &.md-reverse {\n    flex-direction: column-reverse;\n  }\n\n  &:not(.md-overflow) {\n    md-content {\n      padding-top: $baseline-grid;\n      padding-bottom: $baseline-grid;\n    }\n  }\n\n  box-shadow: $whiteframe-shadow-1dp;\n  max-height: ($select-option-height * $select-max-visible-options) + 2 * $baseline-grid;\n  min-height: $select-option-height;\n  overflow-y: hidden;\n\n  @include rtl(transform-origin, left top, right top);\n\n  transform: scale(1.0);\n\n  md-content {\n    min-width: 136px;\n    min-height: $select-option-height;\n    max-height: ($select-option-height * $select-max-visible-options) + 2 * $baseline-grid;\n    overflow-y: auto;\n  }\n  > * {\n    opacity: 0;\n  }\n}\n\nmd-option {\n  cursor: pointer;\n  position: relative;\n  display: flex;\n  align-items: center;\n  width: auto;\n  transition: background 0.15s linear;\n\n  &[disabled] {\n    cursor: default;\n  }\n\n  &:focus {\n    outline: none;\n  }\n\n  .md-text {\n    @include not-selectable();\n    width: auto;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n  padding: 0 $select-option-padding 0 $select-option-padding;\n  height: $select-option-height;\n}\n\nmd-optgroup {\n  display: block;\n  label {\n    display: block;\n    font-size: rem(1.4);\n    text-transform: uppercase;\n    padding: $baseline-grid * 2;\n    font-weight: 500;\n  }\n  md-option {\n    padding-left: $select-option-padding * 2;\n    padding-right: $select-option-padding * 2;\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  .md-select-backdrop {\n    background-color: transparent;\n  }\n  md-select-menu {\n    border: 1px solid #fff;\n  }\n}\n\nmd-select-menu[multiple] {\n  md-option.md-checkbox-enabled {\n    @include rtl(padding-left, $select-option-padding * 2.5, $select-option-padding);\n    @include rtl(padding-right, $select-option-padding, $select-option-padding * 2.5);\n\n    @include checkbox-container('[selected]');\n\n    .md-container {\n      @include rtl(margin-left, $select-option-padding * math.div(2, 3), auto);\n      @include rtl(margin-right, auto, $select-option-padding * math.div(2, 3));\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/select/select.spec.js",
    "content": "describe('<md-select>', function() {\n  var attachedElements = [];\n  var body, $document, $rootScope, $compile, $timeout, $material;\n\n  /**\n   * Register any custom components here.\n   */\n  beforeEach(module(function ($compileProvider) {\n    $compileProvider.component('requiredFormFieldComponent', {\n      controller: ['$scope', function($scope) {\n        var $ctrl = this;\n        $ctrl.value = 'test';\n\n        $scope.$applyAsync(function () {\n          $ctrl.required = true;\n        });\n      }],\n      template: '<md-input-container><label>Test select</label>' +\n        '<md-select name=\"value\" ng-model=\"$ctrl.value\" ng-required=\"$ctrl.required\">' +\n        '<md-option value=\"test\">Test value</md-option>' +\n        '</md-select></md-input-container>'\n    });\n  }));\n\n  beforeEach(function() {\n    module('material.components.select', 'material.components.input', 'ngSanitize', 'ngMessages');\n\n    inject(function($injector) {\n      $document = $injector.get('$document');\n      $rootScope = $injector.get('$rootScope');\n      $compile = $injector.get('$compile');\n      $timeout = $injector.get('$timeout');\n      $material = $injector.get('$material');\n      body = $document[0].body;\n    });\n  });\n\n  afterEach(function() {\n    var body = $document[0].body;\n    var children = body.querySelectorAll('.md-select-menu-container');\n    for (var i = 0; i < children.length; i++) {\n      angular.element(children[i]).remove();\n    }\n  });\n\n  afterEach(function() {\n    attachedElements.forEach(function(element) {\n      var scope = element.scope();\n\n      scope && scope.$destroy();\n      element.remove();\n    });\n    attachedElements = [];\n\n    $document.find('md-select-menu').remove();\n    $document.find('md-backdrop').remove();\n  });\n\n  describe('basic functionality', function() {\n    it('should have `._md` class indicator', function() {\n      var element = setupSelect('ng-model=\"val\"').find('md-select-menu');\n      expect(element.hasClass('_md')).toBe(true);\n    });\n\n    it('should preserve tabindex', function() {\n      var select = setupSelect('tabindex=\"2\" ng-model=\"val\"').find('md-select');\n      expect(select.attr('tabindex')).toBe('2');\n    });\n\n    it('should set a tabindex if the element does not have one', function() {\n      var select = setupSelect('ng-model=\"val\"').find('md-select');\n      expect(select.attr('tabindex')).toBeDefined();\n    });\n\n    it('supports non-disabled state', function() {\n      var select = setupSelect('ng-model=\"val\"').find('md-select');\n      expect(select.attr('aria-disabled')).toBe('false');\n    });\n\n    it('supports disabled state', function() {\n      var select = setupSelect('disabled ng-model=\"val\"').find('md-select');\n      openSelect(select);\n      expectSelectClosed(select);\n      expect($document.find('md-select-menu').length).toBe(0);\n      expect(select.attr('aria-disabled')).toBe('true');\n    });\n\n    it('supports passing classes to the container', function() {\n      var select = setupSelect('ng-model=\"val\" md-container-class=\"test\"').find('md-select');\n      openSelect(select);\n\n      var container = $document[0].querySelector('.md-select-menu-container');\n      expect(container).toBeTruthy();\n      expect(container.classList.contains('test')).toBe(true);\n    });\n\n    it('supports passing classes to the container using `data-` attribute prefix', function() {\n      var select = setupSelect('ng-model=\"val\" data-md-container-class=\"test\"').find('md-select');\n      openSelect(select);\n\n      var container = $document[0].querySelector('.md-select-menu-container');\n      expect(container).toBeTruthy();\n      expect(container.classList.contains('test')).toBe(true);\n    });\n\n    it('supports passing classes to the container using `x-` attribute prefix', function() {\n      var select = setupSelect('ng-model=\"val\" x-md-container-class=\"test\"').find('md-select');\n      openSelect(select);\n\n      var container = $document[0].querySelector('.md-select-menu-container');\n      expect(container).toBeTruthy();\n      expect(container.classList.contains('test')).toBe(true);\n    });\n\n    it('does not set aria-owns on select if DOM ownership is implied', function() {\n      var select = setupSelect('ng-model=\"val\"').find('md-select');\n      var ownsId = select.attr('aria-owns');\n      expect(select.find('md-option')).toBeTruthy();\n      expect(ownsId).toBeFalsy();\n    });\n\n    it('sets aria-owns between the select and the listbox if element moved outside parent', function() {\n      var select = setupSelect('ng-model=\"val\"').find('md-select');\n      openSelect(select);\n      var ownsId = select.attr('aria-owns');\n      expect(ownsId).toBeTruthy();\n      var listboxContentId =\n        $document[0].querySelector('.md-select-menu-container md-content').getAttribute('id');\n      expect(ownsId).toBe(listboxContentId);\n    });\n\n    it('calls md-on-close when the select menu closes', function() {\n      var called = false;\n      $rootScope.onClose = function() {\n        called = true;\n      };\n      var select = setupSelect('ng-model=\"val\" md-on-close=\"onClose()\"', [1, 2, 3]).find('md-select');\n      openSelect(select);\n      expectSelectOpen(select);\n\n      clickOption(select, 0);\n\n      $material.flushInterimElement();\n      expectSelectClosed(select);\n\n      expect(called).toBe(true);\n    });\n\n    it('closes on backdrop click', function() {\n      var select = setupSelect('ng-model=\"val\"', [1, 2, 3]).find('md-select');\n      openSelect(select);\n\n      // Simulate click bubble from option to select menu handler\n      var backdrop = $document.find('md-backdrop');\n      expect(backdrop.length).toBe(1);\n      backdrop.triggerHandler('click');\n\n      $material.flushInterimElement();\n\n      backdrop = $document.find('md-backdrop');\n      expect(backdrop.length).toBe(0);\n    });\n\n    it('removes the menu container when the select is removed', function() {\n      var select = setupSelect('ng-model=\"val\"', [1]).find('md-select');\n      openSelect(select);\n\n      select.remove();\n\n      expect($document.find('md-select-menu').length).toBe(0);\n    });\n\n    it('should not trigger ng-change without a change when using trackBy', function() {\n      var changed = false;\n      $rootScope.onChange = function() { changed = true; };\n\n      // Since we're tracking by id, ng-change shouldn't be triggered\n      // when we have two objects that are not strictly equivalent (one has a 'randomAddedProperty')\n      // but that have the same tracked field\n      $rootScope.val = { id: 1, name: 'Bob', randomAddedProperty: 'random' };\n\n      var opts = [{ id: 1, name: 'Bob' }, { id: 2, name: 'Alice' }];\n      var select = setupSelect('ng-model=\"$root.val\" ng-change=\"onChange()\" ng-model-options=\"{trackBy: \\'$value.id\\'}\"', opts);\n      expect(changed).toBe(false);\n\n      openSelect(select);\n      clickOption(select, 1);\n      $material.flushInterimElement();\n      expect($rootScope.val.id).toBe(2);\n      expect(changed).toBe(true);\n    });\n\n    it('should support trackBy to be updated', function() {\n      var changed = false;\n      $rootScope.onChange = function() { changed = true; };\n      $rootScope.useTrackBy = false;\n      $rootScope.trackByOption = '$value.id';\n\n      var opts = [{ id: 1, name: 'Bob' }, { id: 2, name: 'Alice' }];\n      $rootScope.val = opts[0];\n      var select = setupSelect('ng-model=\"$root.val\"' +\n        'ng-change=\"onChange()\"' +\n        'ng-model-options=\"{ trackBy: $root.useTrackBy ? $root.trackByOption : undefined }\"', opts);\n      expect(changed).toBe(false);\n\n      $rootScope.$apply(function() {\n        $rootScope.useTrackBy = true;\n        // Since we're tracking by id, ng-change shouldn't be triggered\n        // when we have two objects that are not strictly equivalent (one has a 'randomAddedProperty')\n        // but that have the same tracked field\n        $rootScope.val = { id: 1, name: 'Bob', randomAddedProperty: 'random' };\n      });\n      openSelect(select);\n      clickOption(select, 0);\n      $material.flushInterimElement();\n      expect(changed).toBe(false);\n\n      openSelect(select);\n      clickOption(select, 1);\n      $material.flushInterimElement();\n      expect($rootScope.val.id).toBe(2);\n      expect(changed).toBe(true);\n    });\n\n    it('should set touched only after closing', function() {\n      var form = $compile('<form name=\"myForm\">' +\n                          '<md-select name=\"select\" ng-model=\"val\">' +\n                          '<md-option>1</md-option>' +\n                          '</md-select>' +\n                          '</form>')($rootScope);\n      var select = form.find('md-select');\n      openSelect(select);\n      expect($rootScope.myForm.select.$touched).toBe(false);\n      closeSelect();\n      expect($rootScope.myForm.select.$touched).toBe(true);\n    });\n\n    it('should remain untouched during opening', function() {\n      var form = $compile('<form name=\"myForm\">' +\n                          '<md-select name=\"select\" ng-model=\"val\">' +\n                          '<md-option>1</md-option>' +\n                          '</md-select>' +\n                          '</form>')($rootScope);\n      var unwatch = $rootScope.$watch('myForm.select.$touched',\n        function(touched) {\n          expect(touched).toBe(false);\n        });\n      var select = form.find('md-select');\n      openSelect(select);\n      unwatch();\n      closeSelect();\n      expect($rootScope.myForm.select.$touched).toBe(true);\n    });\n\n    it('applies the md-input-focused class to the container when focused with the keyboard', function() {\n      var element = setupSelect('ng-model=\"val\"');\n      var select = element.find('md-select');\n\n      select.triggerHandler('focus');\n      expect(element.hasClass('md-input-focused')).toBe(true);\n\n      select.triggerHandler('blur');\n      expect(element.hasClass('md-input-focused')).toBe(false);\n    });\n\n    it('restores focus to select when the menu is closed', function() {\n      var select = setupSelect('ng-model=\"val\"').find('md-select');\n      openSelect(select);\n\n      body.appendChild(select[0]);\n\n      var selectMenu = $document.find('md-select-menu');\n      // Dismiss the menu with the Escape key.\n      pressKeyByCode(selectMenu, 27);\n      $material.flushInterimElement();\n\n      // FIXME- does not work with minified, jquery\n      // expect($document[0].activeElement).toBe(select[0]);\n\n      // Clean up the DOM after the test.\n      body.removeChild(select[0]);\n    });\n\n    it('auto focuses option in the list when opened', function() {\n      var select = setupSelect('ng-model=\"val\"', ['One']).find('md-select');\n      openSelect(select);\n\n      body.appendChild(select[0]);\n\n      var selectMenu = $document.find('md-select-menu');\n      var mdOption = selectMenu.find('md-option');\n      expect(mdOption[0].classList.contains('md-focused')).toBeTruthy();\n\n      // Clean up the DOM after the test.\n      body.removeChild(select[0]);\n    });\n\n    it('changes focus decoration on selection change by keyboard', function() {\n      var select = setupSelect('ng-model=\"val\"', ['One', 'Two']).find('md-select');\n      openSelect(select);\n\n      body.appendChild(select[0]);\n\n      var selectMenu = $document.find('md-select-menu');\n      var mdOption = selectMenu.find('md-option');\n      expect(mdOption[0].classList.contains('md-focused')).toBeTruthy();\n\n      // Select the second option using the down arrow key.\n      pressKeyByCode(selectMenu, 40);\n      expect(mdOption[0].classList.contains('md-focused')).toBeFalsy();\n      expect(mdOption[1].classList.contains('md-focused')).toBeTruthy();\n      $material.flushInterimElement();\n\n      // Clean up the DOM after the test.\n      body.removeChild(select[0]);\n    });\n\n    it('removes md-focused from first option when second option is clicked', function() {\n      var select = setupSelect('ng-model=\"val\"', ['One', 'Two']).find('md-select');\n      openSelect(select);\n\n      body.appendChild(select[0]);\n\n      var selectMenu = $document.find('md-select-menu');\n      var mdOption = selectMenu.find('md-option');\n      expect(mdOption[0].classList.contains('md-focused')).toBeTruthy();\n\n      clickOption(select, 1);\n      $material.flushInterimElement();\n      expect(mdOption[0].classList.contains('md-focused')).toBeFalsy();\n      expect(mdOption[1].classList.contains('md-focused')).toBeFalsy();\n\n      openSelect(select);\n      selectMenu = $document.find('md-select-menu');\n      mdOption = selectMenu.find('md-option');\n      expect(mdOption[0].classList.contains('md-focused')).toBeFalsy();\n      expect(mdOption[1].classList.contains('md-focused')).toBeTruthy();\n\n      // Clean up the DOM after the test.\n      body.removeChild(select[0]);\n    });\n\n    it('should remove the input-container focus state', function() {\n      $rootScope.val = 0;\n      var element = setupSelect('ng-model=\"val\"', [1, 2, 3]);\n      var select = element.find('md-select');\n      var controller = element.controller('mdInputContainer');\n      $timeout.flush();\n      controller.setHasValue(true);\n\n      select.triggerHandler('focus');\n\n      expect(element.hasClass('md-input-focused')).toBe(true);\n\n      select.triggerHandler('blur');\n\n      expect(element.hasClass('md-input-focused')).toBe(false);\n\n    });\n\n    it('should remove the tabindex from a disabled element', function() {\n      var select = setupSelect('ng-model=\"val\" disabled tabindex=\"1\"').find('md-select');\n      expect(select.attr('tabindex')).toBeUndefined();\n    });\n\n    it('auto-infers a value when none specified', function() {\n        $rootScope.name = \"Hannah\";\n        var el = setupSelect('ng-model=\"name\"', '<md-option>Tom</md-option>' +\n              '<md-option>Hannah</md-option>');\n        expect(selectedOptions(el).length).toBe(1);\n    });\n\n    it('errors for duplicate md-options, non-dynamic value', function() {\n      expect(function() {\n        setupSelect('ng-model=\"$root.model\"', ['a', 'a']);\n      }).toThrow();\n    });\n\n    it('errors for duplicate md-options, ng-value', function() {\n      setupSelect('ng-model=\"$root.model\"', '<md-option ng-value=\"foo\">Hello</md-option>' +\n            '<md-option ng-value=\"bar\">Goodbye</md-option>');\n      $rootScope.$apply('foo = \"a\"');\n      expect(function() {\n        $rootScope.$apply('bar = \"a\"');\n      }).toThrow();\n    });\n\n    it('watches the collection for changes', function() {\n      $rootScope.val = 1;\n      var select = setupSelect('ng-model=\"val\"', [1, 2, 3]).find('md-select');\n      var label = select.find('md-select-value')[0];\n      expect(label.textContent).toBe('1');\n      $rootScope.val = 4;\n      $rootScope.$$values = [4, 5, 6];\n      $rootScope.$digest();\n      expect(label.textContent).toBe('4');\n    });\n\n    it('it should be able to reopen if the element was destroyed while the close ' +\n      'animation is running', function() {\n        $rootScope.showSelect = true;\n\n        var container = setupSelect('ng-model=\"val\" ng-if=\"showSelect\"', [1, 2, 3]);\n        var select = container.find('md-select');\n\n        openSelect(select);\n        expectSelectOpen(select);\n\n        clickOption(select, 0);\n        $rootScope.$apply('showSelect = false');\n        $timeout.flush();\n        expectSelectClosed(select);\n\n        $rootScope.$apply('showSelect = true');\n        $timeout.flush();\n        select = container.find('md-select');\n\n        openSelect(select);\n        expectSelectOpen(select);\n      });\n\n    describe('when required', function() {\n      it('allows 0 as a valid default value', function() {\n        $rootScope.model = 0;\n        $rootScope.opts = [0, 1, 2];\n        $compile('<form name=\"testForm\">' +\n          '<md-select ng-model=\"model\" name=\"defaultSelect\" required>' +\n          '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n          '</md-select></form>')($rootScope);\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect($rootScope.testForm.defaultSelect.$error).toEqual({});\n      });\n    });\n\n    describe('mdSelectOnlyOption support', function() {\n      var $rootScope, $timeout;\n\n      beforeEach(inject(function($injector) {\n        $rootScope = $injector.get('$rootScope');\n        $timeout = $injector.get('$timeout');\n      }));\n\n      it('should select the first option if it only has one option', function() {\n        setupSelect('ng-model=\"val\" md-select-only-option', [1]);\n        $timeout.flush();\n        expect($rootScope.val).toBe(1);\n      });\n\n      it('should work with `multiple`', function() {\n        setupSelectMultiple('ng-model=\"val\" md-select-only-option', [1]);\n        $timeout.flush();\n        expect($rootScope.val).toEqual([1]);\n      });\n\n      it('should not do anything if there is more than one option', function() {\n        setupSelect('ng-model=\"val\" md-select-only-option', [1, 2, 3]);\n        $timeout.flush();\n        expect($rootScope.val).toBeUndefined();\n      });\n\n      it('should keep the ngModel pristine', function() {\n        var el = setupSelect('ng-model=\"val\" md-select-only-option', [1]);\n        var ngModel = el.find('md-select').controller('ngModel');\n\n        $timeout.flush();\n        expect(ngModel.$pristine).toBe(true);\n      });\n    });\n  });\n\n  describe('input container', function() {\n    it('should set has-value class on container for non-ng-model input', function() {\n      var el = setupSelect('ng-model=\"$root.model\"', [1, 2, 3]);\n      var select = el.find('md-select');\n\n      openSelect(select);\n\n      clickOption(select, 0);\n\n      $material.flushInterimElement();\n\n      expect(el).toHaveClass('md-input-has-value');\n    });\n\n    it('should set has-value class on container for ng-model input', function() {\n      $rootScope.value = 'test';\n      var el = setupSelect('ng-model=\"$root.value\"', ['test', 'no-test']);\n      expect(el).toHaveClass('md-input-has-value');\n\n      $rootScope.$apply('value = null');\n      $timeout.flush();\n      expect(el).not.toHaveClass('md-input-has-value');\n    });\n\n    it('should add has-value class on container for option ng-value=\"undefined\"', function() {\n      var el = setupSelect('ng-model=\"$root.value\"',\n        '<md-option ng-value=\"undefined\"></md-option><md-option ng-value=\"1\">1</md-option>'\n      );\n      var select = el.find('md-select');\n\n      document.body.appendChild(el[0]);\n\n      openSelect(select);\n      $material.flushInterimElement();\n      clickOption(select, 0);\n      closeSelect();\n      $material.flushInterimElement();\n      expect(el).toHaveClass('md-input-has-value');\n\n      openSelect(select);\n      $material.flushInterimElement();\n      clickOption(select, 1);\n      closeSelect();\n      $material.flushInterimElement();\n      expect(el).toHaveClass('md-input-has-value');\n\n      el.remove();\n    });\n\n    [\n      '<md-option></md-option>',\n      '<md-option value></md-option>',\n      '<md-option value>None</md-option>',\n      '<md-option ng-value></md-option>',\n      '<md-option ng-value>None</md-option>',\n      '<md-option value=\"\"></md-option>',\n      '<md-option ng-value=\"\"></md-option>'\n    ].forEach(function(template) {\n      it('should unset has-value class on container for empty value option (' + template + ')', function() {\n        var el = setupSelect('ng-model=\"$root.value\"',\n          template + '<md-option ng-value=\"1\">1</md-option>'\n        );\n        var select = el.find('md-select');\n\n        document.body.appendChild(el[0]);\n\n        openSelect(select);\n        $material.flushInterimElement();\n        clickOption(select, 1);\n        closeSelect();\n        $material.flushInterimElement();\n        expect(el).toHaveClass('md-input-has-value');\n\n        openSelect(select);\n        $material.flushInterimElement();\n        clickOption(select, 0);\n        closeSelect();\n        $material.flushInterimElement();\n        expect(el).not.toHaveClass('md-input-has-value');\n\n        el.remove();\n      });\n    });\n\n    it('should match label to given input id', function() {\n      var el = setupSelect('ng-model=\"$root.value\" id=\"foo\"');\n      expect(el.find('label').attr('for')).toBe('foo');\n      expect(el.find('md-select').attr('id')).toBe('foo');\n    });\n\n    it('should match label to automatic input id', function() {\n      var el = setupSelect('ng-model=\"$root.value\"');\n      expect(el.find('md-select').attr('id')).toBeTruthy();\n      expect(el.find('label').attr('for')).toBe(el.find('md-select').attr('id'));\n    });\n  });\n\n  describe('label behavior', function() {\n    it('defaults to the placeholder text', function() {\n      var select = setupSelect('ng-model=\"someVal\" placeholder=\"Hello world\"', null, true).find('md-select');\n      var label = select.find('md-select-value');\n      expect(label.text()).toBe('Hello world');\n      expect(label.hasClass('md-select-placeholder')).toBe(true);\n    });\n\n    it('sets itself to the selected option\\'s label', function() {\n      $rootScope.val = 2;\n      var select = $compile('<md-input-container>' +\n                              '<label>Label</label>' +\n                              '<md-select ng-model=\"val\" placeholder=\"Hello World\">' +\n                                '<md-option value=\"1\">One</md-option>' +\n                                '<md-option value=\"2\">Two</md-option>' +\n                                '<md-option value=\"3\">Three</md-option>' +\n                              '</md-select>' +\n                            '</md-input-container>')($rootScope).find('md-select');\n      var label = select.find('md-select-value');\n      var options = select.find('md-option');\n\n      $rootScope.$digest();\n\n      expect(label.text()).toBe('Two');\n      expect(label.hasClass('md-select-placeholder')).toBe(false);\n\n\n      // Ensure every md-option element does not have a checkbox prepended to it.\n      for (var i = 0; i < options.length; i++) {\n        var checkBoxContainer = options[i].querySelector('.md-container');\n        var checkBoxIcon = options[i].querySelector('.md-icon');\n        expect(checkBoxContainer).toBe(null);\n        expect(checkBoxIcon).toBe(null);\n      }\n    });\n\n    it('displays md-selected-text when specified', function() {\n      $rootScope.selectedText = 'Hello World';\n\n      var select = setupSelect('ng-model=\"someVal\", md-selected-text=\"selectedText\"', null, true).find('md-select');\n      var label = select.find('md-select-value');\n\n      expect(label.text()).toBe($rootScope.selectedText);\n\n      $rootScope.selectedText = 'Goodbye world';\n\n      // The label update function is not called until some user action occurs.\n      openSelect(select);\n      closeSelect(select);\n      $material.flushInterimElement();\n\n      expect(label.text()).toBe($rootScope.selectedText);\n    });\n\n    it('should sanitize md-selected-html', function() {\n      $rootScope.selectedText = '<b>Hello World</b><script>window.mdSelectXss=\"YES\"</script>';\n\n      var select = setupSelect(\n          'ng-model=\"someVal\", ' +\n          'md-selected-html=\"selectedText\"', null, true).find('md-select');\n      var label = select.find('md-select-value');\n\n      expect(label.text()).toBe('Hello World');\n\n      // The label is loaded into a span that is the first child of the '<md-select-value>`.\n      expect(label[0].childNodes[0].innerHTML).toBe('<b>Hello World</b>');\n      expect(window.mdSelectXss).toBeUndefined();\n    });\n\n    it('should always treat md-selected-text as text, not html', function() {\n      $rootScope.selectedText = '<b>Hello World</b>';\n\n      var select = setupSelect(\n          'ng-model=\"someVal\", ' +\n          'md-selected-text=\"selectedText\"', null, true).find('md-select');\n      var label = select.find('md-select-value');\n\n      expect(label.text()).toBe('<b>Hello World</b>');\n    });\n\n    it('supports rendering multiple', function() {\n      $rootScope.val = [1, 3];\n      var select = $compile('<md-input-container>' +\n                              '<label>Label</label>' +\n                              '<md-select multiple ng-model=\"val\" placeholder=\"Hello World\">' +\n                                '<md-option value=\"1\">One</md-option>' +\n                                '<md-option value=\"2\">Two</md-option>' +\n                                '<md-option value=\"3\">Three</md-option>' +\n                              '</md-select>' +\n                            '</md-input-container>')($rootScope).find('md-select');\n      var label = select.find('md-select-value');\n      var options = select.find('md-option');\n\n      $rootScope.$digest();\n      $rootScope.$digest();\n      $timeout.flush();\n      expect(label.text()).toBe('One, Three');\n      expect(label.hasClass('md-select-placeholder')).toBe(false);\n\n      // Ensure every md-option element has a checkbox prepended to it.\n      for (var i = 0; i < options.length; i++) {\n        var checkBoxContainer = options[i].querySelector('.md-container');\n        var checkBoxIcon = options[i].querySelector('.md-icon');\n        expect(checkBoxContainer).not.toBe(null);\n        expect(checkBoxIcon).not.toBe(null);\n      }\n\n    });\n\n    describe('md-select-header behavior', function() {\n      it('supports rendering a md-select-header', function() {\n        $rootScope.val = [1];\n        var select = $compile(\n            '<md-input-container>' +\n            '  <label>Label</label>' +\n            '  <md-select multiple ng-model=\"val\" placeholder=\"Hello World\">' +\n            '    <md-select-header class=\"demo-select-header\">' +\n            '      <span>Hello World</span>' +\n            '    </md-select-header>' +\n            '    <md-optgroup label=\"stuff\">' +\n            '      <md-option value=\"1\">One</md-option>' +\n            '      <md-option value=\"2\">Two</md-option>' +\n            '      <md-option value=\"3\">Three</md-option>' +\n            '    </md-optgroup>' +\n            '  </md-select>' +\n            '</md-input-container>')($rootScope);\n\n        var header = select.find('md-select-header');\n        var headerContent = header.find('span');\n\n        expect(headerContent.text()).toBe('Hello World');\n      });\n\n      it('does not render the label in md-optgroup if md-select-header is present', function() {\n        $rootScope.val = [1];\n        var select = $compile(\n            '<md-input-container>' +\n            '  <label>Label</label>' +\n            '  <md-select multiple ng-model=\"val\" placeholder=\"Hello World\">' +\n            '    <md-select-header class=\"demo-select-header\">' +\n            '      <span>Hello World</span>' +\n            '    </md-select-header>' +\n            '    <md-optgroup label=\"stuff\">' +\n            '      <md-option value=\"1\">One</md-option>' +\n            '      <md-option value=\"2\">Two</md-option>' +\n            '      <md-option value=\"3\">Three</md-option>' +\n            '    </md-optgroup>' +\n            '  </md-select>' +\n            '</md-input-container>')($rootScope);\n\n        var optgroupLabel = select[0].querySelector('.md-container-ignore');\n\n        expect(optgroupLabel).toBe(null);\n      });\n    });\n\n    it('does not allow keydown events to propagate from inside the md-select-menu', function() {\n      var scope = $rootScope.$new();\n\n      scope.val = [1];\n\n      var select = $compile(\n          '<md-input-container>' +\n          '  <label>Label</label>' +\n          '  <md-select multiple ng-model=\"val\" placeholder=\"Hello World\">' +\n          '    <md-option value=\"1\">One</md-option>' +\n          '    <md-option value=\"2\">Two</md-option>' +\n          '    <md-option value=\"3\">Three</md-option>' +\n          '  </md-select>' +\n          '</md-input-container>')(scope);\n\n      var mdOption = select.find('md-option');\n      var selectMenu = select.find('md-select-menu');\n      var keydownEvent = {\n        type: 'keydown',\n        target: mdOption[0],\n        preventDefault: jasmine.createSpy(),\n        stopPropagation: jasmine.createSpy()\n      };\n\n      openSelect(select);\n      angular.element(selectMenu).triggerHandler(keydownEvent);\n\n      expect(keydownEvent.preventDefault).toHaveBeenCalled();\n      expect(keydownEvent.stopPropagation).toHaveBeenCalled();\n\n      scope.$destroy();\n      select.remove();\n    });\n\n    it('supports raw html', inject(function($sce) {\n      $rootScope.val = 0;\n      $rootScope.opts = [\n        { id: 0, label: '<p>Hello World</p>' },\n        { id: 1, label: 'Hello World' }\n      ];\n      angular.forEach($rootScope.opts, function(opt) {\n        opt.label = $sce.trustAs('html', opt.label);\n      });\n      var select = $compile('<md-input-container>' +\n                              '<label>Placeholder</label>' +\n                              '<md-select ng-model=\"val\" placeholder=\"Placeholder\">' +\n                                '<md-option ng-value=\"opt.id\" ng-repeat=\"opt in opts\" ng-bind-html=\"opt.label\"></md-option>' +\n                              '</md-select>' +\n                            '</md-input-container>')($rootScope).find('md-select');\n      var label = select.find('md-select-value').children().eq(0);\n      $rootScope.$digest();\n\n\n      expect(label.text()).toBe('Hello World');\n      expect(label.html()).toBe('<p>Hello World</p>');\n    }));\n  });\n\n  describe('non-multiple', function() {\n\n    describe('model->view', function() {\n\n      it('renders initial model value', function() {\n        $rootScope.$apply('model = \"b\"');\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c']);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n      });\n\n      it('renders nothing if no initial value is set', function() {\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c']);\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('supports ng-selected on md-options', function() {\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c'], false, $rootScope, null,\n          '$index === 2');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toBe('c');\n      });\n\n      it('supports circular references', function() {\n        var opts = [{ id: 1 }, { id: 2 }];\n        opts[0].refs = opts[1];\n        opts[1].refs = opts[0];\n        setupSelect('ng-model=\"$root.model\"', opts, undefined, undefined, { renderValueAs: 'value.id' });\n      });\n\n      it('renders model change by selecting new and deselecting old', function() {\n        $rootScope.$apply('model = \"b\"');\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c']);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = \"c\"');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect(selectedOptions(el).length).toBe(1);\n      });\n\n      it('renders invalid model change by deselecting old and selecting nothing', function() {\n        $rootScope.$apply('model = \"b\"');\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c']);\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = \"d\"');\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('renders model change to undefined by deselecting old and selecting nothing', function() {\n        $rootScope.$apply('model = \"b\"');\n        var el = setupSelect('ng-model=\"$root.model\"', ['a','b','c']);\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = undefined');\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('uses track by if given to compare objects', function() {\n        $rootScope.$apply('model = {id:2}');\n        var el = setupSelect('ng-model=\"$root.model\" ng-model-options=\"{trackBy: \\'$value.id\\'}\"',\n            [{id:1}, {id:2}, {id:3}]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = {id: 3}');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n      });\n\n      it('uses uid by default to compare objects', function() {\n        var one = {}, two = {}, three = {};\n        $rootScope.model = two;\n        var el = setupSelect('ng-model=\"$root.model\"', [one, two, three]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = {}');\n\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('should keep the form pristine when model is predefined', function() {\n        $rootScope.model = 2;\n        $rootScope.opts = [1, 2, 3, 4];\n        $compile('<form name=\"testForm\">' +\n          '<md-select ng-model=\"model\" name=\"multiSelect\">' +\n            '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n          '</md-select></form>')($rootScope);\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect($rootScope.testForm.$pristine).toBe(true);\n      });\n\n      it('should forward the model value to the hidden select', function() {\n        $rootScope.opts = [1, 2, 3, 4];\n        var select = $compile('<form>' +\n          '<md-select ng-model=\"model\" name=\"testing-select\">' +\n            '<md-option ng-repeat=\"opt in opts\">{{ opt }}</md-option>' +\n          '</md-select></form>')($rootScope).find('select'); // not md-select\n\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect(select.val()).toBeFalsy();\n        $rootScope.$apply('model = 3');\n        expect(select.val()).toBe('3');\n      });\n\n      it('should forward the name attribute to the hidden select', function() {\n        var select = $compile('<form>' +\n          '<md-select ng-model=\"model\" name=\"testing-select\">' +\n          '</md-select></form>')($rootScope).find('select');\n\n        expect(select.attr('name')).toBe('testing-select');\n      });\n    });\n\n    describe('view->model', function() {\n\n      it('should do nothing if clicking selected option', function() {\n        $rootScope.model = 3;\n        var el = setupSelect('ng-model=\"$root.model\"', [1,2,3]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n\n        el.triggerHandler({\n          type: 'click',\n          target: el.find('md-option')[2]\n        });\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toBe(3);\n      });\n\n      it('should support the ng-change event', function() {\n          var changesCalled = false;\n          $rootScope.onChanges = function() {\n            changesCalled = true;\n          };\n\n          var selectEl = setupSelect('ng-model=\"myModel\" ng-change=\"changed()\"', [1, 2, 3]).find('md-select');\n          openSelect(selectEl);\n\n          var menuEl = $document.find('md-select-menu');\n          menuEl.triggerHandler({\n            type: 'click',\n            target: menuEl.find('md-option')[1]\n          });\n\n          // FIXME- does not work with minified, jquery\n          // expect(changesCalled).toBe(true);\n      });\n\n      it('should deselect old and select new on click', function() {\n        $rootScope.model = 3;\n        var el = setupSelect('ng-model=\"$root.model\"', [1,2,3]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n\n        openSelect(el);\n        clickOption(el, 1);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toBe(2);\n      });\n\n      it('should keep model value if selected option is removed', function() {\n        $rootScope.model = 3;\n        $rootScope.values = [1,2,3];\n        var el = setupSelect('ng-model=\"$root.model\"', '<md-option ng-repeat=\"v in values\" ng-value=\"v\">{{v}}</md-option>');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('values.pop()');\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect(el.find('md-option').length).toBe(2);\n        expect($rootScope.model).toBe(3);\n      });\n\n      it('should select an option that was just added matching the modelValue', function() {\n        $rootScope.model = 4;\n        $rootScope.values = [1,2,3];\n        var el = setupSelect('ng-model=\"$root.model\"', '<md-option ng-repeat=\"v in values\" ng-value=\"v\">{{v}}</md-option>');\n\n        expect(selectedOptions(el).length).toBe(0);\n\n        $rootScope.$apply('values.unshift(4)');\n\n        expect(el.find('md-option').length).toBe(4);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toBe(4);\n      });\n\n      it('should allow switching between falsy options', inject(function($rootScope) {\n        $rootScope.model = false;\n        var el = setupSelect('ng-model=\"$root.model\"', [false, 0]);\n\n        openSelect(el);\n        clickOption(el, 1);\n\n        expect($rootScope.model).toBe(0);\n      }));\n\n      it('should not override the initial model value', inject(function($rootScope) {\n        $rootScope.model = 2;\n\n        var el = setupSelect('ng-model=\"$root.model\"', ['1', '2', '3']);\n        var selectedOption = selectedOptions(el)[0];\n\n        expect($rootScope.model).toBe(2, 'Expected value not to have been overwritten.');\n        expect(selectedOption).toBeTruthy('Expected an option to be selected.');\n        expect(selectedOption.getAttribute('value')).toBe('2',\n            'Expected the corresponding option to have been selected');\n      }));\n    });\n  });\n\n  describe('multiple', function() {\n\n    describe('model->view', function() {\n\n      it('renders initial model value', function() {\n        $rootScope.model = [1,3];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([1,3]);\n      });\n\n      it('renders nothing if empty array is set', function() {\n        $rootScope.model = [];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([]);\n      });\n\n      it('renders nothing if undefined is set', function() {\n        $rootScope.model = [1, 2];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n        expect(selectedOptions(el).length).toBe(2);\n        $rootScope.$apply('model = undefined');\n        $rootScope.$digest();\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('adding a valid value to the model selects its option', function() {\n        $rootScope.model = [];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([]);\n\n        $rootScope.$apply('model.push(2)');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([2]);\n      });\n\n\n      it('removing a valid value from the model deselects its option', function() {\n        $rootScope.model = [2,3];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect($rootScope.model).toEqual([2,3]);\n\n        $rootScope.$apply('model.shift()');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([3]);\n      });\n\n      it('deselects all options when setting to an empty model', function() {\n        $rootScope.model = [2,3];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect($rootScope.model).toEqual([2,3]);\n\n        $rootScope.$apply('model = []');\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([]);\n      });\n\n      it('adding multiple valid values to a model selects their options', function() {\n        $rootScope.model = [2,3];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4]);\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect($rootScope.model).toEqual([2,3]);\n\n        $rootScope.$apply('model = model.concat([1,4])');\n\n        expect(selectedOptions(el).length).toBe(4);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(3).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([2,3,1,4]);\n      });\n\n      it('correctly selects and deselects options for complete reassignment of model', function() {\n        $rootScope.model = [2,4,5,6];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4,5,6]);\n\n        expect(selectedOptions(el).length).toBe(4);\n        expect($rootScope.model).toEqual([2,4,5,6]);\n\n        $rootScope.$apply('model = [1,2,3]');\n\n        expect(selectedOptions(el).length).toBe(3);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([1,2,3]);\n      });\n\n      it('does not select any options if the models value does not match an option', function() {\n        $rootScope.model = [];\n        $rootScope.obj = {};\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4,5,6]);\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([]);\n\n        $rootScope.$apply('model = [\"bar\", obj]');\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([\"bar\", $rootScope.obj]);\n      });\n\n      it('uses track by if given to compare objects', function() {\n        $rootScope.$apply('model = [{id:2}]');\n        var el=setupSelectMultiple('ng-model=\"$root.model\" ng-model-options=\"{trackBy: \\'$value.id\\'}\"',\n            [{id:1}, {id:2}, {id:3}]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model.push({id: 3}); model.push({id:1}); model.shift();');\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n      });\n\n      it('uses uid by default to compare objects', function() {\n        var one = {}, two = {}, three = {};\n        $rootScope.model = [two];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [one, two, three]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect(el.find('md-option').eq(1).attr('selected')).toBe('selected');\n\n        $rootScope.$apply('model = [{}]');\n\n        expect(selectedOptions(el).length).toBe(0);\n      });\n\n      it('errors the model if model value is truthy and not an array', function() {\n        $rootScope.model = 'string';\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3]);\n        var ngModelCtrl = el.find('md-select').controller('ngModel');\n\n        expect(ngModelCtrl.$error['md-multiple']).toBe(true);\n\n        $rootScope.$apply('model = []');\n        expect(ngModelCtrl.$valid).toBe(true);\n      });\n\n      it('should have the proper md-has-input-class when the model has selected values', function() {\n        $rootScope.model = [2,4,5,6];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2,3,4,5,6]);\n        expect(el).toHaveClass('md-input-has-value');\n      });\n\n      it('does not let an empty array satisfy required', function() {\n          $rootScope.model = [];\n          $rootScope.opts = [1, 2, 3, 4];\n          $compile('<form name=\"testForm\">' +\n            '<md-select ng-model=\"model\" name=\"multiSelect\" required=\"required\" multiple>' +\n              '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n            '</md-select></form>')($rootScope);\n          $rootScope.$digest();\n          expect($rootScope.testForm.$valid).toBe(false);\n      });\n\n      it('properly validates required attribute based on available options', function() {\n        var template =\n          '<form name=\"testForm\">' +\n          '  <md-select ng-model=\"model\" required=\"required\">' +\n          '    <md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n          '  </md-select>' +\n          '</form>';\n\n        $rootScope.opts = [1, 2, 3, 4];\n\n        $compile(template)($rootScope);\n\n        // Option 0 is not available; should be false\n        $rootScope.model = 0;\n        $rootScope.$digest();\n        expect($rootScope.testForm.$valid).toBe(false);\n\n        // Option 1 is available; should be true\n        $rootScope.model = 1;\n        $rootScope.$digest();\n        expect($rootScope.testForm.$valid).toBe(true);\n      });\n\n      it('properly validates required attribute with object options', function() {\n        var template =\n          '<form name=\"testForm\">' +\n          '  <md-select ng-model=\"model\" ng-model-options=\"{ trackBy: \\'$value.id\\' }\" required=\"required\">' +\n          '    <md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n          '  </md-select>' +\n          '</form>';\n\n        $rootScope.opts = [\n          { id: 1, value: 'First'  },\n          { id: 2, value: 'Second' },\n          { id: 3, value: 'Third'  },\n          { id: 4, value: 'Fourth' }\n        ];\n\n        $compile(template)($rootScope);\n\n        // There is no value selected yet, so the validation should currently fail.\n        $rootScope.$digest();\n\n        expect($rootScope.testForm.$valid).toBe(false);\n\n        // Select any valid option, to confirm that the ngModel properly detects the\n        // tracked option.\n        $rootScope.model = $rootScope.opts[0];\n        $rootScope.$digest();\n\n        expect($rootScope.testForm.$valid).toBe(true);\n      });\n\n      it('should keep the form pristine when model is predefined', function() {\n        $rootScope.model = [1, 2];\n        $rootScope.opts = [1, 2, 3, 4];\n        $compile('<form name=\"testForm\">' +\n          '<md-select ng-model=\"model\" name=\"multiSelect\" multiple>' +\n            '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n          '</md-select></form>')($rootScope);\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect($rootScope.testForm.$pristine).toBe(true);\n      });\n\n        it('should not change a dirty form to pristine', function() {\n            $rootScope.rows = [[2], [4,3]];\n            $rootScope.filterTerm;\n            $rootScope.opts = [1, 2, 3, 4];\n            var select = $compile('<form name=\"testForm\">' +\n                '<div ng-repeat=\"item in rows | filter:filterTerm\">' +\n                '<md-select ng-model=\"item\" name=\"multiSelect\" multiple id=\"{{$index}}\">' +\n                '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\"></md-option>' +\n                '</md-select>' +\n                '</div></form>')($rootScope);\n            $rootScope.$apply();\n            $timeout.flush();\n            expect(select.find('md-select').length).toBe(2);\n            $rootScope.testForm.$setDirty();\n            $rootScope.$apply();\n            $timeout.flush();\n            expect($rootScope.testForm.$pristine).toBeFalsy();\n            $rootScope.filterTerm = \"2\";\n            $rootScope.$apply();\n            $timeout.flush();\n            expect(select.find('md-select').length).toBe(1);\n            expect($rootScope.testForm.$pristine).toBeFalsy();\n            $rootScope.filterTerm = \"\";\n            $rootScope.$apply();\n            $timeout.flush();\n            expect(select.find('md-select').length).toBe(2);\n            expect($rootScope.testForm.$dirty).toBeTruthy();\n            expect($rootScope.testForm.$pristine).toBeFalsy();\n        });\n\n      it('should correctly update the input containers label', function() {\n        var el = setupSelect('ng-required=\"isRequired\" ng-model=\"someModel\"');\n        var label = el.find('label');\n\n        expect(label).not.toHaveClass('md-required');\n\n        $rootScope.$apply('isRequired = true');\n\n        expect(label).toHaveClass('md-required');\n      });\n\n      it('should correctly update the input containers label when asterisk is disabled', function() {\n        var el = setupSelect('ng-required=\"isRequired\" md-no-asterisk ng-model=\"someModel\"');\n        var label = el.find('label');\n\n        expect(label).not.toHaveClass('md-required');\n\n        $rootScope.$apply('isRequired = true');\n\n        expect(label).not.toHaveClass('md-required');\n      });\n\n      it('correctly adds the .md-no-asterisk class if the attribute is empty', function() {\n        var el = setupSelect('ng-required=\"isRequired\" md-no-asterisk ng-model=\"someModel\"');\n        var select = el.find('md-select');\n\n        expect(select).toHaveClass('md-no-asterisk');\n      });\n\n      it('correctly adds the .md-no-asterisk class if the attribute is true', function() {\n        var el = setupSelect('ng-required=\"isRequired\" md-no-asterisk ng-model=\"someModel\"');\n        var select = el.find('md-select');\n\n        expect(select).toHaveClass('md-no-asterisk');\n      });\n\n      it('correctly removes the .md-no-asterisk class if the attribute is false', function() {\n        var el = setupSelect('ng-required=\"isRequired\" md-no-asterisk=\"false\" ng-model=\"someModel\"');\n        var select = el.find('md-select');\n\n        expect(select).not.toHaveClass('md-no-asterisk');\n      });\n    });\n\n    describe('view->model', function() {\n\n      it('should deselect a selected option on click', function() {\n        $rootScope.model = [1];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toEqual([1]);\n        openSelect(el);\n        clickOption(el, 0);\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([]);\n      });\n\n      it('selects a deselected option on click', function() {\n        $rootScope.model = [1];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"', [1,2]);\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toEqual([1]);\n\n        openSelect(el);\n\n        clickOption(el, 1);\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect($rootScope.model).toEqual([1,2]);\n      });\n\n      it('should keep model value if a selected option is removed', function() {\n        $rootScope.model = [1];\n        $rootScope.values = [1,2];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"',\n            '<md-option ng-repeat=\"v in values\" ng-value=\"v\">{{v}}</md-option>');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toEqual([1]);\n\n        $rootScope.$apply('values.shift()');\n\n        expect(selectedOptions(el).length).toBe(0);\n        expect($rootScope.model).toEqual([1]);\n      });\n\n      it('should select an option that was just added matching the modelValue', function() {\n        $rootScope.model = [1,3];\n        $rootScope.values = [1,2];\n        var el = setupSelectMultiple('ng-model=\"$root.model\"',\n            '<md-option ng-repeat=\"v in values\" ng-value=\"v\">{{v}}</md-option>');\n\n        expect(selectedOptions(el).length).toBe(1);\n        expect($rootScope.model).toEqual([1,3]);\n\n        $rootScope.$apply('values.push(3)');\n\n        expect(selectedOptions(el).length).toBe(2);\n        expect(el.find('md-option').eq(0).attr('selected')).toBe('selected');\n        expect(el.find('md-option').eq(2).attr('selected')).toBe('selected');\n        expect($rootScope.model).toEqual([1,3]);\n      });\n\n      it('should be multiple if attr.multiple exists', function() {\n        var el = setupSelect('multiple ng-model=\"$root.model\"').find('md-select');\n        openSelect(el);\n        expectSelectOpen(el);\n\n        var selectMenu = $document.find('md-select-menu')[0];\n\n        expect(selectMenu.hasAttribute('multiple')).toBe(true);\n      });\n\n      it('should not be multiple if attr.multiple does not exist', function() {\n        var el = setupSelect('ng-model=\"$root.model\"').find('md-select');\n        openSelect(el);\n        expectSelectOpen(el);\n\n        var selectMenu = $document.find('md-select-menu')[0];\n\n        expect(selectMenu.hasAttribute('multiple')).toBe(false);\n      });\n\n      it('should set the element dirty when selected options changes', function () {\n        $rootScope.model = 2;\n        $rootScope.opts = [1, 2, 3, 4];\n        var form = $compile('<form name=\"testForm\">' +\n          '<md-select multiple ng-model=\"model\" name=\"multiSelect\">' +\n            '<md-option ng-repeat=\"opt in opts\" ng-value=\"opt\">{{opt}}</md-option>' +\n          '</md-select></form>')($rootScope);\n        var el = form.find('md-select');\n\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect($rootScope.testForm.multiSelect.$pristine).toBe(true);\n        expect($rootScope.testForm.multiSelect.$dirty).toBe(false);\n\n        openSelect(el);\n        clickOption(el, 0);\n\n        expect($rootScope.testForm.multiSelect.$pristine).toBe(false);\n        expect($rootScope.testForm.multiSelect.$dirty).toBe(true);\n      });\n    });\n  });\n\n  describe('aria', function() {\n    var el;\n    beforeEach(function() {\n      el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n      var selectMenus = $document.find('md-select-menu');\n      selectMenus.remove();\n    });\n\n    it('adds an aria-label from placeholder', function() {\n      var select = setupSelect('ng-model=\"someVal\" placeholder=\"Hello world\"', null, true).find('md-select');\n      expect(select.attr('aria-label')).toBe('Hello world');\n    });\n\n    it('preserves aria-label on value change', function() {\n      var select = $compile('<md-input-container>' +\n                              '<label>Pick</label>' +\n                              '<md-select ng-model=\"val\">' +\n                                '<md-option value=\"1\">One</md-option>' +\n                                '<md-option value=\"2\">Two</md-option>' +\n                                '<md-option value=\"3\">Three</md-option>' +\n                              '</md-select>' +\n                            '</md-input-container>')($rootScope).find('md-select');\n      $rootScope.$apply('model = 1');\n      $rootScope.$digest();\n\n      expect(select.attr('aria-label')).toBe('Pick');\n    });\n\n    it('preserves existing aria-label', function() {\n      var select = setupSelect('ng-model=\"someVal\" aria-label=\"Hello world\" placeholder=\"Pick\"').find('md-select');\n      expect(select.attr('aria-label')).toBe('Hello world');\n    });\n\n    it('should expect an aria-label if none is present', inject(function($log) {\n      spyOn($log, 'warn');\n      setupSelect('ng-model=\"someVal\"', null, true).find('md-select');\n      $rootScope.$apply();\n      expect($log.warn).toHaveBeenCalled();\n\n      $log.warn.calls.reset();\n      setupSelect('ng-model=\"someVal\", aria-label=\"Hello world\"').find('md-select');\n      $rootScope.$apply();\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('does not overwrite user provided aria-labelledby', function() {\n      var select = setupSelect('ng-model=\"someVal\" placeholder=\"Hello world\" aria-labelledby=\"label\"',\n        null, true).find('md-select');\n      expect(select.attr('aria-labelledby')).toBe('label');\n    });\n\n    it('sets up the aria-expanded attribute', function() {\n      expect(el.attr('aria-expanded')).toBe(undefined);\n      openSelect(el);\n      expect(el.attr('aria-expanded')).toBe('true');\n\n      closeSelect(el);\n      $material.flushInterimElement();\n\n      expect(el.attr('aria-expanded')).toBe(undefined);\n    });\n\n    it('sets up the aria-multiselectable attribute', function() {\n      $rootScope.model = [1, 3];\n      var el = setupSelectMultiple('ng-model=\"$root.model\"', [1, 2, 3]).find('md-select');\n      var listbox = el.find('md-content');\n\n      expect(listbox.attr('aria-multiselectable')).toBe('true');\n    });\n\n    it('sets up the aria-selected attribute', function() {\n      var el = setupSelect('ng-model=\"$root.model\"', [1, 2, 3]);\n      var options = el.find('md-option');\n      openSelect(el);\n      expect(options.eq(2).attr('aria-selected')).toBe(undefined);\n      clickOption(el, 2);\n      expect(options.eq(2).attr('aria-selected')).toBe('true');\n    });\n\n    it('applies label element\\'s text to optgroup\\'s aria-label', function() {\n      $rootScope.val = [1];\n      var select = $compile(\n        '<md-input-container>' +\n        '  <label>Label</label>' +\n        '  <md-select ng-model=\"val\" placeholder=\"Hello World\">' +\n        '    <md-optgroup>' +\n        '      <label>stuff</label>' +\n        '      <md-option value=\"1\">One</md-option>' +\n        '      <md-option value=\"2\">Two</md-option>' +\n        '      <md-option value=\"3\">Three</md-option>' +\n        '    </md-optgroup>' +\n        '  </md-select>' +\n        '</md-input-container>')($rootScope);\n\n      var optgroups = select.find('md-optgroup');\n      expect(optgroups[0].getAttribute('aria-label')).toBe('stuff');\n    });\n\n    it('applies optgroup\\'s label as aria-label', function() {\n      $rootScope.val = [1];\n      var select = $compile(\n        '<md-input-container>' +\n        '  <label>Label</label>' +\n        '  <md-select ng-model=\"val\" placeholder=\"Hello World\">' +\n        '    <md-optgroup label=\"stuff\">' +\n        '      <md-option value=\"1\">One</md-option>' +\n        '      <md-option value=\"2\">Two</md-option>' +\n        '      <md-option value=\"3\">Three</md-option>' +\n        '    </md-optgroup>' +\n        '  </md-select>' +\n        '</md-input-container>')($rootScope);\n\n      var optgroups = select.find('md-optgroup');\n      expect(optgroups[0].getAttribute('aria-label')).toBe('stuff');\n    });\n\n    it('applies setsize and posinset when optgroups are used', function() {\n      $rootScope.val = [1];\n      var select = $compile(\n        '<md-input-container>' +\n        '  <label>Label</label>' +\n        '  <md-select ng-model=\"val\" placeholder=\"Hello World\">' +\n        '    <md-optgroup label=\"stuff\">' +\n        '      <md-option value=\"1\">One</md-option>' +\n        '      <md-option value=\"2\">Two</md-option>' +\n        '      <md-option value=\"3\">Three</md-option>' +\n        '    </md-optgroup>' +\n        '  </md-select>' +\n        '</md-input-container>')($rootScope);\n      $rootScope.$digest();\n\n      var options = select.find('md-option');\n      expect(options[0].getAttribute('aria-setsize')).toBe('3');\n      expect(options[0].getAttribute('aria-posinset')).toBe('1');\n    });\n\n    it('applies setsize and posinset when optgroups are used with multiple', function() {\n      $rootScope.val = [1];\n      var select = $compile(\n        '<md-input-container>' +\n        '  <label>Label</label>' +\n        '  <md-select multiple ng-model=\"val\" placeholder=\"Hello World\">' +\n        '    <md-optgroup label=\"stuff\">' +\n        '      <md-option value=\"1\">One</md-option>' +\n        '      <md-option value=\"2\">Two</md-option>' +\n        '      <md-option value=\"3\">Three</md-option>' +\n        '    </md-optgroup>' +\n        '  </md-select>' +\n        '</md-input-container>')($rootScope);\n      $rootScope.$digest();\n\n      var options = select.find('md-option');\n      expect(options[0].getAttribute('aria-setsize')).toBe('3');\n      expect(options[0].getAttribute('aria-posinset')).toBe('1');\n    });\n\n    it('does not apply setsize and posinset when optgroups are not used', function() {\n      var select = setupSelect('ng-model=\"$root.model\"', [1, 2, 3]);\n      $rootScope.$digest();\n\n      var options = select.find('md-option');\n      expect(options[0].getAttribute('aria-setsize')).toBe(null);\n      expect(options[0].getAttribute('aria-posinset')).toBe(null);\n    });\n  });\n\n  describe('keyboard controls', function() {\n\n    afterEach(function() {\n      var selectMenus = $document.find('md-select-menu');\n      selectMenus.remove();\n    });\n\n    describe('md-select', function() {\n      it('can be opened with a space key', function() {\n        var el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n        pressKeyByCode(el, 32);\n        $material.flushInterimElement();\n        expectSelectOpen(el);\n      });\n\n      it('can be opened with an enter key', function() {\n        var el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n        pressKeyByCode(el, 13);\n        $material.flushInterimElement();\n        expectSelectOpen(el);\n      });\n\n      it('can be opened with the up key', function() {\n        var el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n        pressKeyByCode(el, 38);\n        $material.flushInterimElement();\n        expectSelectOpen(el);\n      });\n\n      it('can be opened with the down key', function() {\n        var el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n        pressKeyByCode(el, 40);\n        $material.flushInterimElement();\n        expectSelectOpen(el);\n      });\n\n      it('supports typing an option name', function() {\n        var el = setupSelect('ng-model=\"someModel\"', [1, 2, 3]).find('md-select');\n        pressKey(el, '2');\n        expect($rootScope.someModel).toBe(2);\n      });\n\n      it('supports typing non-english option names', inject(function($document, $rootScope) {\n        var words = ['algebra', 'álgebra'];\n        var el = setupSelect('ng-model=\"someModel\"', words).find('md-select');\n\n        pressKey(el, words[1][0]);\n        expect($rootScope.someModel).toBe(words[1]);\n      }));\n\n      it('supports typing unicode option names', inject(function($document, $rootScope) {\n        var words = ['algebra', '太阳'];\n        var el = setupSelect('ng-model=\"someModel\"', words).find('md-select');\n\n        pressKey(el, words[1][0]);\n        expect($rootScope.someModel).toBe(words[1]);\n      }));\n\n      it('supports typing dots and commas', inject(function($document, $rootScope) {\n        var words = ['a.b.c', 'a.b,d', 'a.b,c'];\n        var el = setupSelect('ng-model=\"someModel\"', words).find('md-select');\n\n        pressKey(el, 'a');\n        pressKey(el, '.');\n        pressKey(el, 'b');\n        pressKey(el, ',');\n        pressKey(el, 'c');\n        expect($rootScope.someModel).toBe(words[2]);\n      }));\n\n      // Note, this test is designed to check the shouldHandleKey() method which is the default\n      // method if the keypress doesn't match one of the KNOWN keys such as up/down/enter/escape/etc.\n      it('does not swallow useful keys (fn, arrow, etc)', function() {\n        var keyCodes = [17, 92, 113]; // ctrl, comma (`,`), and F3\n        var customEvent = {\n          type: 'keydown',\n          preventDefault: jasmine.createSpy('preventDefault')\n        };\n\n        var words = ['algebra', 'math', 'science'];\n        var el = setupSelect('ng-model=\"someModel\"', words).find('md-select');\n\n        keyCodes.forEach(function(code) {\n          customEvent.keyCode = code;\n          pressKeyByCode(el, null, customEvent);\n          expect(customEvent.preventDefault).not.toHaveBeenCalled();\n        });\n      });\n\n      it('does not swallow modifier keys', function() {\n        var customEvent = {\n          type: 'keydown',\n          preventDefault: jasmine.createSpy('preventDefault')\n        };\n\n        var words = ['algebra', 'math', 'science'];\n        var el = setupSelect('ng-model=\"someModel\"', words).find('md-select');\n\n        customEvent.keyCode = 70;\n        customEvent.ctrlKey = true;\n        pressKeyByCode(el, null, customEvent);\n        expect(customEvent.preventDefault).not.toHaveBeenCalled();\n\n        customEvent.keyCode = 82;\n        customEvent.ctrlKey = false;\n        customEvent.metaKey = true;\n        pressKeyByCode(el, null, customEvent);\n        expect(customEvent.preventDefault).not.toHaveBeenCalled();\n      });\n\n      it('disallows selection of disabled options', function() {\n        var optsTemplate =\n          '<md-option value=\"1\">1</md-option>' +\n          '<md-option value=\"2\" ng-disabled=\"true\">2</md-option>';\n        var el = setupSelect('ng-model=\"someModel\"', optsTemplate).find('md-select');\n\n        pressKeyByCode(el, 50);\n        expect($rootScope.someModel).toBe(undefined);\n      });\n    });\n\n    describe('md-select-menu', function() {\n      it('can be closed with escape', function() {\n        var el = setupSelect('ng-model=\"someVal\"', [1, 2, 3]).find('md-select');\n        openSelect(el);\n        expectSelectOpen(el);\n        var selectMenu = $document.find('md-select-menu');\n        expect(selectMenu.length).toBe(1);\n        pressKeyByCode(selectMenu, 27);\n        $material.flushInterimElement();\n        expectSelectClosed(el);\n      });\n    });\n  });\n\n  // Only test with custom components on AngularJS 1.5+\n  if (angular.version.major === 1 && angular.version.minor >= 5) {\n    describe('with custom components', function() {\n      it('should re-validate when the required value changes within $applyAsync', function() {\n        var nodes = $compile('<form name=\"testForm\">' +\n          ' <required-form-field-component></required-form-field-component>' +\n          '</form>')($rootScope);\n        var ctrl = nodes.find('required-form-field-component')\n                        .controller('requiredFormFieldComponent');\n\n        $rootScope.$digest();\n        $timeout.flush();\n\n        expect(ctrl.value).toBe('test');\n        expect($rootScope.testForm.value.$error.required).toBeUndefined();\n      });\n    });\n  }\n\n  function setupSelect(attrs, options, skipLabel, scope, optCompileOpts, ngSelectedExpression) {\n    var el;\n    var template = '' +\n      '<md-input-container>' +\n        (skipLabel ? '' : '<label>Label</label>') +\n        '<md-select ' + (attrs || '') + '>' +\n          optTemplate(options, optCompileOpts, ngSelectedExpression) +\n        '</md-select>' +\n      '</md-input-container>';\n\n    el = $compile(template)(scope || $rootScope);\n    $rootScope.$digest();\n    $timeout.flush();\n    attachedElements.push(el);\n\n    return el;\n  }\n\n  function setupSelectMultiple(attrs, options, skipLabel, scope) {\n    attrs = (attrs || '') + ' multiple';\n    var toReturn = setupSelect(attrs, options, skipLabel, scope);\n    $timeout.flush();\n    return toReturn;\n  }\n\n  /**\n   * @param {any[]=} options Array of option values to create md-options from\n   * @param {object=} compileOpts\n   * @param {object=} ngSelectedExpression If defined, sets the expression used by ng-selected.\n   * @return {string} template containing the generated md-options\n   */\n  function optTemplate(options, compileOpts, ngSelectedExpression) {\n    var optionsTpl = '';\n    var ngSelectedTemplate = ngSelectedExpression ? ' ng-selected=\"' + ngSelectedExpression + '\"' : '';\n\n    if (angular.isArray(options)) {\n      $rootScope.$$values = options;\n      var renderValueAs = compileOpts ? compileOpts.renderValueAs || 'value' : 'value';\n      optionsTpl = '<md-option ng-repeat=\"value in $$values\" ng-value=\"value\"' + ngSelectedTemplate + '>' +\n        '<div class=\"md-text\">{{' + renderValueAs + '}}</div></md-option>';\n    } else if (angular.isString(options)) {\n      optionsTpl = options;\n    }\n\n    return optionsTpl;\n  }\n\n  function selectedOptions(el) {\n    var querySelector = 'md-option[selected]';\n    var res = angular.element($document[0].querySelectorAll(querySelector));\n\n    if (!res.length) {\n      res = angular.element(el[0].querySelectorAll(querySelector));\n    }\n\n    return res;\n  }\n\n  function openSelect(el) {\n    if (el[0].nodeName !== 'MD-SELECT') {\n      el = el.find('md-select');\n    }\n    try {\n      el.triggerHandler('click');\n      $material.flushInterimElement();\n      el.triggerHandler('blur');\n    } catch (e) {\n      // ignore error\n    }\n  }\n\n  function closeSelect() {\n    var backdrop = $document.find('md-backdrop');\n    if (!backdrop.length) throw Error('Attempted to close select with no backdrop present');\n    $document.find('md-backdrop').triggerHandler('click');\n    $material.flushInterimElement();\n  }\n\n\n  function pressKeyByCode(el, code, customEvent) {\n    var event = customEvent || {\n      type: 'keydown',\n      keyCode: code\n    };\n\n    el.triggerHandler(event);\n  }\n\n  function pressKey(el, key, customEvent) {\n    var event = customEvent || {\n      type: 'keydown',\n      key: key\n    };\n\n    el.triggerHandler(event);\n  }\n\n  function clickOption(select, index) {\n    expectSelectOpen(select);\n\n    var openMenu = $document.find('md-select-menu');\n    var opt = openMenu.find('md-option')[index].querySelector('div');\n\n    if (!opt) throw Error('Could not find option at index: ' + index);\n\n    angular.element(openMenu).triggerHandler({\n      type: 'click',\n      target: angular.element(opt),\n      currentTarget: openMenu[0]\n    });\n  }\n\n  function expectSelectClosed() {\n    var menu = angular.element($document[0].querySelector('.md-select-menu-container'));\n\n    if (menu.length) {\n      if (menu.hasClass('md-active') || menu.attr('aria-hidden') === 'false') {\n        throw Error('Expected select to be closed');\n      }\n    }\n  }\n\n  function expectSelectOpen() {\n    var menu = angular.element($document[0].querySelector('.md-select-menu-container'));\n\n    if (!(menu.hasClass('md-active') && menu.attr('aria-hidden') === 'false')) {\n      throw Error('Expected select to be open');\n    }\n  }\n\n});\n\ndescribe('<md-select> without ngSanitize loaded', function() {\n  var $compile, pageScope;\n\n  beforeEach(module('material.components.select', 'material.components.input'));\n\n  beforeEach(inject(function($injector) {\n    $compile = $injector.get('$compile');\n    pageScope = $injector.get('$rootScope').$new();\n  }));\n\n  it('should throw an error when using md-selected-html without ngSanitize', function() {\n    var template =\n      '<md-select md-selected-html=\"myHtml\" ng-model=\"selectedValue\">' +\n        '<md-option>One</md-option>' +\n      '</md-select>';\n\n    var select = $compile(template)(pageScope);\n\n    expect(function() {\n      pageScope.myHtml = '<p>Barnacle Pete</p>';\n      pageScope.$apply();\n    }).toThrowError(/\\$sce:unsafe/);\n  });\n\n\n  it('should throw an error if using md-selected-text and md-selected-html', function() {\n    var template =\n      '<md-select md-selected-text=\"myText\" md-selected-html=\"myHtml\" ng-model=\"selectedValue\">' +\n        '<md-option>One</md-option>' +\n      '</md-select>';\n\n    var select = $compile(template)(pageScope);\n\n    expect(function() {\n      pageScope.$apply();\n    }).toThrowError('md-select cannot have both `md-selected-text` and `md-selected-html`');\n  });\n});\n"
  },
  {
    "path": "src/components/showHide/showHide.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.showHide\n */\n\n// Add additional handlers to ng-show and ng-hide that notify directives\n// contained within that they should recompute their size.\n// These run in addition to AngularJS's built-in ng-hide and ng-show directives.\nangular.module('material.components.showHide', [\n  'material.core'\n])\n  .directive('ngShow', createDirective('ngShow', true))\n  .directive('ngHide', createDirective('ngHide', false));\n\n\nfunction createDirective(name, targetValue) {\n  return ['$mdUtil', '$window', function($mdUtil, $window) {\n    return {\n      restrict: 'A',\n      multiElement: true,\n      link: function($scope, $element, $attr) {\n        var unregister = $scope.$on('$md-resize-enable', function() {\n          unregister();\n\n          var node = $element[0];\n          var cachedTransitionStyles = node.nodeType === $window.Node.ELEMENT_NODE ?\n            $window.getComputedStyle(node) : {};\n\n          $scope.$watch($attr[name], function(value) {\n            if (!!value === targetValue) {\n              $mdUtil.nextTick(function() {\n                $scope.$broadcast('$md-resize');\n              });\n\n              var opts = {\n                cachedTransitionStyles: cachedTransitionStyles\n              };\n\n              $mdUtil.dom.animator.waitTransitionEnd($element, opts).then(function() {\n                $scope.$broadcast('$md-resize');\n              });\n            }\n          });\n        });\n      }\n    };\n  }];\n}\n"
  },
  {
    "path": "src/components/showHide/showHide.spec.js",
    "content": "describe('showHide', function() {\n  var $compile, $timeout, defered, scope, spy;\n\n  beforeEach(module('material.components.showHide'));\n\n  beforeEach(inject(function(_$compile_, $mdUtil, $q, $rootScope, _$timeout_) {\n    $compile = _$compile_;\n    $timeout = _$timeout_;\n    defered = $q.defer();\n    scope = $rootScope.$new();\n    spy = jasmine.createSpy();\n\n    scope.$on('$md-resize', spy);\n    spyOn($mdUtil.dom.animator, 'waitTransitionEnd').and.returnValue(defered.promise);\n  }));\n\n  afterEach(function() {\n    scope.$destroy();\n  });\n\n  describe('ng-hide', function() {\n    it('should notify when the node unhides', function() {\n      scope.hide = true;\n      var element = $compile('<div ng-hide=\"hide\"></div>')(scope);\n      scope.$broadcast('$md-resize-enable');\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n\n      // Expect a $broadcast when showing.\n      scope.hide = false;\n      scope.$apply();\n      $timeout.flush();\n      expect(spy).toHaveBeenCalled();\n\n      // Expect a $broadcast on transitionEnd after showing.\n      spy.calls.reset();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should not notify on hide', function() {\n      scope.hide = true;\n      var element = $compile('<div ng-hide=\"hide\"></div>')(scope);\n      scope.$broadcast('$md-resize-enable');\n      scope.$apply();\n\n      // Expect no $broadcasts when hiding.\n      expect(spy).not.toHaveBeenCalled();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n    });\n\n    it('should not notify when not activated', function() {\n      scope.hide = true;\n      var element = $compile('<div ng-hide=\"hide\"></div>')(scope);\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n\n      scope.hide = false;\n      scope.$apply();\n      $timeout.flush();\n      expect(spy).not.toHaveBeenCalled();\n\n      spy.calls.reset();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n    });\n  });\n\n  describe('ng-show', function() {\n    it('should notify when the node unhides', function() {\n      scope.show = false;\n      var element = $compile('<div ng-show=\"show\"></div>')(scope);\n      scope.$broadcast('$md-resize-enable');\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n\n      // Expect a $broadcast when showing.\n      scope.show = true;\n      scope.$apply();\n      $timeout.flush();\n      expect(spy).toHaveBeenCalled();\n\n      // Expect a $broadcast on transitionEnd after showing.\n      spy.calls.reset();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).toHaveBeenCalled();\n    });\n\n    it('should not notify on hide', function() {\n      scope.show = false;\n      var element = $compile('<div ng-show=\"show\"></div>')(scope);\n      scope.$broadcast('$md-resize-enable');\n      scope.$apply();\n\n      // Expect no $broadcasts when hiding.\n      expect(spy).not.toHaveBeenCalled();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n    });\n\n    it('should not notify when not activated', function() {\n      scope.show = false;\n      var element = $compile('<div ng-show=\"show\"></div>')(scope);\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n\n      scope.show = true;\n      scope.$apply();\n      $timeout.flush();\n      expect(spy).not.toHaveBeenCalled();\n\n      spy.calls.reset();\n      defered.resolve();\n      scope.$apply();\n      expect(spy).not.toHaveBeenCalled();\n    });\n  });\n});\n\ndescribe('showHide directive on a transcluded element', function() {\n  var $compile, scope;\n\n  beforeEach(function() {\n    module('material.components.showHide', function($compileProvider) {\n      // Declare a directive that will convert the element to a comment node.\n      $compileProvider.directive('convertToCommentNode', function(){\n        return { transclude: 'element' };\n      });\n    });\n\n    inject(function(_$compile_, $rootScope) {\n      $compile = _$compile_;\n      scope = $rootScope.$new();\n    });\n  });\n\n  it('does not try to get the computed style of a comment node', function() {\n    expect(function() {\n      $compile('<div ng-show convert-to-comment-node></div>')(scope);\n      scope.$broadcast('$md-resize-enable');\n      scope.$apply();\n    }).not.toThrowError(/getComputedStyle/);\n  });\n\n  afterEach(function() {\n    scope.$destroy();\n  });\n});\n"
  },
  {
    "path": "src/components/sidenav/demoBasicUsage/index.html",
    "content": "\n<div ng-controller=\"AppCtrl\" layout=\"column\" style=\"height:500px;\" ng-cloak>\n\n  <section layout=\"row\" flex>\n\n    <md-sidenav\n        class=\"md-sidenav-left\"\n        md-component-id=\"left\"\n        md-is-locked-open=\"$mdMedia('gt-md')\"\n        md-whiteframe=\"4\">\n\n      <md-toolbar class=\"md-theme-indigo\">\n        <h1 class=\"md-toolbar-tools\">Sidenav Left</h1>\n      </md-toolbar>\n      <md-content layout-padding ng-controller=\"LeftCtrl\">\n        <md-button ng-click=\"close()\" class=\"md-primary\" hide-gt-md>\n          Close Sidenav Left\n        </md-button>\n        <p hide show-gt-md>\n          This sidenav is locked open on your device. To go back to the default behavior,\n          narrow your display.\n        </p>\n      </md-content>\n\n    </md-sidenav>\n\n    <md-content flex layout-padding>\n\n      <div layout=\"column\" layout-align=\"top center\">\n        <p>\n        The left sidenav will 'lock open' on a medium (>=960px wide) device.\n        </p>\n        <p>\n        The right sidenav will focus on a specific child element.\n        </p>\n\n        <div>\n          <md-button ng-click=\"toggleLeft()\"\n            class=\"md-primary\" hide-gt-md>\n            Toggle left\n          </md-button>\n        </div>\n\n        <div>\n          <md-button ng-click=\"toggleRight()\"\n            ng-hide=\"isOpenRight()\"\n            class=\"md-primary\">\n            Toggle right\n          </md-button>\n        </div>\n      </div>\n\n      <div flex></div>\n\n    </md-content>\n\n    <md-sidenav class=\"md-sidenav-right md-whiteframe-4dp\" md-component-id=\"right\">\n\n      <md-toolbar class=\"md-theme-light\">\n        <h1 class=\"md-toolbar-tools\">Sidenav Right</h1>\n      </md-toolbar>\n      <md-content ng-controller=\"RightCtrl\" layout-padding>\n        <form>\n          <md-input-container>\n            <label for=\"testInput\">Test input</label>\n            <input type=\"text\" id=\"testInput\"\n                   ng-model=\"data\" md-autofocus>\n          </md-input-container>\n        </form>\n        <md-button ng-click=\"close()\" class=\"md-primary\">\n          Close Sidenav Right\n        </md-button>\n      </md-content>\n\n    </md-sidenav>\n\n  </section>\n\n</div>\n"
  },
  {
    "path": "src/components/sidenav/demoBasicUsage/script.js",
    "content": "angular\n  .module('basicUsageSidenavDemo', ['ngMaterial'])\n  .controller('AppCtrl', function ($scope, $timeout, $mdSidenav, $log) {\n    $scope.toggleLeft = buildDelayedToggler('left');\n    $scope.toggleRight = buildToggler('right');\n    $scope.isOpenRight = function(){\n      return $mdSidenav('right').isOpen();\n    };\n\n    /**\n     * Supplies a function that will continue to operate until the\n     * time is up.\n     */\n    function debounce(func, wait, context) {\n      var timer;\n\n      return function debounced() {\n        var context = $scope,\n            args = Array.prototype.slice.call(arguments);\n        $timeout.cancel(timer);\n        timer = $timeout(function() {\n          timer = undefined;\n          func.apply(context, args);\n        }, wait || 10);\n      };\n    }\n\n    /**\n     * Build handler to open/close a SideNav; when animation finishes\n     * report completion in console\n     */\n    function buildDelayedToggler(navID) {\n      return debounce(function() {\n        // Component lookup should always be available since we are not using `ng-if`\n        $mdSidenav(navID)\n          .toggle()\n          .then(function () {\n            $log.debug(\"toggle \" + navID + \" is done\");\n          });\n      }, 200);\n    }\n\n    function buildToggler(navID) {\n      return function() {\n        // Component lookup should always be available since we are not using `ng-if`\n        $mdSidenav(navID)\n          .toggle()\n          .then(function () {\n            $log.debug(\"toggle \" + navID + \" is done\");\n          });\n      };\n    }\n  })\n  .controller('LeftCtrl', function ($scope, $timeout, $mdSidenav, $log) {\n    $scope.close = function () {\n      // Component lookup should always be available since we are not using `ng-if`\n      $mdSidenav('left').close()\n        .then(function () {\n          $log.debug(\"close LEFT is done\");\n        });\n\n    };\n  })\n  .controller('RightCtrl', function ($scope, $timeout, $mdSidenav, $log) {\n    $scope.close = function () {\n      // Component lookup should always be available since we are not using `ng-if`\n      $mdSidenav('right').close()\n        .then(function () {\n          $log.debug(\"close RIGHT is done\");\n        });\n    };\n  });\n"
  },
  {
    "path": "src/components/sidenav/demoCustomSidenav/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" style=\"height: 500px;\" ng-cloak>\n\n  <section layout=\"row\" flex>\n\n    <md-sidenav class=\"md-sidenav-left\" md-component-id=\"left\"\n                md-disable-backdrop=\"\" md-whiteframe=\"4\">\n\n      <md-toolbar class=\"md-theme-indigo\">\n        <h1 class=\"md-toolbar-tools\">Disabled Backdrop</h1>\n      </md-toolbar>\n\n      <md-content layout-margin=\"\">\n        <p>\n          This sidenav is not showing any backdrop, where users can click on it, to close the sidenav.\n        </p>\n        <md-button ng-click=\"toggleLeft()\" class=\"md-accent\">\n          Close this Sidenav\n        </md-button>\n      </md-content>\n\n    </md-sidenav>\n\n    <md-content flex layout-padding>\n\n      <div layout=\"column\" layout-align=\"top center\">\n        <p>\n          Developers can also disable the backdrop of the sidenav.<br/>\n          This will disable the functionality to click outside to close the sidenav.\n        </p>\n\n        <div>\n          <md-button ng-click=\"toggleLeft()\" class=\"md-raised\">\n            Toggle Sidenav\n          </md-button>\n        </div>\n\n      </div>\n\n    </md-content>\n\n  </section>\n\n</div>\n"
  },
  {
    "path": "src/components/sidenav/demoCustomSidenav/script.js",
    "content": "angular\n  .module('customSidenavDemo', ['ngMaterial'])\n  .controller('AppCtrl', function ($scope, $mdSidenav) {\n    $scope.toggleLeft = buildToggler('left');\n\n    function buildToggler(componentId) {\n      return function() {\n        $mdSidenav(componentId).toggle();\n      };\n    }\n  });\n"
  },
  {
    "path": "src/components/sidenav/demoDisableCloseEvents/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" style=\"height: 500px;\" ng-cloak>\n\n    <section layout=\"row\" flex>\n  \n      <md-sidenav class=\"md-sidenav-left\" md-component-id=\"closeEventsDisabled\"\n                  md-whiteframe=\"4\" md-disable-close-events>\n  \n        <md-toolbar class=\"md-theme-indigo\">\n          <h1 class=\"md-toolbar-tools\">Disabled Close Events</h1>\n        </md-toolbar>\n  \n        <md-content layout-margin=\"\">\n          <p>\n            This sidenav is showing the backdrop, but users can't close the\n             sidenav by clicking on the backdrop or pressing the 'Escape' key.\n          </p>\n          <md-button ng-click=\"toggleSidenav()\" class=\"md-accent\">\n            Close this Sidenav\n          </md-button>\n        </md-content>\n  \n      </md-sidenav>\n  \n      <md-content flex layout-padding>\n  \n        <div layout=\"column\" layout-align=\"top center\">\n          <p>\n            Developers can disable closing the sidenav on backdrop clicks and\n             'Escape' key events.<br/>\n          </p>\n  \n          <div>\n            <md-button ng-click=\"toggleSidenav()\" class=\"md-raised md-primary\">\n              Open Sidenav\n            </md-button>\n          </div>\n  \n        </div>\n  \n      </md-content>\n  \n    </section>\n  \n  </div>\n  "
  },
  {
    "path": "src/components/sidenav/demoDisableCloseEvents/script.js",
    "content": "angular\n  .module('disableCloseEventsSidenavDemo', ['ngMaterial'])\n  .controller('AppCtrl', function ($scope, $mdSidenav) {\n    $scope.toggleSidenav = buildToggler('closeEventsDisabled');\n\n    function buildToggler(componentId) {\n      return function() {\n        $mdSidenav(componentId).toggle();\n      };\n    }\n  });\n"
  },
  {
    "path": "src/components/sidenav/sidenav-theme.scss",
    "content": "md-sidenav.md-THEME_NAME-theme {\n  &, md-content {\n    background-color: '{{background-hue-1}}';    \n  }\n}\n"
  },
  {
    "path": "src/components/sidenav/sidenav.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.sidenav\n *\n * @description\n * A Sidenav component.\n */\nangular\n  .module('material.components.sidenav', [\n    'material.core',\n    'material.components.backdrop'\n  ])\n  .factory('$mdSidenav', SidenavService)\n  .directive('mdSidenav', SidenavDirective)\n  .controller('$mdSidenavController', SidenavController);\n\n\n/**\n * @ngdoc service\n * @name $mdSidenav\n * @module material.components.sidenav\n *\n * @description\n * `$mdSidenav` makes it easy to interact with multiple sidenavs in an app. When looking up a\n * sidenav instance, you can either look it up synchronously or wait for it to be initialized\n * asynchronously. This is done by passing the second argument to `$mdSidenav`.\n *\n * @usage\n * <hljs lang=\"js\">\n * // Async lookup for sidenav instance; will resolve when the instance is available\n * $mdSidenav(componentId, true).then(function(instance) {\n *   $log.debug( componentId + \"is now ready\" );\n * });\n * // Sync lookup for sidenav instance; this will resolve immediately.\n * $mdSidenav(componentId).then(function(instance) {\n *   $log.debug( componentId + \"is now ready\" );\n * });\n * // Async toggle the given sidenav;\n * // when instance is known ready and lazy lookup is not needed.\n * $mdSidenav(componentId)\n *    .toggle()\n *    .then(function(){\n *      $log.debug('toggled');\n *    });\n * // Async open the given sidenav\n * $mdSidenav(componentId)\n *    .open()\n *    .then(function(){\n *      $log.debug('opened');\n *    });\n * // Async close the given sidenav\n * $mdSidenav(componentId)\n *    .close()\n *    .then(function(){\n *      $log.debug('closed');\n *    });\n * // Async lookup for sidenav instance\n * $mdSidenav(componentId, true).then(function(instance) {\n *   // On close callback to handle close, backdrop click, or escape key pressed.\n *   // Callback happens BEFORE the close action occurs.\n *   instance.onClose(function() {\n *     $log.debug('closing');\n *   });\n * });\n * // Sync check to see if the specified sidenav is set to be open\n * $mdSidenav(componentId).isOpen();\n * // Sync check to whether given sidenav is locked open\n * // If this is true, the sidenav will be open regardless of close()\n * $mdSidenav(componentId).isLockedOpen();\n * </hljs>\n */\nfunction SidenavService($mdComponentRegistry, $mdUtil, $q, $log) {\n  var errorMsg = \"SideNav '{0}' is not available! Did you use md-component-id='{0}'?\";\n  var service = {\n    find: findInstance,      //  sync  - returns proxy API\n    waitFor: waitForInstance //  async - returns promise\n  };\n\n  /**\n   * Service API that supports three (3) usages:\n   * $mdSidenav().find(\"left\")               // sync (must already exist) or returns undefined\n   * $mdSidenav(\"left\").toggle();            // sync (must already exist) or returns reject promise;\n   * $mdSidenav(\"left\",true).then(function(left) { // async returns instance when available\n   *  left.toggle();\n   * });\n   */\n  return function(handle, enableWait) {\n    if (angular.isUndefined(handle)) {\n      return service;\n    }\n\n    var shouldWait = enableWait === true;\n    var instance = service.find(handle, shouldWait);\n    return !instance && shouldWait ? service.waitFor(handle) :\n           !instance && angular.isUndefined(enableWait) ? addLegacyAPI(service, handle) : instance;\n  };\n\n  /**\n   * For failed instance/handle lookups, older-clients expect an response object with noops\n   * that include `rejected promise APIs`\n   * @param service\n   * @param handle\n   * @returns {Object}\n   */\n  function addLegacyAPI(service, handle) {\n    var falseFn = function() {\n      return false;\n    };\n    var rejectFn = function() {\n      return $q.when($mdUtil.supplant(errorMsg, [handle || \"\"]));\n    };\n\n    return angular.extend({\n      isLockedOpen: falseFn,\n      isOpen: falseFn,\n      toggle: rejectFn,\n      open: rejectFn,\n      close: rejectFn,\n      onClose: angular.noop,\n      then: function(callback) {\n        return waitForInstance(handle).then(callback || angular.noop);\n      }\n    }, service);\n  }\n\n  /**\n   * Synchronously lookup the controller instance for the specified sidNav instance which has been\n   * registered with the markup `md-component-id`\n   */\n  function findInstance(handle, shouldWait) {\n    var instance = $mdComponentRegistry.get(handle);\n\n    if (!instance && !shouldWait) {\n      // Report missing instance\n      $log.error($mdUtil.supplant(errorMsg, [handle || \"\"]));\n\n      // The component has not registered itself... most like NOT yet created\n      // return null to indicate that the Sidenav is not in the DOM\n      return undefined;\n    }\n    return instance;\n  }\n\n  /**\n   * Asynchronously wait for the component instantiation,\n   * Deferred lookup of component instance using $component registry\n   */\n  function waitForInstance(handle) {\n    return $mdComponentRegistry.when(handle).catch($log.error);\n  }\n}\n\n/**\n * @ngdoc directive\n * @name mdSidenav\n * @module material.components.sidenav\n * @restrict E\n *\n * @description\n * A Sidenav component that can be opened and closed programmatically.\n *\n * By default, upon opening it will slide out on top of the main content area.\n *\n * For keyboard and screen reader accessibility, focus is sent to the sidenav wrapper by default.\n * It can be overridden with the `md-autofocus` directive on the child element you want focused.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div layout=\"row\" ng-controller=\"MyController\">\n *   <md-sidenav md-component-id=\"left\" class=\"md-sidenav-left\">\n *     Left Nav!\n *   </md-sidenav>\n *\n *   <md-content>\n *     Center Content\n *     <md-button ng-click=\"openLeftMenu()\">\n *       Open Left Menu\n *     </md-button>\n *   </md-content>\n *\n *   <md-sidenav md-component-id=\"right\"\n *     md-is-locked-open=\"$mdMedia('min-width: 333px')\"\n *     class=\"md-sidenav-right\">\n *     <form>\n *       <md-input-container>\n *         <label for=\"testInput\">Test input</label>\n *         <input id=\"testInput\" type=\"text\"\n *                ng-model=\"data\" md-autofocus>\n *       </md-input-container>\n *     </form>\n *   </md-sidenav>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"js\">\n * var app = angular.module('myApp', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdSidenav) {\n *   $scope.openLeftMenu = function() {\n *     $mdSidenav('left').toggle();\n *   };\n * });\n * </hljs>\n *\n * @param {expression=} md-is-open A model bound to whether the sidenav is opened.\n * @param {boolean=} md-disable-backdrop When present in the markup, the sidenav will not show a\n *  backdrop.\n * @param {boolean=} md-disable-close-events When present in the markup, clicking the backdrop or\n *  pressing the 'Escape' key will not close the sidenav.\n * @param {string=} md-component-id componentId to use with $mdSidenav service.\n * @param {expression=} md-is-locked-open When this expression evaluates to true,\n * the sidenav \"locks open\": it falls into the content's flow instead of appearing over it. This\n * overrides the `md-is-open` attribute.\n *\n * The `$mdMedia()` service is exposed to the `md-is-locked-open` attribute, which\n * can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets.\n * <br><br>Examples:\n *\n *   Lock open when `true`:<br>\n *   `<md-sidenav md-is-locked-open=\"shouldLockOpen\"></md-sidenav>`\n *\n *   Lock open when the width is `1000px` or greater:<br>\n *   `<md-sidenav md-is-locked-open=\"$mdMedia('min-width: 1000px')\"></md-sidenav>`\n *\n *   Lock open on small screens:<br>\n *   `<md-sidenav md-is-locked-open=\"$mdMedia('sm')\"></md-sidenav>`\n *\n * @param {string=} md-disable-scroll-target Selector, pointing to an element, whose scrolling will\n * be disabled when the sidenav is opened. By default this is the sidenav's direct parent.\n */\nfunction SidenavDirective($mdMedia, $mdUtil, $mdConstant, $mdTheming, $mdInteraction, $animate,\n                          $compile, $parse, $log, $q, $document, $window, $$rAF) {\n  return {\n    restrict: 'E',\n    scope: {\n      isOpen: '=?mdIsOpen'\n    },\n    controller: '$mdSidenavController',\n    compile: function(element) {\n      element.addClass('md-closed').attr('tabIndex', '-1');\n      return postLink;\n    }\n  };\n\n  /**\n   * Directive Post Link function...\n   */\n  function postLink(scope, element, attr, sidenavCtrl) {\n    var lastParentOverFlow;\n    var backdrop;\n    var disableScrollTarget = null;\n    var disableCloseEvents;\n    var triggeringInteractionType;\n    var triggeringElement = null;\n    var previousContainerStyles;\n    var promise = $q.when(true);\n    var isLockedOpenParsed = $parse(attr.mdIsLockedOpen);\n    var ngWindow = angular.element($window);\n    var isLocked = function() {\n      return isLockedOpenParsed(scope.$parent, {\n        $mdMedia: $mdMedia\n      });\n    };\n\n    if (attr.mdDisableScrollTarget) {\n      disableScrollTarget = $document[0].querySelector(attr.mdDisableScrollTarget);\n\n      if (disableScrollTarget) {\n        disableScrollTarget = angular.element(disableScrollTarget);\n      } else {\n        $log.warn($mdUtil.supplant('mdSidenav: couldn\\'t find element matching ' +\n          'selector \"{selector}\". Falling back to parent.',\n          { selector: attr.mdDisableScrollTarget }));\n      }\n    }\n\n    if (!disableScrollTarget) {\n      disableScrollTarget = element.parent();\n    }\n\n    // Only create the backdrop if the backdrop isn't disabled.\n    if (!attr.hasOwnProperty('mdDisableBackdrop')) {\n      backdrop = $mdUtil.createBackdrop(scope, \"md-sidenav-backdrop md-opaque ng-enter\");\n    }\n\n    // If md-disable-close-events is set on the sidenav we will disable\n    // backdrop click and Escape key events\n    if (attr.hasOwnProperty('mdDisableCloseEvents')) {\n      disableCloseEvents = true;\n    }\n\n    element.addClass('_md');     // private md component indicator for styling\n    $mdTheming(element);\n\n    // The backdrop should inherit the sidenavs theme,\n    // because the backdrop will take its parent theme by default.\n    if (backdrop) $mdTheming.inherit(backdrop, element);\n\n    element.on('$destroy', function() {\n      backdrop && backdrop.remove();\n      sidenavCtrl.destroy();\n    });\n\n    scope.$on('$destroy', function(){\n      backdrop && backdrop.remove();\n    });\n\n    scope.$watch(isLocked, updateIsLocked);\n    scope.$watch('isOpen', updateIsOpen);\n\n\n    // Publish special accessor for the Controller instance\n    sidenavCtrl.$toggleOpen = toggleOpen;\n\n    /**\n     * Toggle the DOM classes to indicate `locked`\n     * @param isLocked\n     * @param oldValue\n     */\n    function updateIsLocked(isLocked, oldValue) {\n      scope.isLockedOpen = isLocked;\n      if (isLocked === oldValue) {\n        element.toggleClass('md-locked-open', !!isLocked);\n      } else {\n        $animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open');\n      }\n      if (backdrop) {\n        backdrop.toggleClass('md-locked-open', !!isLocked);\n      }\n    }\n\n    /**\n     * Toggle the SideNav view and attach/detach listeners\n     * @param {boolean} isOpen\n     */\n    function updateIsOpen(isOpen) {\n      var focusEl = $mdUtil.findFocusTarget(element) || element;\n      var parent = element.parent();\n      var restorePositioning;\n\n      // If the user hasn't set the disable close events property we are adding\n      // click and escape events to close the sidenav\n      if (!disableCloseEvents) {\n        parent[isOpen ? 'on' : 'off']('keydown', onKeyDown);\n        if (backdrop) backdrop[isOpen ? 'on' : 'off']('click', close);\n      }\n\n      restorePositioning = updateContainerPositions(parent, isOpen);\n\n      if (isOpen) {\n        // Capture upon opening..\n        triggeringElement = $document[0].activeElement;\n        triggeringInteractionType = $mdInteraction.getLastInteractionType();\n      }\n\n      disableParentScroll(isOpen);\n\n      return promise = $q.all([\n        isOpen && backdrop ? $animate.enter(backdrop, parent) : backdrop ?\n                             $animate.leave(backdrop) : $q.when(true),\n        $animate[isOpen ? 'removeClass' : 'addClass'](element, 'md-closed')\n      ]).then(function() {\n        // Perform focus when animations are ALL done...\n        if (scope.isOpen) {\n          $$rAF(function() {\n            // Notifies child components that the sidenav was opened. Should wait\n            // a frame in order to allow for the element height to be computed.\n            ngWindow.triggerHandler('resize');\n          });\n\n          focusEl && focusEl.focus();\n        }\n\n        // Restores the positioning on the sidenav and backdrop.\n        restorePositioning && restorePositioning();\n      });\n    }\n\n    function updateContainerPositions(parent, willOpen) {\n      var drawerEl = element[0];\n      var scrollTop = parent[0].scrollTop;\n\n      if (willOpen && scrollTop) {\n        previousContainerStyles = {\n          top: drawerEl.style.top,\n          bottom: drawerEl.style.bottom,\n          height: drawerEl.style.height\n        };\n\n        // When the parent is scrolled down, then we want to be able to show the sidenav at the\n        // current scroll position. We're moving the sidenav down to the correct scroll position\n        // and apply the height of the parent, to increase the performance. Using 100% as height,\n        // will impact the performance heavily.\n        var positionStyle = {\n          top: scrollTop + 'px',\n          bottom: 'auto',\n          height: parent[0].clientHeight + 'px'\n        };\n\n        // Apply the new position styles to the sidenav and backdrop.\n        element.css(positionStyle);\n        backdrop.css(positionStyle);\n      }\n\n      // When the sidenav is closing and we have previous defined container styles,\n      // then we return a restore function, which resets the sidenav and backdrop.\n      if (!willOpen && previousContainerStyles) {\n        return function() {\n          drawerEl.style.top = previousContainerStyles.top;\n          drawerEl.style.bottom = previousContainerStyles.bottom;\n          drawerEl.style.height = previousContainerStyles.height;\n\n          backdrop[0].style.top = null;\n          backdrop[0].style.bottom = null;\n          backdrop[0].style.height = null;\n\n          previousContainerStyles = null;\n        };\n      }\n    }\n\n    /**\n     * Prevent parent scrolling (when the SideNav is open)\n     */\n    function disableParentScroll(disabled) {\n      if (disabled && !lastParentOverFlow) {\n        lastParentOverFlow = disableScrollTarget.css('overflow');\n        disableScrollTarget.css('overflow', 'hidden');\n      } else if (angular.isDefined(lastParentOverFlow)) {\n        disableScrollTarget.css('overflow', lastParentOverFlow);\n        lastParentOverFlow = undefined;\n      }\n    }\n\n    /**\n     * Toggle the sideNav view and publish a promise to be resolved when\n     * the view animation finishes.\n     * @param {boolean} isOpen true to open the sidenav, false to close it\n     * @returns {*} promise to be resolved when the view animation finishes\n     */\n    function toggleOpen(isOpen) {\n      if (scope.isOpen === isOpen) {\n        return $q.when(true);\n      } else {\n        if (scope.isOpen && sidenavCtrl.onCloseCb) sidenavCtrl.onCloseCb();\n\n        return $q(function(resolve) {\n          // Toggle value to force an async `updateIsOpen()` to run\n          scope.isOpen = isOpen;\n\n          $mdUtil.nextTick(function() {\n            // When the current `updateIsOpen()` animation finishes\n            promise.then(function(result) {\n\n              if (!scope.isOpen && triggeringElement && triggeringInteractionType === 'keyboard') {\n                // reset focus to originating element (if available) upon close\n                triggeringElement.focus();\n                triggeringElement = null;\n              }\n\n              resolve(result);\n            });\n          });\n        });\n      }\n    }\n\n    /**\n     * Auto-close sideNav when the `escape` key is pressed.\n     * @param {KeyboardEvent} ev keydown event\n     */\n    function onKeyDown(ev) {\n      var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);\n      return isEscape ? close(ev) : $q.when(true);\n    }\n\n    /**\n     * With backdrop `clicks` or `escape` key-press, immediately apply the CSS close transition...\n     * Then notify the controller to close() and perform its own actions.\n     * @param {Event} ev\n     * @returns {*}\n     */\n    function close(ev) {\n      ev.preventDefault();\n\n      return sidenavCtrl.close();\n    }\n  }\n}\n\n/*\n * @private\n * @ngdoc controller\n * @name SidenavController\n * @module material.components.sidenav\n */\nfunction SidenavController($scope, $attrs, $mdComponentRegistry, $q, $interpolate) {\n  var self = this;\n\n  // Use Default internal method until overridden by directive postLink\n\n  // Synchronous getters\n  self.isOpen = function() { return !!$scope.isOpen; };\n  self.isLockedOpen = function() { return !!$scope.isLockedOpen; };\n\n  // Synchronous setters\n  self.onClose = function (callback) {\n    self.onCloseCb = callback;\n    return self;\n  };\n\n  // Async actions\n  self.open   = function() { return self.$toggleOpen(true);  };\n  self.close  = function() { return self.$toggleOpen(false); };\n  self.toggle = function() { return self.$toggleOpen(!$scope.isOpen);  };\n  self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); };\n\n  // Evaluate the component id.\n  var rawId = $attrs.mdComponentId;\n  var hasDataBinding = rawId && rawId.indexOf($interpolate.startSymbol()) > -1;\n  var componentId = hasDataBinding ? $interpolate(rawId)($scope.$parent) : rawId;\n\n  // Register the component.\n  self.destroy = $mdComponentRegistry.register(self, componentId);\n\n  // Watch and update the component, if the id has changed.\n  if (hasDataBinding) {\n    $attrs.$observe('mdComponentId', function(id) {\n      if (id && id !== self.$$mdHandle) {\n        // `destroy` only deregisters the old component id so we can add the new one.\n        self.destroy();\n        self.destroy = $mdComponentRegistry.register(self, id);\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "src/components/sidenav/sidenav.scss",
    "content": "$sidenav-mobile-width: 320px !default;\n$sidenav-desktop-width: 400px !default;\n$sidenav-min-space: 56px !default;\n\nmd-sidenav {\n  box-sizing: border-box;\n  position: absolute;\n  flex-direction: column;\n  z-index: $z-index-sidenav;\n\n  width: $sidenav-mobile-width;\n  max-width: $sidenav-mobile-width;\n  bottom: 0;\n  overflow: auto;\n  -webkit-overflow-scrolling: touch;\n\n  ul {\n    list-style: none;\n  }\n\n  // Animation Comment Syntax: [mdLockedOpen]|[mdClosed]\n  // mdLockedOpen states: unlocked, locked, any\n  // mdClosed states: open, closed, any\n  // Default state: unlocked|open\n\n  // unlocked|closed\n  &.md-closed {\n    display: none;\n  }\n\n  // any|open <=> any|closed\n  &.md-closed-add,\n  &.md-closed-remove {\n    display: flex;\n    transition: 0.2s ease-in all;\n  }\n\n  // any|open <=> any|closed (animating)\n  &.md-closed-add.md-closed-add-active,\n  &.md-closed-remove.md-closed-remove-active {\n    transition: $swift-ease-out;\n  }\n\n  // unlocked|any <=> locked|any\n  &.md-locked-open-add,\n  &.md-locked-open-remove {\n    position: static;\n    display: flex;\n    transform: translate3d(0, 0, 0);\n  }\n\n  // locked|any\n  &.md-locked-open,\n  &.md-locked-open.md-closed,\n  &.md-locked-open.md-closed.md-sidenav-left,\n  &.md-locked-open.md-closed.md-sidenav-right {\n    position: static;\n    display: flex;\n    transform: translate3d(0, 0, 0);\n  }\n\n  // locked|closed => unlock|closed\n  &.md-locked-open-remove.md-closed {\n    position: static;\n    display: flex;\n    transform: translate3d(0, 0, 0);\n  }\n\n  // unlocked|closed => locked|closed\n  &.md-closed.md-locked-open-add {\n    position: static;\n    display: flex;\n    transform: translate3d(0%, 0, 0);\n  }\n\n  // unlocked|closed => locked|closed (pre-animation)\n  &.md-closed.md-locked-open-add:not(.md-locked-open-add-active) {\n    transition: width $swift-ease-in-duration $swift-ease-in-timing-function,\n                min-width $swift-ease-in-duration $swift-ease-in-timing-function;\n    width: 0 !important;\n    min-width: 0 !important;\n  }\n\n  // unlocked|closed => locked|closed (animating)\n  &.md-closed.md-locked-open-add-active {\n    transition: width $swift-ease-in-duration $swift-ease-in-timing-function,\n                min-width $swift-ease-in-duration $swift-ease-in-timing-function;\n  }\n\n  // locked|any => unlocked|any (animating)\n  &.md-locked-open-remove-active {\n    transition: width $swift-ease-in-duration $swift-ease-in-timing-function,\n                min-width $swift-ease-in-duration $swift-ease-in-timing-function;\n    width: 0 !important;\n    min-width: 0 !important;\n  }\n\n  @extend .md-sidenav-left;\n}\n.md-sidenav-backdrop.md-locked-open {\n  display: none;\n}\n\n.md-sidenav-left {\n  left: 0;\n  top: 0;\n  transform: translate3d(0%, 0, 0);\n  &.md-closed {\n    transform: translate3d(-100%, 0, 0);\n  }\n}\n\n.md-sidenav-right {\n  left: 100%;\n  top: 0;\n  transform: translate(-100%, 0);\n  &.md-closed {\n    transform: translate(0%, 0);\n  }\n}\n\n@media (min-width: $layout-breakpoint-xs) {\n  md-sidenav {\n    max-width: $sidenav-desktop-width;\n  }\n}\n\n@media (max-width: $sidenav-desktop-width + $sidenav-min-space) {\n  md-sidenav {\n    width: calc(100% - #{$sidenav-min-space});\n    min-width: calc(100% - #{$sidenav-min-space});\n    max-width: calc(100% - #{$sidenav-min-space});\n  }\n}\n\n// IE Only\n@media screen and (-ms-high-contrast: active) {\n  .md-sidenav-left {\n    border-right: 1px solid #fff;\n  }\n  .md-sidenav-right {\n    border-left: 1px solid #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/sidenav/sidenav.spec.js",
    "content": "describe('mdSidenav', function() {\n  beforeEach(module('material.components.sidenav'));\n\n  function setup(attrs, skipInitialDigest) {\n    var el;\n    inject(function($compile, $rootScope) {\n      var parent = angular.element('<div>');\n      el = angular.element('<md-sidenav ' + (attrs || '') + '>');\n      parent.append(el);\n      $compile(parent)($rootScope);\n      !skipInitialDigest && $rootScope.$apply();\n    });\n    return el;\n  }\n\n  describe('directive', function() {\n\n    it('should have `._md` class indicator', inject(function($rootScope) {\n      var element = setup('md-is-open=\"show\"');\n\n      $rootScope.$apply('show = true');\n      expect(element.hasClass('_md')).toBe(true);\n    }));\n\n    it('should bind isOpen attribute', inject(function($rootScope, $material) {\n      var el = setup('md-is-open=\"show\"');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n      expect(el.hasClass('md-closed')).toBe(false);\n      expect(el.parent().find('md-backdrop').length).toBe(1);\n\n      $rootScope.$apply('show = false');\n      $material.flushOutstandingAnimations();\n      expect(el.hasClass('md-closed')).toBe(true);\n      expect(el.parent().find('md-backdrop').length).toBe(0);\n    }));\n\n    it('should close on escape', inject(function($rootScope, $material, $mdConstant, $timeout) {\n      var el = setup('md-is-open=\"show\"');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n      el.parent().triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.ESCAPE\n      });\n      $timeout.flush();\n      expect($rootScope.show).toBe(false);\n    }));\n\n    it('should close on backdrop click', inject(function($rootScope, $material, $timeout) {\n      var el = setup('md-is-open=\"show\"');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n      el.parent().find('md-backdrop').triggerHandler('click');\n      $timeout.flush();\n      expect($rootScope.show).toBe(false);\n    }));\n\n    describe('disable click and Escape key events if md-disable-close-events is set to true',\n      function() {\n        it('should not close on escape and still show the backdrop',\n          inject(function($rootScope, $material, $mdConstant, $timeout) {\n            var el = setup('md-is-open=\"show\" md-disable-close-events');\n            $rootScope.$apply('show = true');\n\n            $material.flushOutstandingAnimations();\n            el.parent().triggerHandler({\n              type: 'keydown',\n              keyCode: $mdConstant.KEY_CODE.ESCAPE\n            });\n            $timeout.flush();\n            var backdrop = el.parent().find('md-backdrop');\n\n            expect($rootScope.show).toBe(true);\n            expect(backdrop.length).toBe(1);\n        }));\n\n        it('should not close on backdrop click and still show the backdrop',\n          inject(function($rootScope, $material, $timeout) {\n            var el = setup('md-is-open=\"show\" md-disable-close-events');\n            $rootScope.$apply('show = true');\n\n            $material.flushOutstandingAnimations();\n            el.parent().find('md-backdrop').triggerHandler('click');\n            $timeout.flush();\n            var backdrop = el.parent().find('md-backdrop');\n\n            expect($rootScope.show).toBe(true);\n            expect(backdrop.length).toBe(1);\n        }));\n    });\n\n    it('should show a backdrop by default', inject(function($rootScope, $material) {\n      var el = setup('md-is-open=\"show\"');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n\n      var backdrop = el.parent().find('md-backdrop');\n      expect(backdrop.length).toBe(1);\n    }));\n\n    it('should not show a backdrop if md-disable-backdrop is set to true', inject(function($rootScope, $material) {\n      var el = setup('md-is-open=\"show\" md-disable-backdrop');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n\n      var backdrop = el.parent().find('md-backdrop');\n      expect(backdrop.length).toBe(0);\n    }));\n\n    it('should focus sidenav on open', inject(function($rootScope, $material, $document) {\n      jasmine.mockElementFocus(this);\n      var el = setup('md-is-open=\"show\"');\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n      expect($document.activeElement).toBe(el[0]);\n    }));\n\n    it('should focus child with md-autofocus', inject(function($rootScope, $material, $document, $compile) {\n      jasmine.mockElementFocus(this);\n      var parent = angular.element('<div>');\n      var markup = '<md-sidenav md-is-open=\"show\">' +\n        '<md-input-container><label>Label</label>' +\n        '<input type=\"text\" md-autofocus>' +\n        '</md-input-container>' +\n        '<md-sidenav>';\n      var sidenavEl = angular.element(markup);\n      parent.append(sidenavEl);\n      $compile(parent)($rootScope);\n      $rootScope.$apply('show = true');\n\n      var focusEl = sidenavEl.find('input');\n      $material.flushOutstandingAnimations();\n      expect($document.activeElement).toBe(focusEl[0]);\n    }));\n\n    it('should focus on last md-autofocus element', inject(function($rootScope, $material, $document, $compile) {\n      jasmine.mockElementFocus(this);\n      var parent = angular.element('<div>');\n      var markup = '<md-sidenav md-is-open=\"show\">' +\n        '<md-button md-autofocus>Button</md-button>' +\n        '<md-input-container><label>Label</label>' +\n        '<input type=\"text\" md-autofocus>' +\n        '</md-input-container>' +\n        '<md-sidenav>';\n      var sidenavEl = angular.element(markup);\n      parent.append(sidenavEl);\n      $compile(parent)($rootScope);\n      $rootScope.$apply('show = true');\n\n      $material.flushOutstandingAnimations();\n      var focusEl = sidenavEl.find('input');\n      expect($document.activeElement).toBe(focusEl[0]);\n    }));\n\n    it('should lock open when is-locked-open is true', inject(function($rootScope, $material, $document) {\n      var el = setup('md-is-open=\"show\" md-is-locked-open=\"lock\"');\n      expect(el.hasClass('md-locked-open')).toBe(false);\n      $rootScope.$apply('lock = true');\n      expect(el.hasClass('md-locked-open')).toBe(true);\n      $rootScope.$apply('show = true');\n      $material.flushOutstandingAnimations();\n      expect(el.parent().find('md-backdrop').hasClass('md-locked-open')).toBe(true);\n    }));\n\n    it('should expose $mdMedia service as local in is-locked-open attribute', function() {\n      var mdMediaSpy = jasmine.createSpy('$mdMedia');\n      module(function($provide) {\n        $provide.value('$mdMedia', mdMediaSpy);\n      });\n      inject(function($rootScope, $animate, $document, $mdMedia) {\n        setup('md-is-locked-open=\"$mdMedia(123)\"');\n        expect($mdMedia).toHaveBeenCalledWith(123);\n      });\n    });\n\n    it('should trigger a resize event when opening',\n      inject(function($rootScope, $animate, $$rAF, $window) {\n        setup('md-is-open=\"show\"');\n        var obj = { callback: function() {} };\n\n        spyOn(obj, 'callback');\n        angular.element($window).on('resize', obj.callback);\n\n        $rootScope.$apply('show = true');\n        $animate.flush();\n        $$rAF.flush();\n\n        expect(obj.callback).toHaveBeenCalled();\n        angular.element($window).off('resize', obj.callback);\n      })\n    );\n\n    describe('parent scroll prevention', function() {\n      it('should prevent scrolling on the parent element', inject(function($rootScope) {\n        var parent = setup('md-is-open=\"isOpen\"').parent()[0];\n\n        expect(parent.style.overflow).toBeFalsy();\n        $rootScope.$apply('isOpen = true');\n        expect(parent.style.overflow).toBe('hidden');\n      }));\n\n      it('should prevent scrolling on a custom element', inject(function($compile, $rootScope) {\n        var preventScrollTarget = angular.element('<div id=\"prevent-scroll-target\"></div>');\n        var parent = angular.element(\n          '<div>' +\n            '<md-sidenav md-disable-scroll-target=\"#prevent-scroll-target\" md-is-open=\"isOpen\"></md-sidenav>' +\n          '</div>'\n        );\n\n        preventScrollTarget.append(parent);\n        angular.element(document.body).append(preventScrollTarget);\n        $compile(preventScrollTarget)($rootScope);\n\n        expect(preventScrollTarget[0].style.overflow).toBeFalsy();\n        expect(parent[0].style.overflow).toBeFalsy();\n\n        $rootScope.$apply('isOpen = true');\n        expect(preventScrollTarget[0].style.overflow).toBe('hidden');\n        expect(parent[0].style.overflow).toBeFalsy();\n        preventScrollTarget.remove();\n      }));\n\n      it('should log a warning and fall back to the parent if the custom scroll target does not exist',\n        inject(function($rootScope, $log) {\n          spyOn($log, 'warn');\n          var parent = setup('md-is-open=\"isOpen\" md-disable-scroll-target=\"does-not-exist\"').parent()[0];\n\n          $rootScope.$apply('isOpen = true');\n          expect($log.warn).toHaveBeenCalled();\n          expect(parent.style.overflow).toBe('hidden');\n        }));\n    });\n\n  });\n\n  describe('controller', function() {\n    it('should create controller', function() {\n      var el = setup();\n      var controller = el.controller('mdSidenav');\n      expect(controller).not.toBe(undefined);\n    });\n\n    it('should open and close and toggle', inject(function($timeout) {\n      var el = setup();\n      var scope = el.isolateScope();\n      var controller = el.controller('mdSidenav');\n\n      // Should start closed\n      expect(el.hasClass('md-closed')).toBe(true);\n\n      controller.open();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(false);\n\n      controller.close();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(true);\n\n      controller.toggle();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(false);\n    }));\n\n  });\n\n  describe(\"focus\", function() {\n\n    var $material, $mdInteraction, $mdConstant;\n    var triggerElement;\n\n    beforeEach(inject(function($injector) {\n      $material = $injector.get('$material');\n      $mdInteraction = $injector.get('$mdInteraction');\n      $mdConstant = $injector.get('$mdInteraction');\n\n      triggerElement = angular.element('<button>Trigger Element</button>');\n      document.body.appendChild(triggerElement[0]);\n    }));\n\n    afterEach(function() {\n      triggerElement.remove();\n    });\n\n    function dispatchEvent(eventName) {\n      angular.element(document.body).triggerHandler(eventName);\n    }\n\n    function flush() {\n      $material.flushInterimElement();\n    }\n\n    function blur() {\n      if ('documentMode' in document) {\n        document.body.focus();\n      } else {\n        triggerElement.blur();\n      }\n    }\n\n    it(\"should restore after sidenav triggered by keyboard\", function() {\n      var sidenavEl = setup('');\n      var controller = sidenavEl.controller('mdSidenav');\n\n      triggerElement.focus();\n\n      dispatchEvent('keydown');\n\n      controller.$toggleOpen(true);\n      flush();\n\n      blur();\n\n      controller.$toggleOpen(false);\n      flush();\n\n      expect($mdInteraction.getLastInteractionType()).toBe(\"keyboard\");\n      expect(document.activeElement).toBe(triggerElement[0]);\n    });\n\n    it(\"should not restore after sidenav triggered by mouse\", function() {\n      var sidenavEl = setup('');\n      var controller = sidenavEl.controller('mdSidenav');\n\n      triggerElement.focus();\n\n      dispatchEvent('mousedown');\n\n      controller.$toggleOpen(true);\n      flush();\n\n      blur();\n\n      controller.$toggleOpen(false);\n      flush();\n\n      expect($mdInteraction.getLastInteractionType()).toBe(\"mouse\");\n      expect(document.activeElement).not.toBe(triggerElement[0]);\n    });\n\n  });\n\n  describe(\"controller Promise API\", function() {\n    var $material, $rootScope, $timeout;\n\n    function flush() {\n      $material.flushInterimElement();\n    }\n\n    beforeEach(inject(function(_$material_, _$rootScope_, _$timeout_) {\n      $material = _$material_;\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n    }));\n\n    it('should open(), close(), and toggle() with promises', function() {\n      var el = setup();\n      var scope = el.isolateScope();\n      var controller = el.controller('mdSidenav');\n\n      var openDone = 0, closeDone = 0, toggleDone = 0;\n      var onOpen = function() {\n        openDone++;\n      };\n      var onClose = function() {\n        closeDone++;\n      };\n      var onToggle = function() {\n        toggleDone++;\n      };\n\n      controller\n        .open()\n        .then(onOpen)\n        .then(controller.close)\n        .then(onClose);\n\n      flush();\n      expect(openDone).toBe(1);\n      flush();\n      expect(closeDone).toBe(1);\n\n      controller\n        .close()\n        .then(onClose);\n\n      flush();\n      expect(closeDone).toBe(2);\n      expect(scope.isOpen).toBe(false);\n\n      controller\n        .toggle()\n        .then(onToggle);\n\n      flush();\n      expect(toggleDone).toBe(1);\n      expect(scope.isOpen).toBe(true);\n    });\n\n    it('should open() to work multiple times before close()', function() {\n      var el = setup();\n      var controller = el.controller('mdSidenav');\n\n      var openDone = 0, closeDone = 0;\n      var onOpen = function() {\n        openDone++;\n      };\n      var onClose = function() {\n        closeDone++;\n      };\n\n      controller\n        .open()\n        .then(onOpen)\n        .then(controller.open)\n        .then(onOpen);\n\n      flush();\n      expect(openDone).toBe(2);\n      expect(closeDone).toBe(0);\n      expect(el.hasClass('md-closed')).toBe(false);\n\n      controller\n        .close()\n        .then(onClose);\n\n      flush();\n      expect(openDone).toBe(2);\n      expect(closeDone).toBe(1);\n      expect(el.hasClass('md-closed')).toBe(true);\n    });\n\n  });\n\n  describe('$mdSidenav Service', function() {\n    var $rootScope, $timeout;\n\n    beforeEach(inject(function(_$rootScope_, _$timeout_) {\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n    }));\n\n    it('should grab instance', inject(function($mdSidenav) {\n      var el = setup('md-component-id=\"left\"');\n      var scope = el.isolateScope();\n\n      var instance = $mdSidenav('left');\n      expect(instance).toBeTruthy();\n\n      instance.open();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(false);\n\n      instance.close();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(true);\n\n      instance.toggle();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(false);\n\n      instance.toggle();\n      scope.$apply();\n\n      expect(el.hasClass('md-closed')).toBe(true);\n    }));\n\n    it('exposes state', inject(function($mdSidenav) {\n      var el = setup('md-component-id=\"stateTest\" md-is-open=\"shouldOpen\" md-is-locked-open=\"shouldLockOpen\"');\n      var scope = el.scope();\n\n      var instance = $mdSidenav('stateTest');\n      expect(instance.isOpen()).toBe(false);\n      expect(instance.isLockedOpen()).toBe(false);\n\n      scope.shouldOpen = true;\n      scope.shouldLockOpen = true;\n      scope.$digest();\n      expect(instance.isOpen()).toBe(true);\n      expect(instance.isLockedOpen()).toBe(true);\n\n      scope.shouldOpen = false;\n      scope.shouldLockOpen = true;\n      scope.$digest();\n      expect(instance.isOpen()).toBe(false);\n      expect(instance.isLockedOpen()).toBe(true);\n    }));\n\n  });\n\n  describe('$mdSidenav lookups', function() {\n    var $rootScope, $timeout, $mdSidenav;\n\n    beforeEach(inject(function(_$rootScope_, _$timeout_, _$mdSidenav_) {\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n      $mdSidenav = _$mdSidenav_;\n    }));\n\n    it('should find an instantiation using `$mdSidenav(id)`', function() {\n      var el = setup('md-component-id=\"left\"');\n      $timeout.flush();\n\n      // Lookup instance still available in the component registry\n      var instance = $mdSidenav('left');\n      expect(instance).toBeTruthy();\n    });\n\n    it('should support data bindings', function() {\n      // It should work on init.\n      $rootScope.leftComponentId = 'left';\n      setup('md-component-id=\"{{ leftComponentId }}\"', true);\n      expect($mdSidenav($rootScope.leftComponentId, false)).toBeTruthy();\n\n      // It should also work if the data binding has changed.\n      $rootScope.$apply('leftComponentId = \"otherLeft\"');\n      expect($mdSidenav($rootScope.leftComponentId, false)).toBeTruthy();\n    });\n\n    it('should find a deferred instantiation using `$mdSidenav(id, true)`', function() {\n      var instance;\n\n      // Lookup deferred (not existing) instance\n      $mdSidenav('left', true).then(function(inst) {\n        instance = inst;\n      });\n      expect(instance).toBeUndefined();\n\n      // Instantiate `left` sidenav component\n      var el = setup('md-component-id=\"left\"');\n      $timeout.flush();\n\n      expect(instance).toBeDefined();\n      expect(instance.isOpen()).toBeFalsy();\n\n      // Lookup instance still available in the component registry\n      instance = $mdSidenav('left', true);\n      expect(instance).toBeTruthy();\n    });\n\n    it('should find a deferred instantiation using `$mdSidenav().waitFor(id)` ', function() {\n      var instance;\n\n      // Lookup deferred (not existing) instance\n      $mdSidenav().waitFor('left').then(function(inst) {\n        instance = inst;\n      });\n      expect(instance).toBeUndefined();\n\n      // Instantiate `left` sidenav component\n      var el = setup('md-component-id=\"left\"');\n      $timeout.flush();\n\n      expect(instance).toBeDefined();\n      expect(instance.isOpen()).toBeFalsy();\n\n      // Lookup instance still available in the component registry\n      instance = undefined;\n      instance = $mdSidenav('left');\n\n      expect(instance).toBeTruthy();\n    });\n\n    it('should not find a lazy instantiation without waiting `$mdSidenav(id)`', function() {\n      var instance = $mdSidenav('left');\n      expect(instance.isOpen).toBeDefined();    // returns legacy API with noops\n\n      instance = $mdSidenav('left', false);     // since enableWait == false, return false\n      expect(instance).toBeFalsy();\n\n      // Instantiate `left` sidenav component\n      var el = setup('md-component-id=\"left\"');\n      $timeout.flush();\n\n      instance = $mdSidenav('left');            // returns instance\n      expect(instance).toBeDefined();\n      expect(instance.isOpen()).toBeFalsy();\n    });\n\n    it('should not find a lazy instantiation without waiting `$mdSidenav().find(id)`', function() {\n      var instance = $mdSidenav().find('left');\n      expect(instance).toBeUndefined();\n\n      // Instantiate `left` sidenav component\n      var el = setup('md-component-id=\"left\"');\n      $timeout.flush();\n\n      instance = $mdSidenav().find('left');\n      expect(instance).toBeDefined();\n      expect(instance.isOpen()).toBeFalsy();\n    });\n\n    describe('onClose', function () {\n      it('should call callback on escape', inject(function($mdSidenav, $rootScope, $material, $mdConstant, $timeout) {\n        var el = setup('md-component-id=\"left\" md-is-open=\"show\"');\n        var callback = jasmine.createSpy(\"callback spy\");\n\n        $mdSidenav('left')\n          .onClose(callback);\n\n        $rootScope.$apply('show = true');\n\n        $material.flushOutstandingAnimations();\n        el.parent().triggerHandler({\n          type: 'keydown',\n          keyCode: $mdConstant.KEY_CODE.ESCAPE\n        });\n        $timeout.flush();\n        expect($rootScope.show).toBe(false);\n        expect(callback).toHaveBeenCalled();\n      }));\n\n      it('should call callback on backdrop click', inject(function($mdSidenav, $rootScope, $material, $timeout) {\n        var el = setup('md-component-id=\"left\" md-is-open=\"show\"');\n        var callback = jasmine.createSpy(\"callback spy\");\n\n        $mdSidenav('left')\n          .onClose(callback);\n\n        $rootScope.$apply('show = true');\n\n        $material.flushOutstandingAnimations();\n        el.parent().find('md-backdrop').triggerHandler('click');\n        $timeout.flush();\n        expect($rootScope.show).toBe(false);\n        expect(callback).toHaveBeenCalled();\n      }));\n\n      it('should call callback on close', inject(function($mdSidenav, $rootScope, $material, $timeout) {\n        var el = setup('md-component-id=\"left\"');\n        var callback = jasmine.createSpy(\"callback spy\");\n\n        $mdSidenav('left')\n          .onClose(callback)\n          .open();\n\n        $timeout.flush();\n\n        expect(el.hasClass('md-closed')).toBe(false);\n\n        $mdSidenav('left')\n          .close();\n\n        $timeout.flush();\n\n        expect(callback).toHaveBeenCalled();\n      }));\n    });\n  });\n\n\n});\n"
  },
  {
    "path": "src/components/slider/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content style=\"margin: 16px; padding:16px\">\n\n    <h3>\n      RGB <span ng-attr-style=\"border: 1px solid #333; background: rgb({{color.red}},{{color.green}},{{color.blue}})\">\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n      </span>\n    </h3>\n\n    <md-slider-container>\n      <span>R</span>\n      <md-slider min=\"0\" max=\"255\" ng-model=\"color.red\" aria-label=\"red\" id=\"red-slider\"\n                 class=\"md-warn\">\n      </md-slider>\n      <md-input-container>\n        <input type=\"number\" ng-model=\"color.red\" aria-label=\"red\" aria-controls=\"red-slider\">\n      </md-input-container>\n    </md-slider-container>\n\n    <md-slider-container>\n      <span>G</span>\n      <md-slider ng-model=\"color.green\" min=\"0\" max=\"255\" aria-label=\"green\" id=\"green-slider\"\n                 class=\"md-accent\">\n      </md-slider>\n      <md-input-container>\n        <input type=\"number\" ng-model=\"color.green\" aria-label=\"green\" aria-controls=\"green-slider\">\n      </md-input-container>\n    </md-slider-container>\n\n    <md-slider-container>\n      <span class=\"md-body-1\">B</span>\n      <md-slider ng-model=\"color.blue\" min=\"0\" max=\"255\" aria-label=\"blue\" id=\"blue-slider\"\n                 class=\"md-primary\">\n      </md-slider>\n      <md-input-container>\n        <input type=\"number\" ng-model=\"color.blue\" aria-label=\"blue\" aria-controls=\"blue-slider\">\n      </md-input-container>\n    </md-slider-container>\n\n    <div style=\"margin-top: 50px;\"></div>\n\n    <h3>Rating: {{rating1}}/5 - demo of theming classes</h3>\n    <div layout>\n      <div flex=\"10\" layout layout-align=\"center center\">\n        <span class=\"md-body-1\">default</span>\n      </div>\n      <md-slider flex md-discrete ng-model=\"rating1\" step=\"1\" min=\"1\" max=\"5\"\n                 aria-label=\"default\"></md-slider>\n    </div>\n    <div layout>\n      <div flex=\"10\" layout layout-align=\"center center\">\n        <span class=\"md-body-1\">md-warn</span>\n      </div>\n      <md-slider flex class=\"md-warn\" md-discrete ng-model=\"rating2\" step=\"1\" min=\"1\" max=\"5\"\n                 aria-label=\"md-warn\">\n      </md-slider>\n    </div>\n    <div layout>\n      <div flex=\"10\" layout layout-align=\"center center\">\n        <span class=\"md-body-1\">md-primary</span>\n      </div>\n      <md-slider flex class=\"md-primary\" md-discrete ng-model=\"rating3\" step=\"1\" min=\"1\" max=\"5\"\n                 aria-label=\"md-primary\">\n      </md-slider>\n    </div>\n\n    <div style=\"margin-top: 50px;\"></div>\n\n    <h3>Disabled</h3>\n    <md-slider-container ng-disabled=\"isDisabled\">\n      <md-icon md-svg-icon=\"device:brightness-low\"></md-icon>\n      <md-slider ng-model=\"disabled1\" aria-label=\"Disabled 1\" md-discrete ng-readonly=\"readonly\"\n                 id=\"disabled1-slider\">\n      </md-slider>\n      <md-input-container>\n        <input type=\"number\" ng-model=\"disabled1\" aria-label=\"Disabled 1\"\n               aria-controls=\"disabled1-slider\">\n      </md-input-container>\n    </md-slider-container>\n    <md-checkbox ng-model=\"isDisabled\">Is disabled</md-checkbox>\n    <md-slider ng-model=\"disabled2\" ng-disabled=\"true\" aria-label=\"Disabled 2\"></md-slider>\n\n    <div style=\"margin-top: 50px;\"></div>\n\n    <h3>Disabled, Discrete, Read Only</h3>\n    <md-slider ng-model=\"disabled2\" ng-disabled=\"true\" step=\"3\" md-discrete min=\"0\" max=\"10\"\n               aria-label=\"Disabled discrete 2\"></md-slider>\n    <md-slider ng-model=\"disabled3\" ng-disabled=\"true\" step=\"10\" md-discrete\n               aria-label=\"Disabled discrete 3\" ng-readonly=\"readonly\"></md-slider>\n    <md-checkbox ng-model=\"readonly\">Read only</md-checkbox>\n\n    <div style=\"margin-top: 50px;\"></div>\n    <h3>Invert</h3>\n    <md-slider-container>\n      <div flex=\"10\" layout layout-align=\"center center\">\n        <span class=\"md-body-1\">Regular</span>\n      </div>\n      <md-slider ng-model=\"invert\" min=\"0\" max=\"100\" aria-label=\"regular\" id=\"regular-slider\">\n      </md-slider>\n\n      <md-input-container>\n        <input type=\"number\" ng-model=\"invert\" aria-label=\"regular\" aria-controls=\"regular-slider\">\n      </md-input-container>\n    </md-slider-container>\n    <md-slider-container>\n      <div flex=\"10\" layout layout-align=\"center center\">\n        <span class=\"md-body-1\">Inverted</span>\n      </div>\n      <md-slider md-invert ng-model=\"invert\" min=\"0\" max=\"100\" aria-label=\"inverted\"\n                 id=\"inverted-slider\"></md-slider>\n\n      <md-input-container>\n        <input type=\"number\" ng-model=\"invert\" aria-label=\"inverted\"\n               aria-controls=\"inverted-slider\">\n      </md-input-container>\n    </md-slider-container>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/slider/demoBasicUsage/script.js",
    "content": "angular.module('sliderDemoBasic', ['ngMaterial'])\n  .config(function ($mdIconProvider) {\n    $mdIconProvider.iconSet('device', 'img/icons/sets/device-icons.svg', 24);\n  })\n  .controller('AppCtrl', function ($scope) {\n    $scope.color = {\n      red: Math.floor(Math.random() * 255),\n      green: Math.floor(Math.random() * 255),\n      blue: Math.floor(Math.random() * 255)\n    };\n\n    $scope.rating1 = 3;\n    $scope.rating2 = 2;\n    $scope.rating3 = 4;\n\n    $scope.disabled1 = Math.floor(Math.random() * 100);\n    $scope.disabled2 = 0;\n    $scope.disabled3 = 70;\n\n    $scope.invert = Math.floor(Math.random() * 100);\n\n    $scope.isDisabled = true;\n  });\n"
  },
  {
    "path": "src/components/slider/demoVertical/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <div layout=\"row\" layout-padding>\n    <md-slider-container flex>\n      <md-input-container>\n        <input flex type=\"number\" ng-model=\"vol\" aria-label=\"volume\" aria-controls=\"volume-slider\">\n      </md-input-container>\n      <md-slider ng-model=\"vol\" min=\"0\" max=\"100\" aria-label=\"volume\" id=\"volume-slider\"\n                 class=\"md-accent\" md-vertical></md-slider>\n      <h5>Volume</h5>\n    </md-slider-container>\n    <md-slider-container flex>\n      <md-input-container>\n        <input flex type=\"number\" ng-model=\"bass\" aria-label=\"bass\" aria-controls=\"bass-slider\"\n               step=\"10\">\n      </md-input-container>\n      <md-slider md-discrete ng-model=\"bass\" min=\"0\" max=\"100\" step=\"10\" aria-label=\"bass\"\n                 class=\"md-primary\" md-vertical id=\"bass-slider\"></md-slider>\n      <h5>Bass</h5>\n    </md-slider-container>\n    <div flex layout=\"column\" layout-align=\"center center\">\n      <md-slider-container ng-disabled=\"readonly\">\n        <md-input-container>\n          <input flex type=\"number\" ng-model=\"treble\" aria-label=\"Treble\" step=\"10\"\n                 aria-controls=\"treble-slider\">\n        </md-input-container>\n        <md-slider flex ng-model=\"treble\" md-discrete aria-label=\"Treble\" md-vertical step=\"10\"\n                   ng-readonly=\"readonly\" id=\"treble-slider\"></md-slider>\n        <h5>Treble</h5>\n      </md-slider-container>\n      <md-checkbox ng-model=\"readonly\">Read only</md-checkbox>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/slider/demoVertical/script.js",
    "content": "angular.module('sliderDemoVertical', ['ngMaterial'])\n.controller('AppCtrl', function($scope) {\n  $scope.vol = Math.floor(Math.random() * 100);\n  $scope.bass = 40;\n  $scope.treble = 80;\n});\n"
  },
  {
    "path": "src/components/slider/slider-theme.scss",
    "content": "md-slider.md-THEME_NAME-theme {\n\n  .md-track {\n    background-color: '{{foreground-3}}';\n  }\n  .md-track-ticks {\n    color: '{{background-contrast}}';\n  }\n  .md-focus-ring {\n    background-color: '{{accent-A200-0.2}}';\n  }\n  .md-disabled-thumb {\n    border-color: '{{background-color}}';\n    background-color: '{{background-color}}';\n  }\n\n  &.md-min {\n    .md-thumb:after {\n      background-color: '{{background-color}}';\n      border-color: '{{foreground-3}}';\n    }\n\n    .md-focus-ring {\n      background-color: '{{foreground-3-0.38}}';\n    }\n\n    &[md-discrete] {\n      .md-thumb {\n        &:after {\n          background-color: '{{background-contrast}}';\n          border-color: transparent;\n        }\n      }\n\n      .md-sign {\n        background-color: '{{background-400}}';\n        &:after {\n          border-top-color: '{{background-400}}';\n        }\n      }\n\n      &[md-vertical] {\n        .md-sign:after {\n          border-top-color: transparent;\n          border-left-color: '{{background-400}}';\n        }\n      }\n    }\n  }\n\n  .md-track.md-track-fill {\n    background-color: '{{accent-color}}';\n  }\n  .md-thumb:after {\n    border-color: '{{accent-color}}';\n    background-color: '{{accent-color}}';\n  }\n  .md-sign {\n    background-color: '{{accent-color}}';\n    &:after {\n      border-top-color: '{{accent-color}}';\n    }\n  }\n\n  &[md-vertical] {\n    .md-sign:after {\n      border-top-color: transparent;\n      border-left-color: '{{accent-color}}';\n    }\n  }\n\n  .md-thumb-text {\n    color: '{{accent-contrast}}';\n  }\n\n  &.md-warn {\n    .md-focus-ring {\n      background-color: '{{warn-200-0.38}}';\n    }\n    .md-track.md-track-fill {\n      background-color: '{{warn-color}}';\n    }\n    .md-thumb:after {\n      border-color: '{{warn-color}}';\n      background-color: '{{warn-color}}';\n    }\n    .md-sign {\n      background-color: '{{warn-color}}';\n\n      &:after {\n        border-top-color: '{{warn-color}}';\n      }\n    }\n\n    &[md-vertical] {\n      .md-sign:after {\n        border-top-color: transparent;\n        border-left-color: '{{warn-color}}';\n      }\n    }\n\n    .md-thumb-text {\n      color: '{{warn-contrast}}';\n    }\n  }\n\n  &.md-primary {\n    .md-focus-ring {\n      background-color: '{{primary-200-0.38}}';\n    }\n    .md-track.md-track-fill {\n      background-color: '{{primary-color}}';\n    }\n    .md-thumb:after {\n      border-color: '{{primary-color}}';\n      background-color: '{{primary-color}}';\n    }\n    .md-sign {\n      background-color: '{{primary-color}}';\n\n      &:after {\n        border-top-color: '{{primary-color}}';\n      }\n    }\n\n    &[md-vertical] {\n      .md-sign:after {\n        border-top-color: transparent;\n        border-left-color: '{{primary-color}}';\n      }\n    }\n\n    .md-thumb-text {\n      color: '{{primary-contrast}}';\n    }\n  }\n\n  &[disabled] {\n    .md-thumb:after {\n      border-color: transparent;\n    }\n    &:not(.md-min), &[md-discrete] {\n      .md-thumb:after {\n        background-color: '{{foreground-3}}';\n        border-color: transparent;\n      }\n    }\n  }\n\n  &[disabled][readonly] {\n    .md-sign {\n      background-color: '{{background-400}}';\n      &:after {\n        border-top-color: '{{background-400}}';\n      }\n    }\n\n    &[md-vertical] {\n      .md-sign:after {\n        border-top-color: transparent;\n        border-left-color: '{{background-400}}';\n      }\n    }\n\n    .md-disabled-thumb {\n      border-color: transparent;\n      background-color: transparent;\n    }\n  }\n}\n\nmd-slider-container {\n  &[disabled] {\n    & > *:first-child,\n    & > *:last-child {\n      &:not(md-slider){\n        color: '{{foreground-3}}';\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/components/slider/slider.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.slider\n */\nangular.module('material.components.slider', [\n  'material.core'\n])\n.directive('mdSlider', SliderDirective)\n.directive('mdSliderContainer', SliderContainerDirective);\n\n/**\n * @type {number} the page size used for stepping when page up/down keys are pressed.\n */\nvar stepPageSize = 10;\n/**\n * @type {number} the multiplier applied to a step when the arrow key is pressed along with\n *  alt, meta, or ctrl.\n */\nvar modifierMultiplier = 4;\n\n/**\n * @ngdoc directive\n * @name mdSliderContainer\n * @module material.components.slider\n * @restrict E\n * @description\n * The `<md-slider-container>` can hold the slider with two other elements.\n * In this case, the other elements are a `span` for the label and an `input` for displaying\n * the model value.\n *\n * @usage\n * <hljs lang=\"html\">\n *  <md-slider-container>\n *    <span>Red</span>\n *    <md-slider min=\"0\" max=\"255\" ng-model=\"color.red\" aria-label=\"red\" id=\"red-slider\">\n *    </md-slider>\n *    <md-input-container>\n *      <input type=\"number\" ng-model=\"color.red\" aria-label=\"Red\" aria-controls=\"red-slider\">\n *    </md-input-container>\n *  </md-slider-container>\n * </hljs>\n */\nfunction SliderContainerDirective() {\n  return {\n    controller: function () {},\n    compile: function (elem) {\n      var slider = elem.find('md-slider');\n\n      if (!slider) {\n        return;\n      }\n\n      var vertical = slider.attr('md-vertical');\n\n      if (vertical !== undefined) {\n        elem.attr('md-vertical', '');\n      }\n\n      if (!slider.attr('flex')) {\n        slider.attr('flex', '');\n      }\n\n      return function postLink(scope, element, attr, ctrl) {\n        element.addClass('_md');     // private md component indicator for styling\n\n        // We have to manually stop the $watch on ngDisabled because it exists\n        // on the parent scope, and won't be automatically destroyed when\n        // the component is destroyed.\n        function setDisable(value) {\n          element.children().attr('disabled', value);\n          element.find('input').attr('disabled', value);\n        }\n\n        var stopDisabledWatch = angular.noop;\n\n        if (attr.disabled) {\n          setDisable(true);\n        }\n        else if (attr.ngDisabled) {\n          stopDisabledWatch = scope.$watch(attr.ngDisabled, function (value) {\n            setDisable(value);\n          });\n        }\n\n        scope.$on('$destroy', function () {\n          stopDisabledWatch();\n        });\n\n        var initialMaxWidth;\n\n        /**\n         * @param {number} length of the input's string value\n         */\n        ctrl.fitInputWidthToTextLength = function (length) {\n          var input = element[0].querySelector('md-input-container');\n\n          if (input) {\n            var computedStyle = getComputedStyle(input);\n            var minWidth = parseInt(computedStyle.minWidth);\n            var padding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight);\n\n            initialMaxWidth = initialMaxWidth || parseInt(computedStyle.maxWidth);\n            var newMaxWidth = Math.max(initialMaxWidth, minWidth + padding + (minWidth / 2 * length));\n\n            input.style.maxWidth = newMaxWidth + 'px';\n          }\n        };\n      };\n    }\n  };\n}\n\n/**\n * @ngdoc directive\n * @name mdSlider\n * @module material.components.slider\n * @restrict E\n * @description\n * The `<md-slider>` component allows the user to choose from a range of values.\n *\n * As per the [Material Design spec](https://material.io/archive/guidelines/style/color.html#color-color-system)\n * the slider is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * The slider has two modes:\n * - \"normal\" mode where the user slides between a wide range of values\n * - \"discrete\" mode where the user slides between only a few select values\n *\n * To enable discrete mode, add the `md-discrete` attribute to a slider\n * and use the `step` attribute to change the distance between\n * values the user is allowed to pick.\n *\n * When using the keyboard:\n * - pressing the arrow keys will increase or decrease the slider's value by one step\n * - holding the Meta, Control, or Alt key while pressing the arrow keys will\n *   move the slider four steps at a time\n * - pressing the Home key will move the slider to the first allowed value\n * - pressing the End key will move the slider to the last allowed value\n * - pressing the Page Up key will increase the slider value by ten\n * - pressing the Page Down key will decrease the slider value by ten\n *\n * @usage\n * <h4>Normal Mode</h4>\n * <hljs lang=\"html\">\n * <md-slider ng-model=\"myValue\" min=\"5\" max=\"500\">\n * </md-slider>\n * </hljs>\n * <h4>Discrete Mode</h4>\n * <hljs lang=\"html\">\n * <md-slider md-discrete ng-model=\"myDiscreteValue\" step=\"10\" min=\"10\" max=\"130\">\n * </md-slider>\n * </hljs>\n * <h4>Invert Mode</h4>\n * <hljs lang=\"html\">\n * <md-slider md-invert ng-model=\"myValue\" step=\"10\" min=\"10\" max=\"130\">\n * </md-slider>\n * </hljs>\n *\n * @param {expression} ng-model Assignable angular expression to be data-bound.\n *  The expression should evaluate to a `number`.\n * @param {expression=} ng-disabled If this expression evaluates as truthy, the slider will be\n *  disabled.\n * @param {expression=} ng-readonly If this expression evaluates as truthy, the slider will be in\n *  read only mode.\n * @param {boolean=} md-discrete If this attribute exists during initialization, enable discrete\n *  mode. Defaults to `false`.\n * @param {boolean=} md-vertical If this attribute exists during initialization, enable vertical\n *  orientation mode. Defaults to `false`.\n * @param {boolean=} md-invert If this attribute exists during initialization, enable inverted mode.\n *  Defaults to `false`.\n * @param {number=} step The distance between values the user is allowed to pick. Defaults to `1`.\n * @param {number=} min The minimum value the user is allowed to pick. Defaults to `0`.\n * @param {number=} max The maximum value the user is allowed to pick. Defaults to `100`.\n * @param {number=} round The amount of numbers after the decimal point. The maximum is 6 to\n *  prevent scientific notation. Defaults to `3`.\n */\nfunction SliderDirective($$rAF, $window, $mdAria, $mdUtil, $mdConstant, $mdTheming, $mdGesture,\n                         $parse, $log, $timeout) {\n  return {\n    scope: {},\n    require: ['?ngModel', '?^mdSliderContainer'],\n    template:\n      '<div class=\"md-slider-wrapper\">' +\n        '<div class=\"md-slider-content\">' +\n          '<div class=\"md-track-container\">' +\n            '<div class=\"md-track\"></div>' +\n            '<div class=\"md-track md-track-fill\"></div>' +\n            '<div class=\"md-track-ticks\"></div>' +\n          '</div>' +\n          '<div class=\"md-thumb-container\">' +\n            '<div class=\"md-thumb\"></div>' +\n            '<div class=\"md-focus-thumb\"></div>' +\n            '<div class=\"md-focus-ring\"></div>' +\n            '<div class=\"md-sign\">' +\n              '<span class=\"md-thumb-text\"></span>' +\n            '</div>' +\n            '<div class=\"md-disabled-thumb\"></div>' +\n          '</div>' +\n        '</div>' +\n      '</div>',\n    compile: compile\n  };\n\n  // **********************************************************\n  // Private Methods\n  // **********************************************************\n\n  function compile (tElement, tAttrs) {\n    var wrapper = angular.element(tElement[0].getElementsByClassName('md-slider-wrapper'));\n\n    var tabIndex = tAttrs.tabindex || 0;\n    wrapper.attr('tabindex', tabIndex);\n\n    if (tAttrs.disabled || tAttrs.ngDisabled) wrapper.attr('tabindex', -1);\n\n    wrapper.attr('role', 'slider');\n\n    $mdAria.expect(tElement, 'aria-label');\n\n    return postLink;\n  }\n\n  function postLink(scope, element, attr, ctrls) {\n    $mdTheming(element);\n    var ngModelCtrl = ctrls[0] || {\n      // Mock ngModelController if it doesn't exist to give us\n      // the minimum functionality needed\n      $setViewValue: function(val) {\n        this.$viewValue = val;\n        this.$viewChangeListeners.forEach(function(cb) { cb(); });\n      },\n      $parsers: [],\n      $formatters: [],\n      $viewChangeListeners: []\n    };\n\n    var containerCtrl = ctrls[1];\n    var container = angular.element($mdUtil.getClosest(element, '_md-slider-container', true));\n    var isDisabled = attr.ngDisabled ? angular.bind(null, $parse(attr.ngDisabled), scope.$parent) : function () {\n          return element[0].hasAttribute('disabled');\n        };\n\n    var thumb = angular.element(element[0].querySelector('.md-thumb'));\n    var thumbText = angular.element(element[0].querySelector('.md-thumb-text'));\n    var thumbContainer = thumb.parent();\n    var trackContainer = angular.element(element[0].querySelector('.md-track-container'));\n    var activeTrack = angular.element(element[0].querySelector('.md-track-fill'));\n    var tickContainer = angular.element(element[0].querySelector('.md-track-ticks'));\n    var wrapper = angular.element(element[0].getElementsByClassName('md-slider-wrapper'));\n    var content = angular.element(element[0].getElementsByClassName('md-slider-content'));\n    var throttledRefreshDimensions = $mdUtil.throttle(refreshSliderDimensions, 5000);\n\n    // Default values, overridable by attrs\n    var DEFAULT_ROUND = 3;\n    var vertical = angular.isDefined(attr.mdVertical);\n    var discrete = angular.isDefined(attr.mdDiscrete);\n    var invert = angular.isDefined(attr.mdInvert);\n    angular.isDefined(attr.min) ? attr.$observe('min', updateMin) : updateMin(0);\n    angular.isDefined(attr.max) ? attr.$observe('max', updateMax) : updateMax(100);\n    angular.isDefined(attr.step)? attr.$observe('step', updateStep) : updateStep(1);\n    angular.isDefined(attr.round)? attr.$observe('round', updateRound) : updateRound(DEFAULT_ROUND);\n\n    // We have to manually stop the $watch on ngDisabled because it exists\n    // on the parent scope, and won't be automatically destroyed when\n    // the component is destroyed.\n    var stopDisabledWatch = angular.noop;\n    if (attr.ngDisabled) {\n      stopDisabledWatch = scope.$parent.$watch(attr.ngDisabled, updateAriaDisabled);\n    }\n\n    $mdGesture.register(wrapper, 'drag', { horizontal: !vertical });\n\n    scope.mouseActive = false;\n\n    wrapper\n      .on('keydown', keydownListener)\n      .on('mousedown', mouseDownListener)\n      .on('focus', focusListener)\n      .on('blur', blurListener)\n      .on('$md.pressdown', onPressDown)\n      .on('$md.pressup', onPressUp)\n      .on('$md.dragstart', onDragStart)\n      .on('$md.drag', onDrag)\n      .on('$md.dragend', onDragEnd);\n\n    // On resize, recalculate the slider's dimensions and re-render\n    function updateAll() {\n      refreshSliderDimensions();\n      ngModelRender();\n    }\n    setTimeout(updateAll, 0);\n\n    var debouncedUpdateAll = $$rAF.throttle(updateAll);\n    angular.element($window).on('resize', debouncedUpdateAll);\n\n    scope.$on('$destroy', function() {\n      angular.element($window).off('resize', debouncedUpdateAll);\n    });\n\n    ngModelCtrl.$render = ngModelRender;\n    ngModelCtrl.$viewChangeListeners.push(ngModelRender);\n    ngModelCtrl.$formatters.push(minMaxValidator);\n    ngModelCtrl.$formatters.push(stepValidator);\n\n    /**\n     * Attributes\n     */\n    var min;\n    var max;\n    var step;\n    var round;\n    function updateMin(value) {\n      min = parseFloat(value);\n      ngModelCtrl.$viewValue = minMaxValidator(ngModelCtrl.$modelValue, min, max);\n      wrapper.attr('aria-valuemin', value);\n      updateAll();\n    }\n    function updateMax(value) {\n      max = parseFloat(value);\n      ngModelCtrl.$viewValue = minMaxValidator(ngModelCtrl.$modelValue, min, max);\n      wrapper.attr('aria-valuemax', value);\n      updateAll();\n    }\n    function updateStep(value) {\n      step = parseFloat(value);\n    }\n    function updateRound(value) {\n      // Set max round digits to 6, after 6 the input uses scientific notation\n      round = minMaxValidator(parseInt(value), 0, 6);\n    }\n    function updateAriaDisabled() {\n      element.attr('aria-disabled', !!isDisabled());\n    }\n\n    // Draw the ticks with canvas.\n    // The alternative to drawing ticks with canvas is to draw one element for each tick,\n    // which could quickly become a performance bottleneck.\n    var tickCanvas, tickCtx;\n    function redrawTicks() {\n      if (!discrete || isDisabled()) return;\n      if (angular.isUndefined(step))         return;\n\n      if (step <= 0) {\n        var msg = 'Slider step value must be greater than zero when in discrete mode';\n        $log.error(msg);\n        throw new Error(msg);\n      }\n\n      var numSteps = Math.floor((max - min) / step);\n      if (!tickCanvas) {\n        tickCanvas = angular.element('<canvas>').css('position', 'absolute');\n        tickContainer.append(tickCanvas);\n\n        tickCtx = tickCanvas[0].getContext('2d');\n      }\n\n      var dimensions = getSliderDimensions();\n\n      // If `dimensions` doesn't have height and width it might be the first attempt so we will refresh dimensions\n      if (dimensions && !dimensions.height && !dimensions.width) {\n        refreshSliderDimensions();\n        dimensions = sliderDimensions;\n      }\n\n      tickCanvas[0].width = dimensions.width;\n      tickCanvas[0].height = dimensions.height;\n\n      var distance;\n      for (var i = 0; i <= numSteps; i++) {\n        var trackTicksStyle = $window.getComputedStyle(tickContainer[0]);\n        tickCtx.fillStyle = trackTicksStyle.color || 'black';\n\n        distance = Math.floor((vertical ? dimensions.height : dimensions.width) * (i / numSteps));\n\n        tickCtx.fillRect(vertical ? 0 : distance - 1,\n          vertical ? distance - 1 : 0,\n          vertical ? dimensions.width : 2,\n          vertical ? 2 : dimensions.height);\n      }\n    }\n\n    function clearTicks() {\n      if (tickCanvas && tickCtx) {\n        var dimensions = getSliderDimensions();\n        tickCtx.clearRect(0, 0, dimensions.width, dimensions.height);\n      }\n    }\n\n    /**\n     * Refreshing Dimensions\n     */\n    var sliderDimensions = {};\n    refreshSliderDimensions();\n    function refreshSliderDimensions() {\n      sliderDimensions = trackContainer[0].getBoundingClientRect();\n    }\n    function getSliderDimensions() {\n      throttledRefreshDimensions();\n      return sliderDimensions;\n    }\n\n    /**\n     * left/right/up/down arrow listener\n     * @param {!KeyboardEvent} ev\n     */\n    function keydownListener(ev) {\n      if (isDisabled()) return;\n      var keyCodes = $mdConstant.KEY_CODE;\n\n      var changeAmount;\n      switch (ev.keyCode) {\n        case keyCodes.DOWN_ARROW:\n        case keyCodes.LEFT_ARROW:\n          ev.preventDefault();\n          changeAmount = -step;\n          break;\n        case keyCodes.UP_ARROW:\n        case keyCodes.RIGHT_ARROW:\n          ev.preventDefault();\n          changeAmount = step;\n          break;\n        case keyCodes.PAGE_DOWN:\n          ev.preventDefault();\n          changeAmount = -step * stepPageSize;\n          break;\n        case keyCodes.PAGE_UP:\n          ev.preventDefault();\n          changeAmount = step * stepPageSize;\n          break;\n        case keyCodes.HOME:\n          ev.preventDefault();\n          ev.stopPropagation();\n          updateValue(min);\n          break;\n        case keyCodes.END:\n          ev.preventDefault();\n          ev.stopPropagation();\n          updateValue(max);\n          break;\n      }\n      if (changeAmount) {\n        changeAmount = invert ? -changeAmount : changeAmount;\n        if (ev.metaKey || ev.ctrlKey || ev.altKey) {\n          changeAmount *= modifierMultiplier;\n        }\n        ev.preventDefault();\n        ev.stopPropagation();\n        updateValue(ngModelCtrl.$viewValue + changeAmount);\n      }\n    }\n\n    /**\n     * @param value new slider value used for setting the model value\n     */\n    function updateValue(value) {\n      scope.$evalAsync(function() {\n        setModelValue(value);\n      });\n    }\n\n    function mouseDownListener() {\n      redrawTicks();\n\n      scope.mouseActive = true;\n      wrapper.removeClass('md-focused');\n\n      $timeout(function() {\n        scope.mouseActive = false;\n      }, 100);\n    }\n\n    function focusListener() {\n      if (scope.mouseActive === false) {\n        wrapper.addClass('md-focused');\n      }\n    }\n\n    function blurListener() {\n      wrapper.removeClass('md-focused');\n      element.removeClass('md-active');\n      clearTicks();\n    }\n\n    /**\n     * ngModel setters and validators\n     */\n    function setModelValue(value) {\n      ngModelCtrl.$setViewValue(minMaxValidator(stepValidator(value)));\n    }\n    function ngModelRender() {\n      if (isNaN(ngModelCtrl.$viewValue)) {\n        ngModelCtrl.$viewValue = ngModelCtrl.$modelValue;\n      }\n\n      ngModelCtrl.$viewValue = minMaxValidator(ngModelCtrl.$viewValue);\n\n      var percent = valueToPercent(ngModelCtrl.$viewValue);\n      scope.modelValue = ngModelCtrl.$viewValue;\n      wrapper.attr('aria-valuenow', ngModelCtrl.$viewValue);\n      setSliderPercent(percent);\n      thumbText.text(ngModelCtrl.$viewValue);\n    }\n\n    function minMaxValidator(value, minValue, maxValue) {\n      if (angular.isNumber(value)) {\n        minValue = angular.isNumber(minValue) ? minValue : min;\n        maxValue = angular.isNumber(maxValue) ? maxValue : max;\n\n        return Math.max(minValue, Math.min(maxValue, value));\n      }\n    }\n\n    function stepValidator(value) {\n      if (angular.isNumber(value)) {\n        var formattedValue = (Math.round((value - min) / step) * step + min);\n        formattedValue = (Math.round(formattedValue * Math.pow(10, round)) / Math.pow(10, round));\n\n        if (containerCtrl && containerCtrl.fitInputWidthToTextLength) {\n          $mdUtil.debounce(function () {\n            containerCtrl.fitInputWidthToTextLength(formattedValue.toString().length);\n          }, 100)();\n        }\n\n        return formattedValue;\n      }\n    }\n\n    /**\n     * @param {number} percent 0-1\n     */\n    function setSliderPercent(percent) {\n\n      percent = clamp(percent);\n\n      var thumbPosition = (percent * 100) + '%';\n      var activeTrackPercent = invert ? (1 - percent) * 100 + '%' : thumbPosition;\n\n      if (vertical) {\n        thumbContainer.css('bottom', thumbPosition);\n      }\n      else {\n        $mdUtil.bidiProperty(thumbContainer, 'left', 'right', thumbPosition);\n      }\n\n\n      activeTrack.css(vertical ? 'height' : 'width', activeTrackPercent);\n\n      element.toggleClass((invert ? 'md-max' : 'md-min'), percent === 0);\n      element.toggleClass((invert ? 'md-min' : 'md-max'), percent === 1);\n    }\n\n    /**\n     * Slide listeners\n     */\n    var isDragging = false;\n\n    function onPressDown(ev) {\n      if (isDisabled()) return;\n\n      element.addClass('md-active');\n      element[0].focus();\n      refreshSliderDimensions();\n\n      var exactVal = percentToValue(positionToPercent(vertical ? ev.srcEvent.clientY : ev.srcEvent.clientX));\n      var closestVal = minMaxValidator(stepValidator(exactVal));\n      scope.$apply(function() {\n        setModelValue(closestVal);\n        setSliderPercent(valueToPercent(closestVal));\n      });\n    }\n    function onPressUp(ev) {\n      if (isDisabled()) return;\n\n      element.removeClass('md-dragging');\n\n      var exactVal = percentToValue(positionToPercent(vertical ? ev.srcEvent.clientY : ev.srcEvent.clientX));\n      var closestVal = minMaxValidator(stepValidator(exactVal));\n      scope.$apply(function() {\n        setModelValue(closestVal);\n        ngModelRender();\n      });\n    }\n    function onDragStart(ev) {\n      if (isDisabled()) return;\n      isDragging = true;\n\n      ev.stopPropagation();\n\n      element.addClass('md-dragging');\n      setSliderFromEvent(ev);\n    }\n    function onDrag(ev) {\n      if (!isDragging) return;\n      ev.stopPropagation();\n      setSliderFromEvent(ev);\n    }\n    function onDragEnd(ev) {\n      if (!isDragging) return;\n      ev.stopPropagation();\n      isDragging = false;\n    }\n\n    function setSliderFromEvent(ev) {\n      // While panning discrete, update only the\n      // visual positioning but not the model value.\n      if (discrete) adjustThumbPosition(vertical ? ev.srcEvent.clientY : ev.srcEvent.clientX);\n      else            doSlide(vertical ? ev.srcEvent.clientY : ev.srcEvent.clientX);\n    }\n\n    /**\n     * Slide the UI by changing the model value\n     * @param x\n     */\n    function doSlide(x) {\n      scope.$evalAsync(function() {\n        setModelValue(percentToValue(positionToPercent(x)));\n      });\n    }\n\n    /**\n     * Slide the UI without changing the model (while dragging/panning)\n     * @param x\n     */\n    function adjustThumbPosition(x) {\n      var exactVal = percentToValue(positionToPercent(x));\n      var closestVal = minMaxValidator(stepValidator(exactVal));\n      setSliderPercent(positionToPercent(x));\n      thumbText.text(closestVal);\n    }\n\n    /**\n    * Clamps the value to be between 0 and 1.\n    * @param {number} value The value to clamp.\n    * @returns {number}\n    */\n    function clamp(value) {\n      return Math.max(0, Math.min(value || 0, 1));\n    }\n\n    /**\n     * Convert position on slider to percentage value of offset from beginning...\n     * @param position\n     * @returns {number}\n     */\n    function positionToPercent(position) {\n      var offset = vertical ? sliderDimensions.top : sliderDimensions.left;\n      var size = vertical ? sliderDimensions.height : sliderDimensions.width;\n      var calc = (position - offset) / size;\n\n      if (!vertical && $mdUtil.isRtl(attr)) {\n        calc = 1 - calc;\n      }\n\n      return Math.max(0, Math.min(1, vertical ? 1 - calc : calc));\n    }\n\n    /**\n     * Convert percentage offset on slide to equivalent model value\n     * @param percent\n     * @returns {*}\n     */\n    function percentToValue(percent) {\n      var adjustedPercent = invert ? (1 - percent) : percent;\n      return (min + adjustedPercent * (max - min));\n    }\n\n    function valueToPercent(val) {\n      var percent = (val - min) / (max - min);\n      return invert ? (1 - percent) : percent;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/slider/slider.scss",
    "content": "$slider-background-color:  rgb(200, 200, 200) !default;\n$slider-size:  48px !default;\n$slider-min-size:  128px !default;\n\n$slider-track-height:  2px !default;\n$slider-thumb-width:  20px !default;\n$slider-thumb-height:  $slider-thumb-width !default;\n\n$slider-thumb-default-scale: 0.7 !default;\n$slider-thumb-hover-scale: 0.8 !default;\n$slider-thumb-focus-scale: 1 !default;\n$slider-thumb-disabled-scale: 0.5 !default;\n$slider-thumb-disabled-border: 4px !default;\n$slider-thumb-focus-duration: .7s !default;\n\n$slider-focus-thumb-width:  34px !default;\n$slider-focus-thumb-height: $slider-focus-thumb-width !default;\n$slider-focus-ring-border-width: 3px !default;\n\n$slider-arrow-height: 16px !default;\n$slider-arrow-width: 28px !default;\n\n$slider-sign-height: 28px !default;\n$slider-sign-width: 28px !default;\n$slider-sign-top: ($slider-size * 0.5) - ($slider-thumb-default-scale * $slider-thumb-height * 0.5) - ($slider-sign-height) - ($slider-arrow-height) + 10px !default;\n\n@keyframes sliderFocusThumb {\n  0% {\n    transform: scale($slider-thumb-default-scale);\n  }\n  30% {\n    transform: scale($slider-thumb-focus-scale);\n  }\n  100% {\n    transform: scale($slider-thumb-default-scale);\n  }\n}\n\n@keyframes sliderDiscreteFocusThumb {\n  0% {\n    transform: scale($slider-thumb-default-scale);\n  }\n  50% {\n    transform: scale($slider-thumb-hover-scale);\n  }\n  100% {\n    transform: scale(0);\n  }\n}\n\n@keyframes sliderDiscreteFocusRing {\n  0% {\n    transform: scale(0.7);\n    opacity: 0;\n  }\n  50% {\n    transform: scale(1);\n    opacity: 1;\n  }\n  100% {\n    transform: scale(0);\n  }\n}\n\n@mixin slider-thumb-position($width: $slider-thumb-width, $height: $slider-thumb-height) {\n  position: absolute;\n  @include rtl-prop(left, right, (-$width * 0.5), auto);\n  top: ($slider-size * 0.5) - ($height * 0.5);\n  width: $width;\n  height: $height;\n  border-radius: max($width, $height);\n}\n\nmd-slider {\n  height: $slider-size;\n  min-width: $slider-min-size;\n  position: relative;\n  margin-left: 4px;\n  margin-right: 4px;\n  padding: 0;\n  display: block;\n  flex-direction: row;\n\n  *, *:after {\n    box-sizing: border-box;\n  }\n\n  .md-slider-wrapper {\n    outline: none;\n    width: 100%;\n    height: 100%;\n  }\n\n  .md-slider-content {\n    position: relative;\n  }\n\n  /**\n   * Track\n   */\n  .md-track-container {\n    width: 100%;\n    position: absolute;\n    top: ($slider-size * 0.5) - ($slider-track-height) * 0.5;\n    height: $slider-track-height;\n  }\n  .md-track {\n    position: absolute;\n    left: 0;\n    right: 0;\n    height: 100%;\n  }\n  .md-track-fill {\n    transition: all .4s cubic-bezier(.25,.8,.25,1);\n    transition-property: width, height;\n  }\n  .md-track-ticks {\n    position: absolute;\n    left: 0;\n    right: 0;\n    height: 100%;\n  }\n  .md-track-ticks canvas {\n    // Restrict the width and the height of the canvas so that ticks are rendered correctly\n    // when parent elements are resized. Else, the position of the ticks might\n    // be incorrect as we only update the canvas width attribute on window resize.\n    width: 100%;\n    height: 100%;\n  }\n\n  /**\n   * Slider thumb\n   */\n  .md-thumb-container {\n    position: absolute;\n    @include rtl-prop(left, right, 0, auto);\n    top: 50%;\n    transform: translate3d(-50%,-50%,0);\n    transition: all .4s cubic-bezier(.25,.8,.25,1);\n    transition-property: left, right, bottom;\n  }\n  .md-thumb {\n    z-index: 1;\n\n    @include slider-thumb-position($slider-thumb-width, $slider-thumb-height);\n\n    // We render thumb in an :after selector to fix an obscure problem with the\n    // thumb being clipped by the focus-ring and focus-thumb while running the focus\n    // animation.\n    &:after {\n      content: '';\n      position: absolute;\n      width: $slider-thumb-width;\n      height: $slider-thumb-height;\n      border-radius: max($slider-thumb-width, $slider-thumb-height);\n      border-width: 3px;\n      border-style: solid;\n      transition: inherit;\n    }\n\n    transform: scale($slider-thumb-default-scale);\n    transition: all .4s cubic-bezier(.25,.8,.25,1);\n  }\n\n  /* The sign that's focused in discrete mode */\n  .md-sign {\n\n    /* Center the children (slider-thumb-text) */\n    display: flex;\n    align-items: center;\n    justify-content: center;\n\n    position: absolute;\n    left: -($slider-sign-height * 0.5);\n    top: $slider-sign-top;\n    width: $slider-sign-width;\n    height: $slider-sign-height;\n    border-radius: max($slider-sign-height, $slider-sign-width);\n\n    transform: scale(0.4) translate3d(0,math.div(-$slider-sign-top + 10, 0.4),0);\n    transition: all 0.3s $swift-ease-in-out-timing-function;\n\n    /* The arrow pointing down under the sign */\n    &:after {\n      position: absolute;\n      content: '';\n      @include rtl-prop(left, right, -(math.div($slider-sign-width, 2) - math.div($slider-arrow-width, 2)), auto);\n      border-radius: $slider-arrow-height;\n      top: 19px;\n      border-left: $slider-arrow-width * 0.5 solid transparent;\n      border-right: $slider-arrow-width * 0.5 solid transparent;\n      border-top-width: $slider-arrow-height;\n      border-top-style: solid;\n\n      opacity: 0;\n      transform: translate3d(0,-8px,0);\n      transition: all 0.2s $swift-ease-in-out-timing-function;\n    }\n\n    .md-thumb-text {\n      z-index: 1;\n      font-size: 12px;\n      font-weight: bold;\n    }\n  }\n\n  /**\n   * The border/background that comes in when focused in non-discrete mode\n   */\n  .md-focus-ring {\n    @include slider-thumb-position($slider-focus-thumb-width, $slider-focus-thumb-height);\n    transform: scale(.7);\n    opacity: 0;\n    // using a custom duration to match the spec example video\n    transition: all ($slider-thumb-focus-duration * 0.5) $swift-ease-in-out-timing-function;\n  }\n  .md-disabled-thumb {\n    @include slider-thumb-position(\n      $slider-thumb-width + $slider-thumb-disabled-border * 2,\n      $slider-thumb-height + $slider-thumb-disabled-border * 2\n    );\n    transform: scale($slider-thumb-disabled-scale);\n    border-width: $slider-thumb-disabled-border;\n    border-style: solid;\n    display: none;\n  }\n\n  &.md-min {\n    .md-sign {\n      opacity: 0;\n    }\n  }\n\n  &:focus {\n    outline: none;\n  }\n\n  /* Don't animate left/right while panning */\n  &.md-dragging {\n    .md-thumb-container,\n    .md-track-fill {\n      transition: none;\n    }\n  }\n\n  &:not([md-discrete]) {\n    /* Hide the sign and ticks in non-discrete mode */\n    .md-track-ticks,\n    .md-sign {\n      display: none;\n    }\n\n    &:not([disabled]) {\n      .md-slider-wrapper {\n        .md-thumb:hover {\n          transform: scale($slider-thumb-hover-scale);\n        }\n\n        &.md-focused {\n          .md-focus-ring {\n            transform: scale(1);\n            opacity: 1;\n          }\n          .md-thumb {\n            animation: sliderFocusThumb $slider-thumb-focus-duration $swift-ease-in-out-timing-function;\n          }\n        }\n      }\n\n      &.md-active {\n        .md-slider-wrapper {\n          .md-thumb {\n            transform: scale($slider-thumb-focus-scale);\n          }\n        }\n      }\n    }\n  }\n\n  &[md-discrete] {\n    &:not([disabled]) {\n      .md-slider-wrapper {\n        &.md-focused {\n          .md-focus-ring {\n            transform: scale(0);\n            animation: sliderDiscreteFocusRing .5s $swift-ease-in-out-timing-function;\n          }\n          .md-thumb {\n            animation: sliderDiscreteFocusThumb .5s $swift-ease-in-out-timing-function;\n          }\n        }\n      }\n      .md-slider-wrapper.md-focused,\n      &.md-active {\n        .md-thumb {\n          transform: scale(0);\n        }\n        .md-sign,\n        .md-sign:after {\n          opacity: 1;\n          transform: translate3d(0,0,0) scale(1.0);\n        }\n      }\n    }\n\n    &[disabled][readonly] {\n      .md-thumb {\n        transform: scale(0);\n      }\n      .md-sign,\n      .md-sign:after {\n        opacity: 1;\n        transform: translate3d(0,0,0) scale(1.0);\n      }\n    }\n  }\n\n  &[disabled] {\n    .md-track-fill {\n      display: none;\n    }\n    .md-track-ticks {\n      opacity: 0;\n    }\n    &:not([readonly]) .md-sign {\n      opacity: 0;\n    }\n    .md-thumb {\n      transform: scale($slider-thumb-disabled-scale);\n    }\n    .md-disabled-thumb {\n      display: block;\n    }\n  }\n\n  &[md-vertical] {\n    flex-direction: column;\n    min-height: $slider-min-size;\n    min-width: 0;\n\n    .md-slider-wrapper {\n      flex: 1;\n      padding-top: 12px;\n      padding-bottom: 12px;\n      width: $slider-size;\n      align-self: center;\n      display: flex;\n      justify-content: center;\n    }\n\n    .md-track-container {\n      height: 100%;\n      width: $slider-track-height;\n      top: 0;\n      left: calc(50% - (#{$slider-track-height} / 2));\n    }\n\n    .md-thumb-container {\n      top: auto;\n      margin-bottom: ($slider-size * 0.5) - ($slider-track-height) * 0.5;\n      left: calc(50% - 1px);\n      bottom: 0;\n\n      .md-thumb:after {\n        left: 1px;\n      }\n\n      .md-focus-ring {\n        left: -(math.div($slider-focus-thumb-width, 2) - math.div($slider-track-height, 2));\n      }\n    }\n\n    .md-track-fill {\n      bottom: 0;\n    }\n\n    &[md-discrete] {\n      .md-sign {\n        $sign-top: -($slider-sign-top * 0.5) + 1;\n\n        left: -$slider-sign-height - 12;\n        top: $sign-top;\n\n        transform: scale(0.4) translate3d(math.div(-$slider-sign-top + 10, 0.4), 0 ,0);\n\n        /* The arrow pointing left next the sign */\n        &:after {\n          top: $sign-top;\n          left: 19px;\n          border-top: $slider-arrow-width * 0.5 solid transparent;\n          border-right: 0;\n          border-bottom: $slider-arrow-width * 0.5 solid transparent;\n          border-left-width: $slider-arrow-height;\n          border-left-style: solid;\n\n          opacity: 0;\n          transform: translate3d(0,-8px,0);\n          transition: all 0.2s ease-in-out;\n        }\n\n        .md-thumb-text {\n          z-index: 1;\n          font-size: 12px;\n          font-weight: bold;\n        }\n      }\n\n      &.md-active,\n      .md-focused,\n      &[disabled][readonly]{\n        .md-sign:after {\n          top: 0;\n        }\n      }\n    }\n\n    &[disabled][readonly] {\n      .md-thumb {\n        transform: scale(0);\n      }\n      .md-sign,\n      .md-sign:after {\n        opacity: 1;\n        transform: translate3d(0,0,0) scale(1.0);\n      }\n    }\n  }\n  &[md-invert] {\n    &:not([md-vertical]) .md-track-fill {\n      @include rtl(left, auto, 0);\n      @include rtl(right, 0, auto);\n    }\n    &[md-vertical] {\n      .md-track-fill {\n        bottom: auto;\n        top: 0;\n      }\n    }\n  }\n}\n\nmd-slider-container {\n  display: flex;\n  align-items: center;\n  flex-direction: row;\n\n  $items-width: 25px;\n  $items-height: $items-width;\n  $items-margin: 16px;\n\n  & > *:first-child,\n  & > *:last-child {\n    &:not(md-slider) {\n      min-width: $items-width;\n      max-width: ($items-width * 2) - 8;\n      height: $items-height;\n      transition: $swift-ease-out;\n      transition-property: color, max-width;\n    }\n  }\n\n  & > *:first-child:not(md-slider) {\n    @include rtl-prop(margin-right, margin-left, $items-margin, auto);\n  }\n\n  & > *:last-child:not(md-slider) {\n    @include rtl-prop(margin-left, margin-right, $items-margin, auto);\n  }\n\n  &[md-vertical] {\n    flex-direction: column;\n\n    & > *:first-child:not(md-slider),\n    & > *:last-child:not(md-slider) {\n      margin-right: 0;\n      margin-left: 0;\n      text-align: center;\n    }\n  }\n\n  md-input-container {\n    input[type=\"number\"] {\n      text-align: center;\n      @include rtl-prop(padding-left, padding-right, 15px, 0); // size of arrows\n      height: $items-height * 2;\n      margin-top: -$items-height;\n    }\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-slider.md-default-theme .md-track {\n    border-bottom: 1px solid #fff;\n  }\n}\n\n"
  },
  {
    "path": "src/components/slider/slider.spec.js",
    "content": "describe('md-slider', function() {\n  var $compile, $timeout, $log, $mdConstant, pageScope;\n\n  beforeEach(module('ngAria'));\n  beforeEach(module('material.components.slider'));\n\n  beforeEach(inject(function($injector) {\n    var $rootScope = $injector.get('$rootScope');\n    pageScope = $rootScope.$new();\n\n    $compile = $injector.get('$compile');\n    $timeout = $injector.get('$timeout');\n    $mdConstant = $injector.get('$mdConstant');\n    $log = $injector.get('$log');\n  }));\n\n  function setup(attrs, dimensions) {\n    var slider;\n\n    slider = $compile('<md-slider ' + (attrs || '') + '>')(pageScope);\n    spyOn(\n      slider[0].querySelector('.md-track-container'),\n      'getBoundingClientRect'\n    ).and.returnValue(angular.extend({\n      width: 100,\n      height: 100,\n      left: 0,\n      right: 0,\n      bottom: 0,\n      top: 0\n    }, dimensions || {}));\n\n    return slider;\n  }\n\n  function setupContainer(attrs, sliderAttrs) {\n    return $compile('<md-slider-container ' + (attrs || '') + '>' +\n      '<md-slider ' + (sliderAttrs || '') + '></md-slider>' +\n      '</md-slider-container>')(pageScope);\n  }\n\n  function getWrapper(slider) {\n    return angular.element(slider[0].querySelector('.md-slider-wrapper'));\n  }\n\n\n\n  it('should not set model below the min', function() {\n    var slider = setup('ng-model=\"value\" min=\"0\" max=\"100\"');\n    pageScope.$apply('value = -50');\n    expect(getWrapper(slider).attr('aria-valuenow')).toEqual('0');\n  });\n\n  it('should not set model above the max', function() {\n    var slider = setup('ng-model=\"value\" min=\"0\" max=\"100\"');\n    pageScope.$apply('value = 150');\n    expect(getWrapper(slider).attr('aria-valuenow')).toEqual('100');\n  });\n\n  it('should set model on press', function() {\n    var slider = setup('ng-model=\"value\" min=\"0\" max=\"100\"');\n    pageScope.$apply('value = 50');\n\n    var wrapper = getWrapper(slider);\n\n    wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientX: 30 }});\n    wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientX: 30 }});\n    $timeout.flush();\n    expect(pageScope.value).toBe(30);\n\n    // When going past max,  it should clamp to max.\n    wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientX: 150}});\n    $timeout.flush();\n    expect(pageScope.value).toBe(100);\n\n    wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientX: 50}});\n    $timeout.flush();\n    expect(pageScope.value).toBe(50);\n  });\n\n  it('should increment model on right arrow', function() {\n    var slider = setup('min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n    pageScope.$apply('model = 100');\n\n    var wrapper = getWrapper(slider);\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(102);\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(104);\n\n    // Stays at max.\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(104);\n  });\n\n  it('should decrement model on left arrow', function() {\n    var slider = setup('min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n    pageScope.$apply('model = 104');\n\n    var wrapper = getWrapper(slider);\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(102);\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(100);\n\n    // Stays at min.\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n    });\n    $timeout.flush();\n    expect(pageScope.model).toBe(100);\n  });\n\n  describe('when raising max and model value equally beyond previous max simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"0\" max=\"{{max}}\" ng-model=\"model\"');\n      pageScope.max = 5;\n      pageScope.model = 5;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('5');\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('5');\n      pageScope.model = 6;\n      pageScope.max = 6;\n      pageScope.$apply();\n    });\n\n    it('should have updated max correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('6');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('6');\n    });\n\n  });\n\n  describe('when raising max and model value beyond previous max simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"0\" max=\"{{max}}\" ng-model=\"model\"');\n      pageScope.max = 4;\n      pageScope.model = 3;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('3');\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('4');\n      pageScope.model = 6;\n      pageScope.max = 7;\n      pageScope.$apply();\n    });\n\n    it('should have updated max correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('7');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('6');\n    });\n\n  });\n\n  describe('when raising max and setting model value below previous max simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"0\" max=\"{{max}}\" ng-model=\"model\"');\n      pageScope.max = 4;\n      pageScope.model = 2;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('2');\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('4');\n      pageScope.model = 3;\n      pageScope.max = 5;\n      pageScope.$apply();\n    });\n\n    it('should have updated max correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemax')).toEqual('5');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('3');\n    });\n\n  });\n\n  describe('when lowering min and model value equally below previous min simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"{{min}}\" max=\"10\" ng-model=\"model\"');\n      pageScope.min = 5;\n      pageScope.model = 5;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('5');\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('5');\n      pageScope.model = 2;\n      pageScope.min = 2;\n      pageScope.$apply();\n    });\n\n    it('should have updated min correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('2');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('2');\n    });\n\n  });\n\n  describe('when lowering min and model value below previous min simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"{{min}}\" max=\"10\" ng-model=\"model\"');\n      pageScope.min = 5;\n      pageScope.model = 6;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('6');\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('5');\n      pageScope.model = 3;\n      pageScope.min = 2;\n      pageScope.$apply();\n    });\n\n    it('should have updated min correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('2');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('3');\n    });\n\n  });\n\n  describe('when lowering min and setting model value above previous min simultaneously', function() {\n\n    var slider = null;\n\n    beforeEach(function() {\n      slider = setup('min=\"{{min}}\" max=\"10\" ng-model=\"model\"');\n      pageScope.min = 5;\n      pageScope.model = 7;\n      pageScope.$apply();\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('7');\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('5');\n      pageScope.model = 6;\n      pageScope.min = 2;\n      pageScope.$apply();\n    });\n\n    it('should have updated min correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuemin')).toEqual('2');\n    });\n\n    it('should have updated value correctly', function() {\n      expect(getWrapper(slider).attr('aria-valuenow')).toEqual('6');\n    });\n\n  });\n\n  it('should update the thumb text', function() {\n    var slider = setup('ng-model=\"value\" md-discrete min=\"0\" max=\"100\" step=\"1\"');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$apply('value = 30');\n    expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('30');\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n    });\n    $timeout.flush();\n    expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('29');\n\n    wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientX: 30}});\n    expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('30');\n\n    wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientX: 31}});\n    wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientX: 31}});\n    expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('31');\n  });\n\n  it('should update the thumb text with the model value when using ng-change', function() {\n    pageScope.stayAt50 = function() {\n      pageScope.value = 50;\n    };\n\n    var slider = setup('ng-model=\"value\" min=\"0\" max=\"100\" ng-change=\"stayAt50()\"');\n    var wrapper = getWrapper(slider);\n\n    wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientX: 30}});\n    $timeout.flush();\n    expect(pageScope.value).toBe(50);\n    expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('50');\n  });\n\n  it('should call $log.warn if aria-label isn\\'t provided', function() {\n    spyOn($log, \"warn\");\n    setup('min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n    expect($log.warn).toHaveBeenCalled();\n  });\n\n  it('should not call $log.warn if aria-label is provided', function() {\n    spyOn($log, \"warn\");\n    setup('aria-label=\"banana\" min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n    expect($log.warn).not.toHaveBeenCalled();\n  });\n\n  it('should add aria attributes', function() {\n    var slider = setup('min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$apply('model = 102');\n\n    expect(wrapper.attr('role')).toEqual('slider');\n    expect(getWrapper(slider).attr('aria-valuemin')).toEqual('100');\n    expect(getWrapper(slider).attr('aria-valuemax')).toEqual('104');\n    expect(getWrapper(slider).attr('aria-valuenow')).toEqual('102');\n\n    wrapper.triggerHandler({\n      type: 'keydown',\n      keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n    });\n    $timeout.flush();\n    expect(getWrapper(slider).attr('aria-valuenow')).toEqual('100');\n  });\n\n  it('should ignore pressdown events when disabled', function() {\n    pageScope.isDisabled = true;\n    var slider = setup('ng-disabled=\"isDisabled\"');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$digest();\n\n    // Doesn't add active class on pressdown when disabled\n    wrapper.triggerHandler({\n      type: '$md.pressdown',\n      srcEvent: {}\n    });\n    expect(slider).not.toHaveClass('md-active');\n\n    // Doesn't remove active class up on pressup when disabled\n    slider.addClass('md-active');\n    wrapper.triggerHandler({\n      type: '$md.pressup',\n      srcEvent: {}\n    });\n    expect(slider).toHaveClass('md-active');\n  });\n\n  it('should disable via the `disabled` attribute', function() {\n    var slider = setup('disabled');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$digest();\n\n    // Check for disabled state by triggering the pressdown handler and asserting that\n    // the slider is not active.\n    wrapper.triggerHandler({\n      type: '$md.pressdown',\n      srcEvent: {}\n    });\n    expect(slider).not.toHaveClass('md-active');\n  });\n\n  it('should add active class on pressdown and remove on blur', function() {\n    var slider = setup();\n    var wrapper = getWrapper(slider);\n\n    expect(slider).not.toHaveClass('md-active');\n\n    wrapper.triggerHandler({\n      type: '$md.pressdown',\n      srcEvent: {}\n    });\n    expect(slider).toHaveClass('md-active');\n\n    wrapper.triggerHandler({\n      type: 'blur',\n      srcEvent: {}\n    });\n    expect(slider).not.toHaveClass('md-active');\n  });\n\n  it('should add md-min class only when at min value', function() {\n    var slider = setup('ng-model=\"model\" min=\"0\" max=\"30\"');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$apply('model = 0');\n    expect(slider).toHaveClass('md-min');\n\n    wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientX: 0}});\n    wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientX: 10}});\n    $timeout.flush();\n    expect(slider).not.toHaveClass('md-min');\n  });\n\n  it('should add md-max class only when at max value', function() {\n    var slider = setup('ng-model=\"model\" min=\"0\" max=\"30\"');\n    var wrapper = getWrapper(slider);\n\n    pageScope.$apply('model = 30');\n    expect(slider).toHaveClass('md-max');\n\n    wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientX: 30}});\n    wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientX: 10}});\n    $timeout.flush();\n    expect(slider).not.toHaveClass('md-max');\n  });\n\n  it('should increment at a predictable step', function() {\n\n    buildSlider(0.1, 0, 1).drag({clientX: 70});\n    expect(pageScope.value).toBe(0.7);\n\n    buildSlider(0.25, 0, 1).drag({clientX: 45});\n    expect(pageScope.value).toBe(0.5);\n\n    buildSlider(0.25, 0, 1).drag({clientX: 35});\n    expect(pageScope.value).toBe(0.25);\n\n    buildSlider(1, 0, 100).drag({clientX: 90});\n    expect(pageScope.value).toBe(90);\n\n    buildSlider(20, 5, 45).drag({clientX: 50});\n    expect(pageScope.value).toBe(25);\n\n    function buildSlider(step, min, max) {\n      var slider = setup('ng-model=\"value\" min=\"' + min + '\" max=\"' + max + '\" step=\"' + step + '\"');\n      pageScope.$apply('value = 0.5');\n\n      var wrapper = getWrapper(slider);\n\n      return {\n        drag: function simulateDrag(drag) {\n\n          wrapper.triggerHandler({type: '$md.pressdown', srcEvent: drag});\n          wrapper.triggerHandler({type: '$md.dragstart', srcEvent: drag});\n\n          $timeout.flush();\n        }\n      };\n    }\n\n  });\n\n  describe('vertical', function() {\n    it('should set model on press', function() {\n      var slider = setup('md-vertical ng-model=\"value\" min=\"0\" max=\"100\"');\n      pageScope.$apply('value = 50');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientY: 70}});\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 70}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(30);\n\n      // When going past max,  it should clamp to max.\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 0}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(100);\n\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 50}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(50);\n    });\n\n    it('should increment model on up arrow', function() {\n      var slider = setup('md-vertical min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 100');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n\n      // Stays at max.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n    });\n\n    it('should decrement model on down arrow', function() {\n      var slider = setup('md-vertical min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 104');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n\n      // Stays at min.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n    });\n\n    it('should update the thumb text', function() {\n      var slider = setup('md-vertical ng-model=\"value\" md-discrete min=\"0\" max=\"100\" step=\"1\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('value = 30');\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('30');\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('29');\n\n      wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientY: 70}});\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('30');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 93}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 93}});\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('7');\n    });\n\n    it('should add md-min class only when at min value', function() {\n      var slider = setup('md-vertical ng-model=\"model\" min=\"0\" max=\"30\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('model = 0');\n      expect(slider).toHaveClass('md-min');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 0}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 10}});\n      $timeout.flush();\n      expect(slider).not.toHaveClass('md-min');\n    });\n\n    it('should add md-max class only when at max value', function() {\n      var slider = setup('md-vertical ng-model=\"model\" min=\"0\" max=\"30\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('model = 30');\n      expect(slider).toHaveClass('md-max');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 30}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 10}});\n      $timeout.flush();\n      expect(slider).not.toHaveClass('md-max');\n    });\n\n    it('should increment at a predictable step', function() {\n\n      buildSlider(0.1, 0, 1).drag({clientY: 30});\n      expect(pageScope.value).toBe(0.7);\n\n      buildSlider(0.25, 0, 1).drag({clientY: 45});\n      expect(pageScope.value).toBe(0.5);\n\n      buildSlider(0.25, 0, 1).drag({clientY: 75});\n      expect(pageScope.value).toBe(0.25);\n\n      buildSlider(1, 0, 100).drag({clientY: 10});\n      expect(pageScope.value).toBe(90);\n\n      buildSlider(20, 5, 45).drag({clientY: 50});\n      expect(pageScope.value).toBe(25);\n\n      function buildSlider(step, min, max) {\n        var slider = setup('md-vertical ng-model=\"value\" min=\"' + min + '\" max=\"' + max + '\" step=\"' + step + '\"');\n        pageScope.$apply('value = 0.5');\n\n        var wrapper = getWrapper(slider);\n\n        return {\n          drag : function simulateDrag(drag) {\n\n            wrapper.triggerHandler({type: '$md.pressdown', srcEvent: drag});\n            wrapper.triggerHandler({type: '$md.dragstart', srcEvent: drag});\n\n            $timeout.flush();\n          }\n        };\n      }\n\n    });\n  });\n\n  describe('slider container', function() {\n\n    it('should have `._md` class indicator', inject(function() {\n      var element = setupContainer('disabled=\"disabled\"');\n      expect(element.hasClass('_md')).toBe(true);\n    }));\n\n    it('should disable via the `disabled` attribute', function() {\n      var container = setupContainer('disabled=\"disabled\"');\n      var slider = angular.element(container[0].querySelector('md-slider'));\n      var wrapper = getWrapper(container);\n\n      // Check for disabled state by triggering the pressdown handler and asserting that\n      // the slider is not active.\n      wrapper.triggerHandler({\n        type: '$md.pressdown',\n        srcEvent: {}\n      });\n      expect(slider).not.toHaveClass('md-active');\n    });\n\n    it('should disable via the `ngDisabled` attribute', function() {\n      var container = setupContainer('ng-disabled=\"isDisabled\"');\n      var slider = angular.element(container[0].querySelector('md-slider'));\n      var wrapper = getWrapper(container);\n\n      // Check for disabled state by triggering the pressdown handler and asserting that\n      // the slider is not active.\n      wrapper.triggerHandler({\n        type: '$md.pressdown',\n        srcEvent: {}\n      });\n      expect(slider).toHaveClass('md-active');\n\n      // Removing focus from the slider\n      wrapper.triggerHandler({\n        type: 'blur',\n        srcEvent: {}\n      });\n\n      pageScope.$apply('isDisabled = true');\n\n      wrapper.triggerHandler({\n        type: '$md.pressdown',\n        srcEvent: {}\n      });\n      expect(slider).not.toHaveClass('md-active');\n    });\n\n    it('should disable related inputs', inject(function($compile) {\n      var container = setupContainer('ng-disabled=\"isDisabled\"');\n      var slider = angular.element(container[0].querySelector('md-slider'));\n\n      var inputContainer = $compile('<md-input-container><input /></md-input-container>')(pageScope);\n      var input = angular.element(inputContainer[0].querySelector('input'));\n\n      container.append(input);\n\n      expect(input.attr('disabled')).toEqual(undefined);\n\n      pageScope.$apply('isDisabled = true');\n\n      expect(input.attr('disabled')).toEqual('disabled');\n    }));\n\n  });\n\n  describe('invert', function() {\n    it('should set model on press', function() {\n      var slider = setup('md-vertical md-invert ng-model=\"value\" min=\"0\" max=\"100\"');\n      pageScope.$apply('value = 50');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientY: 70}});\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 70}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(70);\n\n      // When going past max,  it should clamp to max.\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 0}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(0);\n\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 50}});\n      $timeout.flush();\n      expect(pageScope.value).toBe(50);\n    });\n\n    it('should decrement model on up arrow', function() {\n      var slider = setup('md-vertical md-invert min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 104');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n\n      // Stays at min.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.UP_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n\n    });\n\n    it('should increment model on down arrow', function() {\n      var slider = setup('md-vertical md-invert min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 100');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n\n      // Stays at max.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n    });\n\n    it('should update the thumb text', function() {\n      var slider = setup('md-vertical md-invert ng-model=\"value\" md-discrete min=\"0\" max=\"100\" step=\"1\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('value = 30');\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('30');\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.DOWN_ARROW\n      });\n      $timeout.flush();\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('31');\n\n      wrapper.triggerHandler({type: '$md.pressdown', srcEvent: { clientY: 70}});\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('70');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 93}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 93}});\n      expect(slider[0].querySelector('.md-thumb-text').textContent).toBe('93');\n    });\n\n    it('should add md-min class only when at min value', function() {\n      var slider = setup('md-vertical md-invert ng-model=\"model\" min=\"0\" max=\"30\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('model = 0');\n      expect(slider).toHaveClass('md-min');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 0}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 10}});\n      $timeout.flush();\n      expect(slider).not.toHaveClass('md-min');\n    });\n\n    it('should add md-max class only when at max value', function() {\n      var slider = setup('md-vertical md-invert ng-model=\"model\" min=\"0\" max=\"30\"');\n      var wrapper = getWrapper(slider);\n\n      pageScope.$apply('model = 30');\n      expect(slider).toHaveClass('md-max');\n\n      wrapper.triggerHandler({type: '$md.dragstart', srcEvent: { clientY: 30}});\n      wrapper.triggerHandler({type: '$md.drag', srcEvent: { clientY: 10}});\n      $timeout.flush();\n      expect(slider).not.toHaveClass('md-max');\n    });\n\n    it('should increment at a predictable step', function() {\n\n      buildSlider(0.1, 0, 1).drag({clientY: 30});\n      expect(pageScope.value).toBe(0.3);\n\n      buildSlider(0.25, 0, 1).drag({clientY: 45});\n      expect(pageScope.value).toBe(0.5);\n\n      buildSlider(0.25, 0, 1).drag({clientY: 75});\n      expect(pageScope.value).toBe(0.75);\n\n      buildSlider(1, 0, 100).drag({clientY: 10});\n      expect(pageScope.value).toBe(10);\n\n      buildSlider(20, 5, 45).drag({clientY: 50});\n      expect(pageScope.value).toBe(25);\n\n      function buildSlider(step, min, max) {\n        var slider = setup('md-vertical md-invert ng-model=\"value\" min=\"' + min + '\" max=\"' + max + '\" step=\"' + step + '\"');\n        pageScope.$apply('value = 0.5');\n\n        var wrapper = getWrapper(slider);\n\n        return {\n          drag: function simulateDrag(drag) {\n\n            wrapper.triggerHandler({type: '$md.pressdown', srcEvent: drag});\n            wrapper.triggerHandler({type: '$md.dragstart', srcEvent: drag});\n\n            $timeout.flush();\n          }\n        };\n      }\n\n    });\n\n    it('should increment model on left arrow', function() {\n      var slider = setup('md-invert min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 100');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n\n      // Stays at max.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.LEFT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(104);\n    });\n\n    it('should decrement model on right arrow', function() {\n      var slider = setup('md-invert min=\"100\" max=\"104\" step=\"2\" ng-model=\"model\"');\n      pageScope.$apply('model = 104');\n\n      var wrapper = getWrapper(slider);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(102);\n\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n\n      // Stays at min.\n      wrapper.triggerHandler({\n        type: 'keydown',\n        keyCode: $mdConstant.KEY_CODE.RIGHT_ARROW\n      });\n      $timeout.flush();\n      expect(pageScope.model).toBe(100);\n    });\n\n  });\n\n\n  it('should set a default tabindex', function() {\n    var slider = setup();\n    var wrapper = getWrapper(slider);\n\n    expect(wrapper.attr('tabindex')).toBe('0');\n  });\n\n  it('should set a -1 tabindex to disabled slider', function() {\n    var slider = setup('ng-disabled=\"isDisabled\"');\n    var wrapper = getWrapper(slider);\n\n    expect(wrapper.attr('tabindex')).toBe('-1');\n  });\n\n  it('should not overwrite tabindex attribute', function() {\n    var slider = setup('tabindex=\"2\"');\n    var wrapper = getWrapper(slider);\n\n    expect(wrapper.attr('tabindex')).toBe('2');\n  });\n});\n"
  },
  {
    "path": "src/components/sticky/sticky.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.sticky\n * @description\n * Sticky effects for md.\n */\nangular\n  .module('material.components.sticky', [\n    'material.core',\n    'material.components.content'\n  ])\n  .factory('$mdSticky', MdSticky);\n\n/**\n * @ngdoc service\n * @name $mdSticky\n * @module material.components.sticky\n *\n * @description\n * The `$mdSticky` service provides the capability to make elements sticky, even when the browser\n * does not support `position: sticky`.\n *\n * Whenever the current browser supports stickiness natively, the `$mdSticky` service will leverage\n * the native browser's sticky functionality.\n *\n * By default the `$mdSticky` service compiles the cloned element, when not specified through the\n * `stickyClone` parameter, in the same scope as the actual element lives.\n *\n * @usage\n * <hljs lang=\"js\">\n *   angular.module('myModule')\n *     .directive('stickyText', function($mdSticky) {\n *       return {\n *         restrict: 'E',\n *         template: '<span>Sticky Text</span>',\n *         link: function(scope, element) {\n *           $mdSticky(scope, element);\n *         }\n *       };\n *     });\n * </hljs>\n *\n * <h3>Notes</h3>\n * When using an element which contains a compiled directive that changes the DOM structure\n * during compilation, you should compile the clone yourself.\n *\n * An example of this usage can be found below:\n * <hljs lang=\"js\">\n *   angular.module('myModule')\n *     .directive('stickySelect', function($mdSticky, $compile) {\n *       var SELECT_TEMPLATE =\n *         '<md-select ng-model=\"selected\">' +\n *         '  <md-option>Option 1</md-option>' +\n *         '</md-select>';\n *\n *       return {\n *         restrict: 'E',\n *         replace: true,\n *         template: SELECT_TEMPLATE,\n *         link: function(scope, element) {\n *           $mdSticky(scope, element, $compile(SELECT_TEMPLATE)(scope));\n *         }\n *       };\n *     });\n * </hljs>\n *\n * @returns {function(IScope, JQLite, ITemplateLinkingFunction=): void} `$mdSticky` returns a\n *   function that takes three arguments:\n *   - `scope`: the scope to use when compiling the clone and listening for the `$destroy` event,\n *      which triggers removal of the clone\n *   - `element`: the element that will be 'sticky'\n *   - `stickyClone`: An optional clone of the element (returned from AngularJS'\n *      [$compile service](https://docs.angularjs.org/api/ng/service/$compile#usage)),\n *      that will be shown when the user starts scrolling past the original element. If not\n *      provided, the result of `element.clone()` will be used and compiled in the given scope.\n */\nfunction MdSticky($mdConstant, $$rAF, $mdUtil, $compile) {\n\n  var browserStickySupport = $mdUtil.checkStickySupport();\n\n  /**\n   * Registers an element as sticky, used internally by directives to register themselves.\n   */\n  return function registerStickyElement(scope, element, stickyClone) {\n    var contentCtrl = element.controller('mdContent');\n    if (!contentCtrl) return;\n\n    if (browserStickySupport) {\n      element.css({\n        position: browserStickySupport,\n        top: 0,\n        'z-index': 2\n      });\n    } else {\n      var $$sticky = contentCtrl.$element.data('$$sticky');\n      if (!$$sticky) {\n        $$sticky = setupSticky(contentCtrl);\n        contentCtrl.$element.data('$$sticky', $$sticky);\n      }\n\n      // Compile our cloned element, when cloned in this service, into the given scope.\n      var cloneElement = stickyClone || $compile(element.clone())(scope);\n\n      var deregister = $$sticky.add(element, cloneElement);\n      scope.$on('$destroy', deregister);\n    }\n  };\n\n  function setupSticky(contentCtrl) {\n    var contentEl = contentCtrl.$element;\n\n    // Refresh elements is very expensive, so we use the debounced\n    // version when possible.\n    var debouncedRefreshElements = $$rAF.throttle(refreshElements);\n\n    // setupAugmentedScrollEvents gives us `$scrollstart` and `$scroll`,\n    // more reliable than `scroll` on android.\n    setupAugmentedScrollEvents(contentEl);\n    contentEl.on('$scrollstart', debouncedRefreshElements);\n    contentEl.on('$scroll', onScroll);\n\n    var self;\n    return self = {\n      prev: null,\n      current: null, // the currently stickied item\n      next: null,\n      items: [],\n      add: add,\n      refreshElements: refreshElements\n    };\n\n    /***************\n     * Public\n     ***************/\n    // Add an element and its sticky clone to this content's sticky collection\n    function add(element, stickyClone) {\n      stickyClone.addClass('md-sticky-clone');\n\n      var item = {\n        element: element,\n        clone: stickyClone\n      };\n      self.items.push(item);\n\n      $mdUtil.nextTick(function() {\n        contentEl.prepend(item.clone);\n      });\n\n      debouncedRefreshElements();\n\n      return function remove() {\n        self.items.forEach(function(item, index) {\n          if (item.element[0] === element[0]) {\n            self.items.splice(index, 1);\n            item.clone.remove();\n          }\n        });\n        debouncedRefreshElements();\n      };\n    }\n\n    function refreshElements() {\n      // Sort our collection of elements by their current position in the DOM.\n      // We need to do this because our elements' order of being added may not\n      // be the same as their order of display.\n      self.items.forEach(refreshPosition);\n      self.items = self.items.sort(function(a, b) {\n        return a.top < b.top ? -1 : 1;\n      });\n\n      // Find which item in the list should be active,\n      // based upon the content's current scroll position\n      var item;\n      var currentScrollTop = contentEl.prop('scrollTop');\n      for (var i = self.items.length - 1; i >= 0; i--) {\n        if (currentScrollTop > self.items[i].top) {\n          item = self.items[i];\n          break;\n        }\n      }\n      setCurrentItem(item);\n    }\n\n    /***************\n     * Private\n     ***************/\n\n    // Find the `top` of an item relative to the content element,\n    // and also the height.\n    function refreshPosition(item) {\n      // Find the top of an item by adding to the offsetHeight until we reach the\n      // content element.\n      var current = item.element[0];\n      item.top = 0;\n      item.left = 0;\n      item.right = 0;\n      while (current && current !== contentEl[0]) {\n        item.top += current.offsetTop;\n        item.left += current.offsetLeft;\n        if (current.offsetParent) {\n          // Compute offsetRight\n          item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft;\n        }\n        current = current.offsetParent;\n      }\n      item.height = item.element.prop('offsetHeight');\n\n      var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n      $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n      $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\n    }\n\n    // As we scroll, push in and select the correct sticky element.\n    function onScroll() {\n      var scrollTop = contentEl.prop('scrollTop');\n      var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);\n\n      // Store the previous scroll so we know which direction we are scrolling\n      onScroll.prevScrollTop = scrollTop;\n\n      //\n      // AT TOP (not scrolling)\n      //\n      if (scrollTop === 0) {\n        // If we're at the top, just clear the current item and return\n        setCurrentItem(null);\n        return;\n      }\n\n      //\n      // SCROLLING DOWN (going towards the next item)\n      //\n      if (isScrollingDown) {\n\n        // If we've scrolled down past the next item's position, sticky it and return\n        if (self.next && self.next.top <= scrollTop) {\n          setCurrentItem(self.next);\n          return;\n        }\n\n        // If the next item is close to the current one, push the current one up out of the way\n        if (self.current && self.next && self.next.top - scrollTop <= self.next.height) {\n          translate(self.current, scrollTop + (self.next.top - self.next.height - scrollTop));\n          return;\n        }\n      }\n\n      //\n      // SCROLLING UP (not at the top & not scrolling down; must be scrolling up)\n      //\n      if (!isScrollingDown) {\n\n        // If we've scrolled up past the previous item's position, sticky it and return\n        if (self.current && self.prev && scrollTop < self.current.top) {\n          setCurrentItem(self.prev);\n          return;\n        }\n\n        // If the next item is close to the current one, pull the current one down into view\n        if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {\n          translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));\n          return;\n        }\n      }\n\n      //\n      // Otherwise, just move the current item to the proper place (scrolling up or down)\n      //\n      if (self.current) {\n        translate(self.current, scrollTop);\n      }\n    }\n\n    function setCurrentItem(item) {\n      if (self.current === item) return;\n      // Deactivate currently active item\n      if (self.current) {\n        translate(self.current, null);\n        setStickyState(self.current, null);\n      }\n\n      // Activate new item if given\n      if (item) {\n        setStickyState(item, 'active');\n      }\n\n      self.current = item;\n      var index = self.items.indexOf(item);\n      // If index === -1, index + 1 = 0. It works out.\n      self.next = self.items[index + 1];\n      self.prev = self.items[index - 1];\n      setStickyState(self.next, 'next');\n      setStickyState(self.prev, 'prev');\n    }\n\n    function setStickyState(item, state) {\n      if (!item || item.state === state) return;\n      if (item.state) {\n        item.clone.attr('sticky-prev-state', item.state);\n        item.element.attr('sticky-prev-state', item.state);\n      }\n      item.clone.attr('sticky-state', state);\n      item.element.attr('sticky-state', state);\n      item.state = state;\n    }\n\n    function translate(item, amount) {\n      if (!item) return;\n      if (amount === null || amount === undefined) {\n        if (item.translateY) {\n          item.translateY = null;\n          item.clone.css($mdConstant.CSS.TRANSFORM, '');\n        }\n      } else {\n        item.translateY = amount;\n\n        $mdUtil.bidi(item.clone, $mdConstant.CSS.TRANSFORM,\n          'translate3d(' + item.left + 'px,' + amount + 'px,0)',\n          'translateY(' + amount + 'px)'\n        );\n      }\n    }\n  }\n\n\n  // Android 4.4 don't accurately give scroll events.\n  // To fix this problem, we setup a fake scroll event. We say:\n  // > If a scroll or touchmove event has happened in the last DELAY milliseconds,\n  //   then send a `$scroll` event every animationFrame.\n  // Additionally, we add $scrollstart and $scrollend events.\n  function setupAugmentedScrollEvents(element) {\n    var SCROLL_END_DELAY = 200;\n    var isScrolling;\n    var lastScrollTime;\n    element.on('scroll touchmove', function() {\n      if (!isScrolling) {\n        isScrolling = true;\n        $$rAF.throttle(loopScrollEvent);\n        element.triggerHandler('$scrollstart');\n      }\n      element.triggerHandler('$scroll');\n      lastScrollTime = +$mdUtil.now();\n    });\n\n    function loopScrollEvent() {\n      if (+$mdUtil.now() - lastScrollTime > SCROLL_END_DELAY) {\n        isScrolling = false;\n        element.triggerHandler('$scrollend');\n      } else {\n        element.triggerHandler('$scroll');\n        $$rAF.throttle(loopScrollEvent);\n      }\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/components/sticky/sticky.scss",
    "content": ".md-sticky-clone {\n  z-index: 2;\n  top: 0;\n  left: 0;\n  right: 0;\n  position: absolute !important;\n\n  transform: translate3d(-9999px,-9999px,0);\n\n  &[sticky-state=\"active\"] {\n    transform: translate3d(0, 0, 0);\n    &:not(.md-sticky-no-effect) .md-subheader-inner {\n      animation: subheaderStickyHoverIn 0.3s ease-out both;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/sticky/sticky.spec.js",
    "content": "describe('$mdSticky service', function() {\n\n  beforeEach(module('material.components.sticky'));\n\n  it('should compile our cloned element in the same scope', function(done) {\n    inject(function($compile, $rootScope, $mdSticky, $timeout) {\n      var scope = $rootScope.$new();\n      var contentEl = $compile(angular.element(\n        '<md-content>' +\n        '<sticky-directive>Sticky Element</sticky-directive>' +\n        '</md-content>'\n      ))(scope);\n\n      document.body.appendChild(contentEl[0]);\n\n      var stickyEl = contentEl.children().eq(0);\n      $mdSticky(scope, stickyEl);\n\n      // Flush the `$$sticky.add()` timeout.\n      $timeout.flush();\n\n      // When the current browser, which executes that spec, supports the sticky position, then we will always succeed\n      // the test, because otherwise our test will fail.\n      if (stickyEl.css('position')) {\n        expect(true).toBe(true);\n      } else {\n        expect(contentEl.children().length).toBe(2);\n\n        var stickyClone = contentEl[0].querySelector('.md-sticky-clone');\n        expect(stickyClone).toBeTruthy();\n\n        expect(angular.element(stickyClone).scope()).toBe(scope);\n      }\n\n      contentEl.remove();\n\n      done();\n    });\n  });\n\n  it('should not compile our self specified clone in the given scope', function(done) {\n    inject(function($compile, $rootScope, $mdSticky, $timeout) {\n      var scope = $rootScope.$new();\n      var cloneScope = $rootScope.$new();\n\n      var contentEl = $compile(angular.element(\n        '<md-content>' +\n          '<sticky-directive>Sticky Element</sticky-directive>' +\n        '</md-content>'\n      ))(scope);\n\n      var cloneEl = $compile(angular.element(\n        '<sticky-directive>Self-cloned Element</sticky-directive>'\n      ))(cloneScope);\n\n      document.body.appendChild(contentEl[0]);\n\n      var stickyEl = contentEl.children().eq(0);\n      $mdSticky(scope, stickyEl, cloneEl);\n\n      // Flush the `$$sticky.add()` timeout.\n      $timeout.flush();\n\n      // When the current browser, which executes that spec, supports the sticky position, then we will always succeed\n      // the test, because otherwise our test will fail.\n      if (stickyEl.css('position')) {\n        expect(true).toBe(true);\n      } else {\n        expect(contentEl.children().length).toBe(2);\n\n        var stickyClone = contentEl[0].querySelector('.md-sticky-clone');\n        expect(stickyClone).toBeTruthy();\n\n        expect(angular.element(stickyClone).scope()).toBe(cloneScope);\n      }\n\n      contentEl.remove();\n\n      done();\n    });\n  });\n\n});\n\n/*\n * TODO: adjust to work properly with refactors of original code\n */\n/*\ndescribe('$mdStickySpec', function() {\n  var $document, $compile, $rootScope, $mdSticky;\n\n  beforeEach(module('material.components.sticky'));\n\n  beforeEach(inject(function(_$document_, _$compile_, _$rootScope_, _$mdSticky_) {\n    $document = _$document_;\n    $rootScope = _$rootScope_;\n    $compile = _$compile_;\n    $mdSticky = _$mdSticky_;\n  }));\n\n  var $container, $firstSticky, $secondSticky, $sticky;\n  function setup(opts) {\n    opts = opts || {};\n\n    var TEST_HTML = '<md-content><h2>First sticky</h2><h2>Second sticky</h2></md-content>';\n    var scope = $rootScope.$new();\n    $container = $compile(TEST_HTML)(scope);\n    $firstSticky = $container.children().eq(0);\n    $secondSticky = $container.children().eq(1);\n\n    // Wire up our special $container instance;\n    $firstSticky.controller('mdContent').$element = $container;\n\n    $document.find('body').html('');\n    $document.find('body').append($container);\n\n\n    if(!opts.skipFirst) {\n      $mdSticky($rootScope.$new(), $firstSticky);\n    }\n    if(!opts.skipSecond) {\n      $mdSticky($rootScope.$new(), $secondSticky);\n    }\n\n\n    // Overwrite the scrollTop property to return the opts.containerScroll\n    if(opts.containerScroll) {\n      var originalProp = $container.prop;\n      $container.prop = function(prop) {\n        if(prop == 'scrollTop') {\n          return opts.containerScroll;\n        } else {\n          originalProp.call($container, prop);\n        }\n      };\n    }\n\n    // Overwrite children() to provide mock rect positions\n    if(opts.firstActual) {\n      $firstSticky[0].getBoundingClientRect = function() { return opts.firstActual; };\n    }\n    if(opts.secondActual) {\n      $secondSticky[0].getBoundingClientRect = function() { return opts.secondActual; };\n    }\n    if(opts.firstTarget) {\n      var $firstOuter = $firstSticky.parent();\n      $firstOuter[0].getBoundingClientRect = function() { return opts.firstTarget; };\n    }\n    if(opts.secondTarget) {\n      var $secondOuter = $secondSticky.parent();\n      $secondOuter[0].getBoundingClientRect = function() { return opts.secondTarget; };\n    }\n\n\n\n    $sticky = $container.data('$sticky');\n\n    if(opts.lastScroll) { $sticky.lastScroll = opts.lastScroll; }\n\n    scope.$digest();\n  }\n\n  it('throws an error if uses outside of md-content', inject(function($mdSticky, $compile, $rootScope) {\n    var html = '<h2>Hello world!</h2>';\n    function useWithoutMdContent() {\n      $mdSticky($rootScope.$new(), angular.element(html));\n    }\n    expect(useWithoutMdContent).toThrow('$mdSticky used outside of md-content');\n  }));\n\n  it('adds class md-sticky-active when an element would scroll off screen', function() {\n    var firstActual = { top: -10, bottom: 9, height: 19 };\n    setup({containerScroll: 10, firstActual: firstActual, skipSecond: true});\n    $sticky.check();\n    expect($firstSticky.hasClass('md-sticky-active')).toBe(true);\n  });\n\n  it('removes class md-sticky-active when an element is no longer sticky', function() {\n    var firstTarget = { top: 1, bottom: 10, height: 9 };\n    setup({\n      containerScroll: 10,\n      lastScroll: 11\n    });\n    $firstSticky.addClass('md-sticky-active');\n    $sticky.check();\n    expect($firstSticky.hasClass('md-sticky-active')).toBe(false);\n  });\n\n  it('pushes the active element when the next sticky element touches it', function() {\n    var firstTarget = { top: -10, bottom: 9, height: 19 };\n    var firstActual = { top: 0, bottom: 19, height: 19 };\n    var secondActual = { top: 18, bottom: 37, height: 19 };\n    setup({\n      containerScroll: 19,\n      firstActual: firstActual,\n      firstTarget: firstTarget,\n      secondActual: secondActual\n    });\n    $firstSticky.attr('md-sticky-active', true);\n    $sticky.check();\n    expect($firstSticky.data('translatedHeight')).toBe(-1);\n  });\n\n  it('increments the active element when it is pushed off screen', function() {\n    var firstActual = { top: -9, bottom: 0, height: 10 };\n    setup({\n      containerScroll: 10,\n      firstActual: firstActual\n    });\n    $firstSticky.addClass('md-sticky-active');\n    $sticky.check();\n    expect($firstSticky.hasClass('md-sticky-active')).toBe(false);\n    expect($sticky.targetIndex).toBe(1);\n  });\n\n  it('pulls the previous element when the sticky element losens', function() {\n    var firstActual = { top: -10, bottom: -1, height: 9 };\n    var firstTarget = { top: -50, bottom: -41, height: 9 };\n    var secondActual = { top: 0, bottom: 9, height: 9 };\n    setup({\n      containerScroll: 30,\n      lastScroll: 31,\n      firstActual: firstActual,\n      firstTarget: firstTarget,\n      secondTarget: secondActual,\n      secondActual: secondActual\n    });\n    $sticky.targetIndex = 0;\n    $firstSticky.data('translatedHeight', -10);\n    $firstSticky.addClass('md-sticky-active');\n    $sticky.check();\n    expect($firstSticky.data('translatedHeight')).toBe(-9);\n  });\n});\n*/\n"
  },
  {
    "path": "src/components/subheader/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"SubheaderAppCtrl\" layout=\"column\" flex layout-fill ng-cloak>\n\n  <md-toolbar md-scroll-shrink>\n    <div class=\"md-toolbar-tools\">My Messages</div>\n  </md-toolbar>\n\n  <md-content style=\"height: 600px;\" md-theme=\"altTheme\">\n\n    <section>\n      <md-subheader class=\"md-primary\">Unread Messages</md-subheader>\n      <md-list layout-padding>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"message in messages\">\n            <img ng-src=\"{{message.face}}\" class=\"md-avatar\" alt=\"{{message.who}}\">\n            <div class=\"md-list-item-text\">\n              <h3>{{message.what}}</h3>\n              <h4>{{message.who}}</h4>\n              <p>\n                {{message.notes}}\n              </p>\n            </div>\n        </md-list-item>\n      </md-list>\n    </section>\n\n    <section>\n      <md-subheader class=\"md-warn\">Late Messages</md-subheader>\n      <md-list layout=\"column\" layout-padding>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"message in messages\">\n          <img ng-src=\"{{message.face}}\" class=\"md-avatar\" alt=\"{{message.who}}\">\n          <div class=\"md-list-item-text\">\n            <h3>{{message.what}}</h3>\n            <h4>{{message.who}}</h4>\n            <p>\n              {{message.notes}}\n            </p>\n          </div>\n        </md-list-item>\n      </md-list>\n    </section>\n\n    <section>\n      <md-subheader>Read Messages</md-subheader>\n      <md-list layout=\"column\" layout-padding>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"message in messages\">\n          <img ng-src=\"{{message.face}}\" class=\"md-avatar\" alt=\"{{message.who}}\">\n          <div class=\"md-list-item-text\">\n            <h3>{{message.what}}</h3>\n            <h4>{{message.who}}</h4>\n            <p>\n              {{message.notes}}\n            </p>\n          </div>\n        </md-list-item>\n      </md-list>\n    </section>\n\n    <section>\n      <md-subheader class=\"md-accent\">Archived messages</md-subheader>\n      <md-list layout=\"column\" layout-padding>\n        <md-list-item class=\"md-3-line\" ng-repeat=\"message in messages\">\n          <img ng-src=\"{{message.face}}\" class=\"md-avatar\" alt=\"{{message.who}}\">\n          <div class=\"md-list-item-text\">\n            <h3>{{message.what}}</h3>\n            <h4>{{message.who}}</h4>\n            <p>\n              {{message.notes}}\n            </p>\n          </div>\n        </md-list-item>\n      </md-list>\n    </section>\n\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/subheader/demoBasicUsage/script.js",
    "content": "\nangular.module('subheaderBasicDemo', ['ngMaterial'])\n.config(function($mdThemingProvider) {\n  $mdThemingProvider.theme('altTheme')\n    .primaryPalette('purple');\n})\n.controller('SubheaderAppCtrl', function($scope) {\n    var imagePath = 'img/60.jpeg';\n    $scope.messages = [\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n      {\n        face : imagePath,\n        what: 'Brunch this weekend?',\n        who: 'Min Li Chan',\n        when: '3:08PM',\n        notes: \" I'll be in your neighborhood doing errands\"\n      },\n    ];\n});\n"
  },
  {
    "path": "src/components/subheader/demoBasicUsage/style.css",
    "content": "\n.face {\n  border-radius: 30px;\n  border: 1px solid #ddd;\n  width: 48px;\n  margin: 16px;\n}\n\n"
  },
  {
    "path": "src/components/subheader/subheader-theme.scss",
    "content": ".md-subheader.md-THEME_NAME-theme {\n  color: '{{ foreground-2-0.54 }}';\n  background-color: '{{background-default}}';\n\n  &.md-primary {\n    color: '{{primary-color}}'\n  }\n  &.md-accent {\n    color: '{{accent-color}}'\n  }\n  &.md-warn {\n    color: '{{warn-color}}'\n  }\n}\n"
  },
  {
    "path": "src/components/subheader/subheader.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.subheader\n * @description\n * SubHeader module\n *\n *  Subheaders are special list tiles that delineate distinct sections of a\n *  list or grid list and are typically related to the current filtering or\n *  sorting criteria. Subheader tiles are either displayed inline with tiles or\n *  can be associated with content, for example, in an adjacent column.\n *\n *  Upon scrolling, subheaders remain pinned to the top of the screen and remain\n *  pinned until pushed on or off screen by the next subheader. @see [Material\n *  Design Specifications](https://material.io/archive/guidelines/components/subheaders.html)\n *\n *  > To improve the visual grouping of content, use the system color for your subheaders.\n *\n */\nangular\n  .module('material.components.subheader', [\n    'material.core',\n    'material.components.sticky'\n  ])\n  .directive('mdSubheader', MdSubheaderDirective);\n\n/**\n * @ngdoc directive\n * @name mdSubheader\n * @module material.components.subheader\n *\n * @restrict E\n *\n * @description\n * The `md-subheader` directive creates a sticky subheader for a section.\n *\n * Developers are able to disable the stickiness of the subheader by using the following markup\n *\n * <hljs lang=\"html\">\n *   <md-subheader class=\"md-no-sticky\">Not Sticky</md-subheader>\n * </hljs>\n *\n * ### Notes\n * - The `md-subheader` directive uses the <a ng-href=\"api/service/$mdSticky\">$mdSticky</a> service\n * to make the subheader sticky.\n *\n * > Whenever the current browser doesn't support stickiness natively, the subheader\n * will be compiled twice to create a sticky clone of the subheader.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-subheader>Online Friends</md-subheader>\n * </hljs>\n */\n\nfunction MdSubheaderDirective($mdSticky, $compile, $mdTheming, $mdUtil, $mdAria) {\n  return {\n    restrict: 'E',\n    replace: true,\n    transclude: true,\n    template: (\n    '<div class=\"md-subheader _md\">' +\n    '  <div class=\"md-subheader-inner\">' +\n    '    <div class=\"md-subheader-content\"></div>' +\n    '  </div>' +\n    '</div>'\n    ),\n    link: function postLink(scope, element, attr, controllers, transclude) {\n      $mdTheming(element);\n      element.addClass('_md');\n\n      // Remove the ngRepeat attribute from the root element, because we don't want to compile\n      // the ngRepeat for the sticky clone again.\n      $mdUtil.prefixer().removeAttribute(element, 'ng-repeat');\n\n      var outerHTML = element[0].outerHTML;\n\n      function getContent(el) {\n        return angular.element(el[0].querySelector('.md-subheader-content'));\n      }\n\n      // Set the ARIA attributes on the original element since it keeps it's original place in\n      // the DOM, whereas the clones are in reverse order. Should be done after the outerHTML,\n      // in order to avoid having multiple element be marked as headers.\n      attr.$set('role', 'heading');\n      $mdAria.expect(element, 'aria-level', '2');\n\n      // Transclude the user-given contents of the subheader\n      // the conventional way.\n      transclude(scope, function(clone) {\n        getContent(element).append(clone);\n      });\n\n      // Create another clone, that uses the outer and inner contents\n      // of the element, that will be 'stickied' as the user scrolls.\n      if (!element.hasClass('md-no-sticky')) {\n        transclude(scope, function(clone) {\n          // If the user adds an ng-if or ng-repeat directly to the md-subheader element, the\n          // compiled clone below will only be a comment tag (since they replace their elements with\n          // a comment) which cannot be properly passed to the $mdSticky; so we wrap it in our own\n          // DIV to ensure we have something $mdSticky can use\n          var wrapper = $compile('<div class=\"md-subheader-wrapper\" aria-hidden=\"true\">' + outerHTML + '</div>')(scope);\n\n          // Delay initialization until after any `ng-if`/`ng-repeat`/etc has finished before\n          // attempting to create the clone\n          $mdUtil.nextTick(function() {\n            // Append our transcluded clone into the wrapper.\n            // We don't have to recompile the element again, because the clone is already\n            // compiled in it's transclusion scope. If we recompile the outerHTML of the new clone, we would lose\n            // our ngIf's and other previous registered bindings / properties.\n            getContent(wrapper).append(clone);\n          });\n\n          // Make the element sticky and provide the stickyClone our self, to avoid recompilation of the subheader\n          // element.\n          $mdSticky(scope, element, wrapper);\n        });\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/subheader/subheader.scss",
    "content": "$subheader-line-height: 1em !default;\n$subheader-font-size: rem(1.4) !default;\n$subheader-padding: ($baseline-grid * 2) !default;\n$subheader-font-weight: 500 !default;\n$subheader-margin: 0 0 0 0 !default;\n$subheader-sticky-shadow: 0px 2px 4px 0 rgba(0,0,0,0.16) !default;\n\n@keyframes subheaderStickyHoverIn {\n  0% {\n    box-shadow: 0 0 0 0 transparent;\n  }\n  100% {\n    box-shadow: $subheader-sticky-shadow;\n  }\n}\n@keyframes subheaderStickyHoverOut {\n  0% {\n    box-shadow: $subheader-sticky-shadow;\n  }\n  100% {\n    box-shadow: 0 0 0 0 transparent;\n  }\n}\n\n.md-subheader-wrapper {\n\n  &:not(.md-sticky-no-effect) {\n    .md-subheader {\n      margin: 0;\n    }\n\n    transition: 0.2s ease-out margin;\n\n    &.md-sticky-clone {\n      z-index: 2;\n    }\n\n    &[sticky-state=\"active\"] {\n      margin-top: -2px;\n    }\n\n    &:not(.md-sticky-clone)[sticky-prev-state=\"active\"] .md-subheader-inner:after {\n      animation: subheaderStickyHoverOut 0.3s ease-out both;\n    }\n  }\n\n}\n\n.md-subheader {\n  display: block;\n  font-size: $subheader-font-size;\n  font-weight: $subheader-font-weight;\n  line-height: $subheader-line-height;\n  margin: $subheader-margin;\n  position: relative;\n\n  .md-subheader-inner {\n    display: block;\n    padding: $subheader-padding;\n  }\n\n  .md-subheader-content {\n    display: block;\n    z-index: 1;\n    position: relative;\n  }\n}\n"
  },
  {
    "path": "src/components/subheader/subheader.spec.js",
    "content": "describe('mdSubheader', function() {\n  var BASIC_SUBHEADER = '<md-subheader>Hello world!</md-subheader>';\n  var pageScope, element, cloneElement, controller, contentElement;\n  var $rootScope, $timeout, $exceptionHandler;\n\n  beforeEach(module('material.components.subheader', function($provide) {\n    $provide.decorator('$mdUtil', function($delegate) {\n\n      // We always return nothing on the checkStickySupport method to test the functionality of the subheaders\n      // with the sticky clones behavior.\n      $delegate.checkStickySupport = angular.noop;\n\n      return $delegate;\n    });\n  }));\n\n  beforeEach(inject(function($injector) {\n    $rootScope = $injector.get('$rootScope');\n    $timeout = $injector.get('$timeout');\n    $exceptionHandler = $injector.get('$exceptionHandler');\n  }));\n\n\n  it('should have `._md` class indicator', inject(function() {\n    build(BASIC_SUBHEADER);\n\n    expect(element.hasClass('_md')).toBe(true);\n  }));\n\n\n  it('preserves content', function() {\n    build(\n      '<div>' +\n        '<md-subheader>Hello {{ to }}!</md-subheader>' +\n      '</div>'\n    );\n\n    pageScope.to = 'world';\n    pageScope.$digest();\n\n    var subHeader = element.children();\n\n    expect(subHeader.text().trim()).toEqual('Hello world!');\n  });\n\n  it('implements $mdSticky', function() {\n    build(BASIC_SUBHEADER);\n\n    var cloneScope = element.scope();\n\n    expect(cloneScope).toBe(pageScope);\n  });\n\n  it('applies the theme to the header and clone', function() {\n    build('<div md-theme=\"somethingElse\">' + BASIC_SUBHEADER + '</div>');\n\n    expect(getElement()).toHaveClass('md-somethingElse-theme');\n    expect(getCloneElement()).toHaveClass('md-somethingElse-theme');\n  });\n\n  it('applies the proper scope to the clone', function() {\n    build(\n      '<div>' +\n        '<md-subheader>Hello {{ to }}!</md-subheader>' +\n      '</div>');\n\n    pageScope.to = 'world';\n    pageScope.$apply();\n\n    expect(getElement()[0].textContent.trim()).toEqual('Hello world!');\n    expect(getCloneElement()[0].textContent.trim()).toEqual('Hello world!');\n  });\n\n  it('supports ng-if', function() {\n    build(\n      '<div>' +\n        '<md-subheader ng-if=\"isAdded\">test</md-subheader>' +\n      '</div>'\n    );\n\n    expect(isCloneShowing()).toBeFalsy();\n\n    pageScope.$apply('isAdded = true');\n    $timeout.flush();\n\n    expect(isCloneShowing()).toBeTruthy();\n\n    // Check if there were no exceptions caused.\n    expect($exceptionHandler.errors).toEqual([]);\n\n    function isCloneShowing() {\n      var clone = getCloneElement();\n      return clone.length && !!clone[0].parentNode;\n    }\n  });\n\n  it('should support ng-if inside of the sticky clone', function() {\n    build(\n      '<div>' +\n        '<md-subheader>' +\n          'Foo' +\n          '<span ng-if=\"isBar\">Bar</span>' +\n        '</md-subheader>' +\n      '</div>'\n    );\n\n    var clone = getCloneElement()[0];\n\n    expect(clone.textContent.trim()).toBe('Foo');\n\n    pageScope.$apply('isBar = true');\n\n    expect(clone.textContent.trim()).toBe('FooBar');\n  });\n\n  it('should support ng-show on the sticky clone', function() {\n    build(\n      '<div>' +\n        '<md-subheader ng-show=\"isShowing\">Subheader</md-subheader>' +\n      '</div>'\n    );\n\n    var clone = getCloneElement();\n\n    expect(clone).toHaveClass('ng-hide');\n\n    pageScope.$apply('isShowing = true');\n\n    expect(clone).not.toHaveClass('ng-hide');\n  });\n\n  it('should support ng-hide on the sticky clone', function() {\n    build(\n      '<div>' +\n        '<md-subheader ng-hide=\"isHidden\">Subheader</md-subheader>' +\n      '</div>'\n    );\n\n    var clone = getCloneElement();\n\n    expect(clone).not.toHaveClass('ng-hide');\n\n    pageScope.$apply('isHidden = true');\n\n    expect(clone).toHaveClass('ng-hide');\n  });\n\n  it('should work with a ng-if directive inside of the stickyClone', function() {\n    build(\n      '<div>' +\n        '<md-subheader>' +\n          '<span ng-repeat=\"item in [0, 1, 2, 3]\">{{ item }}</span>' +\n        '</md-subheader>' +\n      '</div>'\n    );\n\n    var cloneContent = getCloneElement()[0].querySelector('.md-subheader-content');\n\n    expect(cloneContent.children.length).toBe(4);\n  });\n\n  it('supports ng-repeat', function() {\n    build(\n      '<div>' +\n        '<md-subheader ng-repeat=\"i in [1, 2, 3]\">Test {{i}}</md-subheader>' +\n      '</div>'\n    );\n\n    expect(contentElement[0].querySelectorAll('.md-subheader').length).toEqual(6);\n\n    // Check if there were no exceptions caused.\n    expect($exceptionHandler.errors).toEqual([]);\n  });\n\n  it('adds the proper aria attributes only to the source element', function() {\n    build(\n      '<div>' +\n        '<md-subheader>Subheader</md-subheader>' +\n      '</div>'\n    );\n\n    expect(element.attr('role')).toBe('heading');\n    expect(element.attr('aria-level')).toBe('2');\n\n    expect(cloneElement.attr('role')).toBeFalsy();\n    expect(cloneElement.parent().attr('aria-hidden')).toBe('true');\n  });\n\n  it('allows for the aria-level to be overwritten', function() {\n    build(\n      '<div>' +\n        '<md-subheader aria-level=\"1\">Subheader</md-subheader>' +\n      '</div>'\n    );\n\n    expect(element.attr('aria-level')).toBe('1');\n  });\n\n  function build(template) {\n    inject(function($compile, $timeout) {\n      pageScope = $rootScope.$new();\n\n      contentElement = $compile('<md-content>' + template + '</md-content>')(pageScope);\n\n      // Flush the timeout, which prepends the sticky clone to the md-content.\n      $timeout.flush();\n\n      element = getElement();\n      cloneElement = getCloneElement();\n\n      controller = element.controller('mdSubheader');\n\n      pageScope.$apply();\n\n      // Flush the timeouts for ngIf and ngRepeat, because those will be added within the\n      // next tick of the subheader tranclusion.\n      $timeout.flush();\n    });\n  }\n\n  function getCloneElement() {\n    // We search for the clone element by using the md-sticky-clone class, which will be automatically added\n    // by the $mdSticky service.\n    return angular.element(contentElement[0].querySelector('.md-sticky-clone .md-subheader'));\n  }\n\n  function getElement() {\n    // The *real* element can be found, by search for a subheader, which doesn't have a parent with a unique class,\n    // which indicates a $mdSticky clone element.\n    var items = contentElement[0].querySelectorAll('.md-subheader');\n\n    return angular.element(checkSubheader(0));\n\n    function checkSubheader(index) {\n      var item = items[index];\n      if (!item) return;\n\n      return item.parentNode.classList.contains('md-sticky-clone') ? checkSubheader(index + 1) : item;\n    }\n  }\n\n\n});\n"
  },
  {
    "path": "src/components/swipe/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"demoSwipeCtrl\" ng-cloak layout=\"row\">\n  <div flex>\n    <div class=\"demo-swipe\" md-swipe-left=\"onSwipeLeft($event, $target)\">\n      <span class=\"no-select\">Swipe me to the left</span>\n      <md-icon md-font-icon=\"android\" aria-label=\"android\"></md-icon>\n    </div>\n    <md-divider></md-divider>\n    <div class=\"demo-swipe\" md-swipe-right=\"onSwipeRight($event, $target)\">\n      <span class=\"no-select\">Swipe me to the right</span>\n    </div>\n  </div>\n  <md-divider></md-divider>\n  <div flex layout=\"row\">\n    <div flex layout=\"row\" layout-align=\"center center\"\n         class=\"demo-swipe\" md-swipe-up=\"onSwipeUp($event, $target)\">\n      <span class=\"no-select\">Swipe me up</span>\n    </div>\n    <md-divider></md-divider>\n    <div flex layout=\"row\" layout-align=\"center center\"\n         class=\"demo-swipe\" md-swipe-down=\"onSwipeDown($event, $target)\">\n      <span class=\"no-select\">Swipe me down</span>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/swipe/demoBasicUsage/readme.html",
    "content": "<p md-warn>This UX pattern is intended for mobile devices only, and\nmay not make sense to use on responsive sites.  To initiate a swipe\ngesture on a desktop, you must click, hold and drag either right,\nleft, up or down</p>\n"
  },
  {
    "path": "src/components/swipe/demoBasicUsage/script.js",
    "content": "angular.module('demoSwipe', ['ngMaterial'])\n  .controller('demoSwipeCtrl', function($scope, $log) {\n    $scope.onSwipeLeft = function(ev, target) {\n      alert('You swiped left!!');\n\n      $log.log('Event Target: ', ev.target);\n      $log.log('Event Current Target: ', ev.currentTarget);\n      $log.log('Original Current Target: ', target.current);\n    };\n\n    $scope.onSwipeRight = function(ev, target) {\n      alert('You swiped right!!');\n\n      $log.log('Event Target: ', ev.target);\n      $log.log('Event Current Target: ', ev.currentTarget);\n      $log.log('Original Current Target: ', target.current);\n    };\n    $scope.onSwipeUp = function(ev, target) {\n      alert('You swiped up!!');\n\n      $log.log('Event Target: ', ev.target);\n      $log.log('Event Current Target: ', ev.currentTarget);\n      $log.log('Original Current Target: ', target.current);\n    };\n\n    $scope.onSwipeDown = function(ev, target) {\n      alert('You swiped down!!');\n\n      $log.log('Event Target: ', ev.target);\n      $log.log('Event Current Target: ', ev.currentTarget);\n      $log.log('Original Current Target: ', target.current);\n    };\n  });\n"
  },
  {
    "path": "src/components/swipe/demoBasicUsage/style.css",
    "content": ".demo-swipe {\n  padding: 20px 10px;\n}\n\n.no-select {\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -khtml-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n"
  },
  {
    "path": "src/components/swipe/swipe.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.swipe\n * @description Swipe module!\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeLeft\n *\n * @restrict A\n *\n * @description\n * The md-swipe-left directive allows you to specify custom behavior when an element is swiped\n * left.\n *\n * ### Notes\n * - The `$event.currentTarget` of the swiped element will be `null`, but you can get a\n * reference to the element that actually holds the `md-swipe-left` directive by using\n * `$target.current`\n *\n * > You can see this in action on the <a ng-href=\"demo/swipe\">demo page</a> (Look at the Developer\n * Tools console while swiping).\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-left=\"onSwipeLeft($event, $target)\">Swipe me left!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeRight\n *\n * @restrict A\n *\n * @description\n * The md-swipe-right directive allows you to specify custom behavior when an element is swiped\n * right.\n *\n * ### Notes\n * - The `$event.currentTarget` of the swiped element will be `null`, but you can get a\n * reference to the element that actually holds the `md-swipe-right` directive by using\n * `$target.current`\n *\n * > You can see this in action on the <a ng-href=\"demo/swipe\">demo page</a> (Look at the Developer\n * Tools console while swiping).\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-right=\"onSwipeRight($event, $target)\">Swipe me right!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeUp\n *\n * @restrict A\n *\n * @description\n * The md-swipe-up directive allows you to specify custom behavior when an element is swiped\n * up.\n *\n * ### Notes\n * - The `$event.currentTarget` of the swiped element will be `null`, but you can get a\n * reference to the element that actually holds the `md-swipe-up` directive by using\n * `$target.current`\n *\n * > You can see this in action on the <a ng-href=\"demo/swipe\">demo page</a> (Look at the Developer\n * Tools console while swiping).\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-up=\"onSwipeUp($event, $target)\">Swipe me up!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeDown\n *\n * @restrict A\n *\n * @description\n * The md-swipe-down directive allows you to specify custom behavior when an element is swiped\n * down.\n *\n * ### Notes\n * - The `$event.currentTarget` of the swiped element will be `null`, but you can get a\n * reference to the element that actually holds the `md-swipe-down` directive by using\n * `$target.current`\n *\n * > You can see this in action on the <a ng-href=\"demo/swipe\">demo page</a> (Look at the Developer\n * Tools console while swiping).\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-down=\"onSwipeDown($event, $target)\">Swipe me down!</div>\n * </hljs>\n */\n\nangular.module('material.components.swipe', ['material.core'])\n    .directive('mdSwipeLeft', getDirective('SwipeLeft'))\n    .directive('mdSwipeRight', getDirective('SwipeRight'))\n    .directive('mdSwipeUp', getDirective('SwipeUp'))\n    .directive('mdSwipeDown', getDirective('SwipeDown'));\n\nfunction getDirective(name) {\n  var directiveName = 'md' + name;\n  var eventName = '$md.' + name.toLowerCase();\n\n  return DirectiveFactory;\n\n  /* @ngInject */\n  function DirectiveFactory($parse) {\n      return { restrict: 'A', link: postLink };\n      function postLink(scope, element, attr) {\n        var fn = $parse(attr[directiveName]);\n        element.on(eventName, function(ev) {\n          var currentTarget = ev.currentTarget;\n          scope.$applyAsync(function() { fn(scope, { $event: ev, $target: { current: currentTarget } }); });\n        });\n      }\n    }\n}\n\n\n"
  },
  {
    "path": "src/components/swipe/swipe.scss",
    "content": "[md-swipe-left], [md-swipe-right] {\n    touch-action : pan-y;\n}\n\n[md-swipe-up], [md-swipe-down] {\n    touch-action : pan-x;\n}\n"
  },
  {
    "path": "src/components/switch/demoBasicUsage/index.html",
    "content": "<div class=\"inset\" ng-controller=\"SwitchDemoCtrl\" ng-cloak>\n  <md-switch ng-model=\"data.cb1\" aria-label=\"Switch 1\">\n    Switch 1: {{ data.cb1 }}\n  </md-switch>\n\n  <md-switch ng-model=\"data.cb2\" aria-label=\"Switch 2\" ng-true-value=\"'yup'\" ng-false-value=\"'nope'\" class=\"md-warn\">\n    Switch 2 (md-warn): {{ data.cb2 }}\n  </md-switch>\n\n  <md-switch ng-disabled=\"true\" aria-label=\"Disabled switch\" ng-model=\"disabledModel\">\n    Switch (Disabled)\n  </md-switch>\n\n  <md-switch ng-disabled=\"true\" aria-label=\"Disabled active switch\" ng-model=\"data.cb4\">\n    Switch (Disabled, Active)\n  </md-switch>\n\n  <md-switch class=\"md-primary\" md-no-ink aria-label=\"Switch No Ink\" ng-model=\"data.cb5\">\n    Switch (md-primary): No Ink\n  </md-switch>\n\n  <md-switch ng-model=\"data.cb6\" aria-label=\"Switch 6\" ng-change=\"onChange(data.cb6)\">\n    Switch 6 message: {{ message }}\n  </md-switch>\n\n  <md-switch md-invert aria-label=\"Switch 7\">\n    Switch (Inverted)\n  </md-switch>\n</div>\n"
  },
  {
    "path": "src/components/switch/demoBasicUsage/script.js",
    "content": "angular.module('switchDemo1', ['ngMaterial'])\n.controller('SwitchDemoCtrl', function($scope) {\n  $scope.data = {\n    cb1: true,\n    cb4: true,\n    cb5: false\n  };\n\n  $scope.message = 'false';\n\n  $scope.onChange = function(cbState) {\n    $scope.message = cbState;\n  };\n});\n"
  },
  {
    "path": "src/components/switch/demoBasicUsage/style.css",
    "content": ".inset {\n    padding-left: 25px;\n    padding-top:25px;\n}\n"
  },
  {
    "path": "src/components/switch/switch-theme.scss",
    "content": "md-switch.md-THEME_NAME-theme {\n  .md-ink-ripple {\n    color: '{{background-500}}';\n  }\n  .md-thumb {\n    background-color: '{{background-50}}';\n  }\n  .md-bar {\n    background-color: '{{background-500}}';\n  }\n\n  &.md-focused {\n    &:not(.md-checked) {\n      .md-thumb:before {\n        background-color: '{{foreground-4}}';\n      }\n    }\n    &[disabled] {\n      .md-thumb:before {\n        background-color: '{{foreground-4}}';\n      }\n    }\n  }\n\n  &.md-checked:not([disabled]) {\n    .md-ink-ripple {\n      color: '{{accent-color}}';\n    }\n    .md-thumb {\n      background-color: '{{accent-color}}';\n    }\n    .md-bar {\n      background-color: '{{accent-color-0.5}}';\n    }\n    &.md-focused .md-thumb:before {\n      background-color: '{{accent-color-0.26}}';\n    }\n\n    &.md-primary {\n      .md-ink-ripple {\n        color: '{{primary-color}}';\n      }\n      .md-thumb {\n        background-color: '{{primary-color}}';\n      }\n      .md-bar {\n        background-color: '{{primary-color-0.5}}';\n      }\n      &.md-focused .md-thumb:before {\n        background-color: '{{primary-color-0.26}}';\n      }\n    }\n\n    &.md-warn {\n      .md-ink-ripple {\n        color: '{{warn-color}}';\n      }\n      .md-thumb {\n        background-color: '{{warn-color}}';\n      }\n      .md-bar {\n        background-color: '{{warn-color-0.5}}';\n      }\n      &.md-focused .md-thumb:before {\n        background-color: '{{warn-color-0.26}}';\n      }\n    }\n  }\n\n  &[disabled] {\n    .md-thumb {\n      background-color: '{{background-400}}';\n    }\n    .md-bar {\n      background-color: '{{foreground-4}}';\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/switch/switch.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.switch\n */\n\nangular.module('material.components.switch', [\n  'material.core',\n  'material.components.checkbox'\n])\n  .directive('mdSwitch', MdSwitch);\n\n/**\n * @ngdoc directive\n * @module material.components.switch\n * @name mdSwitch\n * @restrict E\n *\n * The switch directive is used very much like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).\n *\n * As per the [Material Design spec](https://material.io/archive/guidelines/style/color.html#color-color-system)\n * the switch is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {expression} ng-model Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ng-true-value The value to which the expression should be set when selected.\n * @param {expression=} ng-false-value The value to which the expression should be set when not selected.\n * @param {expression=} ng-change Expression to be executed when the model value changes.\n * @param {expression=} ng-disabled En/Disable based on the expression.\n * @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects.\n * @param {string=} aria-label Publish the button label used by screen-readers for accessibility. Defaults to the switch's text.\n * @param {boolean=} md-invert When set to true, the switch will be inverted.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-switch ng-model=\"isActive\" aria-label=\"Finished?\">\n *   Finished ?\n * </md-switch>\n *\n * <md-switch md-no-ink ng-model=\"hasInk\" aria-label=\"No Ink Effects\">\n *   No Ink Effects\n * </md-switch>\n *\n * <md-switch ng-disabled=\"true\" ng-model=\"isDisabled\" aria-label=\"Disabled\">\n *   Disabled\n * </md-switch>\n *\n * </hljs>\n */\nfunction MdSwitch(mdCheckboxDirective, $mdUtil, $mdConstant, $parse, $$rAF, $mdGesture, $timeout) {\n  var checkboxDirective = mdCheckboxDirective[0];\n\n  return {\n    restrict: 'E',\n    priority: $mdConstant.BEFORE_NG_ARIA,\n    transclude: true,\n    template:\n      '<div class=\"md-container\">' +\n        '<div class=\"md-bar\"></div>' +\n        '<div class=\"md-thumb-container\">' +\n          '<div class=\"md-thumb\" md-ink-ripple md-ink-ripple-checkbox></div>' +\n        '</div>'+\n      '</div>' +\n      '<div ng-transclude class=\"md-label\"></div>',\n    require: ['^?mdInputContainer', '?ngModel', '?^form'],\n    compile: mdSwitchCompile\n  };\n\n  function mdSwitchCompile(element, attr) {\n    var checkboxLink = checkboxDirective.compile(element, attr).post;\n    // No transition on initial load.\n    element.addClass('md-dragging');\n\n    return function (scope, element, attr, ctrls) {\n      var containerCtrl = ctrls[0];\n      var ngModel = ctrls[1] || $mdUtil.fakeNgModel();\n      var formCtrl = ctrls[2];\n\n      var disabledGetter = null;\n      if (attr.disabled != null) {\n        disabledGetter = function() { return true; };\n      } else if (attr.ngDisabled) {\n        disabledGetter = $parse(attr.ngDisabled);\n      }\n\n      var thumbContainer = angular.element(element[0].querySelector('.md-thumb-container'));\n      var switchContainer = angular.element(element[0].querySelector('.md-container'));\n      var labelContainer = angular.element(element[0].querySelector('.md-label'));\n\n      // no transition on initial load\n      $$rAF(function() {\n        element.removeClass('md-dragging');\n      });\n\n      checkboxLink(scope, element, attr, ctrls);\n\n      if (disabledGetter) {\n        scope.$watch(disabledGetter, function(isDisabled) {\n          element.attr('tabindex', isDisabled ? -1 : 0);\n        });\n      }\n\n      attr.$observe('mdInvert', function(newValue) {\n        var isInverted = $mdUtil.parseAttributeBoolean(newValue);\n\n        isInverted ? element.prepend(labelContainer) : element.prepend(switchContainer);\n\n        // Toggle a CSS class to update the margin.\n        element.toggleClass('md-inverted', isInverted);\n      });\n\n      // These events are triggered by setup drag\n      $mdGesture.register(switchContainer, 'drag');\n      switchContainer\n        .on('$md.dragstart', onDragStart)\n        .on('$md.drag', onDrag)\n        .on('$md.dragend', onDragEnd);\n\n      var drag;\n      function onDragStart(ev) {\n        // Don't go if the switch is disabled.\n        if (disabledGetter && disabledGetter(scope)) return;\n        ev.stopPropagation();\n\n        element.addClass('md-dragging');\n        drag = {width: thumbContainer.prop('offsetWidth')};\n      }\n\n      function onDrag(ev) {\n        if (!drag) return;\n        ev.stopPropagation();\n        ev.srcEvent && ev.srcEvent.preventDefault();\n\n        var percent = ev.pointer.distanceX / drag.width;\n\n        // if checked, start from right. else, start from left\n        var translate = ngModel.$viewValue ?  1 + percent : percent;\n        // Make sure the switch stays inside its bounds, 0-1%\n        translate = Math.max(0, Math.min(1, translate));\n\n        thumbContainer.css($mdConstant.CSS.TRANSFORM, 'translate3d(' + (100*translate) + '%,0,0)');\n        drag.translate = translate;\n      }\n\n      function onDragEnd(ev) {\n        if (!drag) return;\n        ev.stopPropagation();\n\n        element.removeClass('md-dragging');\n        thumbContainer.css($mdConstant.CSS.TRANSFORM, '');\n\n        // We changed if there is no distance (this is a click a click),\n        // or if the drag distance is >50% of the total.\n        var isChanged = ngModel.$viewValue ? drag.translate < 0.5 : drag.translate > 0.5;\n        if (isChanged) {\n          applyModelValue(!ngModel.$viewValue);\n        }\n        drag = null;\n\n        // Wait for incoming mouse click\n        scope.skipToggle = true;\n        $timeout(function() {\n          scope.skipToggle = false;\n        }, 1);\n      }\n\n      function applyModelValue(newValue) {\n        scope.$apply(function() {\n          ngModel.$setViewValue(newValue);\n          ngModel.$render();\n        });\n      }\n\n    };\n  }\n\n\n}\n"
  },
  {
    "path": "src/components/switch/switch.scss",
    "content": "$switch-width: 36px !default;\n$switch-height: $baseline-grid * 3 !default;\n$switch-bar-height: 14px !default;\n$switch-thumb-size: 20px !default;\n$switch-margin: 16px !default;\n\n.md-inline-form {\n  md-switch {\n    margin-top: $input-container-vertical-margin;\n    margin-bottom: $input-container-vertical-margin + 1px;\n  }\n}\n\nmd-switch {\n  margin: $switch-margin 0;\n  white-space: nowrap;\n  cursor: pointer;\n  outline: none;\n  user-select: none;\n  height: 30px;\n  line-height: 28px;\n  align-items: center;\n  display: flex;\n\n  @include rtl(margin-left, inherit, $switch-margin);\n  @include rtl(margin-right, $switch-margin, inherit);\n\n  &:last-of-type {\n    @include rtl(margin-left, inherit, 0);\n    @include rtl(margin-right, 0, inherit);\n  }\n\n  &[disabled] {\n    cursor: default;\n\n    .md-container {\n      cursor: default;\n    }\n  }\n\n  .md-container {\n    cursor: grab;\n    width: $switch-width;\n    height: $switch-height;\n    position: relative;\n    user-select: none;\n    @include rtl-prop(margin-right, margin-left, 8px, 0px);\n    float: left;\n  }\n\n  &.md-inverted .md-container {\n    @include rtl(margin-right, initial, 8px);\n    @include rtl(margin-left, 8px, initial);\n  }\n\n  // If the user moves his mouse off the switch, stil display grabbing cursor\n  &:not([disabled]) {\n    .md-dragging,\n    &.md-dragging .md-container {\n      cursor: grabbing;\n    }\n  }\n\n  &.md-focused {\n    .md-thumb:before {\n      left: -8px;\n      top: -8px;\n      right: -8px;\n      bottom: -8px;\n    }\n  }\n\n  .md-label {\n    border-color: transparent;\n    border-width: 0;\n    float: left;\n  }\n\n  .md-bar {\n    left: 1px;\n    width: $switch-width - 2px;\n    top: $switch-height * 0.5 - $switch-bar-height * 0.5;\n    height: $switch-bar-height;\n    border-radius: 8px;\n    position: absolute;\n  }\n\n  .md-thumb-container {\n    top: $switch-height * 0.5 - $switch-thumb-size * 0.5;\n    left: 0;\n    width: $switch-width - $switch-thumb-size;\n    position: absolute;\n    transform: translate3d(0,0,0);\n    z-index: 1;\n  }\n  &.md-checked .md-thumb-container {\n    transform: translate3d(100%,0,0);\n  }\n\n  .md-thumb {\n    position: absolute;\n    margin: 0;\n    left: 0;\n    top: 0;\n    outline: none;\n    height: $switch-thumb-size;\n    width: $switch-thumb-size;\n    border-radius: 50%;\n    box-shadow: $whiteframe-shadow-1dp;\n\n    &:before {\n      background-color: transparent;\n      border-radius: 50%;\n      content: '';\n      position: absolute;\n      display: block;\n      height: auto;\n      left: 0;\n      top: 0;\n      right: 0;\n      bottom: 0;\n      transition: all 0.5s;\n      width: auto;\n    }\n\n    .md-ripple-container {\n      position: absolute;\n      display: block;\n      width: auto;\n      height: auto;\n      left: -$switch-thumb-size;\n      top: -$switch-thumb-size;\n      right: -$switch-thumb-size;\n      bottom: -$switch-thumb-size;\n    }\n  }\n\n  &:not(.md-dragging) {\n    .md-bar,\n    .md-thumb-container,\n    .md-thumb {\n      transition: $swift-linear;\n      transition-property: transform, background-color;\n    }\n    .md-bar,\n    .md-thumb {\n      transition-delay: 0.05s;\n    }\n  }\n\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-switch.md-default-theme .md-bar {\n    background-color: #666;\n  }\n  md-switch.md-default-theme.md-checked .md-bar {\n    background-color: #9E9E9E;\n  }\n  md-switch.md-default-theme .md-thumb {\n    background-color: #fff;\n  }\n}\n"
  },
  {
    "path": "src/components/switch/switch.spec.js",
    "content": "describe('<md-switch>', function() {\n  var CHECKED_CSS = 'md-checked';\n  var $compile, parentScope;\n\n  beforeEach(module('ngAria', 'material.components.switch'));\n\n  beforeEach(inject(function($injector) {\n    var $rootScope = $injector.get('$rootScope');\n    parentScope = $rootScope.$new();\n\n    $compile = $injector.get('$compile');\n  }));\n\n  it('should set checked css class and aria-checked attributes', function() {\n    var template =\n        '<div>' +\n          '<md-switch ng-model=\"blue\"></md-switch>' +\n          '<md-switch ng-model=\"green\"></md-switch>' +\n        '</div>';\n\n    var element = $compile(template)(parentScope);\n\n    parentScope.$apply(function(){\n      parentScope.blue = false;\n      parentScope.green = true;\n    });\n\n    var switches = angular.element(element[0].querySelectorAll('md-switch'));\n\n    expect(switches.eq(0).hasClass(CHECKED_CSS)).toEqual(false);\n    expect(switches.eq(0).attr('aria-checked')).toEqual('false');\n    expect(switches.eq(0).attr('role')).toEqual('checkbox');\n\n    expect(switches.eq(1).hasClass(CHECKED_CSS)).toEqual(true);\n    expect(switches.eq(1).attr('aria-checked')).toEqual('true');\n    expect(switches.eq(1).attr('role')).toEqual('checkbox');\n\n    parentScope.$apply(function(){\n      parentScope.blue = true;\n      parentScope.green = false;\n    });\n\n    expect(switches.eq(1).hasClass(CHECKED_CSS)).toEqual(false);\n    expect(switches.eq(0).hasClass(CHECKED_CSS)).toEqual(true);\n    expect(switches.eq(1).attr('aria-checked')).toEqual('false');\n    expect(switches.eq(0).attr('aria-checked')).toEqual('true');\n    expect(switches.eq(1).attr('role')).toEqual('checkbox');\n  });\n\n  it('should have tabindex -1 while disabled', function() {\n    parentScope.value = false;\n    var el = $compile('<md-switch ng-disabled=\"value\">')(parentScope);\n\n    parentScope.$apply();\n    expect(el.attr('tabindex')).not.toEqual('-1');\n\n    parentScope.$apply('value = true');\n    expect(el.attr('tabindex')).toEqual('-1');\n  });\n\n  it('should disable via `disabled` attribute', function() {\n    parentScope.value = false;\n    var element = $compile('<md-switch disabled>')(parentScope);\n\n    parentScope.$apply();\n    expect(element.attr('tabindex')).toEqual('-1');\n  });\n\n  it('should skip click event if releasing drag over element', function() {\n    var checkbox = $compile('<md-switch></md-switch>')(parentScope);\n    var scope = checkbox.scope();\n\n    // skipToggle is used here to imitate an ending drag, same behavior as in the component.\n    scope.skipToggle = true;\n    scope.$apply();\n\n    checkbox.triggerHandler('click');\n\n    expect(checkbox[0]).not.toHaveClass('md-checked');\n\n  });\n\n  it('should correctly invert the switch through attribute', function() {\n    var element = $compile('<md-switch md-invert=\"{{ isInverted }}\">')(parentScope);\n\n    parentScope.$apply('isInverted = true');\n\n    expect(element).toHaveClass('md-inverted');\n    expect(element.children()[0]).toHaveClass('md-label');\n    expect(element.children()[1]).toHaveClass('md-container');\n\n    parentScope.$apply('isInverted = false');\n\n    expect(element).not.toHaveClass('md-inverted');\n    expect(element.children()[0]).toHaveClass('md-container');\n    expect(element.children()[1]).toHaveClass('md-label');\n  });\n});\n"
  },
  {
    "path": "src/components/tabs/demoCenterTabs/index.html",
    "content": "<div ng-cloak>\n  <md-content>\n    <md-tabs class=\"md-primary\" md-center-tabs>\n      <md-tab label=\"one\">\n        <md-content class=\"md-padding\">\n          <h2 class=\"md-display-1\">Tab One</h2>\n          <p class=\"md-body-1\">\n            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue.\n            Phasellus volutpat neque ac dui mattis vulputate. Etiam consequat aliquam cursus. In\n            sodales pretium ultrices. Maecenas lectus est, sollicitudin consectetur felis nec,\n            feugiat ultricies mi.\n          </p>\n        </md-content>\n      </md-tab>\n      <md-tab label=\"two\">\n        <md-content class=\"md-padding\">\n          <h2 class=\"md-display-1\">Tab Two</h2>\n          <p class=\"md-body-1\">\n            Morbi viverra, ante vel aliquet tincidunt, leo dolor pharetra quam, at semper massa\n            orci nec magna. Donec posuere nec sapien sed laoreet. Etiam cursus nunc in\n            condimentum facilisis. Etiam in tempor tortor. Vivamus faucibus egestas enim,\n            at convallis diam pulvinar vel. Cras ac orci eget nisi maximus cursus.\n          </p>\n        </md-content>\n      </md-tab>\n      <md-tab label=\"three\">\n        <md-content class=\"md-padding\">\n          <h2 class=\"md-display-1\">Tab Three</h2>\n          <p class=\"md-body-1\">\n            Integer turpis erat, porttitor vitae mi faucibus, laoreet interdum tellus. Curabitur\n            posuere molestie dictum. Morbi eget congue risus, quis rhoncus quam. Suspendisse\n            vitae hendrerit erat, at posuere mi. Cras eu fermentum nunc. Sed id ante eu orci\n            commodo volutpat non ac est.\n          </p>\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/tabs/demoCenterTabs/readme.html",
    "content": "<p>This demo shows how you can horizontally center tabs and use the primary color as your tab background.</p>\n"
  },
  {
    "path": "src/components/tabs/demoCenterTabs/script.js",
    "content": "(function () {\n  'use strict';\n  angular.module('tabsDemoCenterTabs', ['ngMaterial']);\n})();\n"
  },
  {
    "path": "src/components/tabs/demoCenterTabs/style.scss",
    "content": "/*\n * Style tab width to align with the MD spec:\n * https://material.io/archive/guidelines/components/tabs.html#tabs-specs\n */\nmd-tab-item {\n  min-width: 72px;\n}\n@media (min-width: 960px) {\n  md-tab-item {\n    min-width: 160px;\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/demoDynamicHeight/index.html",
    "content": "<div ng-cloak>\n  <md-content>\n    <md-tabs md-dynamic-height md-border-bottom>\n      <md-tab label=\"one\">\n        <md-content class=\"md-padding\">\n          <h1 class=\"md-display-2\">Tab One</h1>\n          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue.\n            Phasellus volutpat neque ac dui mattis vulputate. Etiam consequat aliquam cursus. In\n            sodales pretium ultrices. Maecenas lectus est, sollicitudin consectetur felis nec,\n            feugiat ultricies mi.</p>\n        </md-content>\n      </md-tab>\n      <md-tab label=\"two\">\n        <md-content class=\"md-padding\">\n          <h1 class=\"md-display-2\">Tab Two</h1>\n          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla venenatis ante augue.\n            Phasellus volutpat neque ac dui mattis vulputate. Etiam consequat aliquam cursus. In\n            sodales pretium ultrices. Maecenas lectus est, sollicitudin consectetur felis nec,\n            feugiat ultricies mi. Aliquam erat volutpat. Nam placerat, tortor in ultrices porttitor,\n            orci enim rutrum enim, vel tempor sapien arcu a tellus. Vivamus convallis sodales ante\n            varius gravida. Curabitur a purus vel augue ultrices ultricies id a nisl. Nullam\n            malesuada consequat diam, a facilisis tortor volutpat et. Sed urna dolor, aliquet vitae\n            posuere vulputate, euismod ac lorem. Sed felis risus, pulvinar at interdum quis,\n            vehicula sed odio. Phasellus in enim venenatis, iaculis tortor eu, bibendum ante. Donec\n            ac tellus dictum neque volutpat blandit. Praesent efficitur faucibus risus, ac auctor\n            purus porttitor vitae. Phasellus ornare dui nec orci posuere, nec luctus mauris\n            semper.</p>\n          <p>Morbi viverra, ante vel aliquet tincidunt, leo dolor pharetra quam, at semper massa\n            orci nec magna. Donec posuere nec sapien sed laoreet. Etiam cursus nunc in condimentum\n            facilisis. Etiam in tempor tortor. Vivamus faucibus egestas enim, at convallis diam\n            pulvinar vel. Cras ac orci eget nisi maximus cursus. Nunc urna libero, viverra sit amet\n            nisl at, hendrerit tempor turpis. Maecenas facilisis convallis mi vel tempor. Nullam\n            vitae nunc leo. Cras sed nisl consectetur, rhoncus sapien sit amet, tempus sapien.</p>\n          <p>Integer turpis erat, porttitor vitae mi faucibus, laoreet interdum tellus. Curabitur\n            posuere molestie dictum. Morbi eget congue risus, quis rhoncus quam. Suspendisse vitae\n            hendrerit erat, at posuere mi. Cras eu fermentum nunc. Sed id ante eu orci commodo\n            volutpat non ac est. Praesent ligula diam, congue eu enim scelerisque, finibus commodo\n            lectus.</p>\n        </md-content>\n      </md-tab>\n      <md-tab label=\"three\">\n        <md-content class=\"md-padding\">\n          <h1 class=\"md-display-2\">Tab Three</h1>\n          <p>Integer turpis erat, porttitor vitae mi faucibus, laoreet interdum tellus. Curabitur\n            posuere molestie dictum. Morbi eget congue risus, quis rhoncus quam. Suspendisse vitae\n            hendrerit erat, at posuere mi. Cras eu fermentum nunc. Sed id ante eu orci commodo\n            volutpat non ac est. Praesent ligula diam, congue eu enim scelerisque, finibus commodo\n            lectus.</p>\n        </md-content>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/tabs/demoDynamicHeight/readme.html",
    "content": "<p>\n  The Dynamic Height demo shows how tabs can be used to display content with varying heights.\n</p>\n<blockquote>\n  <p>\n    <b>Note:</b> If you are using the Tabs component for page-level navigation, please take a look\n    at the <a href=\"./demo/navBar\">NavBar component</a> instead. It has better support for navigation\n    and can performantly handle tabs with larger, more rich content.\n  </p>\n</blockquote>\n"
  },
  {
    "path": "src/components/tabs/demoDynamicHeight/script.js",
    "content": "angular.module('tabsDemoDynamicHeight', ['ngMaterial']);"
  },
  {
    "path": "src/components/tabs/demoDynamicHeight/style.scss",
    "content": "md-content {\n  h1:first-child {\n    margin-top: 0;\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/demoDynamicTabs/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" ng-cloak>\n  <md-content>\n    <md-tabs md-selected=\"selectedIndex\" md-border-bottom md-autoselect md-swipe-content>\n      <md-tab ng-repeat=\"tab in tabs\"\n              ng-disabled=\"tab.disabled\"\n              label=\"{{tab.title}}\">\n        <div class=\"demo-tab tab{{$index%4}}\">\n          <div ng-bind=\"tab.content\"></div>\n          <br/>\n          <md-button class=\"md-primary md-raised\" ng-click=\"removeTab( tab )\"\n                     ng-disabled=\"tabs.length <= 1\">\n            Remove Tab\n          </md-button>\n        </div>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n\n  <form ng-submit=\"addTab(tTitle,tContent)\" layout=\"column\" class=\"md-padding\">\n    <div layout=\"row\" layout-xs=\"column\">\n      <div flex>\n        <h2 class=\"md-subhead\">Add a new Tab:</h2>\n      </div>\n      <md-input-container>\n        <label for=\"label\">Label</label>\n        <input type=\"text\" id=\"label\" ng-model=\"tTitle\">\n      </md-input-container>\n      <md-input-container>\n        <label for=\"content\">Content</label>\n        <input type=\"text\" id=\"content\" ng-model=\"tContent\">\n      </md-input-container>\n      <md-button class=\"add-tab md-primary md-raised\" ng-disabled=\"!tTitle || !tContent\"\n                 type=\"submit\">\n        Add Tab\n      </md-button>\n    </div>\n  </form>\n</div>\n"
  },
  {
    "path": "src/components/tabs/demoDynamicTabs/readme.html",
    "content": "<p>The Dynamic Tabs demo shows how internal tab views can be used.</p>\n"
  },
  {
    "path": "src/components/tabs/demoDynamicTabs/script.js",
    "content": "(function () {\n  'use strict';\n  angular\n      .module('tabsDemoDynamicTabs', ['ngMaterial'])\n      .controller('AppCtrl', AppCtrl);\n\n  function AppCtrl ($scope, $log) {\n    var tabs = [\n        { title: 'Zero (AKA 0, Cero, One - One, -Nineteen + 19, and so forth and so on and continuing into what seems like infinity)', content: 'Whoa...that is a really long title!' },\n        { title: 'One', content: \"Tabs will become paginated if there isn't enough room for them.\"},\n        { title: 'Two', content: \"You can swipe left and right on a mobile device to change tabs.\"},\n        { title: 'Three', content: \"You can bind the selected tab via the selected attribute on the md-tabs element.\"},\n        { title: 'Four', content: \"If you set the selected tab binding to -1, it will leave no tab selected.\"},\n        { title: 'Five', content: \"If you remove a tab, it will try to select a new one.\"},\n        { title: 'Six', content: \"There's an ink bar that follows the selected tab, you can turn it off if you want.\"},\n        { title: 'Seven', content: \"If you set ng-disabled on a tab, it becomes unselectable. If the currently selected tab becomes disabled, it will try to select the next tab.\"},\n        { title: 'Eight', content: \"If you look at the source, you're using tabs to look at a demo for tabs. Recursion!\"},\n        { title: 'Nine', content: \"If you set md-theme=\\\"green\\\" on the md-tabs element, you'll get green tabs.\"},\n        { title: 'Ten', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Eleven', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Twelve', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Thirteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Fourteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Fifteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Sixteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Seventeen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Eighteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Nineteen', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"},\n        { title: 'Twenty', content: \"If you're still reading this, you should just go check out the API docs for tabs!\"}\n      ],\n      selected = null,\n      previous = null;\n    $scope.tabs = tabs;\n    $scope.selectedIndex = 0;\n    $scope.$watch('selectedIndex', function(newVal, oldVal) {\n      previous = selected;\n      selected = tabs[newVal];\n      if (oldVal + 1 && !angular.equals(oldVal, newVal)) {\n        $log.log('Goodbye ' + previous.title + '!');\n      }\n      if (newVal + 1 > 0) {\n        $log.log('Hello ' + selected.title + '!');\n      }\n    });\n    $scope.addTab = function(title, view) {\n      view = view || title + \" Content View\";\n      tabs.push({title: title, content: view, disabled: false});\n    };\n    $scope.removeTab = function(tab) {\n      var index = tabs.indexOf(tab);\n      tabs.splice(index, 1);\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/tabs/demoDynamicTabs/style.scss",
    "content": "md-content {\n  h1:first-child {\n    margin-top: 0;\n  }\n  md-tabs {\n    .demo-tab {\n      padding: 25px;\n      text-align: center;\n\n      &> div > div {\n        padding: 25px;\n        box-sizing: border-box;\n      }\n    }\n    md-tab {\n      &[disabled] {\n        opacity: 0.5;\n      }\n    }\n  }\n  form {\n    padding-top: 0;\n\n    div[flex] {\n      position: relative;\n\n      h2.md-subhead {\n        position: absolute;\n        bottom: 0;\n        left: 0;\n        margin: 0;\n        font-weight: 500;\n        text-transform: uppercase;\n        line-height: 35px;\n        white-space: nowrap;\n      }\n    }\n    md-button.add-tab {\n      margin-right: 0;\n      transform: translateY(5px);\n    }\n    md-input-container {\n      padding-bottom: 0;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/demoStaticTabs/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n  <md-content class=\"md-padding\">\n    <md-tabs class=\"md-primary md-no-ink-bar-color\" md-selected=\"data.selectedIndex\"\n             md-align-tabs=\"{{data.bottom ? 'bottom' : 'top'}}\">\n      <md-tab id=\"tab1\" md-tab-class=\"example-selector-tab1\">\n        <md-tab-label>Item One</md-tab-label>\n        <md-tab-body>\n          View for Item #1 <br/>\n          data.selectedIndex = 0;\n        </md-tab-body>\n      </md-tab>\n      <md-tab id=\"tab2\" ng-disabled=\"data.secondLocked\">\n        <md-tab-label>{{data.secondLabel}}</md-tab-label>\n        <md-tab-body>\n          View for Item #2 <br/>\n          data.selectedIndex = 1;\n        </md-tab-body>\n      </md-tab>\n      <md-tab id=\"tab3\">\n        <md-tab-label>Item Three</md-tab-label>\n        <md-tab-body>\n          View for Item #3 <br/>\n          data.selectedIndex = 2;\n        </md-tab-body>\n      </md-tab>\n      <md-tab id=\"tab4\">\n        <md-tab-label><md-icon md-svg-icon=\"communication:phone\"></md-icon></md-tab-label>\n        <md-tab-body>\n          View for Item #4 <br/>\n          data.selectedIndex = 3;\n        </md-tab-body>\n      </md-tab>\n      <md-tab id=\"tab5\">\n        <md-tab-label><md-icon md-svg-icon=\"favorite\"></md-icon></md-tab-label>\n        <md-tab-body>\n          View for Item #5 <br/>\n          data.selectedIndex = 4;\n        </md-tab-body>\n      </md-tab>\n    </md-tabs>\n  </md-content>\n\n  <div class=\"md-padding\" layout=\"row\" layout-sm=\"column\" layout-align=\"left center\"\n       style=\"padding-top: 0;\">\n    <md-checkbox ng-model=\"data.secondLocked\" aria-label=\"Disable item two?\" style=\"margin: 5px;\">\n      Disable item two?\n    </md-checkbox>\n    <md-checkbox ng-model=\"data.bottom\" aria-label=\"Align tabs to bottom?\" style=\"margin: 5px;\">\n      Align tabs to bottom?\n    </md-checkbox>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/tabs/demoStaticTabs/readme.html",
    "content": "<p>\n  The Static Tabs demo shows how to disable and bottom-align tabs. Additionally, it demonstrates\n  the <code>md-no-ink-bar-color</code> class.\n</p>\n"
  },
  {
    "path": "src/components/tabs/demoStaticTabs/script.js",
    "content": "(function () {\n  'use strict';\n\n  angular\n      .module('tabsDemoIconTabs', ['ngMaterial'])\n      .config(function($mdIconProvider) {\n        $mdIconProvider\n          .iconSet('communication', 'img/icons/sets/communication-icons.svg')\n          .icon('favorite', 'img/icons/favorite.svg');\n      })\n      .controller('AppCtrl', AppCtrl);\n\n  function AppCtrl ($scope) {\n    $scope.data = {\n      selectedIndex: 0,\n      secondLocked:  true,\n      secondLabel:   \"Item Two\",\n      bottom:        false\n    };\n    $scope.next = function() {\n      $scope.data.selectedIndex = Math.min($scope.data.selectedIndex + 1, 2) ;\n    };\n    $scope.previous = function() {\n      $scope.data.selectedIndex = Math.max($scope.data.selectedIndex - 1, 0);\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/tabs/demoStaticTabs/style.scss",
    "content": "md-content {\n  md-tabs {\n    md-tab-content {\n      padding: 25px;\n      &:nth-child(1) {\n        background-color: #cfd8dc;\n      }\n      &:nth-child(2) {\n        background-color: #ffb74d;\n      }\n      &:nth-child(3) {\n        background-color: #ffd54f;\n      }\n      &:nth-child(4) {\n        background-color: #aed581;\n      }\n      &:nth-child(5) {\n        background-color: #00897b;\n      }\n    }\n  }\n}\n.after-tabs-area {\n  > span {\n    margin-top: 25px;\n    padding-right: 15px;\n    vertical-align: middle;\n    line-height: 30px;\n    height: 35px;\n  }\n  > md-checkbox {\n    margin-top: 26px;\n    margin-left: 0;\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name mdTab\n * @module material.components.tabs\n *\n * @restrict E\n *\n * @description\n * The `<md-tab>` is a nested directive used within `<md-tabs>` to specify a tab with a **label**\n * and optional *view content*.\n *\n * If the `label` attribute is not specified, then an optional `<md-tab-label>` tag can be used to\n * specify more complex tab header markup. If neither the **label** nor the **md-tab-label** are\n * specified, then the nested markup of the `<md-tab>` is used as the tab header markup.\n *\n * Please note that if you use `<md-tab-label>`, your content **MUST** be wrapped in the\n * `<md-tab-body>` tag.  This is to define a clear separation between the tab content and the tab\n * label.\n *\n * This container is used by the TabsController to show/hide the active tab's content view. This\n * synchronization is automatically managed by the internal TabsController whenever the tab\n * selection changes. Selection changes can be initiated via data binding changes, programmatic\n * invocation, or user gestures.\n *\n * @param {string=} label Optional attribute to specify a simple string as the tab label\n * @param {boolean=} ng-disabled If present and expression evaluates to truthy, disabled tab\n *  selection.\n * @param {string=} md-tab-class Optional attribute to specify a class that will be applied to the\n *  tab's button\n * @param {expression=} md-on-deselect Expression to be evaluated after the tab has been\n *  de-selected.\n * @param {expression=} md-on-select Expression to be evaluated after the tab has been selected.\n * @param {boolean=} md-active When true, sets the active tab.  Note: There can only be one active\n *  tab at a time.\n *\n *\n * @usage\n *\n * <hljs lang=\"html\">\n * <md-tab label=\"My Tab\" md-tab-class=\"my-content-tab\" ng-disabled md-on-select=\"onSelect()\"\n *         md-on-deselect=\"onDeselect()\">\n *   <h3>My Tab content</h3>\n * </md-tab>\n *\n * <md-tab>\n *   <md-tab-label>\n *     <h3>My Tab</h3>\n *   </md-tab-label>\n *   <md-tab-body>\n *     <p>\n *       Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque\n *       laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi\n *       architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit\n *       aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione\n *       voluptatem sequi nesciunt.\n *     </p>\n *   </md-tab-body>\n * </md-tab>\n * </hljs>\n *\n */\nangular\n    .module('material.components.tabs')\n    .directive('mdTab', MdTab);\n\nfunction MdTab () {\n  return {\n    require:  '^?mdTabs',\n    terminal: true,\n    compile:  function (element, attr) {\n      var label = firstChild(element, 'md-tab-label'),\n          body  = firstChild(element, 'md-tab-body');\n\n      if (label.length === 0) {\n        label = angular.element('<md-tab-label></md-tab-label>');\n        if (attr.label) label.text(attr.label);\n        else label.append(element.contents());\n\n        if (body.length === 0) {\n          var contents = element.contents().detach();\n          body         = angular.element('<md-tab-body></md-tab-body>');\n          body.append(contents);\n        }\n      }\n\n      element.append(label);\n      if (body.html()) element.append(body);\n\n      return postLink;\n    },\n    scope:    {\n      active:   '=?mdActive',\n      disabled: '=?ngDisabled',\n      select:   '&?mdOnSelect',\n      deselect: '&?mdOnDeselect',\n      tabClass: '@mdTabClass'\n    }\n  };\n\n  function postLink (scope, element, attr, ctrl) {\n    if (!ctrl) return;\n    var index = ctrl.getTabElementIndex(element),\n        body  = firstChild(element, 'md-tab-body').remove(),\n        label = firstChild(element, 'md-tab-label').remove(),\n        data  = ctrl.insertTab({\n          scope:    scope,\n          parent:   scope.$parent,\n          index:    index,\n          element:  element,\n          template: body.html(),\n          label:    label.html()\n        }, index);\n\n    scope.select   = scope.select || angular.noop;\n    scope.deselect = scope.deselect || angular.noop;\n\n    scope.$watch('active', function (active) { if (active) ctrl.select(data.getIndex(), true); });\n    scope.$watch('disabled', function () { ctrl.refreshIndex(); });\n    scope.$watch(\n        function () {\n          return ctrl.getTabElementIndex(element);\n        },\n        function (newIndex) {\n          data.index = newIndex;\n          ctrl.updateTabOrder();\n        }\n    );\n    scope.$on('$destroy', function () { ctrl.removeTab(data); });\n  }\n\n  function firstChild (element, tagName) {\n    var children = element[0].children;\n    for (var i = 0, len = children.length; i < len; i++) {\n      var child = children[i];\n      if (child.tagName === tagName.toUpperCase()) return angular.element(child);\n    }\n    return angular.element();\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabItemDirective.js",
    "content": "angular\n    .module('material.components.tabs')\n    .directive('mdTabItem', MdTabItem);\n\nfunction MdTabItem () {\n  return {\n    require: '^?mdTabs',\n    link:    function link (scope, element, attr, ctrl) {\n      if (!ctrl) return;\n      ctrl.attachRipple(scope, element);\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabLabelDirective.js",
    "content": "angular\n    .module('material.components.tabs')\n    .directive('mdTabLabel', MdTabLabel);\n\nfunction MdTabLabel () {\n  return { terminal: true };\n}\n\n"
  },
  {
    "path": "src/components/tabs/js/tabScroll.js",
    "content": "angular.module('material.components.tabs')\n    .directive('mdTabScroll', MdTabScroll);\n\nfunction MdTabScroll ($parse) {\n  return {\n    restrict: 'A',\n    compile: function ($element, attr) {\n      var fn = $parse(attr.mdTabScroll, null, true);\n      return function ngEventHandler (scope, element) {\n        element.on('wheel', function (event) {\n          scope.$apply(function () { fn(scope, { $event: event }); });\n        });\n      };\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabsController.js",
    "content": "angular\n    .module('material.components.tabs')\n    .controller('MdTabsController', MdTabsController);\n\n/**\n * @ngInject\n */\nfunction MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipple, $mdUtil,\n                           $animateCss, $attrs, $compile, $mdTheming, $mdInteraction, $timeout,\n                           MdTabsPaginationService) {\n  // define private properties\n  var ctrl      = this,\n      locked    = false,\n      queue     = [],\n      destroyed = false,\n      loaded    = false;\n\n  // Define public methods\n  ctrl.$onInit            = $onInit;\n  ctrl.updatePagination   = $mdUtil.debounce(updatePagination, 100);\n  ctrl.redirectFocus      = redirectFocus;\n  ctrl.attachRipple       = attachRipple;\n  ctrl.insertTab          = insertTab;\n  ctrl.removeTab          = removeTab;\n  ctrl.select             = select;\n  ctrl.scroll             = scroll;\n  ctrl.nextPage           = nextPage;\n  ctrl.previousPage       = previousPage;\n  ctrl.keydown            = keydown;\n  ctrl.canPageForward     = canPageForward;\n  ctrl.canPageBack        = canPageBack;\n  ctrl.refreshIndex       = refreshIndex;\n  ctrl.incrementIndex     = incrementIndex;\n  ctrl.getTabElementIndex = getTabElementIndex;\n  ctrl.updateInkBarStyles = $mdUtil.debounce(updateInkBarStyles, 100);\n  ctrl.updateTabOrder     = $mdUtil.debounce(updateTabOrder, 100);\n  ctrl.getFocusedTabId    = getFocusedTabId;\n\n  // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are pre-assigned,\n  // manually call the $onInit hook.\n  if (angular.version.major === 1 && angular.version.minor <= 4) {\n    this.$onInit();\n  }\n\n  /**\n   * AngularJS Lifecycle hook for newer AngularJS versions.\n   * Bindings are not guaranteed to have been assigned in the controller, but they are in the\n   * $onInit hook.\n   */\n  function $onInit() {\n    // Define one-way bindings\n    defineOneWayBinding('stretchTabs', handleStretchTabs);\n\n    // Define public properties with change handlers\n    defineProperty('focusIndex', handleFocusIndexChange, ctrl.selectedIndex || 0);\n    defineProperty('offsetLeft', handleOffsetChange, 0);\n    defineProperty('hasContent', handleHasContent, false);\n    defineProperty('maxTabWidth', handleMaxTabWidth, getMaxTabWidth());\n    defineProperty('shouldPaginate', handleShouldPaginate, false);\n\n    // Define boolean attributes\n    defineBooleanAttribute('noInkBar', handleInkBar);\n    defineBooleanAttribute('dynamicHeight', handleDynamicHeight);\n    defineBooleanAttribute('noPagination');\n    defineBooleanAttribute('swipeContent');\n    defineBooleanAttribute('autoselect');\n    defineBooleanAttribute('noSelectClick');\n    defineBooleanAttribute('centerTabs', handleCenterTabs);\n    defineBooleanAttribute('enableDisconnect');\n\n    // Define public properties\n    ctrl.scope             = $scope;\n    ctrl.parent            = $scope.$parent;\n    ctrl.tabs              = [];\n    ctrl.lastSelectedIndex = null;\n    ctrl.hasFocus          = false;\n    ctrl.styleTabItemFocus = false;\n    ctrl.shouldCenterTabs  = shouldCenterTabs();\n    ctrl.tabContentPrefix  = 'tab-content-';\n    ctrl.navigationHint = 'Use the left and right arrow keys to navigate between tabs';\n\n    // Setup the tabs controller after all bindings are available.\n    setupTabsController();\n  }\n\n  /**\n   * Perform setup for the controller, setup events and watcher(s)\n   */\n  function setupTabsController () {\n    ctrl.selectedIndex = ctrl.selectedIndex || 0;\n    compileTemplate();\n    configureWatchers();\n    bindEvents();\n    $mdTheming($element);\n    $mdUtil.nextTick(function () {\n      updateHeightFromContent();\n      adjustOffset();\n      updateInkBarStyles();\n      ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n      loaded = true;\n      updatePagination();\n    });\n  }\n\n  /**\n   * Compiles the template provided by the user.  This is passed as an attribute from the tabs\n   * directive's template function.\n   */\n  function compileTemplate () {\n    var template = $attrs.$mdTabsTemplate,\n        element  = angular.element($element[0].querySelector('md-tab-data'));\n\n    element.html(template);\n    $compile(element.contents())(ctrl.parent);\n    delete $attrs.$mdTabsTemplate;\n  }\n\n  /**\n   * Binds events used by the tabs component.\n   */\n  function bindEvents () {\n    angular.element($window).on('resize', handleWindowResize);\n    $scope.$on('$destroy', cleanup);\n  }\n\n  /**\n   * Configure watcher(s) used by Tabs\n   */\n  function configureWatchers () {\n    $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n  }\n\n  /**\n   * Creates a one-way binding manually rather than relying on AngularJS's isolated scope\n   * @param key\n   * @param handler\n   */\n  function defineOneWayBinding (key, handler) {\n    var attr = $attrs.$normalize('md-' + key);\n    if (handler) defineProperty(key, handler);\n    $attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; });\n  }\n\n  /**\n   * Defines boolean attributes with default value set to true. I.e. md-stretch-tabs with no value\n   * will be treated as being truthy.\n   * @param {string} key\n   * @param {Function=} handler\n   */\n  function defineBooleanAttribute (key, handler) {\n    var attr = $attrs.$normalize('md-' + key);\n    if (handler) defineProperty(key, handler, undefined);\n    if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);\n    $attrs.$observe(attr, updateValue);\n    function updateValue (newValue) {\n      ctrl[ key ] = newValue !== 'false';\n    }\n  }\n\n  /**\n   * Remove any events defined by this controller\n   */\n  function cleanup () {\n    destroyed = true;\n    angular.element($window).off('resize', handleWindowResize);\n  }\n\n  // Change handlers\n\n  /**\n   * Toggles stretch tabs class and updates inkbar when tab stretching changes.\n   */\n  function handleStretchTabs () {\n    var elements = getElements();\n    angular.element(elements.wrapper).toggleClass('md-stretch-tabs', shouldStretchTabs());\n    updateInkBarStyles();\n  }\n\n  /**\n   * Update the value of ctrl.shouldCenterTabs.\n   */\n  function handleCenterTabs () {\n    ctrl.shouldCenterTabs = shouldCenterTabs();\n  }\n\n  /**\n   * @param {number} newWidth new max tab width in pixels\n   * @param {number} oldWidth previous max tab width in pixels\n   */\n  function handleMaxTabWidth (newWidth, oldWidth) {\n    if (newWidth !== oldWidth) {\n      var elements = getElements();\n\n      // Set the max width for the real tabs\n      angular.forEach(elements.tabs, function(tab) {\n        tab.style.maxWidth = newWidth + 'px';\n      });\n\n      // Set the max width for the dummy tabs too\n      angular.forEach(elements.dummies, function(tab) {\n        tab.style.maxWidth = newWidth + 'px';\n      });\n\n      $mdUtil.nextTick(ctrl.updateInkBarStyles);\n    }\n  }\n\n  function handleShouldPaginate (newValue, oldValue) {\n    if (newValue !== oldValue) {\n      ctrl.maxTabWidth      = getMaxTabWidth();\n      ctrl.shouldCenterTabs = shouldCenterTabs();\n      $mdUtil.nextTick(function () {\n        ctrl.maxTabWidth = getMaxTabWidth();\n        adjustOffset(ctrl.selectedIndex);\n      });\n    }\n  }\n\n  /**\n   * Add/remove the `md-no-tab-content` class depending on `ctrl.hasContent`\n   * @param {boolean} hasContent\n   */\n  function handleHasContent (hasContent) {\n    $element[ hasContent ? 'removeClass' : 'addClass' ]('md-no-tab-content');\n  }\n\n  /**\n   * Apply ctrl.offsetLeft to the paging element when it changes\n   * @param {string|number} left\n   */\n  function handleOffsetChange (left) {\n    var newValue = ((ctrl.shouldCenterTabs || isRtl() ? '' : '-') + left + 'px');\n\n    // Fix double-negative which can happen with RTL support\n    newValue = newValue.replace('--', '');\n\n    angular.element(getElements().paging).css($mdConstant.CSS.TRANSFORM,\n                                              'translate(' + newValue + ', 0)');\n    $scope.$broadcast('$mdTabsPaginationChanged');\n  }\n\n  /**\n   * Update the UI whenever `ctrl.focusIndex` is updated\n   * @param {number} newIndex\n   * @param {number} oldIndex\n   */\n  function handleFocusIndexChange (newIndex, oldIndex) {\n    if (newIndex === oldIndex) return;\n    if (!getElements().tabs[ newIndex ]) return;\n    adjustOffset();\n    redirectFocus();\n  }\n\n  /**\n   * Update the UI whenever the selected index changes. Calls user-defined select/deselect methods.\n   * @param {number} newValue selected index's new value\n   * @param {number} oldValue selected index's previous value\n   */\n  function handleSelectedIndexChange (newValue, oldValue) {\n    if (newValue === oldValue) return;\n\n    ctrl.selectedIndex     = getNearestSafeIndex(newValue);\n    ctrl.lastSelectedIndex = oldValue;\n    ctrl.updateInkBarStyles();\n    updateHeightFromContent();\n    adjustOffset(newValue);\n    $scope.$broadcast('$mdTabsChanged');\n    ctrl.tabs[ oldValue ] && ctrl.tabs[ oldValue ].scope.deselect();\n    ctrl.tabs[ newValue ] && ctrl.tabs[ newValue ].scope.select();\n  }\n\n  function getTabElementIndex(tabEl){\n    var tabs = $element[0].getElementsByTagName('md-tab');\n    return Array.prototype.indexOf.call(tabs, tabEl[0]);\n  }\n\n  /**\n   * Queues up a call to `handleWindowResize` when a resize occurs while the tabs component is\n   * hidden.\n   */\n  function handleResizeWhenVisible () {\n    // if there is already a watcher waiting for resize, do nothing\n    if (handleResizeWhenVisible.watcher) return;\n    // otherwise, we will abuse the $watch function to check for visible\n    handleResizeWhenVisible.watcher = $scope.$watch(function () {\n      // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n      $mdUtil.nextTick(function () {\n        // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n        if (!handleResizeWhenVisible.watcher) return;\n\n        if ($element.prop('offsetParent')) {\n          handleResizeWhenVisible.watcher();\n          handleResizeWhenVisible.watcher = null;\n\n          handleWindowResize();\n        }\n      }, false);\n    });\n  }\n\n  // Event handlers / actions\n\n  /**\n   * Handle user keyboard interactions\n   * @param {KeyboardEvent} event keydown event\n   */\n  function keydown (event) {\n    switch (event.keyCode) {\n      case $mdConstant.KEY_CODE.LEFT_ARROW:\n        event.preventDefault();\n        incrementIndex(-1, true);\n        break;\n      case $mdConstant.KEY_CODE.RIGHT_ARROW:\n        event.preventDefault();\n        incrementIndex(1, true);\n        break;\n      case $mdConstant.KEY_CODE.SPACE:\n      case $mdConstant.KEY_CODE.ENTER:\n        event.preventDefault();\n        if (!locked) select(ctrl.focusIndex);\n        break;\n      case $mdConstant.KEY_CODE.TAB:\n        // On tabbing out of the tablist, reset hasFocus to reset ng-focused and\n        // its md-focused class if the focused tab is not the active tab.\n        if (ctrl.focusIndex !== ctrl.selectedIndex) {\n          ctrl.focusIndex = ctrl.selectedIndex;\n        }\n        break;\n    }\n  }\n\n  /**\n   * Update the selected index. Triggers a click event on the original `md-tab` element in order\n   * to fire user-added click events if canSkipClick or `md-no-select-click` are false.\n   * @param index\n   * @param canSkipClick Optionally allow not firing the click event if `md-no-select-click` is also true.\n   */\n  function select (index, canSkipClick) {\n    if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index;\n    // skip the click event if noSelectClick is enabled\n    if (canSkipClick && ctrl.noSelectClick) return;\n    // nextTick is required to prevent errors in user-defined click events\n    $mdUtil.nextTick(function () {\n      ctrl.tabs[ index ].element.triggerHandler('click');\n    }, false);\n  }\n\n  /**\n   * When pagination is on, this makes sure the selected index is in view.\n   * @param {WheelEvent} event\n   */\n  function scroll (event) {\n    if (!ctrl.shouldPaginate) return;\n    event.preventDefault();\n    if (event.deltaY) {\n      ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaY);\n    } else if (event.deltaX) {\n      ctrl.offsetLeft = fixOffset(ctrl.offsetLeft + event.deltaX);\n    }\n  }\n\n  /**\n   * Slides the tabs over approximately one page forward.\n   */\n  function nextPage () {\n    if (!ctrl.canPageForward()) { return; }\n\n    var newOffset = MdTabsPaginationService.increasePageOffset(getElements(), ctrl.offsetLeft);\n\n    ctrl.offsetLeft = fixOffset(newOffset);\n  }\n\n  /**\n   * Slides the tabs over approximately one page backward.\n   */\n  function previousPage () {\n    if (!ctrl.canPageBack()) { return; }\n\n    var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);\n\n    // Set the new offset\n    ctrl.offsetLeft = fixOffset(newOffset);\n  }\n\n  /**\n   * Update size calculations when the window is resized.\n   */\n  function handleWindowResize () {\n    ctrl.lastSelectedIndex = ctrl.selectedIndex;\n    ctrl.offsetLeft        = fixOffset(ctrl.offsetLeft);\n\n    $mdUtil.nextTick(function () {\n      ctrl.updateInkBarStyles();\n      updatePagination();\n    });\n  }\n\n  /**\n   * Hides or shows the tabs ink bar.\n   * @param {boolean} hide A Boolean (not just truthy/falsy) value to determine whether the class\n   * should be added or removed.\n   */\n  function handleInkBar (hide) {\n    angular.element(getElements().inkBar).toggleClass('ng-hide', hide);\n  }\n\n  /**\n   * Enables or disables tabs dynamic height.\n   * @param {boolean} value A Boolean (not just truthy/falsy) value to determine whether the class\n   * should be added or removed.\n   */\n  function handleDynamicHeight (value) {\n    $element.toggleClass('md-dynamic-height', value);\n  }\n\n  /**\n   * Remove a tab from the data and select the nearest valid tab.\n   * @param {Object} tabData tab to remove\n   */\n  function removeTab (tabData) {\n    if (destroyed) return;\n    var selectedIndex = ctrl.selectedIndex,\n        tab           = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];\n    refreshIndex();\n    // when removing a tab, if the selected index did not change, we have to manually trigger the\n    //   tab select/deselect events\n    if (ctrl.selectedIndex === selectedIndex) {\n      tab.scope.deselect();\n      ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n    }\n    $mdUtil.nextTick(function () {\n      updatePagination();\n      ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n    });\n  }\n\n  /**\n   * Create an entry in the tabs array for a new tab at the specified index.\n   * @param {Object} tabData tab to insert\n   * @param {number} index location to insert the new tab\n   * @returns {Object} the inserted tab\n   */\n  function insertTab (tabData, index) {\n    var hasLoaded = loaded;\n    var proto = {\n          getIndex:     function () { return ctrl.tabs.indexOf(tab); },\n          isActive:     function () { return this.getIndex() === ctrl.selectedIndex; },\n          isLeft:       function () { return this.getIndex() < ctrl.selectedIndex; },\n          isRight:      function () { return this.getIndex() > ctrl.selectedIndex; },\n          shouldRender: function () { return ctrl.dynamicHeight || this.isActive(); },\n          hasFocus:     function () {\n            return ctrl.styleTabItemFocus\n                && ctrl.hasFocus && this.getIndex() === ctrl.focusIndex;\n          },\n          id:           $mdUtil.nextUid(),\n          hasContent: !!(tabData.template && tabData.template.trim())\n    };\n    var tab = angular.extend(proto, tabData);\n\n    if (angular.isDefined(index)) {\n      ctrl.tabs.splice(index, 0, tab);\n    } else {\n      ctrl.tabs.push(tab);\n    }\n    processQueue();\n    updateHasContent();\n\n    $mdUtil.nextTick(function () {\n      updatePagination();\n      setAriaControls(tab);\n\n      // if autoselect is enabled, select the newly added tab\n      if (hasLoaded && ctrl.autoselect) {\n        $mdUtil.nextTick(function () {\n          $mdUtil.nextTick(function () { select(ctrl.tabs.indexOf(tab)); });\n        });\n      }\n    });\n    return tab;\n  }\n\n  // Getter methods\n\n  /**\n   * Gathers references to all of the DOM elements used by this controller.\n   * @returns {Object}\n   */\n  function getElements () {\n    var elements = {};\n    var node = $element[0];\n\n    // gather tab bar elements\n    elements.wrapper = node.querySelector('md-tabs-wrapper');\n    elements.canvas  = elements.wrapper.querySelector('md-tabs-canvas');\n    elements.paging  = elements.canvas.querySelector('md-pagination-wrapper');\n    elements.inkBar  = elements.paging.querySelector('md-ink-bar');\n    elements.nextButton = node.querySelector('md-next-button');\n    elements.prevButton = node.querySelector('md-prev-button');\n\n    elements.contents = node.querySelectorAll('md-tabs-content-wrapper > md-tab-content');\n    elements.tabs    = elements.paging.querySelectorAll('md-tab-item');\n    elements.dummies = elements.canvas.querySelectorAll('md-dummy-tab');\n\n    return elements;\n  }\n\n  /**\n   * Determines whether or not the left pagination arrow should be enabled.\n   * @returns {boolean}\n   */\n  function canPageBack () {\n    // This works for both LTR and RTL\n    return ctrl.offsetLeft > 0;\n  }\n\n  /**\n   * Determines whether or not the right pagination arrow should be enabled.\n   * @returns {*|boolean}\n   */\n  function canPageForward () {\n    var elements = getElements();\n    var lastTab = elements.tabs[ elements.tabs.length - 1 ];\n\n    if (isRtl()) {\n      return ctrl.offsetLeft < elements.paging.offsetWidth - elements.canvas.offsetWidth;\n    }\n\n    return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canvas.clientWidth +\n        ctrl.offsetLeft;\n  }\n\n  /**\n   * Returns currently focused tab item's element ID\n   */\n  function getFocusedTabId() {\n    var focusedTab = ctrl.tabs[ctrl.focusIndex];\n    if (!focusedTab || !focusedTab.id) {\n      return null;\n    }\n    return 'tab-item-' + focusedTab.id;\n  }\n\n  /**\n   * Determines if the UI should stretch the tabs to fill the available space.\n   * @returns {*}\n   */\n  function shouldStretchTabs () {\n    switch (ctrl.stretchTabs) {\n      case 'always':\n        return true;\n      case 'never':\n        return false;\n      default:\n        return !ctrl.shouldPaginate\n            && $window.matchMedia('(max-width: 600px)').matches;\n    }\n  }\n\n  /**\n   * Determines if the tabs should appear centered.\n   * @returns {boolean}\n   */\n  function shouldCenterTabs () {\n    return ctrl.centerTabs && !ctrl.shouldPaginate;\n  }\n\n  /**\n   * Determines if pagination is necessary to display the tabs within the available space.\n   * @returns {boolean} true if pagination is necessary, false otherwise\n   */\n  function shouldPaginate () {\n    var shouldPaginate;\n    if (ctrl.noPagination || !loaded) return false;\n    var canvasWidth = $element.prop('clientWidth');\n\n    angular.forEach(getElements().tabs, function (tab) {\n      canvasWidth -= tab.offsetWidth;\n    });\n\n    shouldPaginate = canvasWidth < 0;\n    // Work around width calculation issues on IE11 when pagination is enabled.\n    // Don't do this on other browsers because it breaks scroll to new tab animation.\n    if ($mdUtil.msie) {\n      if (shouldPaginate) {\n        getElements().paging.style.width = '999999px';\n      } else {\n        getElements().paging.style.width = undefined;\n      }\n    }\n    return shouldPaginate;\n  }\n\n  /**\n   * Finds the nearest tab index that is available. This is primarily used for when the active\n   * tab is removed.\n   * @param newIndex\n   * @returns {*}\n   */\n  function getNearestSafeIndex (newIndex) {\n    if (newIndex === -1) return -1;\n    var maxOffset = Math.max(ctrl.tabs.length - newIndex, newIndex),\n        i, tab;\n    for (i = 0; i <= maxOffset; i++) {\n      tab = ctrl.tabs[ newIndex + i ];\n      if (tab && (tab.scope.disabled !== true)) return tab.getIndex();\n      tab = ctrl.tabs[ newIndex - i ];\n      if (tab && (tab.scope.disabled !== true)) return tab.getIndex();\n    }\n    return newIndex;\n  }\n\n  // Utility methods\n\n  /**\n   * Defines a property using a getter and setter in order to trigger a change handler without\n   * using `$watch` to observe changes.\n   * @param {PropertyKey} key\n   * @param {Function} handler\n   * @param {any} value\n   */\n  function defineProperty (key, handler, value) {\n    Object.defineProperty(ctrl, key, {\n      get: function () { return value; },\n      set: function (newValue) {\n        var oldValue = value;\n        value        = newValue;\n        handler && handler(newValue, oldValue);\n      }\n    });\n  }\n\n  /**\n   * Updates whether or not pagination should be displayed.\n   */\n  function updatePagination () {\n    ctrl.maxTabWidth = getMaxTabWidth();\n    ctrl.shouldPaginate = shouldPaginate();\n  }\n\n  /**\n   * @param {Array<HTMLElement>} tabs tab item elements for use in computing total width\n   * @returns {number} the width of the tabs in the specified array in pixels\n   */\n  function calcTabsWidth(tabs) {\n    var width = 0;\n\n    angular.forEach(tabs, function (tab) {\n      // Uses the larger value between `getBoundingClientRect().width` and `offsetWidth`.  This\n      // prevents `offsetWidth` value from being rounded down and causing wrapping issues, but\n      // also handles scenarios where `getBoundingClientRect()` is inaccurate (ie. tabs inside\n      // of a dialog).\n      width += Math.max(tab.offsetWidth, tab.getBoundingClientRect().width);\n    });\n\n    return Math.ceil(width);\n  }\n\n  /**\n   * @returns {number} either the max width as constrained by the container or the max width from\n   * the 2017 version of the Material Design spec.\n   */\n  function getMaxTabWidth() {\n    var elements = getElements(),\n      containerWidth = elements.canvas.clientWidth,\n\n      // See https://material.io/archive/guidelines/components/tabs.html#tabs-specs\n      specMax = 264;\n\n    // Do the spec maximum, or the canvas width; whichever is *smaller* (tabs larger than the canvas\n    // width can break the pagination) but not less than 0\n    return Math.max(0, Math.min(containerWidth - 1, specMax));\n  }\n\n  /**\n   * Re-orders the tabs and updates the selected and focus indexes to their new positions.\n   * This is triggered by `tabDirective.js` when the user's tabs have been re-ordered.\n   */\n  function updateTabOrder () {\n    var selectedItem   = ctrl.tabs[ ctrl.selectedIndex ],\n        focusItem      = ctrl.tabs[ ctrl.focusIndex ];\n    ctrl.tabs          = ctrl.tabs.sort(function (a, b) {\n      return a.index - b.index;\n    });\n    ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);\n    ctrl.focusIndex    = ctrl.tabs.indexOf(focusItem);\n  }\n\n  /**\n   * This moves the selected or focus index left or right. This is used by the keydown handler.\n   * @param {number} inc amount to increment\n   * @param {boolean} focus true to increment the focus index, false to increment the selected index\n   */\n  function incrementIndex (inc, focus) {\n    var newIndex,\n        key   = focus ? 'focusIndex' : 'selectedIndex',\n        index = ctrl[ key ];\n    for (newIndex = index + inc;\n         ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;\n         newIndex += inc) { /* do nothing */ }\n\n    newIndex = (index + inc + ctrl.tabs.length) % ctrl.tabs.length;\n\n    if (ctrl.tabs[ newIndex ]) {\n      ctrl[ key ] = newIndex;\n    }\n  }\n\n  /**\n   * This is used to forward focus to tab container elements. This method is necessary to avoid\n   * animation issues when attempting to focus an item that is out of view.\n   */\n  function redirectFocus () {\n    ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard');\n    var tabToFocus = getElements().tabs[ctrl.focusIndex];\n    if (tabToFocus) {\n      tabToFocus.focus();\n    }\n  }\n\n  /**\n   * Forces the pagination to move the focused tab into view.\n   * @param {number=} index of tab to have its offset adjusted\n   */\n  function adjustOffset (index) {\n    var elements = getElements();\n\n    if (!angular.isNumber(index)) index = ctrl.focusIndex;\n    if (!elements.tabs[ index ]) return;\n    if (ctrl.shouldCenterTabs) return;\n    var tab         = elements.tabs[ index ],\n        left        = tab.offsetLeft,\n        right       = tab.offsetWidth + left,\n        extraOffset = 32;\n\n    // If we are selecting the first tab (in LTR and RTL), always set the offset to 0\n    if (index === 0) {\n      ctrl.offsetLeft = 0;\n      return;\n    }\n\n    if (isRtl()) {\n      var tabWidthsBefore = calcTabsWidth(Array.prototype.slice.call(elements.tabs, 0, index));\n      var tabWidthsIncluding = calcTabsWidth(Array.prototype.slice.call(elements.tabs, 0, index + 1));\n\n      ctrl.offsetLeft = Math.min(ctrl.offsetLeft, fixOffset(tabWidthsBefore));\n      ctrl.offsetLeft = Math.max(ctrl.offsetLeft, fixOffset(tabWidthsIncluding - elements.canvas.clientWidth));\n    } else {\n      ctrl.offsetLeft = Math.max(ctrl.offsetLeft, fixOffset(right - elements.canvas.clientWidth + extraOffset));\n      ctrl.offsetLeft = Math.min(ctrl.offsetLeft, fixOffset(left));\n    }\n  }\n\n  /**\n   * Iterates through all queued functions and clears the queue. This is used for functions that\n   * are called before the UI is ready, such as size calculations.\n   */\n  function processQueue () {\n    queue.forEach(function (func) { $mdUtil.nextTick(func); });\n    queue = [];\n  }\n\n  /**\n   * Determines if the tab content area is needed.\n   */\n  function updateHasContent () {\n    var hasContent = false;\n    var i;\n\n    for (i = 0; i < ctrl.tabs.length; i++) {\n      if (ctrl.tabs[i].hasContent) {\n        hasContent = true;\n        break;\n      }\n    }\n\n    ctrl.hasContent = hasContent;\n  }\n\n  /**\n   * Moves the indexes to their nearest valid values.\n   */\n  function refreshIndex () {\n    ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);\n    ctrl.focusIndex    = getNearestSafeIndex(ctrl.focusIndex);\n  }\n\n  /**\n   * Calculates the content height of the current tab.\n   * @returns {*}\n   */\n  function updateHeightFromContent () {\n    if (!ctrl.dynamicHeight) return $element.css('height', '');\n    if (!ctrl.tabs.length) return queue.push(updateHeightFromContent);\n\n    var elements = getElements();\n\n    var tabContent    = elements.contents[ ctrl.selectedIndex ],\n        contentHeight = tabContent ? tabContent.offsetHeight : 0,\n        tabsHeight    = elements.wrapper.offsetHeight,\n        newHeight     = contentHeight + tabsHeight,\n        currentHeight = $element.prop('clientHeight');\n\n    if (currentHeight === newHeight) return;\n\n    // Adjusts calculations for when the buttons are bottom-aligned since this relies on absolute\n    // positioning.  This should probably be cleaned up if a cleaner solution is possible.\n    if ($element.attr('md-align-tabs') === 'bottom') {\n      currentHeight -= tabsHeight;\n      newHeight -= tabsHeight;\n      // Need to include bottom border in these calculations\n      if ($element.attr('md-border-bottom') !== undefined) {\n        ++currentHeight;\n      }\n    }\n\n    // Lock during animation so the user can't change tabs\n    locked = true;\n\n    var fromHeight = { height: currentHeight + 'px' },\n        toHeight = { height: newHeight + 'px' };\n\n    // Set the height to the current, specific pixel height to fix a bug on iOS where the height\n    // first animates to 0, then back to the proper height causing a visual glitch\n    $element.css(fromHeight);\n\n    // Animate the height from the old to the new\n    $animateCss($element, {\n      from: fromHeight,\n      to: toHeight,\n      easing: 'cubic-bezier(0.35, 0, 0.25, 1)',\n      duration: 0.5\n    }).start().done(function () {\n      // Then (to fix the same iOS issue as above), disable transitions and remove the specific\n      // pixel height so the height can size with browser width/content changes, etc.\n      $element.css({\n        transition: 'none',\n        height: ''\n      });\n\n      // In the next tick, re-allow transitions (if we do it all at once, $element.css is \"smart\"\n      // enough to batch it for us instead of doing it immediately, which undoes the original\n      // transition: none)\n      $mdUtil.nextTick(function() {\n        $element.css('transition', '');\n      });\n\n      // And unlock so tab changes can occur\n      locked = false;\n    });\n  }\n\n  /**\n   * Repositions the ink bar to the selected tab.\n   * Parameters are used when calling itself recursively when md-center-tabs is used as we need to\n   * run two passes to properly center the tabs. These parameters ensure that we only run two passes\n   * and that we don't run indefinitely.\n   * @param {number=} previousTotalWidth previous width of pagination wrapper\n   * @param {number=} previousWidthOfTabItems previous width of all tab items\n   */\n  function updateInkBarStyles (previousTotalWidth, previousWidthOfTabItems) {\n    if (ctrl.noInkBar) {\n      return;\n    }\n    var elements = getElements();\n\n    if (!elements.tabs[ ctrl.selectedIndex ]) {\n      angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' });\n      return;\n    }\n\n    if (!ctrl.tabs.length) {\n      queue.push(ctrl.updateInkBarStyles);\n      return;\n    }\n    // If the element is not visible, we will not be able to calculate sizes until it becomes\n    // visible. We should treat that as a resize event rather than just updating the ink bar.\n    if (!$element.prop('offsetParent')) {\n      handleResizeWhenVisible();\n      return;\n    }\n\n    var index      = ctrl.selectedIndex,\n        totalWidth = elements.paging.offsetWidth,\n        tab        = elements.tabs[ index ],\n        left       = tab.offsetLeft,\n        right      = totalWidth - left - tab.offsetWidth;\n\n    if (ctrl.shouldCenterTabs) {\n      // We need to use the same calculate process as in the pagination wrapper, to avoid rounding\n      // deviations.\n      var totalWidthOfTabItems = calcTabsWidth(elements.tabs);\n\n      if (totalWidth > totalWidthOfTabItems &&\n          previousTotalWidth !== totalWidth &&\n          previousWidthOfTabItems !== totalWidthOfTabItems) {\n        $timeout(updateInkBarStyles, 0, true, totalWidth, totalWidthOfTabItems);\n      }\n    }\n    updateInkBarClassName();\n    angular.element(elements.inkBar).css({ left: left + 'px', right: right + 'px' });\n  }\n\n  /**\n   * Adds left/right classes so that the ink bar will animate properly.\n   */\n  function updateInkBarClassName () {\n    var elements = getElements();\n    var newIndex = ctrl.selectedIndex,\n        oldIndex = ctrl.lastSelectedIndex,\n        ink      = angular.element(elements.inkBar);\n    if (!angular.isNumber(oldIndex)) return;\n    ink\n        .toggleClass('md-left', newIndex < oldIndex)\n        .toggleClass('md-right', newIndex > oldIndex);\n  }\n\n  /**\n   * Takes an offset value and makes sure that it is within the min/max allowed values.\n   * @param {number} value\n   * @returns {number}\n   */\n  function fixOffset (value) {\n    var elements = getElements();\n\n    if (!elements.tabs.length || !ctrl.shouldPaginate) return 0;\n\n    var lastTab    = elements.tabs[ elements.tabs.length - 1 ],\n        totalWidth = lastTab.offsetLeft + lastTab.offsetWidth;\n\n    if (isRtl()) {\n      value = Math.min(elements.paging.offsetWidth - elements.canvas.clientWidth, value);\n      value = Math.max(0, value);\n    } else {\n      value = Math.max(0, value);\n      value = Math.min(totalWidth - elements.canvas.clientWidth, value);\n    }\n\n    return value;\n  }\n\n  /**\n   * Attaches a ripple to the tab item element.\n   * @param scope\n   * @param element\n   */\n  function attachRipple (scope, element) {\n    var elements = getElements();\n    var options = { colorElement: angular.element(elements.inkBar) };\n    $mdTabInkRipple.attach(scope, element, options);\n  }\n\n  /**\n   * Sets the `aria-controls` attribute to the elements that correspond to the passed-in tab.\n   * @param tab\n   */\n  function setAriaControls (tab) {\n    if (tab.hasContent) {\n      var nodes = $element[0].querySelectorAll('[md-tab-id=\"' + tab.id + '\"]');\n      angular.element(nodes).attr('aria-controls', ctrl.tabContentPrefix + tab.id);\n    }\n  }\n\n  function isRtl() {\n    return $mdUtil.isRtl($attrs);\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabsDirective.js",
    "content": "/**\n * @ngdoc directive\n * @name mdTabs\n * @module material.components.tabs\n *\n * @restrict E\n *\n * @description\n * The `<md-tabs>` directive serves as the container for 1..n\n * <a ng-href=\"api/directive/mdTab\">`<md-tab>`</a> child directives.\n * In turn, the nested `<md-tab>` directive is used to specify a tab label for the\n * **header button** and <i>optional</i> tab view content that will be associated with each tab\n * button.\n *\n * Below is the markup for its simplest usage:\n *\n *  <hljs lang=\"html\">\n *  <md-tabs>\n *    <md-tab label=\"Tab #1\"></md-tab>\n *    <md-tab label=\"Tab #2\"></md-tab>\n *    <md-tab label=\"Tab #3\"></md-tab>\n *  </md-tabs>\n *  </hljs>\n *\n * Tabs support three (3) usage scenarios:\n *\n *  1. Tabs (buttons only)\n *  2. Tabs with internal view content\n *  3. Tabs with external view content\n *\n * **Tabs-only** support is useful when tab buttons are used for custom navigation regardless of any\n * other components, content, or views.\n *\n * <blockquote><b>Note:</b> If you are using the Tabs component for page-level navigation, please\n * use the <a ng-href=\"./api/directive/mdNavBar\">NavBar component</a> instead. It handles this\n * case a more natively and more performantly.</blockquote>\n *\n * **Tabs with internal views** are the traditional usage where each tab has associated view\n * content and the view switching is managed internally by the Tabs component.\n *\n * **Tabs with external view content** is often useful when content associated with each tab is\n * independently managed and data-binding notifications announce tab selection changes.\n *\n * Additional features include:\n *\n * *  Content can include any markup.\n * *  If a tab is disabled while active/selected, then the next tab will be auto-selected.\n *\n * ### Theming\n *\n * By default, tabs use your app's accent color for the selected tab's text and ink bar.\n *\n * You can use the theming classes to change the color of the `md-tabs` background:\n * * Applying `class=\"md-primary\"` will use your app's primary color for the background, your\n *   accent color for the ink bar, and your primary palette's contrast color for the text of the\n *   selected tab.\n *   * When using the `md-primary` class, you can add the `md-no-ink-bar-color` class to make the\n *     ink bar use your theme's primary contrast color instead of the accent color.\n * * Applying `class=\"md-accent\"` will use your app's accent color for the background and your\n *   accent palette's contrast color for the text and ink bar of the selected tab.\n * * Applying `class=\"md-warn\"` will use your app's warn color for the background and your\n *   warn palette's contrast color for the text and ink bar of the selected tab.\n *\n * ### Explanation of tab stretching\n *\n * Initially, tabs will have an inherent size.  This size will either be defined by how much space\n * is needed to accommodate their text or set by the user through CSS.\n * Calculations will be based on this size.\n *\n * On mobile devices, tabs will be expanded to fill the available horizontal space.\n * When this happens, all tabs will become the same size.\n *\n * On desktops, by default, stretching will never occur.\n *\n * This default behavior can be overridden through the `md-stretch-tabs` attribute.\n * Here is a table showing when stretching will occur:\n *\n * `md-stretch-tabs` | mobile    | desktop\n * ------------------|-----------|--------\n * `auto`            | stretched | ---\n * `always`          | stretched | stretched\n * `never`           | ---       | ---\n *\n * @param {number=} md-selected Index of the active/selected tab.\n * @param {expression=} md-no-ink-bar If `true` or no value, disables the selection ink bar.\n * @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`;\n *  Default is `top`.\n * @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`,\n *  `always`, or `never`; Default is `auto`.\n * @param {expression=} md-dynamic-height If `true` or no value, the tab wrapper will resize based\n *  on the contents of the selected tab.\n * @param {boolean=} md-border-bottom If the attribute is present, shows a solid `1px` border\n *  between the tabs and their content.\n * @param {boolean=} md-center-tabs If the attribute is present, tabs will be centered provided\n *  there is no need for pagination.\n * @param {boolean=} md-no-pagination If the attribute is present, pagination will remain off.\n * @param {expression=} md-swipe-content When enabled, swipe gestures will be enabled for the content\n *  area to allow swiping between tabs.\n * @param {boolean=} md-enable-disconnect When enabled, scopes will be disconnected for tabs that\n *  are not being displayed. This provides a performance boost, but may also cause unexpected\n *  issues. It is not recommended for most users.\n * @param {boolean=} md-autoselect If the attribute is present, any tabs added after the initial\n *  load will be automatically selected.\n * @param {boolean=} md-no-select-click When true, click events will not be fired when the value of\n *  `md-active` on an `md-tab` changes. This is useful when using tabs with UI-Router's child\n *  states, as triggering a click event in that case can cause an extra tab change to occur.\n * @param {string=} md-navigation-hint Attribute to override the default `tablist` navigation hint\n *  that screen readers will announce to provide instructions for navigating between tabs. This is\n *  desirable when you want the hint to be in a different language. Default is \"Use the left and\n *  right arrow keys to navigate between tabs\".\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-tabs md-selected=\"selectedIndex\">\n *   <img ng-src=\"img/angular.png\" class=\"centered\" alt=\"Angular icon\">\n *   <md-tab\n *       ng-repeat=\"tab in tabs | orderBy:predicate:reversed\"\n *       md-on-select=\"onTabSelected(tab)\"\n *       md-on-deselect=\"announceDeselected(tab)\"\n *       ng-disabled=\"tab.disabled\">\n *     <md-tab-label>\n *       {{tab.title}}\n *       <img src=\"img/removeTab.png\" ng-click=\"removeTab(tab)\" class=\"delete\" alt=\"Remove tab\">\n *     </md-tab-label>\n *     <md-tab-body>\n *       {{tab.content}}\n *     </md-tab-body>\n *   </md-tab>\n * </md-tabs>\n * </hljs>\n *\n */\nangular\n    .module('material.components.tabs')\n    .directive('mdTabs', MdTabs);\n\nfunction MdTabs ($$mdSvgRegistry) {\n  return {\n    scope:            {\n      navigationHint: '@?mdNavigationHint',\n      selectedIndex: '=?mdSelected'\n    },\n    template:         function (element, attr) {\n      attr.$mdTabsTemplate = element.html();\n      return '' +\n        '<md-tabs-wrapper> ' +\n          '<md-tab-data></md-tab-data> ' +\n          '<md-prev-button ' +\n              'tabindex=\"-1\" ' +\n              'role=\"button\" ' +\n              'aria-label=\"Previous Page\" ' +\n              'aria-disabled=\"{{!$mdTabsCtrl.canPageBack()}}\" ' +\n              'ng-class=\"{ \\'md-disabled\\': !$mdTabsCtrl.canPageBack() }\" ' +\n              'ng-if=\"$mdTabsCtrl.shouldPaginate\" ' +\n              'ng-click=\"$mdTabsCtrl.previousPage()\"> ' +\n            '<md-icon md-svg-src=\"'+ $$mdSvgRegistry.mdTabsArrow +'\"></md-icon> ' +\n          '</md-prev-button> ' +\n          '<md-next-button ' +\n              'tabindex=\"-1\" ' +\n              'role=\"button\" ' +\n              'aria-label=\"Next Page\" ' +\n              'aria-disabled=\"{{!$mdTabsCtrl.canPageForward()}}\" ' +\n              'ng-class=\"{ \\'md-disabled\\': !$mdTabsCtrl.canPageForward() }\" ' +\n              'ng-if=\"$mdTabsCtrl.shouldPaginate\" ' +\n              'ng-click=\"$mdTabsCtrl.nextPage()\"> ' +\n            '<md-icon md-svg-src=\"'+ $$mdSvgRegistry.mdTabsArrow +'\"></md-icon> ' +\n          '</md-next-button> ' +\n          '<md-tabs-canvas ' +\n              'tabindex=\"{{ $mdTabsCtrl.hasFocus ? -1 : 0 }}\" ' +\n              'ng-focus=\"$mdTabsCtrl.redirectFocus()\" ' +\n              'ng-class=\"{ ' +\n                  '\\'md-paginated\\': $mdTabsCtrl.shouldPaginate, ' +\n                  '\\'md-center-tabs\\': $mdTabsCtrl.shouldCenterTabs ' +\n              '}\" ' +\n              'ng-keydown=\"$mdTabsCtrl.keydown($event)\"> ' +\n            '<md-pagination-wrapper ' +\n                'ng-class=\"{ \\'md-center-tabs\\': $mdTabsCtrl.shouldCenterTabs }\" ' +\n                'md-tab-scroll=\"$mdTabsCtrl.scroll($event)\" ' +\n                'role=\"tablist\" ' +\n                'aria-label=\"{{::$mdTabsCtrl.navigationHint}}\">' +\n              '<md-tab-item ' +\n                  'tabindex=\"{{ tab.isActive() ? 0 : -1 }}\" ' +\n                  'class=\"md-tab {{::tab.scope.tabClass}}\" ' +\n                  'ng-repeat=\"tab in $mdTabsCtrl.tabs\" ' +\n                  'role=\"tab\" ' +\n                  'id=\"tab-item-{{::tab.id}}\" ' +\n                  'md-tab-id=\"{{::tab.id}}\" ' +\n                  'aria-selected=\"{{tab.isActive()}}\" ' +\n                  'aria-disabled=\"{{tab.scope.disabled || \\'false\\'}}\" ' +\n                  'ng-click=\"$mdTabsCtrl.select(tab.getIndex())\" ' +\n                  'ng-focus=\"$mdTabsCtrl.hasFocus = true\" ' +\n                  'ng-blur=\"$mdTabsCtrl.hasFocus = false\" ' +\n                  'ng-class=\"{ ' +\n                      '\\'md-active\\':    tab.isActive(), ' +\n                      '\\'md-focused\\':   tab.hasFocus(), ' +\n                      '\\'md-disabled\\':  tab.scope.disabled ' +\n                  '}\" ' +\n                  'ng-disabled=\"tab.scope.disabled\" ' +\n                  'md-swipe-left=\"$mdTabsCtrl.nextPage()\" ' +\n                  'md-swipe-right=\"$mdTabsCtrl.previousPage()\" ' +\n                  'md-tabs-template=\"::tab.label\" ' +\n                  'md-scope=\"::tab.parent\"></md-tab-item> ' +\n              '<md-ink-bar></md-ink-bar> ' +\n            '</md-pagination-wrapper> ' +\n            '<md-tabs-dummy-wrapper aria-hidden=\"true\" class=\"md-visually-hidden md-dummy-wrapper\"> ' +\n              '<md-dummy-tab ' +\n                  'class=\"md-tab\" ' +\n                  'tabindex=\"-1\" ' +\n                  'ng-focus=\"$mdTabsCtrl.hasFocus = true\" ' +\n                  'ng-blur=\"$mdTabsCtrl.hasFocus = false\" ' +\n                  'ng-repeat=\"tab in $mdTabsCtrl.tabs\" ' +\n                  'md-tabs-template=\"::tab.label\" ' +\n                  'md-scope=\"::tab.parent\"></md-dummy-tab> ' +\n            '</md-tabs-dummy-wrapper> ' +\n          '</md-tabs-canvas> ' +\n        '</md-tabs-wrapper> ' +\n        '<md-tabs-content-wrapper ng-show=\"$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0\" class=\"_md\"> ' +\n          '<md-tab-content ' +\n              'id=\"{{:: $mdTabsCtrl.tabContentPrefix + tab.id}}\" ' +\n              'class=\"_md\" ' +\n              'role=\"tabpanel\" ' +\n              'aria-labelledby=\"tab-item-{{::tab.id}}\" ' +\n              'md-swipe-left=\"$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)\" ' +\n              'md-swipe-right=\"$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)\" ' +\n              'ng-if=\"tab.hasContent\" ' +\n              'ng-repeat=\"(index, tab) in $mdTabsCtrl.tabs\" ' +\n              'ng-class=\"{ ' +\n                '\\'md-no-transition\\': $mdTabsCtrl.lastSelectedIndex == null, ' +\n                '\\'md-active\\':        tab.isActive(), ' +\n                '\\'md-left\\':          tab.isLeft(), ' +\n                '\\'md-right\\':         tab.isRight(), ' +\n                '\\'md-no-scroll\\':     $mdTabsCtrl.dynamicHeight ' +\n              '}\"> ' +\n            '<div ' +\n                'md-tabs-template=\"::tab.template\" ' +\n                'md-connected-if=\"tab.isActive()\" ' +\n                'md-scope=\"::tab.parent\" ' +\n                'ng-if=\"$mdTabsCtrl.enableDisconnect || tab.shouldRender()\"></div> ' +\n          '</md-tab-content> ' +\n        '</md-tabs-content-wrapper>';\n    },\n    controller:       'MdTabsController',\n    controllerAs:     '$mdTabsCtrl',\n    bindToController: true\n  };\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabsDummyWrapperDirective.js",
    "content": "angular\n  .module('material.components.tabs')\n  .directive('mdTabsDummyWrapper', MdTabsDummyWrapper);\n\n/**\n * @private\n *\n * @param $mdUtil\n * @param $window\n * @returns {{require: string, link: link}}\n * @constructor\n *\n * @ngInject\n */\nfunction MdTabsDummyWrapper ($mdUtil, $window) {\n  return {\n    require: '^?mdTabs',\n    link:    function link (scope, element, attr, ctrl) {\n      if (!ctrl) return;\n\n      var observer;\n      var disconnect;\n\n      var mutationCallback = function() {\n        ctrl.updatePagination();\n        ctrl.updateInkBarStyles();\n      };\n\n      if ('MutationObserver' in $window) {\n        var config = {\n          childList: true,\n          subtree: true,\n          // Per https://bugzilla.mozilla.org/show_bug.cgi?id=1138368, browsers will not fire\n          // the childList mutation, once a <span> element's innerText changes.\n          // The characterData of the <span> element will change.\n          characterData: true\n        };\n\n        observer = new MutationObserver(mutationCallback);\n        observer.observe(element[0], config);\n        disconnect = observer.disconnect.bind(observer);\n      } else {\n        var debounced = $mdUtil.debounce(mutationCallback, 15, null, false);\n\n        element.on('DOMSubtreeModified', debounced);\n        disconnect = element.off.bind(element, 'DOMSubtreeModified', debounced);\n      }\n\n      // Disconnect the observer\n      scope.$on('$destroy', function() {\n        disconnect();\n      });\n    }\n  };\n}\n"
  },
  {
    "path": "src/components/tabs/js/tabsTemplateDirective.js",
    "content": "angular\n    .module('material.components.tabs')\n    .directive('mdTabsTemplate', MdTabsTemplate);\n\nfunction MdTabsTemplate ($compile, $mdUtil) {\n  return {\n    restrict: 'A',\n    link:     link,\n    scope:    {\n      template:     '=mdTabsTemplate',\n      connected:    '=?mdConnectedIf',\n      compileScope: '=mdScope'\n    },\n    require:  '^?mdTabs'\n  };\n  function link (scope, element, attr, ctrl) {\n    if (!ctrl) return;\n\n    var compileScope = ctrl.enableDisconnect ? scope.compileScope.$new() : scope.compileScope;\n\n    element.html(scope.template);\n    $compile(element.contents())(compileScope);\n\n    return $mdUtil.nextTick(handleScope);\n\n    function handleScope () {\n      scope.$watch('connected', function (value) { value === false ? disconnect() : reconnect(); });\n      scope.$on('$destroy', reconnect);\n    }\n\n    function disconnect () {\n      if (ctrl.enableDisconnect) $mdUtil.disconnectScope(compileScope);\n    }\n\n    function reconnect () {\n      if (ctrl.enableDisconnect) $mdUtil.reconnectScope(compileScope);\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/tabs/tabs-theme.scss",
    "content": "@mixin md-tab-primary {\n  > md-tabs-wrapper {\n    background-color: '{{primary-color}}';\n\n    md-prev-button md-icon,\n    md-next-button md-icon {\n      color: '{{primary-contrast}}';\n    }\n    > md-tabs-canvas {\n      > md-pagination-wrapper {\n        > md-tab-item:not([disabled]) {\n          &, md-icon {\n            color: '{{primary-contrast-0.7}}';\n          }\n          &.md-active, &.md-focused {\n            &, md-icon {\n              color: '{{primary-contrast}}';\n            }\n          }\n          &.md-focused {\n            background: '{{primary-contrast-0.1}}';\n          }\n        }\n        > md-ink-bar {\n          color: '{{accent-color}}';\n          background: '{{accent-color}}';\n        }\n      }\n    }\n  }\n  &.md-no-ink-bar-color {\n    &>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar {\n      color: '{{primary-contrast}}';\n      background: '{{primary-contrast}}';\n    }\n  }\n}\n@mixin md-tab-warn {\n  > md-tabs-wrapper {\n    background-color: '{{warn-500}}';\n\n    md-prev-button md-icon,\n    md-next-button md-icon {\n      color: '{{warn-500-contrast}}';\n    }\n    > md-tabs-canvas {\n      > md-pagination-wrapper {\n        > md-tab-item:not([disabled]) {\n          &, md-icon {\n            color: '{{warn-500-contrast-0.7}}';\n          }\n          &.md-active, &.md-focused {\n            &, md-icon {\n              color: '{{warn-500-contrast-1}}';\n            }\n          }\n          &.md-focused {\n            background: '{{warn-500-contrast-0.1}}';\n          }\n        }\n        > md-ink-bar {\n          color: '{{warn-500-contrast}}';\n          background: '{{warn-500-contrast}}';\n        }\n      }\n    }\n  }\n}\n@mixin md-tab-accent {\n  > md-tabs-wrapper {\n    background-color: '{{accent-500}}';\n\n    md-prev-button md-icon,\n    md-next-button md-icon {\n      color: '{{accent-500-contrast-0.7}}';\n    }\n    > md-tabs-canvas {\n      > md-pagination-wrapper {\n        > md-tab-item:not([disabled]) {\n          &, md-icon {\n            color: '{{accent-500-contrast-0.7}}';\n          }\n          &.md-active, &.md-focused {\n            &, md-icon {\n              color: '{{accent-500-contrast-1}}';\n            }\n          }\n          &.md-focused {\n            background: '{{accent-500-contrast-0.1}}';\n          }\n        }\n        > md-ink-bar {\n          color: '{{accent-500-contrast}}';\n          background: '{{accent-500-contrast}}';\n        }\n      }\n    }\n  }\n}\nmd-tabs.md-THEME_NAME-theme {\n  md-tabs-wrapper {\n    background-color: transparent;\n    border-color: '{{foreground-4}}';\n  }\n  md-prev-button md-icon,\n  md-next-button md-icon {\n    color: '{{foreground-2}}';\n  }\n\n  md-ink-bar {\n    color: '{{accent-color}}';\n    background: '{{accent-color}}';\n  }\n\n  .md-tab {\n    color: '{{foreground-2}}';\n    &[disabled] {\n      &, md-icon {\n        color: '{{foreground-3}}';\n      }\n    }\n    &.md-active, &.md-focused {\n      &, md-icon {\n        color: '{{accent-color}}';\n      }\n    }\n    &.md-focused {\n      background: '{{primary-color-0.1}}';\n    }\n    .md-ripple-container {\n      color: '{{accent-A100}}';\n    }\n  }\n\n  &.md-accent {\n    @include md-tab-accent();\n  }\n\n  &.md-primary {\n    @include md-tab-primary();\n  }\n\n  &.md-warn {\n    @include md-tab-warn();\n  }\n}\n\nmd-toolbar > md-tabs.md-THEME_NAME-theme {\n  @include md-tab-primary();\n}\nmd-toolbar.md-accent > md-tabs.md-THEME_NAME-theme {\n  @include md-tab-accent();\n}\nmd-toolbar.md-warn > md-tabs.md-THEME_NAME-theme {\n  @include md-tab-warn();\n}\n"
  },
  {
    "path": "src/components/tabs/tabs.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.tabs\n * @description\n *\n *  Tabs, created with the `<md-tabs>` directive provide *tabbed* navigation with different styles.\n *  The Tabs component consists of clickable tabs that are aligned horizontally side-by-side.\n *\n *  Features include support for:\n *\n *  - static or dynamic tabs,\n *  - responsive designs,\n *  - accessibility support (ARIA),\n *  - tab pagination,\n *  - external or internal tab content,\n *  - focus indicators and arrow-key navigations,\n *  - programmatic lookup and access to tab controllers, and\n *  - dynamic transitions through different tab contents.\n *\n */\n/*\n * @see js folder for tabs implementation\n */\nangular.module('material.components.tabs', [\n  'material.core',\n  'material.components.icon'\n]);\n"
  },
  {
    "path": "src/components/tabs/tabs.scss",
    "content": "$tabs-paginator-width: $baseline-grid * 4 !default;\n$tabs-tab-width: $baseline-grid * 12 !default;\n$tabs-header-height: 48px !default;\n\n@keyframes md-tab-content-hide {\n  0% { opacity: 1; }\n  50% { opacity: 1; }\n  100% { opacity: 0; }\n}\n\nmd-tab-data {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  z-index: -1;\n  opacity: 0;\n}\n\nmd-tabs {\n  display: block;\n  margin: 0;\n  border-radius: 2px;\n  overflow: hidden;\n  position: relative;\n  flex-shrink: 0;\n  &:not(.md-no-tab-content):not(.md-dynamic-height) {\n    min-height: 200 + $tabs-header-height;\n  }\n  &[md-align-tabs=\"bottom\"] {\n    padding-bottom: $tabs-header-height;\n\n    > md-tabs-wrapper {\n      position: absolute;\n      bottom: 0;\n      left: 0;\n      right: 0;\n      height: $tabs-header-height;\n      z-index: 2;\n    }\n    > md-tabs-content-wrapper {\n      top: 0;\n      bottom: $tabs-header-height;\n    }\n  }\n  &.md-dynamic-height {\n    md-tabs-content-wrapper {\n      min-height: 0;\n      position: relative;\n      top: auto;\n      left: auto;\n      right: auto;\n      bottom: auto;\n      overflow: visible;\n    }\n    md-tab-content {\n      &.md-active {\n        position: relative;\n      }\n    }\n  }\n  &[md-border-bottom] {\n    md-tabs-wrapper {\n      border-width: 0 0 1px;\n      border-style: solid;\n    }\n    &:not(.md-dynamic-height) {\n      md-tabs-content-wrapper {\n        top: $tabs-header-height + 1;\n      }\n    }\n  }\n}\n\nmd-tabs-wrapper {\n  display: block;\n  position: relative;\n  // transform is needed for iOS Safari to prevent content from disappearing on scroll\n  transform: translate(0, 0);\n  md-prev-button, md-next-button {\n    height: 100%;\n    width: $tabs-paginator-width;\n    position: absolute;\n    top: 50%;\n    transform: translateY(-50%);\n    line-height: 1em;\n    z-index: 2;\n    cursor: pointer;\n    font-size: 16px;\n    background: transparent no-repeat center center;\n    transition: $swift-ease-in-out;\n    &:focus {\n      outline: none;\n    }\n    &.md-disabled {\n      opacity: 0.25;\n      cursor: default;\n    }\n    &.ng-leave {\n      transition: none;\n    }\n    md-icon {\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n    }\n\n    // For RTL tabs, rotate the buttons\n    [dir=\"rtl\"] & {\n      transform: rotateY(180deg) translateY(-50%);\n    }\n  }\n  md-prev-button {\n    @include rtl-prop(left, right, 0, auto);\n    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==');\n  }\n  md-next-button {\n    @include rtl-prop(right, left, 0, auto);\n    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K');\n\n    // In regular mode, we need to flip the chevron icon to point the other way\n    md-icon {\n      transform: translate(-50%, -50%) rotate(180deg);\n    }\n  }\n  &.md-stretch-tabs {\n    md-pagination-wrapper {\n      width: 100%;\n      flex-direction: row;\n      md-tab-item {\n        flex-grow: 1;\n      }\n    }\n  }\n}\n\nmd-tabs-canvas {\n  @include pie-clearfix;\n  position: relative;\n  overflow: hidden;\n  display: block;\n  height: $tabs-header-height;\n  .md-dummy-wrapper {\n    position: absolute;\n    top: 0;\n    @include rtl-prop(left, right, 0, auto);\n  }\n  &.md-paginated {\n    margin: 0 $tabs-paginator-width;\n  }\n  &.md-center-tabs {\n    display: flex;\n    flex-direction: column;\n    text-align: center;\n    .md-tab {\n      float: none;\n      display: inline-block;\n    }\n  }\n}\n\nmd-pagination-wrapper {\n  @include pie-clearfix;\n  height: $tabs-header-height;\n  display: flex;\n  transition: transform $swift-ease-in-out-duration $swift-ease-in-out-timing-function;\n  position: absolute;\n  @include rtl-prop(left, right, 0, auto);\n  transform: translate(0, 0);\n  &.md-center-tabs {\n    position: relative;\n    justify-content: center;\n  }\n  md-tab-item {\n    min-width: 72px;\n  }\n  @media (min-width: $layout-breakpoint-xs) {\n    md-tab-item {\n      min-width: 160px;\n    }\n  }\n}\n\nmd-tabs-content-wrapper {\n  display: block;\n  position: absolute;\n  top: $tabs-header-height;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n}\n\nmd-tab-content {\n  display: flex;\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  transition: transform $swift-ease-in-out-duration $swift-ease-in-out-timing-function;\n  overflow: auto;\n  // transform is needed for iOS Safari to prevent content from disappearing on scroll\n  transform: translate(0, 0);\n  &.md-no-scroll {\n    bottom: auto;\n    overflow: hidden;\n  }\n  &.ng-leave, &.md-no-transition {\n    transition: none;\n  }\n  &.md-left:not(.md-active) {\n    @include rtl(transform, translateX(-100%), translateX(+100%));\n    animation: 2 * $swift-ease-in-out-duration md-tab-content-hide;\n    visibility: hidden;\n    * {\n      transition: visibility 0s linear;\n      transition-delay: $swift-ease-in-out-duration;\n      visibility: hidden;\n    }\n  }\n  &.md-right:not(.md-active) {\n    @include rtl(transform, translateX(100%), translateX(-100%));\n    animation: 2 * $swift-ease-in-out-duration md-tab-content-hide;\n    visibility: hidden;\n    * {\n      transition: visibility 0s linear;\n      transition-delay: $swift-ease-in-out-duration;\n      visibility: hidden;\n    }\n  }\n  > div {\n    flex: 1 0 100%;\n    min-width: 0;\n    &.ng-leave {\n      animation: 2 * $swift-ease-in-out-duration md-tab-content-hide;\n    }\n  }\n}\n\nmd-ink-bar {\n  $duration: $swift-ease-in-out-duration * 0.5;\n  $multiplier: 0.5;\n  position: absolute;\n  left: auto;\n  right: auto;\n  bottom: 0;\n  height: 2px;\n  &.md-left {\n    transition: left ($duration * $multiplier) $swift-ease-in-out-timing-function,\n        right $duration $swift-ease-in-out-timing-function;\n  }\n  &.md-right {\n    transition: left $duration $swift-ease-in-out-timing-function,\n        right ($duration * $multiplier) $swift-ease-in-out-timing-function;\n  }\n}\n\nmd-tab {\n  position: absolute;\n  z-index: -1;\n  left: -9999px;\n}\n\n.md-tab {\n  font-size: 14px;\n  text-align: center;\n  line-height: $tabs-header-height - 24;\n  padding: 12px;\n  transition: background-color 0.35s $swift-ease-in-out-timing-function;\n  cursor: pointer;\n  white-space: nowrap;\n  position: relative;\n  text-transform: uppercase;\n  @include rtl(float, left, right);\n  font-weight: 500;\n  box-sizing: border-box;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  &.md-focused, &:focus {\n    box-shadow: none;\n    outline: none;\n  }\n  &.md-active {\n    cursor: default;\n  }\n  &.md-disabled {\n    pointer-events: none;\n    touch-action: pan-y;\n    user-select: none;\n    -webkit-user-drag: none;\n    opacity: 0.5;\n    cursor: default;\n  }\n  &.ng-leave {\n    transition: none;\n  }\n}\n\nmd-toolbar + md-tabs, md-toolbar + md-dialog-content md-tabs {\n  border-top-left-radius: 0;\n  border-top-right-radius: 0;\n}\n"
  },
  {
    "path": "src/components/tabs/tabs.spec.js",
    "content": "describe('<md-tabs>', function () {\n\n  beforeEach(module('material.components.tabs'));\n  beforeEach(function () {\n    jasmine.mockElementFocus(this);\n\n    jasmine.addMatchers({\n      toBeActiveTab: function () {\n        return {\n          compare: function (actual, expected) {\n            var fails = [];\n\n            if (!actual.length) {\n              fails.push('element not found');\n            } else {\n              if (!actual.hasClass('md-active')) {\n                fails.push('does not have active class');\n              }\n              if (actual.attr('aria-selected') != 'true') {\n                fails.push('aria-selected is not true');\n              }\n            }\n\n            var results  = { pass: fails.length === 0 };\n            var negation = !results.pass ? \"\" : \" not \";\n\n            results.message = \"\";\n            results.message += \"Expected '\";\n            results.message += angular.mock.dump(actual);\n            results.message += negation + \"' to be the active tab. Failures: \" + fails.join(', ');\n\n            return results;\n          }\n        };\n      }\n    });\n  });\n\n  function setup (template, scope) {\n    var el;\n    inject(function ($compile, $rootScope) {\n      var newScope = $rootScope.$new();\n      for (var key in scope || {}) newScope[key] = scope[key];\n      el = $compile(template)(newScope);\n      newScope.$apply();\n    });\n    return el;\n  }\n\n  function triggerKeydown (el, keyCode) {\n    return el.triggerHandler({\n      type:           'keydown',\n      keyCode:        keyCode,\n      preventDefault: angular.noop\n    });\n  }\n\n  describe('activating tabs', function () {\n\n    it('should have `._md` class indicator', inject(function() {\n      var tabs = setup(\n        '<md-tabs> ' +\n        '   <md-tab label=\"a\">a</md-tab>' +\n        '   <md-tab label=\"b\">b</md-tab>' +\n        '</md-tabs>'\n      );\n\n      expect(tabs.find('md-tabs-content-wrapper').hasClass('_md')).toBe(true);\n    }));\n\n    it('should select first tab by default', function () {\n      var tabs = setup(\n              '<md-tabs> ' +\n              '   <md-tab label=\"a\">a</md-tab>' +\n              '   <md-tab label=\"b\">b</md-tab>' +\n              '</md-tabs>'\n          );\n      expect(tabs.find('md-tab-item').eq(0)).toBeActiveTab();\n    });\n\n    it('should select & focus tab on click', inject(function ($document, $rootScope) {\n      var tabs     = setup('<md-tabs>' +\n                           '<md-tab></md-tab>' +\n                           '<md-tab></md-tab>' +\n                           '<md-tab ng-disabled=\"true\"></md-tab>' +\n                           '</md-tabs>');\n      var tabItems = tabs.find('md-tab-item');\n\n      tabs.find('md-tab-item').eq(1).triggerHandler('click');\n      $rootScope.$apply();\n      expect(tabItems.eq(1)).toBeActiveTab();\n\n      tabs.find('md-tab-item').eq(0).triggerHandler('click');\n      expect(tabItems.eq(0)).toBeActiveTab();\n    }));\n\n    it('should focus tab on arrow if tab is enabled', inject(function ($document, $mdConstant, $timeout) {\n      var tabs     = setup('<md-tabs>' +\n                           '<md-tab></md-tab>' +\n                           '<md-tab ng-disabled=\"true\"></md-tab>' +\n                           '<md-tab></md-tab>' +\n                           '</md-tabs>');\n      var ctrl = tabs.controller('mdTabs');\n      var tabItems = tabs.find('md-tab-item');\n\n      expect(tabItems.eq(0)).toBeActiveTab();\n\n      // Focus should move to the last tab if left arrow is pressed\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);\n      expect(ctrl.getFocusedTabId()).toBe(tabItems.eq(2).attr('id'));\n\n      // Focus should move to the first tab if right arrow is pressed\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);\n      expect(ctrl.getFocusedTabId()).toBe(tabItems.eq(0).attr('id'));\n\n      // Tab 0 should still be active, but tab 2 focused (skip tab 1 it's disabled)\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);\n      expect(tabItems.eq(0)).toBeActiveTab();\n\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);\n      expect(tabItems.eq(2)).toBeActiveTab();\n\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);\n      expect(tabItems.eq(2)).toBeActiveTab();\n\n      // Skip tab 1 again, it's disabled\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);\n      expect(tabItems.eq(0)).toBeActiveTab();\n\n    }));\n\n    it('should select tab on space or enter', inject(function ($document, $mdConstant) {\n      var tabs     = setup('<md-tabs>' +\n                           '<md-tab></md-tab>' +\n                           '<md-tab></md-tab>' +\n                           '</md-tabs>');\n      var tabItems = tabs.find('md-tab-item');\n      tabs.find('md-tab-item').eq(0).triggerHandler('click');\n\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);\n      expect(tabItems.eq(1)).toBeActiveTab();\n      expect(tabItems.eq(1).attr('tabindex')).toBe('0');\n\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.SPACE);\n      expect(tabItems.eq(0)).toBeActiveTab();\n      // Active tab should be added to the tab order as per ARIA practices.\n      expect(tabItems.eq(0).attr('tabindex')).toBe('0');\n      // Deactivated tab should be removed from the tab order.\n      expect(tabItems.eq(1).attr('tabindex')).toBe('-1');\n    }));\n\n    it('should bind to selected', function () {\n      var tabs      = setup('<md-tabs md-selected=\"current\">' +\n                            '<md-tab></md-tab>' +\n                            '<md-tab></md-tab>' +\n                            '<md-tab></md-tab>' +\n                            '</md-tabs>');\n      var tabItems  = tabs.find('md-tab-item');\n      var dummyTabs = tabs.find('md-dummy-tab');\n\n      expect(tabItems.eq(0)).toBeActiveTab();\n      expect(tabs.scope().current).toBe(0);\n\n      tabs.scope().$apply('current = 1');\n      expect(tabItems.eq(1)).toBeActiveTab();\n\n      expect(tabItems.eq(0).attr('aria-selected')).toBe('false');\n\n      tabItems.eq(2).triggerHandler('click');\n      expect(tabs.scope().current).toBe(2);\n    });\n\n    it('disabling active tab', function () {\n      var tabs      = setup('<md-tabs>' +\n                            '<md-tab ng-disabled=\"disabled0\"></md-tab>' +\n                            '<md-tab ng-disabled=\"disabled1\"></md-tab>' +\n                            '</md-tabs>');\n      var tabItems  = tabs.find('md-tab-item');\n\n      expect(tabItems.eq(0)).toBeActiveTab();\n      expect(tabItems.eq(0).attr('aria-selected')).toBe('true');\n\n      tabs.scope().$apply('disabled0 = true');\n      expect(tabItems.eq(1)).toBeActiveTab();\n\n      expect(tabItems.eq(0).attr('aria-disabled')).toBe('true');\n      expect(tabItems.eq(1).attr('aria-disabled')).toBe('false');\n\n      tabs.scope().$apply('disabled0 = false; disabled1 = true');\n      expect(tabItems.eq(0)).toBeActiveTab();\n\n      expect(tabItems.eq(0).attr('aria-disabled')).toBe('false');\n      expect(tabItems.eq(1).attr('aria-disabled')).toBe('true');\n    });\n\n    it('should reconcile focused and active tabs', inject(function($mdConstant) {\n      var tabs = setup('<md-tabs>' +\n                       '<md-tab label=\"super label\"></md-tab>' +\n                       '<md-tab label=\"super label two\"></md-tab>' +\n                       '</md-tabs>' +\n                       '<div tabindex=\"0\">Focusable element</div>');\n      var ctrl = tabs.controller('mdTabs');\n      var tabItems = tabs.find('md-tab-item');\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);\n      expect(tabItems.eq(0)).toBeActiveTab();\n      expect(ctrl.getFocusedTabId()).toBe(tabItems.eq(1).attr('id'));\n\n      triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.TAB);\n      expect(tabItems.eq(0)).toBeActiveTab();\n      expect(ctrl.getFocusedTabId()).toBe(tabItems.eq(0).attr('id'));\n    }));\n\n  });\n\n  describe('tab label & content DOM', function () {\n\n    it('should support both label types', function () {\n      var tabs1 = setup('<md-tabs>' +\n                        '<md-tab label=\"super label\"></md-tab>' +\n                        '</md-tabs>');\n      expect(tabs1.find('md-tab-item').text()).toBe('super label');\n\n      var tabs2 = setup('<md-tabs>' +\n                        '<md-tab><md-tab-label><b>super</b> label</md-tab-label></md-tab>' +\n                        '</md-tabs>');\n      expect(tabs2.find('md-tab-item').text()).toBe('super label');\n\n    });\n\n    it('should support content inside with each kind of label', function () {\n      var tabs1 = setup('<md-tabs>' +\n                        '<md-tab label=\"label that!\"><b>content</b> that!</md-tab>' +\n                        '</md-tabs>');\n      expect(tabs1.find('md-tab-item').text()).toBe('label that!');\n      expect(tabs1[ 0 ].querySelector('md-tab-content').textContent.trim()).toBe('content that!');\n\n      var tabs2 = setup('<md-tabs>\\\n        <md-tab>\\\n          <md-tab-label>label that!</md-tab-label>\\\n          <md-tab-body><b>content</b> that!</md-tab-body>\\\n        </md-tab>\\\n      </md-tabs>');\n      expect(tabs1.find('md-tab-item').text()).toBe('label that!');\n      expect(tabs1[ 0 ].querySelector('md-tab-content').textContent.trim()).toBe('content that!');\n    });\n\n    it('updates pagination and ink styles when string labels change', function(done) {\n      inject(function($rootScope, $timeout) {\n        // Setup our initial label\n        $rootScope.$apply('label = \"Some Label\"');\n\n        // Init our variables\n        var template = '<md-tabs><md-tab label=\"{{label}}\"></md-tab></md-tabs>';\n        var tabs = setup(template);\n        var ctrl = tabs.controller('mdTabs');\n\n        // Flush the tabs controller timeout for initialization.\n        $timeout.flush();\n\n        // After the first timeout the mutation observer should have been fired once, because\n        // the initialization of the dummy tabs, already causes some mutations.\n        // Use setTimeout to add our expectations to the end of the call stack, after the\n        // MutationObservers have already fired\n        setTimeout(function() {\n          // Setup spies\n          spyOn(ctrl, 'updatePagination');\n          spyOn(ctrl, 'updateInkBarStyles');\n\n          // Update the label to trigger a new update of the pagination and InkBar styles.\n          $rootScope.$apply('label = \"Another Label\"');\n\n          // Use setTimeout to add our expectations to the end of the call stack, after the\n          // MutationObservers have already fired\n          setTimeout(function() {\n            expect(ctrl.updatePagination).toHaveBeenCalledTimes(1);\n            expect(ctrl.updateInkBarStyles).toHaveBeenCalledTimes(1);\n\n            done();\n          });\n        });\n      })\n    });\n\n    it('updates pagination and ink styles when content label changes', function(done) {\n      inject(function($rootScope, $timeout) {\n        // Setup our initial label\n        $rootScope.$apply('label = \"Default Label\"');\n\n        // Init our variables\n        var template = '' +\n          '<md-tabs>' +\n            '<md-tab>' +\n              '<md-tab-label>{{ label }}</md-tab-label>' +\n            '</md-tab>' +\n          '</md-tabs>';\n\n        var tabs = setup(template);\n        var ctrl = tabs.controller('mdTabs');\n\n        // Flush the tabs controller timeout for initialization.\n        $timeout.flush();\n\n        // After the first timeout the mutation observer should have been fired once, because\n        // the initialization of the dummy tabs, already causes some mutations.\n        // Use setTimeout to add our expectations to the end of the call stack, after the\n        // MutationObservers have already fired\n        setTimeout(function() {\n          // Setup spies\n          spyOn(ctrl, 'updatePagination');\n          spyOn(ctrl, 'updateInkBarStyles');\n\n          // Update the label to trigger a new update of the pagination and InkBar styles.\n          $rootScope.$apply('label = \"New Label\"');\n\n          // Use setTimeout to add our expectations to the end of the call stack, after the\n          // MutationObservers have already fired\n          setTimeout(function() {\n            expect(ctrl.updatePagination).toHaveBeenCalledTimes(1);\n            expect(ctrl.updateInkBarStyles).toHaveBeenCalledTimes(1);\n\n            done();\n          });\n        });\n      })\n    });\n\n    it('updates pagination and ink styles when HTML labels change', function(done) {\n      inject(function($rootScope) {\n        // Setup our initial label\n        $rootScope.$apply('label = \"Some Label\"');\n\n        // Init our variables\n        var template = '<md-tabs><md-tab><md-tab-label>{{label}}</md-tab-label></md-tab></md-tabs>';\n        var tabs = setup(template);\n        var ctrl = tabs.controller('mdTabs');\n\n        // Setup spies\n        spyOn(ctrl, 'updatePagination');\n        spyOn(ctrl, 'updateInkBarStyles');\n\n        // Change the label\n        $rootScope.$apply('label=\"Another Label\"');\n\n        // Use window.setTimeout to add our expectations to the end of the call stack, after the\n        // MutationObservers have already fired\n        window.setTimeout(function() {\n          // Fire expectations\n          expect(ctrl.updatePagination.calls.count()).toBe(1);\n          expect(ctrl.updateInkBarStyles.calls.count()).toBe(1);\n\n          done();\n        });\n      });\n    });\n  });\n\n  describe('aria', function () {\n    var $timeout;\n\n    beforeEach(inject(function(_$timeout_) {\n      $timeout = _$timeout_;\n    }));\n\n    it('should link tab content to tabItem with auto-generated ids', function () {\n      var tabs       = setup('<md-tabs>' +\n                             '<md-tab label=\"label!\">content!</md-tab>' +\n                             '</md-tabs>');\n      var tabItem    = tabs.find('md-tab-item');\n      var tabContent = angular.element(tabs[ 0 ].querySelector('md-tab-content'));\n\n      $timeout.flush();\n\n      expect(tabs.find('md-pagination-wrapper').attr('role')).toBe('tablist');\n\n      expect(tabItem.attr('id')).toBeTruthy();\n      expect(tabItem.attr('aria-controls')).toBe(tabContent.attr('id'));\n\n      expect(tabContent.attr('id')).toBeTruthy();\n      expect(tabContent.attr('role')).toBe('tabpanel');\n      expect(tabContent.attr('aria-labelledby')).toBe(tabItem.attr('id'));\n\n      // Unique ids check\n      expect(tabContent.attr('id')).not.toEqual(tabItem.attr('id'));\n    });\n\n    it('should not assign role to dummy tabs', function () {\n      var tabs       = setup('<md-tabs>' +\n                             '<md-tab label=\"label!\">content!</md-tab>' +\n                             '</md-tabs>');\n      var tabItem    = tabs.find('md-dummy-tab');\n\n      expect(tabItem.attr('role')).toBeFalsy();\n    });\n\n    it('should assign role to visible tabs', function () {\n      var tabs       = setup('<md-tabs>' +\n                             '<md-tab label=\"label!\">content!</md-tab>' +\n                             '</md-tabs>');\n      var tabItem    = tabs.find('md-tab-item');\n\n      expect(tabItem.attr('role')).toBe('tab');\n    });\n\n    it('should not set `aria-controls` if the tab does not have content', function () {\n      var tabs = setup(\n        '<md-tabs>' +\n          '<md-tab label=\"label!\"></md-tab>' +\n        '</md-tabs>'\n      );\n\n      $timeout.flush();\n\n      expect(tabs.find('md-dummy-tab').attr('aria-controls')).toBeFalsy();\n    });\n  });\n\n  describe('<md-tab>', function () {\n    it('should use its contents as the label if there is no label attribute or label/body tags', function () {\n      var tab = setup('<md-tab>test</md-tab>');\n      expect(tab[ 0 ].tagName).toBe('MD-TAB');\n      expect(tab.find('md-tab-label').length).toBe(1);\n      expect(tab.find('md-tab-label').text()).toBe('test');\n      expect(tab.find('md-tab-body').length).toBe(0);\n    });\n    it('should use its contents as the body if there is a label attribute', function () {\n      var tab = setup('<md-tab label=\"test\">content</md-tab>');\n      expect(tab[ 0 ].tagName).toBe('MD-TAB');\n      expect(tab.find('md-tab-label').length).toBe(1);\n      expect(tab.find('md-tab-body').length).toBe(1);\n      expect(tab.find('md-tab-label').html()).toBe('test');\n      expect(tab.find('md-tab-body').html()).toBe('content');\n    });\n    it('should convert a label attribute to a label tag', function () {\n      var tab = setup('<md-tab label=\"test\"><md-tab-body>content</md-tab-body></md-tab>');\n      expect(tab[ 0 ].tagName).toBe('MD-TAB');\n      expect(tab.find('md-tab-label').length).toBe(1);\n      expect(tab.find('md-tab-body').length).toBe(1);\n      expect(tab.find('md-tab-label').html()).toBe('test');\n      expect(tab.find('md-tab-body').html()).toBe('content');\n    });\n    it('should not insert a body if there is no content', function () {\n      var tab = setup('<md-tab>' +\n                      '<md-tab-label>test</md-tab-label>' +\n                      '</md-tab>');\n      expect(tab[ 0 ].tagName).toBe('MD-TAB');\n      expect(tab.find('md-tab-label').length).toBe(1);\n      expect(tab.find('md-tab-label').text()).toBe('test');\n      expect(tab.find('md-tab-body').length).toBe(0);\n    });\n    it('should apply tab class on the associated md-tab-item', function () {\n      var template = '\\\n        <md-tabs md-selected=\"selectedTab\">\\\n          <md-tab label=\"a\" md-tab-class=\"tester-class\"></md-tab>\\\n        </md-tabs>';\n      var element  = setup(template);\n      var tab      = element.find('md-tab-item');\n\n      expect(tab[ 0 ].className.indexOf('tester-class')).toBeGreaterThan(-1);\n    });\n  });\n\n  describe('internal scope', function () {\n    it('should have the same internal scope as external', function () {\n      var template = '\\\n        <md-tabs md-selected=\"selectedTab\">\\\n          <md-tab label=\"a\">\\\n            <md-button ng-click=\"data = false\">Set data to false</md-button>\\\n          </md-tab>\\\n        </md-tabs>\\\n      ';\n      var element  = setup(template);\n      var button   = element.find('md-button');\n\n      expect(button[ 0 ].tagName).toBe('MD-BUTTON');\n\n      button.triggerHandler('click');\n\n      expect(element.scope().data).toBe(false);\n    });\n  });\n\n  describe('no tab selected', function () {\n    it('should allow cases where no tabs are selected', inject(function () {\n      var template = '\\\n        <md-tabs md-selected=\"selectedIndex\">\\\n          <md-tab label=\"a\">tab content</md-tab>\\\n          <md-tab label=\"b\">tab content</md-tab>\\\n        </md-tabs>\\\n      ';\n      var element  = setup(template, { selectedIndex: -1 });\n      var scope = element.scope();\n\n      expect(scope.selectedIndex).toBe(-1);\n      expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);\n      expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);\n      expect(element.find('md-tabs-content-wrapper').hasClass('ng-hide')).toBe(true);\n\n      element.find('md-tab-item').eq(0).triggerHandler('click');\n\n      expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(true);\n      expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);\n      expect(scope.selectedIndex).toBe(0);\n\n      element.find('md-tab-item').eq(1).triggerHandler('click');\n\n      expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);\n      expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(true);\n      expect(scope.selectedIndex).toBe(1);\n\n      scope.$apply('selectedIndex = -1');\n\n      expect(scope.selectedIndex).toBe(-1);\n      expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);\n      expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);\n      expect(element.find('md-tabs-content-wrapper').hasClass('ng-hide')).toBe(true);\n    }));\n  });\n\n  describe('nested tabs', function () {\n    it('should properly nest tabs', inject(function () {\n      var template = '' +\n          '<md-tabs>' +\n          ' <md-tab label=\"one\">' +\n          '   <md-tabs>' +\n          '     <md-tab><md-tab-label>a</md-tab-label></md-tab>' +\n          '     <md-tab><md-tab-label>b</md-tab-label></md-tab>' +\n          '     <md-tab><md-tab-label>c</md-tab-label></md-tab>' +\n          '   </md-tabs>' +\n          ' </md-tab>' +\n          ' <md-tab label=\"two\">two</md-tab>' +\n          '</md-tabs>';\n      var element = setup(template);\n      // first item should be 'one'\n      expect(element.find('md-tab-item').eq(0).text()).toBe('one');\n      // first item in nested tabs should be 'a'\n      expect(element.find('md-tabs').find('md-tab-item').eq(0).text()).toBe('a');\n    }));\n  });\n\n  describe('no element content', function() {\n    it('should not add the `md-no-tab-content` class if the element has content', function() {\n      var tabs = setup(\n        '<md-tabs>' +\n           '<md-tab label=\"label!\">content!</md-tab>' +\n        '</md-tabs>'\n      );\n\n      expect(tabs).not.toHaveClass('md-no-tab-content');\n    });\n\n    it('should add the `md-no-tab-content` class if the element does not have content', function() {\n      var tabs = setup(\n        '<md-tabs>' +\n           '<md-tab label=\"label!\"></md-tab>' +\n        '</md-tabs>'\n      );\n\n      expect(tabs).toHaveClass('md-no-tab-content');\n    });\n\n    it('should trim before determining whether the element has content', function() {\n      var tabs = setup(\n        '<md-tabs>' +\n           '<md-tab label=\"label!\">\\n\\n\\n</md-tab>' +\n        '</md-tabs>'\n      );\n\n      expect(tabs).toHaveClass('md-no-tab-content');\n    });\n  });\n});\n"
  },
  {
    "path": "src/components/tabs/tabsPaginationService.js",
    "content": "angular\n.module('material.components.tabs')\n.service('MdTabsPaginationService', MdTabsPaginationService);\n\n/**\n * @private\n * @module material.components.tabs\n * @name MdTabsPaginationService\n * @description Provides many standalone functions to ease in pagination calculations.\n *\n * Most functions accept the elements and the current offset.\n *\n * The `elements` parameter is typically the value returned from the `getElements()` function of the\n * tabsController.\n *\n * The `offset` parameter is always positive regardless of LTR or RTL (we simply make the LTR one\n * negative when we apply our transform). This is typically the `ctrl.leftOffset` variable in the\n * tabsController.\n *\n * @returns MdTabsPaginationService\n * @constructor\n */\nfunction MdTabsPaginationService() {\n  return {\n    decreasePageOffset: decreasePageOffset,\n    increasePageOffset: increasePageOffset,\n    getTabOffsets: getTabOffsets,\n    getTotalTabsWidth: getTotalTabsWidth\n  };\n\n  /**\n   * Returns the offset for the next decreasing page.\n   *\n   * @param elements\n   * @param currentOffset\n   * @returns {number}\n   */\n  function decreasePageOffset(elements, currentOffset) {\n    var canvas       = elements.canvas,\n        tabOffsets   = getTabOffsets(elements),\n        i, firstVisibleTabOffset;\n\n    // Find the first fully visible tab in offset range\n    for (i = 0; i < tabOffsets.length; i++) {\n      if (tabOffsets[i] >= currentOffset) {\n        firstVisibleTabOffset = tabOffsets[i];\n        break;\n      }\n    }\n\n    // Return (the first visible tab offset - the tabs container width) without going negative\n    return Math.max(0, firstVisibleTabOffset - canvas.clientWidth);\n  }\n\n  /**\n   * Returns the offset for the next increasing page.\n   *\n   * @param elements\n   * @param currentOffset\n   * @returns {number}\n   */\n  function increasePageOffset(elements, currentOffset) {\n    var canvas       = elements.canvas,\n        maxOffset    = getTotalTabsWidth(elements) - canvas.clientWidth,\n        tabOffsets   = getTabOffsets(elements),\n        i, firstHiddenTabOffset;\n\n    // Find the first partially (or fully) invisible tab\n    for (i = 0; i < tabOffsets.length, tabOffsets[i] <= currentOffset + canvas.clientWidth; i++) {\n      firstHiddenTabOffset = tabOffsets[i];\n    }\n\n    // Return the offset of the first hidden tab, or the maximum offset (whichever is smaller)\n    return Math.min(maxOffset, firstHiddenTabOffset);\n  }\n\n  /**\n   * Returns the offsets of all of the tabs based on their widths.\n   *\n   * @param elements\n   * @returns {number[]}\n   */\n  function getTabOffsets(elements) {\n    var i, tab, currentOffset = 0, offsets = [];\n\n    for (i = 0; i < elements.tabs.length; i++) {\n      tab = elements.tabs[i];\n      offsets.push(currentOffset);\n      currentOffset += tab.offsetWidth;\n    }\n\n    return offsets;\n  }\n\n  /**\n   * Sum the width of all tabs.\n   *\n   * @param elements\n   * @returns {number}\n   */\n  function getTotalTabsWidth(elements) {\n    var sum = 0, i, tab;\n\n    for (i = 0; i < elements.tabs.length; i++) {\n      tab = elements.tabs[i];\n      sum += tab.offsetWidth;\n    }\n\n    return sum;\n  }\n\n}\n"
  },
  {
    "path": "src/components/tabs/tabsPaginationService.spec.js",
    "content": "describe('MdTabsPaginationService', function() {\n\n  var TAB_WIDTH = 100;\n\n  var MdTabsPaginationService;\n\n  beforeEach(module('material.components.tabs'));\n  beforeEach(injectGlobals);\n\n  var customMatchers = {\n    toEqualPageOffset: function(util, customEqualityTesters) {\n      return {\n        compare: function(actual, expected) {\n          var config = decode(expected),\n            result = {};\n\n          result.pass = util.equals(actual, config.offsetStart, customEqualityTesters);\n\n          if (!result.pass) {\n            result.message = \"Expected \" + actual + \" to equal \" + config.offsetStart +\n              \" for pagination description '\" + expected + \"'.\";\n          }\n\n          return result;\n        }\n      }\n    }\n  };\n\n  beforeEach(function() {\n    jasmine.addMatchers(customMatchers);\n  });\n\n  describe('#decreasePageOffset', function() {\n    it('with a current offset of 0 returns 0', function() {\n      var start = '[-----]----------';\n      var end   = '[-----]----------';\n      var config = decode(start);\n\n      var decreasedOffset = MdTabsPaginationService.decreasePageOffset(config.elements, 0);\n      expect(decreasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a current offset smaller than the offset range returns 0', function() {\n      var start = '---[-----]-------';\n      var end   = '[-----]----------';\n      var config = decode(start);\n\n      var decreasedOffset =\n            MdTabsPaginationService.decreasePageOffset(config.elements, config.offsetStart);\n\n      expect(decreasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a current offset larger than the offset range shows next lowest page', function() {\n      var start = '---------[-----]-';\n      var end   = '----[-----]------';\n      var config = decode(start);\n\n      var decreasedOffset =\n            MdTabsPaginationService.decreasePageOffset(config.elements, config.offsetStart);\n\n      expect(decreasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a max offset and partially visible tab it fully shows the tab', function() {\n      var start = '---------.[.-----]'; // Tab 9 (0-based index) is partially visible\n      var end   = '----.[.-----]-----'; // Tab 9 (0-based index) is the last fully visible tab\n      var config = decode(start);\n\n      var decreasedOffset =\n            MdTabsPaginationService.decreasePageOffset(config.elements, config.offsetStart);\n\n      expect(decreasedOffset).toEqualPageOffset(end);\n    });\n  });\n\n  describe('#increasePageOffset', function() {\n    it('with a current offset at 0 and no partial tabs shows the next page up', function() {\n      var start = '[-----]----------';\n      var end   = '-----[-----]-----';\n      var config = decode(start);\n\n      var increasedOffset =\n            MdTabsPaginationService.increasePageOffset(config.elements, config.offsetStart);\n      expect(increasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a current offset at 0 and partial tabs shows the partially hidden tab', function() {\n      var start = '[-----.].---------';\n      var end   = '-----[-----.].----';\n      var config = decode(start);\n\n      var increasedOffset =\n            MdTabsPaginationService.increasePageOffset(config.elements, config.offsetStart);\n      expect(increasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a current offset close to the max returns max', function() {\n      var start   = '-----[-----.].----';\n      var end     = '---------.[.-----]';\n      var config = decode(start);\n\n      var increasedOffset =\n            MdTabsPaginationService.increasePageOffset(config.elements, config.offsetStart);\n      expect(increasedOffset).toEqualPageOffset(end);\n    });\n\n    it('with a current offset at max returns max', function() {\n      var start = '----------[-----]';\n      var end   = '----------[-----]';\n      var config = decode(start);\n\n      var increasedOffset =\n            MdTabsPaginationService.increasePageOffset(config.elements, config.offsetStart);\n      expect(increasedOffset).toEqualPageOffset(end);\n    });\n  });\n\n  describe('#getTabOffsets', function() {\n    it('returns an array of tab offsets', function() {\n      var descriptor = '[----]------';\n      var config = decode(descriptor);\n\n      var expected = new Array(10).fill(0).map(function(item, index) { return TAB_WIDTH * index});\n\n      expect(MdTabsPaginationService.getTabOffsets(config.elements)).toEqual(expected);\n    });\n  });\n\n  describe('#getTotalTabsWidth', function() {\n    it('adds the width of ideal tabs', function() {\n      var descriptor = '[-----]----------';\n      var config = decode(descriptor);\n\n      expect(MdTabsPaginationService.getTotalTabsWidth(config.elements)).toEqual(TAB_WIDTH * 15);\n    });\n\n    it('adds the width of partially visible tabs', function() {\n      var descriptor = '[-----.].---------';\n      var config = decode(descriptor);\n\n      expect(MdTabsPaginationService.getTotalTabsWidth(config.elements)).toEqual(TAB_WIDTH * 15);\n    });\n  });\n\n  /**\n   * Decode the requested pagination description and return a config object containing the canvas\n   * and tab elements, along with the start/end offset.\n   *\n   * The width of every tab is defined by the TAB_WIDTH constant at the top of this file.\n   *\n   * @param description {string} A string representing the pagination object. Each character\n   * represents a portion of the tabs as follows:\n   *\n   *     `-` - The dash, or hyphen, represents a single tab of length TAB_WIDTH.\n   *     `.` - A period represents a tab that is half-visible. It is partially hidden by the\n   *           pagination wrapping. If used, you MUST have an even number of periods, and you MUST\n   *           only separate them with pagination characters (i.e. don't put a tab inside a half\n   *           tab).\n   *     `[` - The beginning of the pagination.\n   *     `]` - The end of the pagination.\n   *\n   * All descriptions MUST contain a series of dashes and/or dots representing tabs, as well as a\n   * single beginning and ending tag for the pagination.\n   *\n   * Examples:\n   *\n   *     '[-----.].----'\n   *\n   * This example has 5 visible tabs; 1 tab that is half-visible, half-hidden; and 4 visible tabs.\n   * The pagination starts at 0 and ends at 5.5 * TAB_WIDTH.\n   *\n   *     '---[---]---'\n   *\n   * This example has 3 hidden tabs; 3 visible tabs; and then 3 more hidden tabs. The pagination\n   * starts at 3 * TAB_WIDTH and ends at 6 * TAB_WIDTH.\n   *\n   * @returns {{elements: {canvas: {}, tabs: Array}, offsetStart: number, offsetEnd: number}}\n   */\n  function decode(description) {\n    var pagination = {\n      elements: { canvas: {}, tabs: [] },\n      offsetStart: 0,\n      offsetEnd: 0\n    };\n\n    var i, char, currentWidth = 0, midTab = false;\n\n    // Initialize our tabs and offsets\n    for (i = 0; i < description.length; i++) {\n      char = description.charAt(i);\n\n      switch (char) {\n        case '-':\n          currentWidth += TAB_WIDTH;\n          pagination.elements.tabs.push({ offsetWidth: TAB_WIDTH });\n          break;\n        case '.':\n          currentWidth += (TAB_WIDTH / 2);\n\n          // If we're in the middle of a tab and we see another half; go ahead and add a full tab.\n          if (midTab) {\n            pagination.elements.tabs.push({ offsetWidth: TAB_WIDTH });\n            midTab = false;\n          } else {\n            midTab = true;\n          }\n          break;\n        case '[': pagination.offsetStart = currentWidth;\n          break;\n        case ']': pagination.offsetEnd = currentWidth;\n          break;\n        default:\n          throw new Error(\"Unrecognized char for decode(): '\" + char + \"'\");\n      }\n    }\n\n    // Initialize our canvas element\n    pagination.elements.canvas.clientWidth = pagination.offsetEnd - pagination.offsetStart;\n\n    return pagination;\n  }\n\n  function injectGlobals() {\n    inject(function(_MdTabsPaginationService_) {\n      MdTabsPaginationService = _MdTabsPaginationService_;\n    });\n  }\n\n});\n"
  },
  {
    "path": "src/components/toast/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" layout-fill layout=\"column\" class=\"inset\" ng-cloak>\n  <p>Toast can be dismissed with a swipe, a timer, or a button.<br/></p>\n\n  <div layout=\"row\" layout-align=\"space-around\">\n    <div class=\"spacer\"></div>\n    <md-button ng-click=\"ctrl.showSimpleToast()\">\n      Show Simple\n    </md-button>\n    <md-button class=\"md-raised\" ng-click=\"ctrl.showActionToast()\">\n      Show With Action\n    </md-button>\n    <div class=\"spacer\"></div>\n  </div>\n\n  <div layout=\"row\" id=\"toastBounds\">\n    <div>\n      <p><b>Toast Position: \"{{ctrl.getToastPosition()}}\"</b></p>\n      <md-checkbox ng-repeat=\"(name, isSelected) in ctrl.toastPosition\"\n                   ng-model=\"ctrl.toastPosition[name]\">\n        {{name}}\n      </md-checkbox>\n    </div>\n  </div>\n\n  <div layout=\"row\">\n    <md-button class=\"md-primary md-fab md-fab-bottom-right\">\n      FAB\n    </md-button>\n    <md-button class=\"md-accent md-fab md-fab-top-right\">\n      FAB\n    </md-button>\n\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/toast/demoBasicUsage/script.js",
    "content": "(function() {\n  angular.module('toastBasicDemo', ['ngMaterial'])\n  .controller('AppCtrl', AppCtrl);\n\n  function AppCtrl($mdToast, $log) {\n    var ctrl = this;\n    var last = {\n      bottom: false,\n      top: true,\n      left: false,\n      right: true\n    };\n\n    ctrl.toastPosition = angular.extend({}, last);\n\n    ctrl.getToastPosition = function() {\n      sanitizePosition();\n\n      return Object.keys(ctrl.toastPosition)\n      .filter(function(pos) {\n        return ctrl.toastPosition[pos];\n      }).join(' ');\n    };\n\n    function sanitizePosition() {\n      var current = ctrl.toastPosition;\n\n      if (current.bottom && last.top) {\n        current.top = false;\n      }\n      if (current.top && last.bottom) {\n        current.bottom = false;\n      }\n      if (current.right && last.left) {\n        current.left = false;\n      }\n      if (current.left && last.right) {\n        current.right = false;\n      }\n\n      last = angular.extend({}, current);\n    }\n\n    ctrl.showSimpleToast = function() {\n      var pinTo = ctrl.getToastPosition();\n\n      $mdToast.show(\n        $mdToast.simple()\n        .textContent('Simple Toast!')\n        .position(pinTo)\n        .hideDelay(3000))\n      .then(function() {\n        $log.log('Toast dismissed.');\n      }).catch(function() {\n        $log.log('Toast failed or was forced to close early by another toast.');\n      });\n    };\n\n    ctrl.showActionToast = function() {\n      var pinTo = ctrl.getToastPosition();\n      var toast = $mdToast.simple()\n        .textContent('Marked as read')\n        .actionKey('z')\n        .actionHint('Press the Control-\"z\" key combination to ')\n        .action('UNDO')\n        .dismissHint('Activate the Escape key to dismiss this toast.')\n        .highlightAction(true)\n        // Accent is used by default, this just demonstrates the usage.\n        .highlightClass('md-accent')\n        .position(pinTo)\n        .hideDelay(0);\n\n      $mdToast.show(toast)\n      .then(function(response) {\n        if (response === 'ok') {\n          alert('You selected the \\'UNDO\\' action.');\n        } else {\n          $log.log('Toast dismissed.');\n        }\n      }).catch(function() {\n        $log.log('Toast failed or was forced to close early by another toast.');\n      });\n    };\n  }\n})();\n"
  },
  {
    "path": "src/components/toast/demoBasicUsage/style.scss",
    "content": ".spacer {\n  width: 50px;\n}\n"
  },
  {
    "path": "src/components/toast/demoCustomUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" id=\"custom-toast-container\" class=\"inset\" ng-cloak>\n  <span>Toast can have multiple actions:</span>\n  <md-button ng-click=\"ctrl.showCustomToast()\" class=\"md-raised\">\n    Show Custom Toast\n  </md-button>\n</div>\n"
  },
  {
    "path": "src/components/toast/demoCustomUsage/script.js",
    "content": "(function() {\n  var isDlgOpen;\n  var ACTION_RESOLVE = 'undo';\n  var UNDO_KEY = 'z';\n  var DIALOG_KEY = 'd';\n\n  angular.module('toastCustomDemo', ['ngMaterial'])\n  .controller('AppCtrl', AppCtrl)\n  .controller('ToastCtrl', ToastCtrl);\n\n  function AppCtrl($mdToast, $log) {\n    var ctrl = this;\n    var message = 'Custom toast';\n\n    ctrl.showCustomToast = function() {\n      $mdToast.show({\n        hideDelay: 0,\n        position: 'top right',\n        controller: 'ToastCtrl',\n        controllerAs: 'ctrl',\n        bindToController: true,\n        locals: {toastMessage: message},\n        templateUrl: 'toast-template.html'\n      }).then(function(result) {\n        if (result === ACTION_RESOLVE) {\n          $log.log('Undo action triggered by button.');\n        } else if (result === 'key') {\n          $log.log('Undo action triggered by hot key: Control-' + UNDO_KEY + '.');\n        } else if (result === false) {\n          $log.log('Custom toast dismissed by Escape key.');\n        } else {\n          $log.log('Custom toast hidden automatically.');\n        }\n      }).catch(function(error) {\n        $log.error('Custom toast failure:', error);\n      });\n    };\n  }\n\n  function ToastCtrl($mdToast, $mdDialog, $document, $scope) {\n    var ctrl = this;\n    ctrl.keyListenerConfigured = false;\n    ctrl.undoKey = UNDO_KEY;\n    ctrl.dialogKey = DIALOG_KEY;\n    setupActionKeyListener();\n\n    ctrl.closeToast = function() {\n      if (isDlgOpen) {\n        return;\n      }\n\n      $mdToast.hide(ACTION_RESOLVE).then(function() {\n        isDlgOpen = false;\n      });\n    };\n\n    ctrl.openMoreInfo = function(e) {\n      if (isDlgOpen) {\n        return;\n      }\n      isDlgOpen = true;\n\n      $mdDialog.show(\n        $mdDialog.alert()\n        .title('More info goes here.')\n        .textContent('Something witty.')\n        .ariaLabel('More info')\n        .ok('Got it')\n        .targetEvent(e)\n      ).then(function() {\n        isDlgOpen = false;\n      });\n    };\n\n    /**\n     * @param {KeyboardEvent} event to handle\n     */\n    function handleKeyDown(event) {\n      if (event.key === 'Escape') {\n        $mdToast.hide(false);\n      }\n      if (event.key === UNDO_KEY && event.ctrlKey) {\n        $mdToast.hide('key');\n      }\n      if (event.key === DIALOG_KEY && event.ctrlKey) {\n        ctrl.openMoreInfo(event);\n      }\n    }\n\n    function setupActionKeyListener() {\n      if (!ctrl.keyListenerConfigured) {\n        $document.on('keydown', handleKeyDown);\n        ctrl.keyListenerConfigured = true;\n      }\n    }\n\n    function removeActionKeyListener() {\n      if (ctrl.keyListenerConfigured) {\n        $document.off('keydown');\n        ctrl.keyListenerConfigured = false;\n      }\n    }\n\n    $scope.$on('$destroy', function() {\n      removeActionKeyListener();\n    });\n  }\n})();\n"
  },
  {
    "path": "src/components/toast/demoCustomUsage/style.scss",
    "content": "#custom-toast-container {\n  height: 300px;\n  padding: 25px;\n\n  .md-button.md-raised {\n    padding-left: 10px;\n    padding-right: 10px;\n  }\n}\n.md-toast-text {\n  flex: 1 0 88px;\n}\n"
  },
  {
    "path": "src/components/toast/demoCustomUsage/toast-template.html",
    "content": "<md-toast role=\"alert\" aria-relevant=\"all\">\n  <span class=\"md-toast-text\">{{ctrl.toastMessage}}</span>\n  <span class=\"md-visually-hidden\">\n    Press Escape to dismiss. Press Control-\"{{ctrl.dialogKey}}\" for\n  </span>\n  <md-button class=\"md-highlight\" ng-click=\"ctrl.openMoreInfo($event)\">\n    More info\n  </md-button>\n  <span class=\"md-visually-hidden\">\n    Press Control-\"{{ctrl.undoKey}}\" to\n  </span>\n  <md-button ng-click=\"ctrl.closeToast()\">\n    Undo\n  </md-button>\n</md-toast>\n"
  },
  {
    "path": "src/components/toast/toast-theme.scss",
    "content": "md-toast.md-THEME_NAME-theme {\n\n  .md-toast-content {\n    background-color: #323232;\n    color: '{{background-50}}';\n\n    .md-button {\n      color: '{{background-50}}';\n\n      &.md-highlight {\n        // By default the toast should use the accent color as the primary highlight color\n        color: '{{accent-color}}';\n\n        &.md-primary {\n          color: '{{primary-color}}';\n        }\n\n        &.md-warn {\n          color: '{{warn-color}}';\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/toast/toast.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.toast\n * @description\n * Toast and Snackbar component.\n */\nangular.module('material.components.toast', [\n  'material.core',\n  'material.components.button'\n])\n  .directive('mdToast', MdToastDirective)\n  .provider('$mdToast', MdToastProvider);\n\n/* @ngInject */\nfunction MdToastDirective($mdToast) {\n  return {\n    restrict: 'E',\n    link: function postLink(scope, element) {\n      element.addClass('_md');     // private md component indicator for styling\n\n      // When navigation force destroys an interimElement, then\n      // listen and $destroy() that interim instance...\n      scope.$on('$destroy', function() {\n        $mdToast.destroy();\n      });\n    }\n  };\n}\n\n/**\n * @ngdoc service\n * @name $mdToast\n * @module material.components.toast\n *\n * @description\n * `$mdToast` is a service to build a toast notification on any position\n * on the screen with an optional duration, and provides a simple promise API.\n *\n * The toast will be always positioned at the `bottom`, when the screen size is\n * between `600px` and `959px` (`sm` breakpoint)\n *\n * ## Restrictions on custom toasts\n * - The toast's template must have an outer `<md-toast>` element.\n * - For a toast action, use element with class `md-action`.\n * - Add the class `md-capsule` for curved corners.\n *\n * ### Custom Presets\n * Developers are also able to create their own preset, which can be easily used without repeating\n * their options each time.\n *\n * <hljs lang=\"js\">\n *   $mdToastProvider.addPreset('testPreset', {\n *     options: function() {\n *       return {\n *         template:\n *           '<md-toast>' +\n *             '<div class=\"md-toast-content\">' +\n *               'This is a custom preset' +\n *             '</div>' +\n *           '</md-toast>',\n *         controllerAs: 'toast',\n *         bindToController: true\n *       };\n *     }\n *   });\n * </hljs>\n *\n * After you created your preset at config phase, you can easily access it.\n *\n * <hljs lang=\"js\">\n *   $mdToast.show(\n *     $mdToast.testPreset()\n *   );\n * </hljs>\n *\n * ## Parent container notes\n *\n * The toast is positioned using absolute positioning relative to its first non-static parent\n * container. Thus, if the requested parent container uses static positioning, we will temporarily\n * set its positioning to `relative` while the toast is visible and reset it when the toast is\n * hidden.\n *\n * Because of this, it is usually best to ensure that the parent container has a fixed height and\n * prevents scrolling by setting the `overflow: hidden;` style. Since the position is based off of\n * the parent's height, the toast may be mispositioned if you allow the parent to scroll.\n *\n * You can, however, have a scrollable element inside of the container; just make sure the\n * container itself does not scroll.\n *\n * <hljs lang=\"html\">\n * <div layout-fill id=\"toast-container\">\n *   <md-content>\n *     I can have lots of content and scroll!\n *   </md-content>\n * </div>\n * </hljs>\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyController\">\n *   <md-button ng-click=\"openToast()\">\n *     Open a Toast!\n *   </md-button>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"js\">\n * var app = angular.module('app', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdToast) {\n *   $scope.openToast = function($event) {\n *     $mdToast.show($mdToast.simple().textContent('Hello!'));\n *     // Could also do $mdToast.showSimple('Hello');\n *   };\n * });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#showSimple\n *\n * @param {string} message The message to display inside the toast\n * @description\n * Convenience method which builds and shows a simple toast.\n *\n * @returns {promise} A promise that can be resolved with `$mdToast.hide()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#simple\n *\n * @description\n * Builds a preconfigured toast.\n *\n * @returns {obj} a `$mdToastPreset` with the following chainable configuration methods.\n *\n * _**Note:** These configuration methods are provided in addition to the methods provided by\n * the `build()` and `show()` methods below._\n *\n * <table class=\"md-api-table methods\">\n *    <thead>\n *      <tr>\n *        <th>Method</th>\n *        <th>Description</th>\n *      </tr>\n *    </thead>\n *    <tbody>\n *      <tr>\n *        <td>`.textContent(string)`</td>\n *        <td>Sets the toast content to the specified string</td>\n *      </tr>\n *      <tr>\n *        <td>`.action(string)`</td>\n *        <td>\n *          Adds an action button. <br/>\n *          If clicked, the promise (returned from `show()`) will resolve with the value `'ok'`;\n *          otherwise, it is resolved with `true` after a `hideDelay` timeout.\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.actionKey(string)`</td>\n *        <td>\n *          Adds a hotkey for the action button to the page. <br/>\n *          If the `actionKey` and `Control` key are pressed, the toast's action will be triggered.\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.actionHint(string)`</td>\n *        <td>\n *          Text that a screen reader will announce to let the user know how to activate the\n *          action. <br>\n *          If an `actionKey` is defined, this defaults to:\n *          'Press Control-\"`actionKey`\" to ' followed by the `action`.\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.dismissHint(string)`</td>\n *        <td>\n *          Text that a screen reader will announce to let the user know how to dismiss the toast.\n *          <br>Defaults to: \"Press Escape to dismiss.\"\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.highlightAction(boolean)`</td>\n *        <td>\n *          Whether or not the action button will have an additional highlight class.<br/>\n *          By default the `accent` color will be applied to the action button.\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.highlightClass(string)`</td>\n *        <td>\n *          If set, the given class will be applied to the highlighted action button.<br/>\n *          This allows you to specify the highlight color easily. Highlight classes are\n *          `md-primary`, `md-warn`, and `md-accent`\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.capsule(boolean)`</td>\n *        <td>\n *          Whether or not to add the `md-capsule` class to the toast to provide rounded corners\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.theme(string)`</td>\n *        <td>\n *          Sets the theme on the toast to the requested theme. Default is `$mdThemingProvider`'s\n *          default.\n *        </td>\n *      </tr>\n *      <tr>\n *        <td>`.toastClass(string)`</td>\n *        <td>Sets a class on the toast element</td>\n *      </tr>\n *    </tbody>\n * </table>\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#updateTextContent\n *\n * @description\n * Updates the content of an existing toast. Useful for updating things like counts, etc.\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#build\n *\n * @description\n * Creates a custom `$mdToastPreset` that you can configure.\n *\n * @returns {obj} a `$mdToastPreset` with the chainable configuration methods for shows' options\n *   (see below).\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#show\n *\n * @description Shows the toast.\n *\n * @param {Object} optionsOrPreset Either provide an `$mdToastPreset` returned from `simple()`\n * and `build()`, or an options object with the following properties:\n *\n *   - `templateUrl` - `{string=}`: The url of an html template file that will\n *     be used as the content of the toast. Restrictions: the template must\n *     have an outer `md-toast` element.\n *   - `template` - `{string=}`: Same as templateUrl, except this is an actual\n *     template string.\n *   - `autoWrap` - `{boolean=}`: Whether or not to automatically wrap the template content with a\n *     `<div class=\"md-toast-content\">` if one is not provided. Defaults to true. Can be disabled\n *     if you provide a custom toast directive.\n *   - `scope` - `{Object=}`: the scope to link the template / controller to. If none is specified,\n *     it will create a new child scope. This scope will be destroyed when the toast is removed\n *     unless `preserveScope` is set to true.\n *   - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed.\n *     Default is false\n *   - `hideDelay` - `{number=}`: The number of milliseconds the toast should stay active before\n *     automatically closing. Set to `0` or `false` to have the toast stay open until closed\n *     manually via an action in the toast, a hotkey, or a swipe gesture. For accessibility, toasts\n *     should not automatically close when they contain an action.<br>\n *     Defaults to: `3000`.\n *   - `position` - `{string=}`: Sets the position of the toast. <br/>\n *     Available: any combination of `'bottom'`, `'left'`, `'top'`, `'right'`, `'end'`, and\n *     `'start'`. The properties `'end'` and `'start'` are dynamic and can be used for RTL support.\n *     <br/>\n *     Default combination: `'bottom left'`.\n *   - `toastClass` - `{string=}`: A class to set on the toast element.\n *   - `controller` - `{string=}`: The controller to associate with this toast.\n *     The controller will be injected the local `$mdToast.hide()`, which is a function\n *     used to hide the toast.\n *   - `locals` - `{Object=}`: An object containing key/value pairs. The keys will be used as names\n *     of values to inject into the controller. For example, `locals: {three: 3}` would inject\n *     `three` into the controller with the value of 3.\n *   - `bindToController` - `{boolean=}`: bind the locals to the controller, instead of passing\n *     them in.\n *   - `resolve` - `{Object=}`: Similar to locals, except it takes promises as values\n *     and the toast will not open until the promises resolve.\n *   - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n *   - `parent` - `{element=}`: The element to append the toast to. Defaults to appending\n *     to the root element of the application.\n *\n * @returns {promise} A promise that can be resolved with `$mdToast.hide()`. `$mdToast.hide()` will\n * resolve either with the boolean value `true` or the value passed as an argument to\n * `$mdToast.hide()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#hide\n *\n * @description\n * Hide an existing toast and resolve the promise returned from `$mdToast.show()`.\n *\n * @param {*=} response An argument for the resolved promise.\n *\n * @returns {promise} A promise that is called when the existing element is removed from the DOM.\n * The promise is resolved with either the Boolean value `true` or the value passed as the\n * argument to `$mdToast.hide()`.\n */\n\nfunction MdToastProvider($$interimElementProvider) {\n  // Differentiate promise resolves: hide timeout (value == true) and hide action clicks\n  // (value == ok).\n  var ACTION_RESOLVE = 'ok';\n\n  var activeToastContent;\n  var $mdToast = $$interimElementProvider('$mdToast')\n    .setDefaults({\n      methods: ['position', 'hideDelay', 'capsule', 'parent', 'position', 'toastClass'],\n      options: toastDefaultOptions\n    })\n    .addPreset('simple', {\n      argOption: 'textContent',\n      methods: ['textContent', 'action', 'actionKey', 'actionHint', 'highlightAction',\n                'highlightClass', 'theme', 'parent', 'dismissHint'],\n      options: /* @ngInject */ function($mdToast, $mdTheming) {\n        return {\n          template:\n            '<md-toast md-theme=\"{{ toast.theme }}\" ng-class=\"{\\'md-capsule\\': toast.capsule}\">' +\n            '  <div class=\"md-toast-content\" aria-live=\"polite\" aria-relevant=\"all\">' +\n            '    <span class=\"md-toast-text\">' +\n            '      {{ toast.content }}' +\n            '    </span>' +\n            '    <span class=\"md-visually-hidden\">{{ toast.dismissHint }}</span>' +\n            '    <span class=\"md-visually-hidden\" ng-if=\"toast.action && toast.actionKey\">' +\n            '      {{ toast.actionHint }}' +\n            '    </span>' +\n            '    <md-button class=\"md-action\" ng-if=\"toast.action\" ng-click=\"toast.resolve()\" ' +\n            '               ng-class=\"highlightClasses\">' +\n            '      {{ toast.action }}' +\n            '    </md-button>' +\n            '  </div>' +\n            '</md-toast>',\n          controller: MdToastController,\n          theme: $mdTheming.defaultTheme(),\n          controllerAs: 'toast',\n          bindToController: true\n        };\n      }\n    })\n    .addMethod('updateTextContent', updateTextContent);\n\n    function updateTextContent(newContent) {\n      activeToastContent = newContent;\n    }\n\n    return $mdToast;\n\n  /**\n   * Controller for the Toast interim elements.\n   * @ngInject\n   */\n  function MdToastController($mdToast, $scope, $log) {\n    // For compatibility with AngularJS 1.6+, we should always use the $onInit hook in\n    // interimElements. The $mdCompiler simulates the $onInit hook for all versions.\n    this.$onInit = function() {\n      var self = this;\n\n      if (self.highlightAction) {\n        $scope.highlightClasses = [\n          'md-highlight',\n          self.highlightClass\n        ];\n      }\n\n      // If an action is defined and no actionKey is specified, then log a warning.\n      if (self.action && !self.actionKey) {\n        $log.warn('Toasts with actions should define an actionKey for accessibility.',\n          'Details: https://material.angularjs.org/latest/api/service/$mdToast#mdtoast-simple');\n      }\n\n      if (self.actionKey && !self.actionHint) {\n        self.actionHint = 'Press Control-\"' + self.actionKey + '\" to ';\n      }\n\n      if (!self.dismissHint) {\n        self.dismissHint = 'Press Escape to dismiss.';\n      }\n\n      $scope.$watch(function() { return activeToastContent; }, function() {\n        self.content = activeToastContent;\n      });\n\n      this.resolve = function() {\n        $mdToast.hide(ACTION_RESOLVE);\n      };\n    };\n  }\n\n  /* @ngInject */\n  function toastDefaultOptions($animate, $mdToast, $mdUtil, $mdMedia, $document, $q) {\n    var SWIPE_EVENTS = '$md.swipeleft $md.swiperight $md.swipeup $md.swipedown';\n    return {\n      onShow: onShow,\n      onRemove: onRemove,\n      toastClass: '',\n      position: 'bottom left',\n      themable: true,\n      hideDelay: 3000,\n      autoWrap: true,\n      transformTemplate: function(template, options) {\n        var shouldAddWrapper = options.autoWrap && template && !/md-toast-content/g.test(template);\n\n        if (shouldAddWrapper) {\n          // Root element of template will be <md-toast>. We need to wrap all of its content inside\n          // of <div class=\"md-toast-content\">. All templates provided here should be static,\n          // developer-controlled content (meaning we're not attempting to guard against XSS).\n          var templateRoot = document.createElement('md-template');\n          templateRoot.innerHTML = template;\n\n          // Iterate through all root children, to detect possible md-toast directives.\n          for (var i = 0; i < templateRoot.children.length; i++) {\n            if (templateRoot.children[i].nodeName === 'MD-TOAST') {\n              var wrapper = angular.element('<div class=\"md-toast-content\">');\n\n              // Wrap the children of the `md-toast` directive in jqLite, to be able to append\n              // multiple nodes with the same execution.\n              wrapper.append(angular.element(templateRoot.children[i].childNodes));\n\n              // Append the new wrapped element to the `md-toast` directive.\n              templateRoot.children[i].appendChild(wrapper[0]);\n            }\n          }\n\n          // We have to return the innerHTML, because we do not want to have the `md-template`\n          // element to be the root element of our interimElement.\n          return templateRoot.innerHTML;\n        }\n\n        return template || '';\n      }\n    };\n\n    /**\n     * @param {{toast: {actionKey: string=}}=} scope\n     * @param {JQLite} element\n     * @param {Object.<string, string>} options\n     * @return {*}\n     */\n    function onShow(scope, element, options) {\n      activeToastContent = options.textContent;\n\n      var isSmScreen = !$mdMedia('gt-sm');\n\n      element = $mdUtil.extractElementByName(element, 'md-toast', true);\n      options.element = element;\n\n      options.onSwipe = function(ev) {\n        // Add the relevant swipe class to the element so it can animate correctly\n        var swipe = ev.type.replace('$md.','');\n        var direction = swipe.replace('swipe', '');\n\n        // If the swipe direction is down/up but the toast came from top/bottom don't fade away\n        // Unless the screen is small, then the toast always on bottom\n        if ((direction === 'down' && options.position.indexOf('top') !== -1 && !isSmScreen) ||\n            (direction === 'up' && (options.position.indexOf('bottom') !== -1 || isSmScreen))) {\n          return;\n        }\n\n        if ((direction === 'left' || direction === 'right') && isSmScreen) {\n          return;\n        }\n\n        element.addClass('md-' + swipe);\n        $mdUtil.nextTick($mdToast.cancel);\n      };\n      options.openClass = toastOpenClass(options.position);\n\n      element.addClass(options.toastClass);\n\n      // 'top left' -> 'md-top md-left'\n      options.parent.addClass(options.openClass);\n\n      // static is the default position\n      if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {\n        options.parent.css('position', 'relative');\n      }\n\n      setupActionKeyListener(scope.toast && scope.toast.actionKey ?\n        scope.toast.actionKey : undefined);\n\n      element.on(SWIPE_EVENTS, options.onSwipe);\n\n      var verticalPositionDefined = false;\n      var positionClasses = options.position.split(' ').map(function (position) {\n        if (position) {\n          var className = 'md-' + position;\n          if (className === 'md-top' || className === 'md-bottom') {\n            verticalPositionDefined = true;\n          }\n          return className;\n        }\n        return 'md-bottom';\n      });\n      // If only \"right\" or \"left\" are defined, default to a vertical position of \"bottom\"\n      // as documented.\n      if (!verticalPositionDefined) {\n        positionClasses.push('md-bottom');\n      }\n      element.addClass(isSmScreen ? 'md-bottom' : positionClasses.join(' '));\n\n      if (options.parent) {\n        options.parent.addClass('md-toast-animating');\n      }\n      return $animate.enter(element, options.parent).then(function() {\n        if (options.parent) {\n          options.parent.removeClass('md-toast-animating');\n        }\n      });\n    }\n\n    /**\n     * @param {Object} scope the toast's scope\n     * @param {JQLite} element the toast to be removed\n     * @param {Object} options\n     * @return {Promise<*>} a Promise to remove the element immediately or to animate it out.\n     */\n    function onRemove(scope, element, options) {\n      if (scope.toast && scope.toast.actionKey) {\n        removeActionKeyListener();\n      }\n      element.off(SWIPE_EVENTS, options.onSwipe);\n      if (options.parent) options.parent.addClass('md-toast-animating');\n      if (options.openClass) options.parent.removeClass(options.openClass);\n\n      // Don't run the leave animation if the element has already been destroyed.\n      return ((options.$destroy === true) ? $q.when(element.remove()) : $animate.leave(element))\n        .then(function () {\n          if (options.parent) options.parent.removeClass('md-toast-animating');\n          if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {\n            options.parent.css('position', '');\n          }\n        });\n    }\n\n    function toastOpenClass(position) {\n      // For mobile, always open full-width on bottom\n      if (!$mdMedia('gt-xs')) {\n        return 'md-toast-open-bottom';\n      }\n\n      return 'md-toast-open-' + (position.indexOf('top') > -1 ? 'top' : 'bottom');\n    }\n\n    /**\n     * @param {string} actionKey\n     */\n    function setupActionKeyListener(actionKey) {\n      /**\n       * @param {KeyboardEvent} event\n       */\n      var handleKeyDown = function(event) {\n        if (event.key === 'Escape') {\n          $mdToast.hide(false);\n        }\n        if (actionKey && event.key === actionKey && event.ctrlKey) {\n          $mdToast.hide(ACTION_RESOLVE);\n        }\n      };\n      $document.on('keydown', handleKeyDown);\n    }\n\n    function removeActionKeyListener() {\n      $document.off('keydown');\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/toast/toast.scss",
    "content": "// See height set globally, depended on by buttons\n\n$md-toast-content-padding: 3 * $baseline-grid - $button-left-right-padding !default;\n$md-toast-button-left-margin: 3 * $baseline-grid - 2 * $button-left-right-padding !default;\n$md-toast-text-padding: $button-left-right-padding !default;\n\n\n.md-toast-text {\n  padding: 0 $md-toast-text-padding;\n}\n\nmd-toast {\n  position: absolute;\n  z-index: $z-index-toast;\n\n  box-sizing: border-box;\n  cursor: default;\n  overflow: hidden;\n\n  // Add some padding to the outer toast container so that the wrapper's box shadow is visible\n  padding: $toast-margin;\n\n  // Setup opacity transition on whole toast\n  opacity: 1;\n  transition: $swift-ease-out;\n\n  .md-toast-content {\n    display: flex;\n    flex-direction: row;\n    align-items: center;\n\n    max-height: 7 * $toast-height;\n    max-width: 100%;\n\n    min-height: 48px;\n    // Since we're vertically centering our text by using flexbox and having a min-height, we need to apply\n    // a fix for an IE11 flexbug, otherwise the text won't be centered vertically.\n    @include ie11-min-height-flexbug(48px);\n\n    padding: 0 $md-toast-content-padding;\n\n    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);\n    border-radius: 2px;\n    font-size: 14px;\n\n    overflow: hidden;\n\n    // Setup for transform transitions on inner content\n    transform: translate3d(0, 0, 0) rotateZ(0deg);\n    transition: $swift-ease-out;\n\n    @include rtl(justify-content, flex-start, flex-end);\n\n    span {\n      // Layout  [flex]\n      flex:1 1 0%;\n      box-sizing:border-box;\n      min-width :0;\n    }\n  }\n\n  &.md-capsule {\n    border-radius: 24px;\n\n    .md-toast-content {\n      border-radius: 24px;\n    }\n  }\n\n  &.ng-leave-active {\n    .md-toast-content {\n      transition: $swift-ease-in;\n    }\n  }\n\n  /* Transition differently when swiping */\n  &.md-swipeleft,\n  &.md-swiperight,\n  &.md-swipeup,\n  &.md-swipedown {\n    .md-toast-content {\n      transition: $swift-ease-out;\n    }\n  }\n\n  &.ng-enter {\n    opacity: 0;\n    .md-toast-content {\n      transform: translate3d(0, 100%, 0);\n    }\n    &.md-top {\n      .md-toast-content {\n        transform: translate3d(0, -100%, 0);\n      }\n    }\n    &.ng-enter-active {\n      opacity: 1;\n      .md-toast-content {\n        transform: translate3d(0, 0, 0);\n      }\n    }\n  }\n  /*\n   * When the toast doesn't take up the whole screen,\n   * make it rotate when the user swipes it away\n   */\n  &.ng-leave.ng-leave-active {\n    .md-toast-content {\n      opacity: 0;\n      transform: translate3d(0, 100%, 0);\n    }\n\n    &.md-swipeup {\n      .md-toast-content {\n        transform: translate3d(0, -50%, 0);\n      }\n    }\n    &.md-swipedown {\n      .md-toast-content {\n        transform: translate3d(0, 50%, 0);\n      }\n    }\n    &.md-top {\n      .md-toast-content {\n        transform: translate3d(0, -100%, 0);\n      }\n    }\n  }\n\n  .md-action {\n    line-height: 19px;\n    margin-left: 24px;\n    margin-right: 0;\n    cursor: pointer;\n    text-transform: uppercase;\n    float: right;\n  }\n\n  .md-button {\n    min-width: 0;\n    @include rtl(margin-right, 0, $md-toast-button-left-margin);\n    @include rtl(margin-left, $md-toast-button-left-margin, 0);\n  }\n}\n\n@media (max-width: $layout-breakpoint-sm - 1) {\n  md-toast {\n    left: 0;\n    right: 0;\n    width: 100%;\n    max-width: 100%;\n    min-width: 0;\n    border-radius: 0;\n    bottom: 0;\n    padding: 0;\n\n    &.ng-leave.ng-leave-active {\n      &.md-swipeup {\n        .md-toast-content {\n          transform: translate3d(0, -50%, 0);\n        }\n      }\n      &.md-swipedown {\n        .md-toast-content {\n          transform: translate3d(0, 50%, 0);\n        }\n      }\n    }\n  }\n}\n\n@media (min-width: $layout-breakpoint-sm) {\n  md-toast {\n    min-width: 288px + $toast-margin * 2;\n    &.md-bottom {\n      bottom: 0;\n    }\n    &.md-left {\n      left: 0;\n    }\n    &.md-right {\n      right: 0;\n    }\n    &.md-top {\n      top: 0;\n    }\n\n    // Support for RTL alignment\n    &._md-start {\n      @include rtl-prop(left, right, 0, auto);\n    }\n\n    &._md-end {\n      @include rtl-prop(right, left, 0, auto);\n    }\n\n    /*\n   * When the toast doesn't take up the whole screen,\n   * make it rotate when the user swipes it away\n   */\n    &.ng-leave.ng-leave-active {\n      &.md-swipeleft {\n        .md-toast-content {\n          transform: translate3d(-50%, 0, 0);\n        }\n      }\n      &.md-swiperight {\n        .md-toast-content {\n          transform: translate3d(50%, 0, 0);\n        }\n      }\n    }\n  }\n}\n\n@media (min-width: $layout-breakpoint-lg) {\n  md-toast {\n    .md-toast-content {\n      max-width: $baseline-grid * 71;\n    }\n  }\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-toast {\n    border: 1px solid #fff;\n  }\n}\n\n\n// While animating, set the toast parent's overflow to hidden so scrollbars do not appear\n.md-toast-animating {\n  overflow: hidden !important;\n}\n"
  },
  {
    "path": "src/components/toast/toast.spec.js",
    "content": "describe('$mdToast service', function() {\n\n  beforeEach(module('material.components.toast'));\n\n  beforeEach(function () {\n    module(function ($provide) {\n      $provide.value('$mdMedia', function () {\n        return true;\n      });\n    });\n  });\n\n  afterEach(inject(function($material) {\n    $material.flushOutstandingAnimations();\n  }));\n\n  function setup(options) {\n    var promise = null;\n    inject(function($mdToast, $material) {\n      options = options || {};\n      promise = $mdToast.show(options);\n      $material.flushOutstandingAnimations();\n    });\n    return promise;\n  }\n\n  describe('simple()', function() {\n\n    hasConfigMethods(['textContent', 'action', 'capsule', 'highlightAction', 'theme', 'toastClass']);\n\n    it('should have `._md` class indicator', inject(function($mdToast, $material) {\n      var parent = angular.element('<div>');\n\n      $mdToast.show(\n        $mdToast.simple({\n          parent: parent,\n          textContent: 'Do something',\n          theme: 'some-theme',\n          capsule: true\n      }));\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-toast').hasClass('_md')).toBe(true);\n    }));\n\n    it('supports a basic toast', inject(function($mdToast, $rootScope, $timeout, $material) {\n      var openAndClosed = false;\n      var parent = angular.element('<div>');\n      $mdToast.show(\n        $mdToast.simple({\n          parent: parent,\n          textContent: 'Do something',\n          theme: 'some-theme',\n          capsule: true\n        })\n      ).then(function() {\n        openAndClosed = true;\n      });\n\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('span').text().trim()).toContain('Do something');\n      expect(parent.find('span')).toHaveClass('md-toast-text');\n      expect(parent.find('md-toast')).toHaveClass('md-capsule');\n      expect(parent.find('md-toast').attr('md-theme')).toBe('some-theme');\n\n      $material.flushInterimElement();\n\n      expect(openAndClosed).toBe(true);\n    }));\n\n    it('supports dynamically updating the content', inject(function($mdToast, $rootScope, $rootElement) {\n      $mdToast.showSimple('Hello world');\n      $rootScope.$digest();\n      $mdToast.updateTextContent('Goodbye world');\n      $rootScope.$digest();\n      expect($rootElement.find('span').text().trim()).toContain('Goodbye world');\n    }));\n\n    it('supports an action toast', inject(function($mdToast, $rootScope, $material) {\n      var resolved = false;\n      var parent = angular.element('<div>');\n      $mdToast.show(\n        $mdToast.simple({\n          textContent: 'Do something',\n          parent: parent\n        })\n          .action('Click me')\n          .highlightAction(true)\n      ).then(function() {\n        resolved = true;\n      });\n      $material.flushOutstandingAnimations();\n      var button = parent.find('button');\n      expect(button.text().trim()).toBe('Click me');\n      button.triggerHandler('click');\n      $material.flushInterimElement();\n      expect(resolved).toBe(true);\n    }));\n\n    it('should apply the highlight class when using highlightAction', inject(function($mdToast, $rootScope, $material) {\n      var parent = angular.element('<div>');\n\n      $mdToast.show(\n        $mdToast.simple({\n            textContent: 'Marked as read',\n            parent: parent\n          })\n          .action('UNDO')\n          .highlightAction(true)\n          .highlightClass('md-warn')\n      );\n\n      $material.flushOutstandingAnimations();\n\n      var button = parent.find('button');\n\n      expect(button.text().trim()).toBe('UNDO');\n      expect(button).toHaveClass('md-highlight');\n      expect(button).toHaveClass('md-warn');\n    }));\n\n    it('adds the specified class to md-toast when using toastClass', inject(function($mdToast, $material) {\n      var parent = angular.element('<div>');\n\n      $mdToast.show(\n        $mdToast.simple()\n          .parent(parent)\n          .toastClass('test')\n      );\n      $material.flushOutstandingAnimations();\n\n      expect(parent.find('md-toast').hasClass('test')).toBe(true);\n    }));\n\n    describe('when using custom interpolation symbols', function() {\n      beforeEach(module(function($interpolateProvider) {\n        $interpolateProvider.startSymbol('[[').endSymbol(']]');\n      }));\n\n      it('displays correctly', inject(function($mdToast, $rootScope) {\n        var parent = angular.element('<div>');\n        var toast = $mdToast.simple({\n          textContent: 'Do something',\n          parent: parent\n        }).action('Click me');\n\n        $mdToast.show(toast);\n        $rootScope.$digest();\n\n        var content = parent.find('span').eq(0);\n        var button = parent.find('button');\n\n        expect(content.text().trim()).toBe('Do something');\n        expect(button.text().trim()).toBe('Click me');\n      }));\n\n\n      it('displays correctly with parent()', inject(function($mdToast, $rootScope) {\n              var parent = angular.element('<div>');\n              var toast = $mdToast.simple({\n                textContent: 'Do something',\n              })\n              .parent(parent)\n              .action('Click me');\n\n              $mdToast.show(toast);\n              $rootScope.$digest();\n\n              var content = parent.find('span').eq(0);\n              var button = parent.find('button');\n\n              expect(content.text().trim()).toBe('Do something');\n              expect(button.text().trim()).toBe('Click me');\n            }));\n    });\n\n    function hasConfigMethods(methods) {\n      angular.forEach(methods, function(method) {\n        return it('supports config method #' + method, inject(function($mdToast) {\n          var basic = $mdToast.simple();\n          expect(typeof basic[method]).toBe('function');\n          expect(basic[method]()).toBe(basic);\n        }));\n      });\n    }\n  });\n\n  describe('build()', function() {\n    describe('options', function() {\n      it('should have template', inject(function($timeout, $rootScope, $rootElement) {\n        var parent = angular.element('<div>');\n        setup({\n          template: '<md-toast>{{1}}234</md-toast>',\n          appendTo: parent\n        });\n        var toast = $rootElement.find('md-toast');\n        $timeout.flush();\n        expect(toast.text().trim()).toBe('1234');\n      }));\n\n      it('should have templateUrl', inject(function($timeout, $rootScope, $templateCache, $rootElement) {\n        $templateCache.put('template.html', '<md-toast>hello, {{1}}</md-toast>');\n        setup({\n          templateUrl: 'template.html',\n        });\n        var toast = $rootElement.find('md-toast');\n        expect(toast.text().trim()).toBe('hello, 1');\n      }));\n\n      it('should not throw an error if template starts with comment', inject(function($timeout, $rootScope, $rootElement) {\n        var parent = angular.element('<div>');\n        setup({\n          template: '<!-- COMMENT --><md-toast>{{1}}234</md-toast>',\n          appendTo: parent\n        });\n\n        var toast = $rootElement.find('md-toast');\n        $timeout.flush();\n\n        expect(toast.length).not.toBe(0);\n      }));\n\n      it('should correctly wrap the custom template', inject(function($timeout, $rootScope, $rootElement) {\n        var parent = angular.element('<div>');\n\n        setup({\n          template: '<md-toast>Message</md-toast>',\n          appendTo: parent\n        });\n\n        var toast = $rootElement.find('md-toast');\n        $timeout.flush();\n\n        expect(toast[0].querySelector('.md-toast-content').textContent).toBe('Message');\n      }));\n\n      it('should add position class to toast', inject(function($rootElement, $timeout) {\n        setup({\n          template: '<md-toast>',\n          position: 'top left'\n        });\n        var toast = $rootElement.find('md-toast');\n        $timeout.flush();\n        expect(toast.hasClass('md-top')).toBe(true);\n        expect(toast.hasClass('md-left')).toBe(true);\n      }));\n\n      it('should wrap toast content with .md-toast-content', inject(function($rootElement, $timeout) {\n        setup({\n          template: '<md-toast><p>Charmander</p></md-toast>',\n          position: 'top left'\n        });\n        var toast = $rootElement.find('md-toast')[0];\n        $timeout.flush();\n\n        expect(toast.children.length).toBe(1);\n        var toastContent = toast.children[0];\n        var contentSpan = toastContent.children[0];\n        expect(toastContent.classList.contains('md-toast-content'));\n        expect(toastContent.textContent).toMatch('Charmander');\n        expect(contentSpan).not.toHaveClass('md-toast-text');\n      }));\n\n\n\n      describe('sm screen', function () {\n        beforeEach(function () {\n          module(function ($provide) {\n            $provide.value('$mdMedia', function () {\n              return false;\n            });\n          });\n        });\n\n        it('should always be on bottom', inject(function($rootElement, $material) {\n          disableAnimations();\n\n          setup({\n            template: '<md-toast>'\n          });\n          expect($rootElement.hasClass('md-toast-open-bottom')).toBe(true);\n\n          $material.flushInterimElement();\n\n          setup({\n            template: '<md-toast>',\n            position: 'top'\n          });\n          expect($rootElement.hasClass('md-toast-open-bottom')).toBe(true);\n        }));\n      });\n    });\n  });\n\n  describe('lifecycle', function() {\n\n    describe('should hide',function() {\n      it('current toast when showing new one', inject(function($rootElement, $material) {\n        disableAnimations();\n\n        setup({\n          template: '<md-toast class=\"one\">'\n        });\n\n        expect($rootElement[0].querySelector('md-toast.one')).toBeTruthy();\n        expect($rootElement[0].querySelector('md-toast.two')).toBeFalsy();\n        expect($rootElement[0].querySelector('md-toast.three')).toBeFalsy();\n\n        $material.flushInterimElement();\n\n        setup({\n          template: '<md-toast class=\"two\">'\n        });\n\n        expect($rootElement[0].querySelector('md-toast.one')).toBeFalsy();\n        expect($rootElement[0].querySelector('md-toast.two')).toBeTruthy();\n        expect($rootElement[0].querySelector('md-toast.three')).toBeFalsy();\n\n        $material.flushInterimElement();\n\n        setup({\n          template: '<md-toast class=\"three\">'\n        });\n\n        $material.flushOutstandingAnimations();\n\n        expect($rootElement[0].querySelector('md-toast.one')).toBeFalsy();\n        expect($rootElement[0].querySelector('md-toast.two')).toBeFalsy();\n        expect($rootElement[0].querySelector('md-toast.three')).toBeTruthy();\n      }));\n\n      it('after duration', inject(function($timeout, $animate, $rootElement) {\n        disableAnimations();\n\n        var hideDelay = 1234;\n        setup({\n          template: '<md-toast />',\n          hideDelay: hideDelay\n        });\n        expect($rootElement.find('md-toast').length).toBe(1);\n        $timeout.flush(hideDelay);\n        expect($rootElement.find('md-toast').length).toBe(0);\n      }));\n\n      it('and resolve with default `true`', inject(function($timeout, $material, $mdToast) {\n        disableAnimations();\n\n        var result = null, fault = null;\n        setup({\n          template: '<md-toast />',\n          hideDelay: 1234\n        }).then(\n          function(response){ result = response;  },\n          function(error){ fault = error;  }\n        );\n\n        $mdToast.hide();\n\n        $material.flushInterimElement();\n\n        expect(angular.isUndefined(result)).toBe(true);\n        expect(fault).toBe(null);\n      }));\n\n      it('and resolve with specified value', inject(function($timeout, $animate, $material, $mdToast) {\n        disableAnimations();\n\n        var result = null, fault = null;\n        setup({\n          template: '<md-toast />',\n          hideDelay: 1234\n        }).then(\n          function(response){ result = response;  },\n          function(error){ fault = error;  }\n        );\n\n        $mdToast.hide(\"secret\");\n\n        $material.flushInterimElement();\n\n        expect(result).toBe(\"secret\");\n        expect(fault).toBe(null);\n      }));\n\n      it('and resolve `true` after timeout', inject(function($timeout, $material) {\n        disableAnimations();\n\n        var result = null, fault = null;\n        setup({\n          template: '<md-toast />',\n          hideDelay: 1234\n        }).then(\n          function(response){ result = response;  },\n          function(error){ fault = error;  }\n        );\n\n        $material.flushInterimElement();\n\n        expect(angular.isUndefined(result)).toBe(true);\n        expect(fault).toBe(null);\n      }));\n\n      it('and resolve `ok` with click on OK button', inject(function($mdToast, $rootScope, $timeout, $material) {\n        var result = null, fault = null;\n        var parent = angular.element('<div>');\n        var toast = $mdToast.simple({\n          parent: parent,\n          textContent: 'Do something'\n        }).action('Close with \"ok\" response');\n\n        $mdToast\n          .show(toast)\n          .then(\n            function(response){ result = response;  },\n            function(error){ fault = error;  }\n          );\n\n        $material.flushOutstandingAnimations();\n\n        parent.find('button').triggerHandler('click');\n\n        $material.flushInterimElement();\n\n        expect(result).toBe('ok');\n        expect(fault).toBe(null);\n      }));\n    });\n\n    it('should add class to toastParent', inject(function($rootElement, $material) {\n      disableAnimations();\n\n      setup({\n        template: '<md-toast>'\n      });\n      expect($rootElement.hasClass('md-toast-open-bottom')).toBe(true);\n\n      $material.flushInterimElement();\n\n      setup({\n        template: '<md-toast>',\n        position: 'top'\n      });\n      expect($rootElement.hasClass('md-toast-open-top')).toBe(true);\n    }));\n  });\n\n});\n"
  },
  {
    "path": "src/components/toolbar/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"BasicDemoCtrl\" ng-cloak>\n  <md-content>\n    <br>\n    <md-toolbar class=\"md-hue-2\">\n      <div class=\"md-toolbar-tools\">\n        <md-button class=\"md-icon-button\" aria-label=\"Settings\" ng-disabled=\"true\">\n          <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n        </md-button>\n\n        <h2 flex md-truncate>Toolbar with Disabled/Enabled Icon Buttons</h2>\n\n        <md-button class=\"md-icon-button\" aria-label=\"Favorite\">\n          <md-icon md-svg-icon=\"img/icons/favorite.svg\" class=\"favorite-icon\"></md-icon>\n        </md-button>\n\n        <md-button class=\"md-icon-button\" aria-label=\"More\">\n          <md-icon md-svg-icon=\"img/icons/more_vert.svg\"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <br>\n\n    <md-toolbar>\n      <div class=\"md-toolbar-tools\">\n        <md-button aria-label=\"Go Back\">\n          Back\n        </md-button>\n\n        <h2 flex md-truncate>Toolbar with Standard Buttons and a Mini FAB</h2>\n        <md-button class=\"md-raised md-accent md-hue-3\" aria-label=\"Learn More\">\n          Learn More\n        </md-button>\n        <md-button class=\"md-fab md-mini md-hue-3\" aria-label=\"Favorite\">\n          <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n        </md-button>\n      </div>\n    </md-toolbar>\n    <br>\n\n    <md-toolbar class=\"md-hue-1\">\n      <div layout=\"row\">\n        <md-toolbar-filler>\n          <md-icon id=\"filler-icon\" md-svg-icon=\"img/icons/octicon-repo.svg\"></md-icon>\n        </md-toolbar-filler>\n        <h2 class=\"md-toolbar-tools\">\n          <span>Toolbar: with filler and icon (md-hue-1)</span>\n        </h2>\n      </div>\n    </md-toolbar>\n    <br>\n\n    <md-toolbar class=\"md-tall md-accent\">\n      <h2 class=\"md-toolbar-tools\">\n        <span>Toolbar: tall (md-accent)</span>\n      </h2>\n    </md-toolbar>\n    <br>\n\n    <md-toolbar class=\"md-tall md-warn md-hue-3\">\n      <span flex></span>\n      <h2 class=\"md-toolbar-tools\">\n        <span class=\"md-flex\">Toolbar: tall with actions pinned to the bottom (md-warn md-hue-3)</span>\n      </h2>\n    </md-toolbar>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/toolbar/demoBasicUsage/script.js",
    "content": "angular.module('toolbarDemoBasic', ['ngMaterial'])\n\n.controller('BasicDemoCtrl', function($scope) {\n\n});\n"
  },
  {
    "path": "src/components/toolbar/demoBasicUsage/style.scss",
    "content": "md-toolbar {\n  .md-button.md-icon-button {\n    .favorite-icon {\n      fill: #DE3641; // docs-red A100\n    }\n  }\n  md-toolbar-filler {\n    display: flex;\n    background-color: #e0e0e0; // grey 200\n\n    #filler-icon {\n      fill: #4C9EF1; // docs-blue 300 - hue-1\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/toolbar/demoInputsInToolbar/index.html",
    "content": "<div ng-controller=\"DemoCtrl\" ng-cloak>\n  <md-toolbar class=\"md-accent\">\n    <header layout=\"row\" layout-align=\"start center\">\n      <span>\n        <md-button class=\"md-icon-button md-primary\" aria-label=\"Settings\" disabled>\n          <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n        </md-button>\n        <label style=\"vertical-align: middle; margin-right: 24px;\">ACME</label>\n      </span>\n      <md-input-container md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"primary\" aria-label=\"primary\" />\n      </md-input-container>\n      <md-input-container class=\"md-accent\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"accent\" aria-label=\"accent\" />\n      </md-input-container>\n      <md-input-container class=\"md-warn\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"warn\" aria-label=\"warn\" />\n      </md-input-container>\n    </header>\n  </md-toolbar>\n  <md-toolbar class=\"md-primary\">\n    <header layout=\"row\" layout-align=\"start center\">\n      <span>\n        <md-button class=\"md-icon-button md-primary\" aria-label=\"Settings\" disabled>\n          <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n        </md-button>\n        <label style=\"vertical-align: middle; margin-right: 24px;\">ACME</label>\n      </span>\n      <md-input-container md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"primary\" aria-label=\"primary\" />\n      </md-input-container>\n      <md-input-container class=\"md-accent\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"accent\" aria-label=\"accent\" />\n      </md-input-container>\n      <md-input-container class=\"md-warn\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"warn\" aria-label=\"warn\" />\n      </md-input-container>\n    </header>\n  </md-toolbar>\n  <md-toolbar class=\"md-warn\">\n    <header layout=\"row\" layout-align=\"start center\">\n      <span>\n        <md-button class=\"md-icon-button md-primary\" aria-label=\"Settings\" disabled>\n          <md-icon md-svg-icon=\"img/icons/menu.svg\"></md-icon>\n        </md-button>\n        <label style=\"vertical-align: middle; margin-right: 24px;\">ACME</label>\n      </span>\n      <md-input-container md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"primary\" aria-label=\"primary\" />\n      </md-input-container>\n      <md-input-container class=\"md-accent\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"accent\" aria-label=\"accent\" />\n      </md-input-container>\n      <md-input-container class=\"md-warn\" md-no-float>\n        <md-icon md-svg-src=\"img/icons/ic_person_24px.svg\"></md-icon>\n        <input placeholder=\"warn\" aria-label=\"warn\" />\n      </md-input-container>\n    </header>\n  </md-toolbar>\n  <md-content class=\"md-margin\">\n    <md-input-container md-no-float>\n      <input placeholder=\"primary no float\" aria-label=\"primary no float\" />\n    </md-input-container>\n    <md-input-container>\n      <input placeholder=\"primary\" aria-label=\"primary\" />\n    </md-input-container>\n    <md-input-container class=\"md-accent\">\n      <input placeholder=\"accent\" aria-label=\"accent\" />\n    </md-input-container>\n  </md-content>\n</div>\n"
  },
  {
    "path": "src/components/toolbar/demoInputsInToolbar/script.js",
    "content": "angular.module('inputsInToolbarDemo', ['ngMaterial'])\n.controller('DemoCtrl', function($scope) {});\n"
  },
  {
    "path": "src/components/toolbar/demoInputsInToolbar/style.scss",
    "content": "md-toolbar {\n  header {\n    margin-top: 16px;\n\n    >span {\n      height: 58px;\n      margin: 18px 0;\n    }\n\n    md-input-container {\n      width: 160px;\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/toolbar/demoScrollShrink/index.html",
    "content": "<div ng-controller=\"AppCtrl\" layout=\"column\" style=\"height:600px\" ng-cloak>\n\n  <md-toolbar md-scroll-shrink ng-if=\"true\" ng-controller=\"TitleController\">\n    <div class=\"md-toolbar-tools\">\n      <h3>\n        <span>{{title}}</span>\n      </h3>\n    </div>\n  </md-toolbar>\n\n  <md-content flex>\n\n    <md-list>\n\n      <md-list-item class=\"md-3-line\" ng-repeat=\"item in todos\">\n        <img ng-src=\"{{item.face}}\" alt=\"{{item.who}}\" class=\"md-avatar\">\n\n        <div class=\"md-list-item-text\">\n          <h3>{{item.what}}</h3>\n          <h4>{{item.who}}</h4>\n\n          <p>\n            {{item.notes}}\n          </p>\n        </div>\n        <md-divider inset></md-divider>\n      </md-list-item>\n\n    </md-list>\n\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/toolbar/demoScrollShrink/script.js",
    "content": "angular.module('toolbarDemo2', ['ngMaterial'])\n\n.controller('TitleController', function($scope) {\n  $scope.title = 'My App Title';\n})\n.controller('AppCtrl', function($scope) {\n  var imagePath = 'img/60.jpeg';\n\n  $scope.todos = [];\n  for (var i = 0; i < 15; i++) {\n    $scope.todos.push({\n      face: imagePath,\n      what: \"Brunch this weekend?\",\n      who: \"Min Li Chan\",\n      notes: \"I'll be in your neighborhood doing errands.\"\n    });\n  }\n});\n"
  },
  {
    "path": "src/components/toolbar/demoScrollShrink/style.css",
    "content": ".face {\n  width: 48px;\n  margin: 16px;\n  border-radius: 48px;\n  border: 1px solid #ddd;\n}\n"
  },
  {
    "path": "src/components/toolbar/toolbar-theme.scss",
    "content": "md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) {\n  background-color: '{{primary-color}}';\n  color: '{{primary-contrast}}';\n\n  md-icon {\n    color: '{{primary-contrast}}';\n    fill: '{{primary-contrast}}';\n  }\n\n  .md-button[disabled] md-icon {\n    color: '{{primary-contrast-0.26}}';\n    fill: '{{primary-contrast-0.26}}';\n  }\n\n  md-input-container[md-no-float] {\n    .md-input {\n      @include input-placeholder-color('\\'{{primary-default-contrast-hint}}\\'');\n      color: '{{primary-default-contrast}}';\n      border-color: '{{primary-default-contrast-divider}}';\n    }\n\n    &.md-input-focused {\n      .md-input {\n        @include input-placeholder-color('\\'{{primary-default-contrast-secondary}}\\'');\n      }\n    }\n\n    &:not(.md-input-invalid) {\n      &.md-input-focused,\n      &.md-input-resized {\n        .md-input {\n          border-color: '{{primary-contrast}}';\n        }\n      }\n\n      &.md-input-focused {\n        &.md-accent {\n          .md-input {\n            border-color: '{{accent-color}}';\n          }\n        }\n        &.md-warn {\n          .md-input {\n            border-color: '{{warn-A700}}';\n          }\n        }\n      }\n    }\n  }\n\n  &.md-accent {\n    background-color: '{{accent-500}}';\n    color: '{{accent-500-contrast}}';\n\n    .md-ink-ripple {\n      color: '{{accent-500-contrast}}';\n    }\n\n    md-icon {\n      color: '{{accent-500-contrast}}';\n      fill: '{{accent-500-contrast}}';\n    }\n\n    .md-button[disabled] md-icon {\n      color: '{{accent-500-contrast-0.26}}';\n      fill: '{{accent-500-contrast-0.26}}';\n    }\n\n    md-input-container[md-no-float] {\n      .md-input {\n        @include input-placeholder-color('\\'{{accent-500-contrast-hint}}\\'');\n        color: '{{accent-500-contrast}}';\n        border-color: '{{accent-500-contrast-divider}}';\n      }\n\n      &.md-input-focused {\n        .md-input {\n          @include input-placeholder-color('\\'{{accent-500-contrast-secondary}}\\'');\n        }\n      }\n\n      &:not(.md-input-invalid) {\n        &.md-input-focused,\n        &.md-input-resized {\n          .md-input {\n            border-color: '{{primary-color}}';\n          }\n        }\n\n        &.md-input-focused {\n          &.md-accent {\n            .md-input {\n              border-color: '{{accent-500-contrast}}';\n            }\n          }\n          &.md-warn {\n            .md-input {\n              border-color: '{{warn-A700}}';\n            }\n          }\n        }\n      }\n    }\n  }\n\n  &.md-warn {\n    background-color: '{{warn-500}}';\n    color: '{{warn-500-contrast}}';\n\n    md-icon {\n      color: '{{warn-500-contrast}}';\n      fill: '{{warn-500-contrast}}';\n    }\n\n    md-input-container[md-no-float] {\n      .md-input {\n        @include input-placeholder-color('\\'{{warn-500-contrast-hint}}\\'');\n        color: '{{warn-500-contrast}}';\n        border-color: '{{warn-500-contrast-divider}}';\n      }\n\n      &.md-input-focused {\n        .md-input {\n          @include input-placeholder-color('\\'{{warn-500-contrast-secondary}}\\'');\n        }\n      }\n\n      &:not(.md-input-invalid) {\n        &.md-input-focused,\n        &.md-input-resized {\n          .md-input {\n            border-color: '{{primary-color}}';\n          }\n        }\n\n        &.md-input-focused {\n          &.md-accent {\n            .md-input {\n              border-color: '{{accent-color}}';\n            }\n          }\n          &.md-warn {\n            .md-input {\n              border-color: '{{warn-500-contrast}}';\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/toolbar/toolbar.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.toolbar\n */\nangular.module('material.components.toolbar', [\n  'material.core',\n  'material.components.content'\n])\n  .directive('mdToolbar', mdToolbarDirective);\n\n/**\n * @ngdoc directive\n * @name mdToolbar\n * @module material.components.toolbar\n * @restrict E\n * @description\n * `md-toolbar` is used to place a toolbar in your app.\n *\n * Toolbars are usually used above a content area to display the title of the\n * current page, and show relevant action buttons for that page.\n *\n * You can change the height of the toolbar by adding either the\n * `md-medium-tall` or `md-tall` class to the toolbar.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div layout=\"column\" layout-fill>\n *   <md-toolbar>\n *\n *     <div class=\"md-toolbar-tools\">\n *       <h2 md-truncate flex>My App's Title</h2>\n *\n *       <md-button>\n *         Right Bar Button\n *       </md-button>\n *     </div>\n *\n *   </md-toolbar>\n *   <md-content>\n *     Hello!\n *   </md-content>\n * </div>\n * </hljs>\n *\n * <i><b>Note:</b> The code above shows usage with the `md-truncate` component which provides an\n * ellipsis if the title is longer than the width of the Toolbar.</i>\n *\n * ## CSS & Styles\n *\n * The `<md-toolbar>` provides a few custom CSS classes that you may use to enhance the\n * functionality of your toolbar.\n *\n * <div>\n * <docs-css-api-table>\n *\n *   <docs-css-selector code=\"md-toolbar .md-toolbar-tools\">\n *     The `md-toolbar-tools` class provides quite a bit of automatic styling for your toolbar\n *     buttons and text. When applied, it will center the buttons and text vertically for you.\n *   </docs-css-selector>\n *\n * </docs-css-api-table>\n * </div>\n *\n * ### Private Classes\n *\n * Currently, the only private class is the `md-toolbar-transitions` class. All other classes are\n * considered public.\n *\n * @param {boolean=} md-scroll-shrink Whether the header should shrink away as\n * the user scrolls down, and reveal itself as the user scrolls up.\n *\n * _**Note (1):** for scrollShrink to work, the toolbar must be a sibling of a\n * `md-content` element, placed before it. See the scroll shrink demo._\n *\n * _**Note (2):** The `md-scroll-shrink` attribute is only parsed on component\n * initialization, it does not watch for scope changes._\n *\n *\n * @param {number=} md-shrink-speed-factor How much to change the speed of the toolbar's\n * shrinking by. For example, if 0.25 is given then the toolbar will shrink\n * at one fourth the rate at which the user scrolls down. Default 0.5.\n *\n */\n\nfunction mdToolbarDirective($$rAF, $mdConstant, $mdUtil, $mdTheming, $animate, $timeout) {\n  var translateY = angular.bind(null, $mdUtil.supplant, 'translate3d(0,{0}px,0)');\n\n  return {\n    template: '',\n    restrict: 'E',\n\n    link: function(scope, element, attr) {\n\n      element.addClass('_md');     // private md component indicator for styling\n      $mdTheming(element);\n\n      $mdUtil.nextTick(function () {\n        element.addClass('_md-toolbar-transitions');     // adding toolbar transitions after digest\n      }, false);\n\n      if (angular.isDefined(attr.mdScrollShrink)) {\n        setupScrollShrink();\n      }\n\n      function setupScrollShrink() {\n\n        var toolbarHeight;\n        var contentElement;\n        var disableScrollShrink = angular.noop;\n\n        // Current \"y\" position of scroll\n        // Store the last scroll top position\n        var y = 0;\n        var prevScrollTop = 0;\n        var shrinkSpeedFactor = attr.mdShrinkSpeedFactor || 0.5;\n\n        var debouncedContentScroll = $$rAF.throttle(onContentScroll);\n        var debouncedUpdateHeight = $mdUtil.debounce(updateToolbarHeight, 5 * 1000);\n\n        // Wait for $mdContentLoaded event from mdContent directive.\n        // If the mdContent element is a sibling of our toolbar, hook it up\n        // to scroll events.\n\n        scope.$on('$mdContentLoaded', onMdContentLoad);\n\n        // If the toolbar is used inside an ng-if statement, we may miss the\n        // $mdContentLoaded event, so we attempt to fake it if we have a\n        // md-content close enough.\n\n        attr.$observe('mdScrollShrink', onChangeScrollShrink);\n\n        // If the toolbar has ngShow or ngHide we need to update height immediately as it changed\n        // and not wait for $mdUtil.debounce to happen\n\n        if (attr.ngShow) { scope.$watch(attr.ngShow, updateToolbarHeight); }\n        if (attr.ngHide) { scope.$watch(attr.ngHide, updateToolbarHeight); }\n\n        // If the scope is destroyed (which could happen with ng-if), make sure\n        // to disable scroll shrinking again\n\n        scope.$on('$destroy', disableScrollShrink);\n\n        /**\n         * @param {string} shrinkWithScroll value of md-scroll-shrink attribute\n         */\n        function onChangeScrollShrink(shrinkWithScroll) {\n          var closestContent = $mdUtil.getSiblings(element, 'md-content');\n\n          // If there are content elements, fake the call using the first content element.\n          // This might still fail if the content element isn't a sibling of the toolbar.\n          if (!contentElement && closestContent.length) {\n            onMdContentLoad(null, closestContent[0]);\n          }\n\n          // Evaluate the expression\n          shrinkWithScroll = scope.$eval(shrinkWithScroll);\n\n          // Disable only if the attribute's expression evaluates to false\n          if (shrinkWithScroll === false) {\n            disableScrollShrink();\n          } else {\n            disableScrollShrink = enableScrollShrink();\n          }\n        }\n\n        /**\n         * @param {null} $event $mdContentLoaded always has a null event\n         * @param {JQLite} newContentEl JQLite object containing an md-content\n         */\n        function onMdContentLoad($event, newContentEl) {\n          // Toolbar and content must be siblings\n          if (newContentEl && element.parent()[0] === newContentEl.parent()[0]) {\n            // unhook old content event listener if exists\n            if (contentElement) {\n              contentElement.off('scroll', debouncedContentScroll);\n            }\n\n            contentElement = newContentEl;\n            disableScrollShrink = enableScrollShrink();\n          }\n        }\n\n        /**\n         *\n         */\n        function onContentScroll(e) {\n          var scrollTop = e ? e.target.scrollTop : prevScrollTop;\n\n          debouncedUpdateHeight();\n\n          y = Math.min(\n            toolbarHeight / shrinkSpeedFactor,\n            Math.max(0, y + scrollTop - prevScrollTop)\n          );\n\n          element.css($mdConstant.CSS.TRANSFORM, translateY([-y * shrinkSpeedFactor]));\n          contentElement.css($mdConstant.CSS.TRANSFORM, translateY([(toolbarHeight - y) * shrinkSpeedFactor]));\n\n          prevScrollTop = scrollTop;\n\n          $mdUtil.nextTick(function() {\n            var hasWhiteFrame = element.hasClass('md-whiteframe-z1');\n\n            if (hasWhiteFrame && !y) {\n              $animate.removeClass(element, 'md-whiteframe-z1');\n            } else if (!hasWhiteFrame && y) {\n              $animate.addClass(element, 'md-whiteframe-z1');\n            }\n          });\n\n        }\n\n        /**\n         *\n         */\n        function enableScrollShrink() {\n          if (!contentElement)     return angular.noop;           // no md-content\n\n          contentElement.on('scroll', debouncedContentScroll);\n          contentElement.attr('scroll-shrink', 'true');\n\n          $timeout(updateToolbarHeight);\n\n          return function disableScrollShrink() {\n            contentElement.off('scroll', debouncedContentScroll);\n            contentElement.attr('scroll-shrink', 'false');\n\n            updateToolbarHeight();\n          };\n        }\n\n        /**\n         *\n         */\n        function updateToolbarHeight() {\n          toolbarHeight = element.prop('offsetHeight');\n          // Add a negative margin-top the size of the toolbar to the content el.\n          // The content will start transformed down the toolbarHeight amount,\n          // so everything looks normal.\n          //\n          // As the user scrolls down, the content will be transformed up slowly\n          // to put the content underneath where the toolbar was.\n          var margin = (-toolbarHeight * shrinkSpeedFactor) + 'px';\n\n          contentElement.css({\n            \"margin-top\": margin,\n            \"margin-bottom\": margin\n          });\n\n          onContentScroll();\n        }\n\n      }\n\n    }\n  };\n\n}\n"
  },
  {
    "path": "src/components/toolbar/toolbar.scss",
    "content": "// Standard/Desktop Heights\n$md-toolbar-height: $baseline-grid * 8 !default;\n$md-toolbar-medium-tall-height: 88px !default;\n$md-toolbar-tall-height: 128px !default;\n\n// Mobile device heights\n$md-toolbar-height-mobile-portrait: 56px !default;\n$md-toolbar-height-mobile-landscape: 48px !default;\n\n$md-toolbar-indent-margin: 64px !default;\n$md-toolbar-padding: 16px !default;\n\n$icon-button-margin-offset: rem(-0.800) !default;\n\nmd-toolbar {\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n\n  position: relative;\n  z-index: 2;\n\n  font-size: rem(2.0);\n  min-height: $md-toolbar-height;\n  width: 100%;\n\n  &._md-toolbar-transitions {\n    transition-duration: $swift-ease-in-out-duration;\n    transition-timing-function: $swift-ease-in-out-timing-function;\n    transition-property: background-color, fill, color;\n  }\n\n  &.md-whiteframe-z1-add, &.md-whiteframe-z1-remove {\n    transition: box-shadow $swift-ease-in-out-duration linear;\n  }\n\n  md-toolbar-filler {\n    width: 9 * $baseline-grid;\n  }\n\n  *,\n  *:before,\n  *:after {\n    box-sizing: border-box;\n  }\n\n  // By default $ngAnimate looks for transition durations on the element, when using ng-hide, ng-if, ng-show.\n  // The toolbar has a transition duration applied, which means, that $ngAnimate delays the hide process.\n  // To avoid this, we need to reset the transition, when $ngAnimate looks for the duration.\n  &.ng-animate {\n    transition: none;\n  }\n\n  &.md-tall {\n    height: $md-toolbar-tall-height;\n    min-height: $md-toolbar-tall-height;\n    max-height: $md-toolbar-tall-height;\n  }\n\n  &.md-medium-tall {\n    height: $md-toolbar-medium-tall-height;\n    min-height: $md-toolbar-medium-tall-height;\n    max-height: $md-toolbar-medium-tall-height;\n\n    .md-toolbar-tools {\n      height: 48px;\n      min-height: 48px;\n      max-height: 48px;\n    }\n  }\n\n  > .md-indent {\n    @include rtl-prop(margin-left, margin-right, $md-toolbar-indent-margin, auto);\n  }\n\n  ~ md-content {\n    > md-list {\n      padding: 0;\n\n      md-list-item:last-child {\n        md-divider {\n          display: none;\n        }\n      }\n    }\n  }\n}\n\n.md-toolbar-tools {\n  font-size: $title-font-size-base;\n  letter-spacing: 0.005em;\n  box-sizing: border-box;\n  font-weight: 400;\n  display: flex;\n  align-items: center;\n  flex-direction: row;\n\n  width: 100%;\n  height: $md-toolbar-height;\n  max-height: $md-toolbar-height;\n  padding: 0 $md-toolbar-padding;\n  margin: 0;\n\n  h1, h2, h3 {\n    font-size: inherit;\n    font-weight: inherit;\n    margin: inherit;\n  }\n\n  a {\n    color: inherit;\n    text-decoration: none;\n  }\n  .fill-height {\n    display: flex;\n    align-items: center;\n  }\n  md-checkbox {\n    margin: inherit;\n  }\n  .md-button {\n    margin-top: 0;\n    margin-bottom: 0;\n\n    &, &.md-icon-button md-icon {\n      transition-duration: $swift-ease-in-out-duration;\n      transition-timing-function: $swift-ease-in-out-timing-function;\n      transition-property: background-color, fill, color;\n\n      // Normally .md-button is already resetting the transition, when $ngAnimate looks for the duration,\n      // but in this case, the selector has a higher specificity than the `reset selector`, which means, that\n      // we need to reset the transition our self.\n      &.ng-animate {\n        transition: none;\n      }\n    }\n  }\n  &> .md-button:first-child {\n    @include rtl-prop(margin-left, margin-right, $icon-button-margin-offset, auto);\n  }\n  &> .md-button:last-child {\n    @include rtl-prop(margin-right, margin-left, $icon-button-margin-offset, auto);\n  }\n\n  &> md-menu:last-child {\n    @include rtl-prop(margin-right, margin-left, $icon-button-margin-offset, auto);\n    & > .md-button {\n      @include rtl-prop(margin-right, margin-left, 0, auto);\n    }\n  }\n\n  @media screen and (-ms-high-contrast: active) {\n    border-bottom: 1px solid #fff;\n  }\n}\n\n// Handle mobile portrait\n@media (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: portrait) {\n  md-toolbar {\n    min-height: $md-toolbar-height-mobile-portrait;\n  }\n\n  .md-toolbar-tools {\n    height: $md-toolbar-height-mobile-portrait;\n    max-height: $md-toolbar-height-mobile-portrait;\n  }\n}\n\n// Handle mobile landscape\n@media (min-width: 0) and (max-width: $layout-breakpoint-sm - 1) and (orientation: landscape) {\n  md-toolbar {\n    min-height: $md-toolbar-height-mobile-landscape;\n  }\n\n  .md-toolbar-tools {\n    height: $md-toolbar-height-mobile-landscape;\n    max-height: $md-toolbar-height-mobile-landscape;\n  }\n}\n\n"
  },
  {
    "path": "src/components/toolbar/toolbar.spec.js",
    "content": "describe('<md-toolbar>', function() {\n\n  var pageScope, element, controller;\n  var $rootScope, $timeout;\n\n  beforeEach(function() {\n    module('material.components.toolbar', function($controllerProvider) {\n      $controllerProvider.register('MockController', function() {});\n    });\n  });\n  beforeEach(inject(function(_$rootScope_, _$timeout_) {\n    $rootScope = _$rootScope_;\n    $timeout = _$timeout_;\n  }));\n\n  it('with scrollShrink, it should shrink scrollbar when going to bottom',\n    inject(function($compile, $rootScope, $mdConstant, mdToolbarDirective) {\n\n    var parent = angular.element('<div>');\n    var toolbar = angular.element('<md-toolbar>');\n    var contentEl = angular.element('<div>');\n    // Make content and toolbar siblings\n    parent.append(toolbar).append(contentEl);\n\n    // Prop will be used for offsetHeight, give a fake offsetHeight\n    spyOn(toolbar, 'prop').and.callFake(function() {\n      return 100;\n    });\n\n    // Fake the css function so we can read css values properly,\n    // no matter which browser the tests are being run on.\n    // (IE, firefox, chrome all give different results when reading element.style)\n    var toolbarCss = {};\n    spyOn(toolbar, 'css').and.callFake(function(k, v) {\n      toolbarCss[k] = v;\n    });\n    var contentCss = {};\n    spyOn(contentEl, 'css').and.callFake(function(properties, value) {\n      var k;\n      if (angular.isObject(properties)) {\n        for (k in properties) {\n          if (properties.hasOwnProperty(k)) {\n            contentCss[k] = properties[k];\n          }\n        }\n      } else {\n        contentCss[properties] = value;\n      }\n    });\n\n    // Manually link so we can give our own elements with spies on them\n    mdToolbarDirective[0].link($rootScope, toolbar, {\n      mdScrollShrink: true,\n      mdShrinkSpeedFactor: 1,\n      $observe: function() {}\n    });\n\n    $rootScope.$apply();\n    $rootScope.$broadcast('$mdContentLoaded', contentEl);\n    $timeout.flush();\n\n\n    // Expect everything to be in its proper initial state.\n    expect(toolbarCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,0px,0)');\n    expect(contentCss['margin-top']).toEqual('-100px');\n    expect(contentCss['margin-bottom']).toEqual('-100px');\n    expect(contentCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,100px,0)');\n\n    // Fake scroll to the bottom\n    contentEl.triggerHandler({\n      type: 'scroll',\n      target: {scrollTop: 500}\n    });\n\n    expect(toolbarCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,-100px,0)');\n    expect(contentCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,0px,0)');\n\n    // Fake scroll back to the top\n    contentEl.triggerHandler({\n      type: 'scroll',\n      target: {scrollTop: 0}\n    });\n\n    expect(toolbarCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,0px,0)');\n    expect(contentCss[$mdConstant.CSS.TRANSFORM]).toEqual('translate3d(0,100px,0)');\n\n  }));\n\n  it('works without ng-if', inject(function() {\n    build(\n      '<div>' +\n      '  <md-toolbar md-scroll-shrink=\"true\"></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual('true');\n  }));\n\n  it('works with ng-if', inject(function() {\n    build(\n      '<div>' +\n      '  <md-toolbar md-scroll-shrink=\"true\" ng-if=\"shouldShowToolbar\"></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    // It starts out undefined\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual(undefined);\n\n    // Change the ng-if to add the toolbar which then injects a scrollShrink\n    // on the mdContent\n    pageScope.$apply('shouldShowToolbar = true');\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual('true');\n\n    // Change the ng-if to remove the toolbar\n    pageScope.$apply('shouldShowToolbar = false');\n    expect(element.find('md-toolbar').length).toBe(0);\n  }));\n\n  it('works with ng-show', inject(function($timeout) {\n    var template =\n      '<div layout=\"column\" style=\"height: 600px;\">' +\n      '  <md-toolbar md-scroll-shrink=\"true\" ng-show=\"shouldShowToolbar\">test</md-toolbar>' +\n      '  <md-content flex><div style=\"height: 5000px;\"></div></md-content>' +\n      '</div>';\n\n    // Build/append the element\n    build(template);\n    document.body.appendChild(element[0]);\n\n    //\n    // Initial tests\n    //\n\n    var toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);\n    var contentStyles = getComputedStyle(element.find('md-content')[0]);\n\n    // Should start out hidden because we have not set shouldShowToolbar\n    expect(toolbarStyles.display).toBeTruthy();\n    expect(toolbarStyles.display).toEqual('none');\n\n    // Expect the content to have a zero margin top\n    expect(contentStyles.marginTop).toBeTruthy();\n    expect(contentStyles.marginTop).toEqual('0px');\n\n    //\n    // After showing toolbar tests\n    //\n\n    // Show the toolbar and ensure it is visible\n    pageScope.$apply('shouldShowToolbar = true');\n    pageScope.$digest();\n    $timeout.flush();\n\n    toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);\n    contentStyles = getComputedStyle(element.find('md-content')[0]);\n\n    // Expect the toolbar to be visible\n    expect(toolbarStyles.display).toBeTruthy();\n    expect(toolbarStyles.display).not.toEqual('none');\n\n    // Expect the content to have a non-zero margin top (because updateToolbarHeight() was called)\n    expect(contentStyles.marginTop).toBeTruthy();\n    expect(contentStyles.marginTop).not.toEqual('0px');\n\n    // Remove the element\n    document.body.removeChild(element[0]);\n  }));\n\n  it('works with ng-hide', inject(function($timeout) {\n    var template =\n      '<div layout=\"column\" style=\"height: 600px;\">' +\n      '  <md-toolbar md-scroll-shrink=\"true\" ng-hide=\"shouldNotShowToolbar\">test</md-toolbar>' +\n      '  <md-content flex><div style=\"height: 5000px;\"></div></md-content>' +\n      '</div>';\n\n    // Build/append the element\n    build(template);\n    document.body.appendChild(element[0]);\n\n    // Flushing to get the actual height of toolbar\n    $timeout.flush();\n\n    //\n    // Initial tests\n    //\n\n    var toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);\n    var contentStyles = getComputedStyle(element.find('md-content')[0]);\n\n    // Should start out visible because we have not set shouldNotShowToolbar\n    expect(toolbarStyles.display).toBeTruthy();\n    expect(toolbarStyles.display).not.toEqual('none');\n\n    // Expect the content to have a non-zero margin top\n    expect(contentStyles.marginTop).toBeTruthy();\n    expect(contentStyles.marginTop).not.toEqual('0px');\n\n    //\n    // After showing toolbar tests\n    //\n\n    // Show the toolbar and ensure it is hidden\n    pageScope.$apply('shouldNotShowToolbar = true');\n    pageScope.$digest();\n    $timeout.flush();\n\n    toolbarStyles = getComputedStyle(element.find('md-toolbar')[0]);\n    contentStyles = getComputedStyle(element.find('md-content')[0]);\n\n    // Expect the toolbar to be hidden\n    expect(toolbarStyles.display).toBeTruthy();\n    expect(toolbarStyles.display).toEqual('none');\n\n    // Expect the content to have a zero margin top (because updateToolbarHeight() was called)\n    expect(contentStyles.marginTop).toBeTruthy();\n    expect(contentStyles.marginTop).toEqual('0px');\n\n    // Remove the element\n    document.body.removeChild(element[0]);\n  }));\n\n  // The toolbar is like a container component, so we want to make sure it works with ng-controller\n  it('works with ng-controller', inject(function($exceptionHandler) {\n    build(\n      '<div>' +\n      '  <md-toolbar md-scroll-shrink ng-controller=\"MockController\"></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    // Expect no errors\n    expect($exceptionHandler.errors).toEqual([]);\n  }));\n\n  it('should have `._md` class indicator', inject(function() {\n    build(\n      '<div>' +\n      '  <md-toolbar></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    expect(element.find('md-toolbar').hasClass('_md')).toBe(true);\n  }));\n\n  it('disables scroll shrink when the attribute is not provided', inject(function() {\n    build(\n      '<div>' +\n      '  <md-toolbar></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual(undefined);\n  }));\n\n  it('enables scroll shrink when the attribute has no value', function() {\n    build(\n      '<div>' +\n      '  <md-toolbar md-scroll-shrink></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>'\n    );\n\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual('true');\n  });\n\n  it('disables scroll shrink if the expression evaluates to false', function() {\n    var pageScope = $rootScope.$new();\n\n    // Set the value to false\n    pageScope.$apply('someValue = false');\n\n    // Build the element\n    build(\n      // Pass our template\n      '<div>' +\n      '  <md-toolbar md-scroll-shrink=\"someValue\"></md-toolbar>' +\n      '  <md-content></md-content>' +\n      '</div>',\n\n      // Pass our custom pageScope\n      pageScope\n    );\n\n    // Check that scroll shrink is disabled\n    expect(element.find('md-content').attr('scroll-shrink')).toEqual('false');\n  });\n\n\n  function build(template, scope) {\n    inject(function($compile) {\n      if (scope) {\n        pageScope = scope\n      } else {\n        pageScope = $rootScope.$new();\n      }\n\n      element = $compile(template)(pageScope);\n      controller = element.controller('mdToolbar');\n\n      pageScope.$apply();\n      $timeout.flush();\n    });\n  }\n});\n"
  },
  {
    "path": "src/components/tooltip/demoBasicUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl\" ng-cloak>\n\n  <md-toolbar class=\"md-accent\">\n    <div class=\"md-toolbar-tools\">\n\n      <h2>Awesome Material App</h2>\n      <span flex></span>\n      <md-button class=\"md-icon-button test-tooltip\" aria-label=\"Refresh\">\n        <md-tooltip md-direction=\"left\">Refresh</md-tooltip>\n        <md-icon\n          md-svg-src=\"img/icons/ic_refresh_24px.svg\"\n          style=\"width: 24px; height: 24px\">\n        </md-icon>\n      </md-button>\n\n    </div>\n  </md-toolbar>\n\n  <md-content layout-padding style=\"margin-left: 20px; margin-right: 20px\">\n    <div>\n\n      <p>\n        The tooltip is visible when the button is hovered, focused, or touched.\n        Hover over the <strong>Refresh</strong> icon in the above toolbar.\n      </p>\n\n      <div style=\"margin-top: 20px\">\n        <p>\n          The Tooltip's <code>md-z-index</code> attribute can be used to change\n          the tooltip's visual level in comparison with the other elements of\n          the application.<br />\n          <strong>Note:</strong> the z-index default is <strong>100</strong>.\n        </p>\n      </div>\n\n      <div style=\"margin-top: 20px\">\n        <p>\n          The Tooltip's <code>md-direction</code> attribute can be used to\n          dynamically change the direction of the tooltip.<br />\n          <strong>Note:</strong> the direction default value is\n          <strong>'bottom'</strong>.\n        </p>\n        <div layout=\"row\" layout-align=\"space-between\">\n          <md-radio-group\n            ng-model=\"demo.tipDirection\"\n            style=\"padding-left: 30px\">\n            <md-radio-button value=\"top\">Top</md-radio-button>\n            <md-radio-button value=\"right\">Right</md-radio-button>\n            <md-radio-button value=\"bottom\">Bottom</md-radio-button>\n            <md-radio-button value=\"left\">Left</md-radio-button>\n          </md-radio-group>\n          <md-button class=\"md-fab\">\n            <md-tooltip\n              md-direction=\"{{demo.tipDirection}}\">\n              Insert Drive\n            </md-tooltip>\n            <md-icon\n              md-svg-src=\"img/icons/ic_insert_drive_file_24px.svg\">\n            </md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div style=\"margin-top: 30px\">\n        <p>\n          The Tooltip's <code>md-visible</code> attribute can be used to\n          programmatically show/hide itself. Toggle the checkbox below...\n        </p>\n        <div layout=\"row\" layout-align=\"space-between center\">\n          <div style=\"padding-left: 30px\">\n            <md-checkbox ng-model=\"demo.showTooltip\" style=\"padding-left: 30px\">\n              Insert Drive\n            </md-checkbox>\n          </div>\n          <md-button class=\"md-fab\" aria-label=\"Photos\">\n            <md-tooltip md-visible=\"demo.showTooltip\">Photos</md-tooltip>\n            <md-icon md-svg-src=\"img/icons/ic_photo_24px.svg\"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n      <div style=\"margin-top: 20px\">\n        <p>\n          The Tooltip's <code>md-delay</code> attribute can be used to delay\n          the show animation.<br />\n          <strong>Note:</strong> the delay default value is\n          <strong>0 milliseconds</strong>.\n        </p>\n        <div layout=\"row\" layout-align=\"space-between center\">\n          <div style=\"padding-left: 30px\">\n            <md-input-container>\n              <label>Tooltip Delay</label>\n              <input ng-model=\"demo.delayTooltip\" />\n            </md-input-container>\n          </div>\n          <md-button\n            class=\"md-fab\"\n            aria-label=\"Menu with Tooltip Delay\"\n            style=\"margin-top: -24px\">\n            <md-tooltip md-delay=\"demo.delayTooltip\">\n              Menu with Tooltip Delay {{demo.delayTooltip}} msecs\n            </md-tooltip>\n            <md-icon md-svg-src=\"img/icons/ic_more_vert_24px.svg\"></md-icon>\n          </md-button>\n        </div>\n      </div>\n\n    </div>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/tooltip/demoBasicUsage/script.js",
    "content": "angular.module('tooltipDemo', ['ngMaterial'])\n    .controller('AppCtrl', AppCtrl);\n\nfunction AppCtrl($scope) {\n  $scope.demo = {\n    showTooltip: false,\n    tipDirection: 'bottom'\n  };\n\n  $scope.demo.delayTooltip = undefined;\n  $scope.$watch('demo.delayTooltip', function(val) {\n    $scope.demo.delayTooltip = parseInt(val, 10) || 0;\n  });\n}\n"
  },
  {
    "path": "src/components/tooltip/tooltip-theme.scss",
    "content": ".md-panel.md-tooltip.md-THEME_NAME-theme {\n  color: '{{background-700-contrast}}';\n  background-color: '{{background-700}}';\n}\n"
  },
  {
    "path": "src/components/tooltip/tooltip.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.tooltip\n */\nangular\n    .module('material.components.tooltip', [\n      'material.core',\n      'material.components.panel'\n    ])\n    .directive('mdTooltip', MdTooltipDirective)\n    .service('$$mdTooltipRegistry', MdTooltipRegistry);\n\n\n/**\n * @ngdoc directive\n * @name mdTooltip\n * @module material.components.tooltip\n * @description\n * Tooltips are used to describe elements that are interactive and primarily\n * graphical (not textual).\n *\n * Place a `<md-tooltip>` as a child of the element it describes.\n *\n * A tooltip will activate when the user hovers over, focuses, or touches the\n * parent element.\n *\n * @usage\n * <hljs lang=\"html\">\n *   <md-button class=\"md-fab md-accent\" aria-label=\"Play\">\n *     <md-tooltip>Play Music</md-tooltip>\n *     <md-icon md-svg-src=\"img/icons/ic_play_arrow_24px.svg\"></md-icon>\n *   </md-button>\n * </hljs>\n *\n * @param {number=} md-z-index The visual level that the tooltip will appear\n *     in comparison with the rest of the elements of the application.\n * @param {expression=} md-visible Boolean bound to whether the tooltip is\n *     currently visible.\n * @param {number=} md-delay How many milliseconds to wait to show the tooltip\n *     after the user hovers over, focuses, or touches the parent element.\n *     Defaults to 0ms on non-touch devices and 75ms on touch.\n * @param {boolean=} md-autohide If present or provided with a boolean value,\n *     the tooltip will hide on mouse leave, regardless of focus.\n * @param {string=} md-direction The direction that the tooltip is shown,\n *     relative to the parent element. Supports top, right, bottom, and left.\n *     Defaults to bottom.\n */\nfunction MdTooltipDirective($timeout, $window, $$rAF, $document, $interpolate,\n    $mdUtil, $mdPanel, $$mdTooltipRegistry) {\n\n  var ENTER_EVENTS = 'focus touchstart mouseenter';\n  var LEAVE_EVENTS = 'blur touchcancel mouseleave';\n  var TOOLTIP_DEFAULT_Z_INDEX = 100;\n  var TOOLTIP_DEFAULT_SHOW_DELAY = 0;\n  var TOOLTIP_DEFAULT_DIRECTION = 'bottom';\n  var TOOLTIP_DIRECTIONS = {\n    top: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.ABOVE },\n    right: { x: $mdPanel.xPosition.OFFSET_END, y: $mdPanel.yPosition.CENTER },\n    bottom: { x: $mdPanel.xPosition.CENTER, y: $mdPanel.yPosition.BELOW },\n    left: { x: $mdPanel.xPosition.OFFSET_START, y: $mdPanel.yPosition.CENTER }\n  };\n\n  return {\n    restrict: 'E',\n    priority: 210, // Before ngAria\n    scope: {\n      mdZIndex: '=?mdZIndex',\n      mdDelay: '=?mdDelay',\n      mdVisible: '=?mdVisible',\n      mdAutohide: '=?mdAutohide',\n      mdDirection: '@?mdDirection' // Do not expect expressions.\n    },\n    link: linkFunc\n  };\n\n  function linkFunc(scope, element, attr) {\n    // Set constants.\n    var tooltipId = 'md-tooltip-' + $mdUtil.nextUid();\n    var parent = $mdUtil.getParentWithPointerEvents(element);\n    var debouncedOnResize = $$rAF.throttle(updatePosition);\n    var mouseActive = false;\n    var origin, position, panelPosition, panelRef, autohide, showTimeout,\n        elementFocusedOnWindowBlur = null;\n\n    // Set defaults\n    setDefaults();\n\n    // Set parent aria-label.\n    addAriaLabel();\n\n    // Remove the element from its current DOM position.\n    element.detach();\n\n    updatePosition();\n    bindEvents();\n    configureWatchers();\n\n    function setDefaults() {\n      scope.mdZIndex = scope.mdZIndex || TOOLTIP_DEFAULT_Z_INDEX;\n      scope.mdDelay = scope.mdDelay || TOOLTIP_DEFAULT_SHOW_DELAY;\n      if (!TOOLTIP_DIRECTIONS[scope.mdDirection]) {\n        scope.mdDirection = TOOLTIP_DEFAULT_DIRECTION;\n      }\n    }\n\n    function addAriaLabel(labelText) {\n      // Only interpolate the text from the HTML element because otherwise the custom text could\n      // be interpolated twice and cause XSS violations.\n      var interpolatedText = labelText || $interpolate(element.text().trim())(scope.$parent);\n\n      // Only add the `aria-label` to the parent if there isn't already one, if there isn't an\n      // already present `aria-labelledby`, or if the previous `aria-label` was added by the\n      // tooltip directive.\n      if (\n        (!parent.attr('aria-label') && !parent.attr('aria-labelledby')) ||\n        parent.attr('md-labeled-by-tooltip')\n      ) {\n        parent.attr('aria-label', interpolatedText);\n\n        // Set the `md-labeled-by-tooltip` attribute if it has not already been set.\n        if (!parent.attr('md-labeled-by-tooltip')) {\n          parent.attr('md-labeled-by-tooltip', tooltipId);\n        }\n      }\n    }\n\n    function updatePosition() {\n      setDefaults();\n\n      // If the panel has already been created, remove the current origin\n      // class from the panel element.\n      if (panelRef && panelRef.panelEl) {\n        panelRef.panelEl.removeClass(origin);\n      }\n\n      // Set the panel element origin class based off of the current\n      // mdDirection.\n      origin = 'md-origin-' + scope.mdDirection;\n\n      // Create the position of the panel based off of the mdDirection.\n      position = TOOLTIP_DIRECTIONS[scope.mdDirection];\n\n      // Using the newly created position object, use the MdPanel\n      // panelPosition API to build the panel's position.\n      panelPosition = $mdPanel.newPanelPosition()\n          .relativeTo(parent)\n          .addPanelPosition(position.x, position.y);\n\n      // If the panel has already been created, add the new origin class to\n      // the panel element and update it's position with the panelPosition.\n      if (panelRef && panelRef.panelEl) {\n        panelRef.panelEl.addClass(origin);\n        panelRef.updatePosition(panelPosition);\n      }\n    }\n\n    function bindEvents() {\n      // Add a mutationObserver where there is support for it and the need\n      // for it in the form of viable host(parent[0]).\n      if (parent[0] && 'MutationObserver' in $window) {\n        // Use a mutationObserver to tackle #2602.\n        var attributeObserver = new MutationObserver(function(mutations) {\n          if (isDisabledMutation(mutations)) {\n            $mdUtil.nextTick(function() {\n              setVisible(false);\n            });\n          }\n        });\n\n        attributeObserver.observe(parent[0], {\n          attributes: true\n        });\n      }\n\n      elementFocusedOnWindowBlur = false;\n\n      $$mdTooltipRegistry.register('scroll', windowScrollEventHandler, true);\n      $$mdTooltipRegistry.register('blur', windowBlurEventHandler);\n      $$mdTooltipRegistry.register('resize', debouncedOnResize);\n\n      scope.$on('$destroy', onDestroy);\n\n      // To avoid 'synthetic clicks', we listen to mousedown instead of\n      // 'click'.\n      parent.on('mousedown', mousedownEventHandler);\n      parent.on(ENTER_EVENTS, enterEventHandler);\n\n      function isDisabledMutation(mutations) {\n        mutations.some(function(mutation) {\n          return mutation.attributeName === 'disabled' && parent[0].disabled;\n        });\n        return false;\n      }\n\n      function windowScrollEventHandler() {\n        setVisible(false);\n      }\n\n      function windowBlurEventHandler() {\n        elementFocusedOnWindowBlur = document.activeElement === parent[0];\n      }\n\n      function enterEventHandler($event) {\n        // Prevent the tooltip from showing when the window is receiving\n        // focus.\n        if ($event.type === 'focus' && elementFocusedOnWindowBlur) {\n          elementFocusedOnWindowBlur = false;\n        } else if (!scope.mdVisible) {\n          parent.on(LEAVE_EVENTS, leaveEventHandler);\n          setVisible(true);\n\n          // If the user is on a touch device, we should bind the tap away\n          // after the 'touched' in order to prevent the tooltip being\n          // removed immediately.\n          if ($event.type === 'touchstart') {\n            parent.one('touchend', function() {\n              $mdUtil.nextTick(function() {\n                $document.one('touchend', leaveEventHandler);\n              }, false);\n            });\n          }\n        }\n      }\n\n      function leaveEventHandler() {\n        autohide = scope.hasOwnProperty('mdAutohide') ?\n            scope.mdAutohide :\n            attr.hasOwnProperty('mdAutohide');\n\n        if (autohide || mouseActive ||\n            $document[0].activeElement !== parent[0]) {\n          // When a show timeout is currently in progress, then we have\n          // to cancel it, otherwise the tooltip will remain showing\n          // without focus or hover.\n          if (showTimeout) {\n            $timeout.cancel(showTimeout);\n            setVisible.queued = false;\n            showTimeout = null;\n          }\n\n          parent.off(LEAVE_EVENTS, leaveEventHandler);\n          parent.triggerHandler('blur');\n          setVisible(false);\n        }\n        mouseActive = false;\n      }\n\n      function mousedownEventHandler() {\n        mouseActive = true;\n      }\n\n      function onDestroy() {\n        $$mdTooltipRegistry.deregister('scroll', windowScrollEventHandler, true);\n        $$mdTooltipRegistry.deregister('blur', windowBlurEventHandler);\n        $$mdTooltipRegistry.deregister('resize', debouncedOnResize);\n\n        parent\n            .off(ENTER_EVENTS, enterEventHandler)\n            .off(LEAVE_EVENTS, leaveEventHandler)\n            .off('mousedown', mousedownEventHandler);\n\n        // Trigger the handler in case any of the tooltips are\n        // still visible.\n        leaveEventHandler();\n        attributeObserver && attributeObserver.disconnect();\n      }\n    }\n\n    function configureWatchers() {\n      if (element[0] && 'MutationObserver' in $window) {\n        var attributeObserver = new MutationObserver(function(mutations) {\n          mutations.forEach(function(mutation) {\n            if (mutation.attributeName === 'md-visible' &&\n                !scope.visibleWatcher) {\n              scope.visibleWatcher = scope.$watch('mdVisible',\n                  onVisibleChanged);\n            }\n          });\n        });\n\n        attributeObserver.observe(element[0], {\n          attributes: true\n        });\n\n        // Build watcher only if mdVisible is being used.\n        if (attr.hasOwnProperty('mdVisible')) {\n          scope.visibleWatcher = scope.$watch('mdVisible',\n              onVisibleChanged);\n        }\n      } else {\n        // MutationObserver not supported\n        scope.visibleWatcher = scope.$watch('mdVisible', onVisibleChanged);\n      }\n\n      // Direction watcher\n      scope.$watch('mdDirection', updatePosition);\n\n      // Clean up if the element or parent was removed via jqLite's .remove.\n      // A couple of notes:\n      //   - In these cases the scope might not have been destroyed, which\n      //     is why we destroy it manually. An example of this can be having\n      //     `md-visible=\"false\"` and adding tooltips while they're\n      //     invisible. If `md-visible` becomes true, at some point, you'd\n      //     usually get a lot of tooltips.\n      //   - We use `.one`, not `.on`, because this only needs to fire once.\n      //     If we were using `.on`, it would get thrown into an infinite\n      //     loop.\n      //   - This kicks off the scope's `$destroy` event which finishes the\n      //     cleanup.\n      element.one('$destroy', onElementDestroy);\n      parent.one('$destroy', onElementDestroy);\n      scope.$on('$destroy', function() {\n        setVisible(false);\n        panelRef && panelRef.destroy();\n        attributeObserver && attributeObserver.disconnect();\n        element.remove();\n      });\n\n      // Updates the aria-label when the element text changes. This watch\n      // doesn't need to be set up if the element doesn't have any data\n      // bindings.\n      if (element.text().indexOf($interpolate.startSymbol()) > -1) {\n        scope.$watch(function() {\n          return element.text().trim();\n        }, addAriaLabel);\n      }\n\n      function onElementDestroy() {\n        scope.$destroy();\n      }\n    }\n\n    function setVisible(value) {\n      // Break if passed value is already in queue or there is no queue and\n      // passed value is current in the controller.\n      if (setVisible.queued && setVisible.value === !!value ||\n          !setVisible.queued && scope.mdVisible === !!value) {\n        return;\n      }\n      setVisible.value = !!value;\n\n      if (!setVisible.queued) {\n        if (value) {\n          setVisible.queued = true;\n          showTimeout = $timeout(function() {\n            scope.mdVisible = setVisible.value;\n            setVisible.queued = false;\n            showTimeout = null;\n            if (!scope.visibleWatcher) {\n              onVisibleChanged(scope.mdVisible);\n            }\n          }, scope.mdDelay);\n        } else {\n          $mdUtil.nextTick(function() {\n            scope.mdVisible = false;\n            if (!scope.visibleWatcher) {\n              onVisibleChanged(false);\n            }\n          });\n        }\n      }\n    }\n\n    function onVisibleChanged(isVisible) {\n      isVisible ? showTooltip() : hideTooltip();\n    }\n\n    function showTooltip() {\n      // Do not show the tooltip if the text is empty.\n      if (!element[0].textContent.trim()) {\n        throw new Error('Text for the tooltip has not been provided. ' +\n            'Please include text within the mdTooltip element.');\n      }\n\n      if (!panelRef) {\n        var attachTo = angular.element(document.body);\n        var panelAnimation = $mdPanel.newPanelAnimation()\n            .openFrom(parent)\n            .closeTo(parent)\n            .withAnimation({\n              open: 'md-show',\n              close: 'md-hide'\n            });\n\n        var panelConfig = {\n          id: tooltipId,\n          attachTo: attachTo,\n          contentElement: element,\n          propagateContainerEvents: true,\n          panelClass: 'md-tooltip',\n          animation: panelAnimation,\n          position: panelPosition,\n          zIndex: scope.mdZIndex,\n          focusOnOpen: false,\n          onDomAdded: function() {\n            panelRef.panelEl.addClass(origin);\n          }\n        };\n\n        panelRef = $mdPanel.create(panelConfig);\n      }\n\n      panelRef.open().then(function() {\n        panelRef.panelEl.attr('role', 'tooltip');\n      });\n    }\n\n    function hideTooltip() {\n      panelRef && panelRef.close();\n    }\n  }\n\n}\n\n\n/**\n * Service that is used to reduce the amount of listeners that are being\n * registered on the `window` by the tooltip component. Works by collecting\n * the individual event handlers and dispatching them from a global handler.\n *\n * @ngInject\n */\nfunction MdTooltipRegistry() {\n  var listeners = {};\n  var ngWindow = angular.element(window);\n\n  return {\n    register: register,\n    deregister: deregister\n  };\n\n  /**\n   * Global event handler that dispatches the registered handlers in the\n   * service.\n   * @param {!Event} event Event object passed in by the browser\n   */\n  function globalEventHandler(event) {\n    if (listeners[event.type]) {\n      listeners[event.type].forEach(function(currentHandler) {\n        currentHandler.call(this, event);\n      }, this);\n    }\n  }\n\n  /**\n   * Registers a new handler with the service.\n   * @param {string} type Type of event to be registered.\n   * @param {!Function} handler Event handler.\n   * @param {boolean} useCapture Whether to use event capturing.\n   */\n  function register(type, handler, useCapture) {\n    var handlers = listeners[type] = listeners[type] || [];\n\n    if (!handlers.length) {\n      useCapture ? window.addEventListener(type, globalEventHandler, true) :\n          ngWindow.on(type, globalEventHandler);\n    }\n\n    if (handlers.indexOf(handler) === -1) {\n      handlers.push(handler);\n    }\n  }\n\n  /**\n   * Removes an event handler from the service.\n   * @param {string} type Type of event handler.\n   * @param {!Function} handler The event handler itself.\n   * @param {boolean} useCapture Whether the event handler used event capturing.\n   */\n  function deregister(type, handler, useCapture) {\n    var handlers = listeners[type];\n    var index = handlers ? handlers.indexOf(handler) : -1;\n\n    if (index > -1) {\n      handlers.splice(index, 1);\n\n      if (handlers.length === 0) {\n        useCapture ? window.removeEventListener(type, globalEventHandler, true) :\n            ngWindow.off(type, globalEventHandler);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/components/tooltip/tooltip.scss",
    "content": "$tooltip-fontsize-lg: 10px !default;\n$tooltip-fontsize-sm: 14px !default;\n$tooltip-height-lg: 22px !default;\n$tooltip-height-sm: 32px !default;\n$tooltip-top-margin-lg: 14px !default;\n$tooltip-top-margin-sm: 24px !default;\n$tooltip-lr-padding-lg: 8px !default;\n$tooltip-lr-padding-sm: 16px !default;\n$tooltip-max-width: 32px !default;\n\n.md-tooltip {\n  display: inline-block;\n  pointer-events: none;\n  border-radius: 4px;\n  overflow: hidden;\n  opacity: 0;\n  font-weight: 500;\n  font-size: $tooltip-fontsize-sm;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  height: $tooltip-height-sm;\n  line-height: $tooltip-height-sm;\n  padding-right: $tooltip-lr-padding-sm;\n  padding-left: $tooltip-lr-padding-sm;\n  &.md-origin-top {\n    transform-origin: center bottom;\n    margin-top: -$tooltip-top-margin-sm;\n  }\n  &.md-origin-right {\n    transform-origin: left center;\n    margin-left: $tooltip-top-margin-sm;\n  }\n  &.md-origin-bottom {\n    transform-origin: center top;\n    margin-top: $tooltip-top-margin-sm;\n  }\n  &.md-origin-left {\n    transform-origin: right center;\n    margin-left: -$tooltip-top-margin-sm;\n  }\n\n  @media (min-width: $layout-breakpoint-sm) {\n    font-size: $tooltip-fontsize-lg;\n    height: $tooltip-height-lg;\n    line-height: $tooltip-height-lg;\n    padding-right: $tooltip-lr-padding-lg;\n    padding-left: $tooltip-lr-padding-lg;\n    &.md-origin-top { margin-top: -$tooltip-top-margin-lg; }\n    &.md-origin-right { margin-left: $tooltip-top-margin-lg; }\n    &.md-origin-bottom { margin-top: $tooltip-top-margin-lg; }\n    &.md-origin-left { margin-left: -$tooltip-top-margin-lg; }\n  }\n\n  &.md-show-add {\n    transform: scale(0);\n  }\n  &.md-show {\n    transition: $swift-ease-out;\n    transition-duration: 150ms;\n    transform: scale(1);\n    opacity: 0.9;\n  }\n  &.md-hide {\n    transition: $swift-ease-in;\n    transition-duration: 150ms;\n    transform: scale(0);\n    opacity: 0;\n  }\n}\n"
  },
  {
    "path": "src/components/tooltip/tooltip.spec.js",
    "content": "describe('MdTooltip Component', function() {\n  var $compile, parentScope, $material, $timeout, $mdPanel, $$mdTooltipRegistry;\n  var element;\n\n  var injectLocals = function($injector) {\n    $compile = $injector.get('$compile');\n    parentScope = $injector.get('$rootScope').$new();\n    $material = $injector.get('$material');\n    $timeout = $injector.get('$timeout');\n    $mdPanel = $injector.get('$mdPanel');\n    $$mdTooltipRegistry = $injector.get('$$mdTooltipRegistry');\n  };\n\n  // Test filter for ensuring tooltip expressions are evaluated against the correct scope.\n  angular.module('fullNameFilter', []).filter('fullName', function() {\n    return function(user) {\n        // Intentionally dereference user without checking whether it is defined. Do not change!\n        return user.name.first + ' ' + user.name.last;\n    };\n  });\n\n  beforeEach(function() {\n    module(\n      'material.components.tooltip',\n      'material.components.button',\n      'fullNameFilter'\n    );\n\n    inject(injectLocals);\n  });\n\n  afterEach(function() {\n    // Make sure to remove/cleanup after each test.\n    element.remove();\n    var scope = element && element.scope();\n    scope && scope.$destroy;\n    element = undefined;\n  });\n\n  it('should support dynamic directions', function() {\n    expect(function() {\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip md-direction=\"{{direction}}\">Tooltip</md-tooltip>' +\n        '</md-button>'\n      );\n    }).not.toThrow();\n  });\n\n  it('should set the position to \"bottom\" if it is undefined', function() {\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip md-visible=\"true\">Tooltip</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(findTooltip()).toHaveClass('md-origin-bottom');\n  });\n\n  it('should not re-templatize tooltip content', function() {\n    parentScope.name = '{{2 + 2}}';\n\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip md-visible=\"true\">{{name}}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(findTooltip().text()).toBe('{{2 + 2}}');\n  });\n\n  it('should evaluate expressions against the parent scope', function() {\n    parentScope.user = {name: {first: 'Neil', last: 'Diamond'}};\n\n    // Using a filter that dereferences the user object multiple times will cause an error to be\n    // thrown if user is not given correctly.\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip md-visible=\"true\">{{user | fullName}}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(findTooltip().text()).toBe('Neil Diamond');\n  });\n\n  it('should preserve parent text', function() {\n    buildTooltip(\n      '<md-button>' +\n      'Hello' +\n      '<md-tooltip md-visible=\"testModel.isVisible\">Tooltip</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(element.text()).toBe('Hello');\n  });\n\n  it('should label parent', function() {\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip md-visible=\"testModel.isVisible\">' +\n      'Tooltip' +\n      '</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(element.attr('aria-label')).toEqual('Tooltip');\n    expect(element.attr('md-labeled-by-tooltip')).toBeDefined();\n  });\n\n  it('should not label the parent if it already has a label', function() {\n    buildTooltip(\n      '<md-button aria-label=\"Button Label\">' +\n      '<md-tooltip md-visible=\"testModel.isVisible\">' +\n      'Tooltip' +\n      '</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(element.attr('aria-label')).toEqual('Button Label');\n    expect(element.attr('md-labeled-by-tooltip')).toBeUndefined();\n  });\n\n  it('should not label the parent if it has already been labelled by ' +\n    'another element.', function() {\n    buildTooltip(\n      '<md-button aria-labelledby=\"button-1\">' +\n      '<md-tooltip md-visible=\"testModel.isVisible\">' +\n      'Tooltip' +\n      '</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(element.attr('aria-label')).toBeUndefined();\n    expect(element.attr('aria-labelledby')).toEqual('button-1');\n  });\n\n  it('should interpolate the aria-label', function() {\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip>{{ \"hello\" | uppercase }}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect(element.attr('aria-label')).toBe('HELLO');\n    expect(element.attr('md-labeled-by-tooltip')).toBeDefined();\n  });\n\n  it('should update the aria-label when the interpolated value changes', function() {\n    var labeledByTooltip;\n    var labeledByTooltip2;\n\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip>{{ testModel.ariaText }}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaText = 'test 1';\n    });\n\n    expect(element.attr('aria-label')).toBe('test 1');\n    labeledByTooltip = element.attr('md-labeled-by-tooltip');\n    expect(labeledByTooltip).toBeDefined();\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaText = 'test 2';\n    });\n\n    expect(element.attr('aria-label')).toBe('test 2');\n    labeledByTooltip2 = element.attr('md-labeled-by-tooltip');\n    expect(labeledByTooltip2).toEqual(labeledByTooltip);\n  });\n\n  it('should not update the parent aria-label when the interpolated' +\n    'value changes and the parent has a label that was not set by ' +\n    'the tooltip', function() {\n    buildTooltip(\n      '<md-button aria-label=\"Button Label\">' +\n      '<md-tooltip>{{ testModel.ariaText }}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaText = 'test 1';\n    });\n\n    expect(element.attr('aria-label')).toBe('Button Label');\n    expect(element.attr('md-labeled-by-tooltip')).toBeUndefined();\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaText = 'test 2';\n    });\n\n    expect(element.attr('aria-label')).toBe('Button Label');\n    expect(element.attr('md-labeled-by-tooltip')).toBeUndefined();\n  });\n\n  it('should not interpolate interpolated values', function() {\n    var labeledByTooltip;\n    var labeledByTooltip2;\n\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip>{{ testModel.ariaTest }}</md-tooltip>' +\n      '</md-button>'\n    );\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaTest = 'test {{1+1}}';\n    });\n\n    expect(element.attr('aria-label')).toBe('test {{1+1}}');\n    labeledByTooltip = element.attr('md-labeled-by-tooltip');\n    expect(labeledByTooltip).toBeDefined();\n\n    parentScope.$apply(function() {\n      parentScope.testModel.ariaTest = 'test {{1+1336}}';\n    });\n\n    expect(element.attr('aria-label')).toBe('test {{1+1336}}');\n    labeledByTooltip2 = element.attr('md-labeled-by-tooltip');\n    expect(labeledByTooltip2).toEqual(labeledByTooltip);\n  });\n\n  it('should not set parent to items with no pointer events',\n    inject(function($window) {\n      spyOn($window, 'getComputedStyle').and.callFake(function(el) {\n        return {'pointer-events': el ? 'none' : ''};\n      });\n\n      buildTooltip(\n        '<outer>' +\n        '<inner>' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        'Hello world' +\n        '</md-tooltip>' +\n        '</inner>' +\n        '</outer>'\n      );\n\n      triggerEvent('mouseenter', true);\n      expect(parentScope.testModel.isVisible).toBeUndefined();\n    }));\n\n  it('should show after tooltipDelay ms', function() {\n    buildTooltip(\n      '<md-button>' +\n      'Hello' +\n      '<md-tooltip md-visible=\"testModel.isVisible\" md-delay=\"99\">' +\n      'Tooltip' +\n      '</md-tooltip>' +\n      '</md-button>'\n    );\n\n    triggerEvent('focus', true);\n    expect(parentScope.testModel.isVisible).toBeFalsy();\n\n    // Wait 1 below delay, nothing should happen\n    $timeout.flush(98);\n    expect(parentScope.testModel.isVisible).toBeFalsy();\n\n    // Total 300 == tooltipDelay\n    $timeout.flush(1);\n    expect(parentScope.testModel.isVisible).toBe(true);\n  });\n\n  it('should register itself with the $$mdTooltipRegistry', function() {\n    spyOn($$mdTooltipRegistry, 'register');\n\n    buildTooltip(\n      '<md-button>' +\n      '<md-tooltip>Tooltip</md-tooltip>' +\n      '</md-button>'\n    );\n\n    expect($$mdTooltipRegistry.register).toHaveBeenCalled();\n  });\n\n  describe('show and hide', function() {\n    it('should show and hide when visible is set', function() {\n      expect(findTooltip().length).toBe(0);\n\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        'Tooltip' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      showTooltip(true);\n\n      expect(findTooltip().length).toBe(1);\n      expect(findTooltip().hasClass('md-show')).toBe(true);\n\n      showTooltip(false);\n\n      expect(findTooltip().length).toBe(1);\n      expect(findTooltip().hasClass('md-hide')).toBe(true);\n    });\n\n    it('should set visible on mouseenter and mouseleave', function() {\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        'Tooltip' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      triggerEvent('mouseenter');\n      expect(parentScope.testModel.isVisible).toBe(true);\n\n      triggerEvent('mouseleave');\n      expect(parentScope.testModel.isVisible).toBe(false);\n    });\n\n    it('should toggle visibility on the next touch',\n      inject(function($document) {\n        buildTooltip(\n          '<md-button>' +\n          'Hello' +\n          '<md-tooltip md-visible=\"testModel.isVisible\">' +\n          'Tooltip' +\n          '</md-tooltip>' +\n          '</md-button>'\n        );\n\n        triggerEvent('touchstart');\n        expect(parentScope.testModel.isVisible).toBe(true);\n        triggerEvent('touchend');\n\n        $document.triggerHandler('touchend');\n        $timeout.flush();\n        expect(parentScope.testModel.isVisible).toBe(false);\n      }));\n\n    it('should cancel when mouseleave was before the delay', function() {\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip ' +\n        'md-delay=\"99\" ' +\n        'md-autohide ' +\n        'md-visible=\"testModel.isVisible\">' +\n        'Tooltip' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      triggerEvent('mouseenter', true);\n      expect(parentScope.testModel.isVisible).toBeFalsy();\n\n      triggerEvent('mouseleave', true);\n      expect(parentScope.testModel.isVisible).toBeFalsy();\n\n      // Total 99 == tooltipDelay\n      $timeout.flush(99);\n\n      expect(parentScope.testModel.isVisible).toBe(false);\n    });\n\n    it('should throw when the tooltip text is empty', function() {\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        '{{ textContent }}' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      expect(function() {\n        showTooltip(true);\n      }).toThrow();\n    });\n\n    it('should set visible on focus and blur', function() {\n      buildTooltip(\n        '<md-button>' +\n        'Hello' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        'Tooltip' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      triggerEvent('focus');\n      expect(parentScope.testModel.isVisible).toBe(true);\n\n      triggerEvent('blur');\n      expect(parentScope.testModel.isVisible).toBe(false);\n    });\n\n    it('should not be visible on mousedown and then mouseleave',\n      inject(function($document) {\n        buildTooltip(\n          '<md-button>' +\n          'Hello' +\n          '<md-tooltip md-visible=\"testModel.isVisible\">' +\n          'Tooltip' +\n          '</md-tooltip>' +\n          '</md-button>'\n        );\n\n        // Append element to DOM so it can be set as activeElement.\n        $document[0].body.appendChild(element[0]);\n        element[0].focus();\n        triggerEvent('focus,mousedown');\n\n        expect($document[0].activeElement).toBe(element[0]);\n        expect(parentScope.testModel.isVisible).toBe(true);\n\n        triggerEvent('mouseleave');\n        expect(parentScope.testModel.isVisible).toBe(false);\n\n        // Clean up document.body.\n        // element.remove();\n      }));\n\n    it('should not be visible when the window is refocused',\n      inject(function($window, $document) {\n        buildTooltip(\n          '<md-button>' +\n          'Hello' +\n          '<md-tooltip md-visible=\"testModel.isVisible\">' +\n          'Tooltip' +\n          '</md-tooltip>' +\n          '</md-button>'\n        );\n\n        // Append element to DOM so it can be set as activeElement.\n        $document[0].body.appendChild(element[0]);\n        element[0].focus();\n        triggerEvent('focus,mousedown');\n        expect(document.activeElement).toBe(element[0]);\n\n        triggerEvent('mouseleave');\n\n        // Simulate tabbing away.\n        angular.element($window).triggerHandler('blur');\n\n        // Simulate focus event that occurs when tabbing back to the window.\n        triggerEvent('focus');\n        expect(parentScope.testModel.isVisible).toBe(false);\n\n        // Clean up document.body.\n        $document[0].body.removeChild(element[0]);\n      }));\n  });\n\n  describe('cleanup', function() {\n    it('should clean up if the parent scope was destroyed', function() {\n      buildTooltip(\n        '<md-button>' +\n        '<md-tooltip md-visible=\"true\">Tooltip</md-tooltip>' +\n        '</md-button>'\n      );\n      var tooltip = findTooltip();\n\n      expect(tooltip.length).toBe(1);\n      expect(tooltip.scope()).toBeTruthy();\n\n      element.scope().$destroy();\n      expect(tooltip.scope()).toBeUndefined();\n      expect(findTooltip().length).toBe(0);\n    });\n\n    it('should remove the tooltip when its own scope is destroyed', function() {\n      buildTooltip(\n        '<md-button>' +\n        '<md-tooltip md-visible=\"true\">Tooltip</md-tooltip>' +\n        '</md-button>'\n      );\n      var tooltip = findTooltip();\n\n      expect(tooltip.length).toBe(1);\n      tooltip.scope().$destroy();\n      expect(findTooltip().length).toBe(0);\n    });\n\n    it('should remove itself from the $$mdTooltipRegistry when the parent ' +\n      'scope is destroyed', function() {\n      buildTooltip(\n        '<md-button>' +\n        '<md-tooltip md-visible=\"true\">Tooltip</md-tooltip>' +\n        '</md-button>'\n      );\n\n      spyOn($$mdTooltipRegistry, 'deregister');\n      element.scope().$destroy();\n      expect($$mdTooltipRegistry.deregister).toHaveBeenCalled();\n    });\n\n    it('should not re-appear if it was outside the DOM when the parent was ' +\n      'removed', function() {\n      buildTooltip(\n        '<md-button>' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">' +\n        'Tooltip' +\n        '</md-tooltip>' +\n        '</md-button>'\n      );\n\n      showTooltip(false);\n      expect(findTooltip().length).toBe(0);\n\n      element.remove();\n      showTooltip(true);\n      expect(findTooltip().length).toBe(0);\n    });\n\n    it('should unbind the parent listeners when it gets destroyed', function() {\n      buildTooltip(\n        '<md-button>' +\n        '<md-tooltip md-visible=\"testModel.isVisible\">Tooltip</md-tooltip>' +\n        '</md-button>'\n      );\n\n      triggerEvent('focus');\n      expect(parentScope.testModel.isVisible).toBe(true);\n\n      element.remove();\n      triggerEvent('blur mouseleave touchend touchcancel');\n      expect(parentScope.testModel.isVisible).toBe(true);\n    });\n  });\n\n  // ******************************************************\n  // Internal Utility methods\n  // ******************************************************\n\n  function buildTooltip(markup) {\n    element = $compile(markup)(parentScope);\n    parentScope.testModel = {};\n\n    parentScope.$apply();\n    $material.flushOutstandingAnimations();\n\n    return element;\n  }\n\n  function showTooltip(isVisible) {\n    if (angular.isUndefined(isVisible)) {\n      isVisible = true;\n    }\n    parentScope.testModel.isVisible = !!isVisible;\n    parentScope.$apply();\n    $material.flushOutstandingAnimations();\n  }\n\n  function findTooltip() {\n    return angular.element(document.querySelector('.md-tooltip'));\n  }\n\n  function triggerEvent(eventType, skipFlush) {\n    angular.forEach(eventType.split(','), function(name) {\n      element.triggerHandler(name);\n    });\n    !skipFlush && $timeout.flush();\n  }\n});\n\n// ******************************************************\n// mdTooltipRegistry Testing\n// ******************************************************\n\ndescribe('$$mdTooltipRegistry service', function() {\n  var tooltipRegistry, ngWindow;\n\n  beforeEach(function() {\n    module('material.components.tooltip');\n\n    inject(function($$mdTooltipRegistry, $window) {\n      tooltipRegistry = $$mdTooltipRegistry;\n      ngWindow = angular.element($window);\n    });\n  });\n\n  it('should allow for registering event handlers on the window', function() {\n    var obj = {\n      callback: function() {\n      }\n    };\n\n    spyOn(obj, 'callback');\n    tooltipRegistry.register('resize', obj.callback);\n    ngWindow.triggerHandler('resize');\n\n    // check that the callback was triggered\n    expect(obj.callback).toHaveBeenCalled();\n\n    // check that the event object was passed\n    expect(obj.callback.calls.mostRecent().args[0]).toBeTruthy();\n  });\n\n  it('should allow deregistering of the callbacks', function() {\n    var obj = {\n      callback: function() {\n      }\n    };\n\n    spyOn(obj, 'callback');\n    tooltipRegistry.register('resize', obj.callback);\n    ngWindow.triggerHandler('resize');\n    expect(obj.callback).toHaveBeenCalledTimes(1);\n\n    tooltipRegistry.deregister('resize', obj.callback);\n    ngWindow.triggerHandler('resize');\n    expect(obj.callback).toHaveBeenCalledTimes(1);\n  });\n});\n"
  },
  {
    "path": "src/components/truncate/demoBasicUsage/index.html",
    "content": "<div>\n\n  <div layout-padding>\n    <p>\n      The <code>md-truncate</code> component can be used within a wide range of existing Material\n      components and supports multiple layout scenarios.\n    </p>\n\n    <div>\n      <md-toolbar class=\"md-accent\">\n        <div class=\"md-toolbar-tools\">\n          <md-truncate flex>\n            Here is an awesome title that will shrink and overflow.\n          </md-truncate>\n\n          <md-button class=\"md-icon-button md-fab-mini\" aria-label=\"Favorite\">\n            <md-icon md-svg-icon=\"img/icons/favorite.svg\"></md-icon>\n          </md-button>\n        </div>\n      </md-toolbar>\n    </div>\n\n    <p>\n      Note the Toolbar above which uses flex to grow and shrink, or the fake app below which uses\n      absolute positioning.\n    </p>\n\n    <div id=\"fake-app\">\n      <div class=\"sidebar\">\n        <md-icon md-svg-icon=\"img/icons/menu.svg\" aria-label=\"Menu\"></md-icon>\n        <md-icon md-svg-icon=\"img/icons/favorite.svg\" aria-label=\"Favorites\"></md-icon>\n        <md-icon md-svg-icon=\"img/icons/more_vert.svg\" aria-label=\"More Options\"></md-icon>\n      </div>\n\n      <div class=\"app-body\">\n        <h2 md-truncate>My Awesome Application - Page Title</h2>\n\n        <p>\n          Did you know?\n        </p>\n\n        <p>\n          Bacon ipsum dolor amet ground round landjaeger kielbasa fatback biltong hamburger shankle\n          shank tenderloin short loin pork. Chicken spare ribs meatball ball tip. Turducken pancetta\n          shank filet mignon ham boudin. Drumstick kevin pork chop ham meatloaf venison. Doner\n          turducken pastrami ham. Fatback beef meatball pork chop.\n        </p>\n\n        <p>\n          Pastrami turducken spare ribs short ribs. Leberkas pork loin ham hock landjaeger.\n          Porchetta pork chop ham hock turducken beef leberkas. Drumstick pork belly alcatra,\n          andouille meatball salami chuck hamburger ham hock t-bone ham swine cow cupim jerky.\n        </p>\n\n        <p>\n          Landjaeger pastrami pork chop hamburger swine jowl beef ribs. Alcatra ball tip short loin\n          flank picanha ground round tri-tip porchetta biltong fatback frankfurter swine. Shankle\n          flank short ribs capicola. Frankfurter tongue sausage meatball rump fatback strip steak\n          tenderloin swine venison. Tongue bacon cupim fatback ham.\n        </p>\n      </div>\n\n      <div class=\"rightbar\">\n        <p>\n          Here is some fantastic information about your application!\n        </p>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/truncate/demoBasicUsage/style.scss",
    "content": "#fake-app {\n  position: relative;\n  height: 400px;\n  width: 400px;\n  margin-left: auto;\n  margin-right: auto;\n\n  border: 1px solid #333;\n\n  .sidebar {\n    position: absolute;\n    width: 50px;\n    left: 0;\n    top: 0;\n    bottom: 0;\n\n    background-color: #333;\n\n    md-icon {\n      display: block;\n      color: #ddd;\n      margin-top: 15px;\n    }\n  }\n\n  .app-body {\n    position: absolute;\n    left: 50px;\n    right: 100px;\n    top: 0;\n    bottom: 0;\n\n    background-color: white;\n    padding: 10px;\n    overflow: auto;\n  }\n\n  .rightbar {\n    position: absolute;\n    width: 100px;\n    right: 0;\n    top: 0;\n    bottom: 0;\n\n    background: #ddd;\n    padding: 10px;\n  }\n}"
  },
  {
    "path": "src/components/truncate/truncate.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.truncate\n */\nangular.module('material.components.truncate', ['material.core'])\n  .directive('mdTruncate', MdTruncateDirective);\n\n/**\n * @ngdoc directive\n * @name mdTruncate\n * @module material.components.truncate\n * @restrict AE\n * @description\n *\n * The `md-truncate` component displays a label that will automatically clip text which is wider\n * than the component. By default, it displays an ellipsis, but you may apply the `md-clip` CSS\n * class to override this default and use a standard \"clipping\" approach.\n *\n * <i><b>Note:</b> The `md-truncate` component does not automatically adjust it's width. You must\n * provide the `flex` attribute, or some other CSS-based width management. See the\n * <a ng-href=\"./demo/truncate\">demos</a> for examples.</i>\n *\n * @usage\n *\n * ### As an Element\n *\n * <hljs lang=\"html\">\n *   <div layout=\"row\">\n *     <md-button>Back</md-button>\n *\n *     <md-truncate flex>Chapter 1 - The Way of the Old West</md-truncate>\n *\n *     <md-button>Forward</md-button>\n *   </div>\n * </hljs>\n *\n * ### As an Attribute\n *\n * <hljs lang=\"html\">\n *   <h2 md-truncate style=\"max-width: 100px;\">Some Title With a Lot of Text</h2>\n * </hljs>\n *\n * ## CSS & Styles\n *\n * `<md-truncate>` provides two CSS classes that you may use to control the type of clipping.\n *\n * <i><b>Note:</b> The `md-truncate` also applies a setting of `width: 0;` when used with the `flex`\n * attribute to fix an issue with the flex element not shrinking properly.</i>\n *\n * <div>\n * <docs-css-api-table>\n *\n *   <docs-css-selector code=\".md-ellipsis\">\n *     Assigns the \"ellipsis\" behavior (default) which will cut off mid-word and append an ellipsis\n *     (&hellip;) to the end of the text.\n *   </docs-css-selector>\n *\n *   <docs-css-selector code=\".md-clip\">\n *     Assigns the \"clipping\" behavior which will simply chop off the text. This may happen\n *     mid-word or even mid-character.\n *   </docs-css-selector>\n *\n * </docs-css-api-table>\n * </div>\n */\nfunction MdTruncateDirective() {\n  return {\n    restrict: 'AE',\n\n    controller: MdTruncateController\n  };\n}\n\n/**\n * Controller for the <md-truncate> component.\n *\n * @param $element The md-truncate element.\n *\n * @constructor\n * @ngInject\n */\nfunction MdTruncateController($element) {\n  $element.addClass('md-truncate');\n}\n"
  },
  {
    "path": "src/components/truncate/truncate.scss",
    "content": ".md-truncate {\n  overflow: hidden;\n  white-space: nowrap;\n\n  // Default overflow is ellipsis\n  text-overflow: ellipsis;\n\n  // Allow override to use clipping\n  &.md-clip {\n    text-overflow: clip;\n  }\n\n  // This is a flex-specific hack that forces the element to only take up available space.\n  &.flex {\n    width: 0;\n  }\n}"
  },
  {
    "path": "src/components/truncate/truncate.spec.js",
    "content": "describe('<md-truncate>', function() {\n  var $compile, $rootScope;\n\n  beforeEach(module('material.components.truncate'));\n  beforeEach(inject(function(_$compile_, _$rootScope_) {\n    $compile = _$compile_;\n    $rootScope = _$rootScope_;\n  }));\n\n  it('works as an element', function() {\n    var el = setup('<md-truncate>Test</md-truncate>');\n\n    expect(el).toHaveClass('md-truncate');\n  });\n\n  it('works as an attribute', function() {\n    var el = setup('<h2 md-truncate>Test</h2>');\n\n    expect(el).toHaveClass('md-truncate');\n  });\n\n  function setup(template) {\n    var element = $compile(template)($rootScope);\n\n    $rootScope.$digest();\n\n    return element;\n  }\n});"
  },
  {
    "path": "src/components/virtualRepeat/demoDeferredLoading/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" ng-cloak>\n  <md-content layout=\"column\">\n    <p>\n       Display a list of 50,000 items that load on demand in a viewport of only 7 rows (height=40px).\n       <br/><br/>\n       This demo shows scroll and rendering performance gains when using <code>md-virtual-repeat</code>;\n       achieved with the dynamic reuse of rows visible in the viewport area. Developers are required to\n       explicitly use <code>md-virtual-repeat-container</code> as a wrapping parent container.\n       <br/><br/>\n       To enable load-on-demand behavior, developers must pass in a custom instance of\n       mdVirtualRepeatModel (see the example's source for more info).\n    </p>\n\n    <md-virtual-repeat-container id=\"vertical-container\">\n      <div md-virtual-repeat=\"item in ctrl.dynamicItems\" md-on-demand\n          class=\"repeated-item\" flex>\n        {{item}}\n      </div>\n    </md-virtual-repeat-container>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/virtualRepeat/demoDeferredLoading/script.js",
    "content": "(function () {\n  'use strict';\n\n    angular\n      .module('virtualRepeatDeferredLoadingDemo', ['ngMaterial'])\n      .controller('AppCtrl', function($timeout) {\n\n        // In this example, we set up our model using a class.\n        // Using a plain object works too. All that matters\n        // is that we implement getItemAtIndex and getLength.\n        var DynamicItems = function() {\n          /**\n           * @type {!Object<?Array>} Data pages, keyed by page number (0-index).\n           */\n          this.loadedPages = {};\n\n          /** @type {number} Total number of items. */\n          this.numItems = 0;\n\n          /** @const {number} Number of items to fetch per request. */\n          this.PAGE_SIZE = 50;\n\n          this.fetchNumItems_();\n        };\n\n        // Required.\n        DynamicItems.prototype.getItemAtIndex = function(index) {\n          var pageNumber = Math.floor(index / this.PAGE_SIZE);\n          var page = this.loadedPages[pageNumber];\n\n          if (page) {\n            return page[index % this.PAGE_SIZE];\n          } else if (page !== null) {\n            this.fetchPage_(pageNumber);\n          }\n        };\n\n        // Required.\n        DynamicItems.prototype.getLength = function() {\n          return this.numItems;\n        };\n\n        DynamicItems.prototype.fetchPage_ = function(pageNumber) {\n          // Set the page to null so we know it is already being fetched.\n          this.loadedPages[pageNumber] = null;\n\n          // For demo purposes, we simulate loading more items with a timed\n          // promise. In real code, this function would likely contain an\n          // $http request.\n          $timeout(angular.noop, 300).then(angular.bind(this, function() {\n            this.loadedPages[pageNumber] = [];\n            var pageOffset = pageNumber * this.PAGE_SIZE;\n            for (var i = pageOffset; i < pageOffset + this.PAGE_SIZE; i++) {\n              this.loadedPages[pageNumber].push(i);\n            }\n          }));\n        };\n\n        DynamicItems.prototype.fetchNumItems_ = function() {\n          // For demo purposes, we simulate loading the item count with a timed\n          // promise. In real code, this function would likely contain an\n          // $http request.\n          $timeout(angular.noop, 300).then(angular.bind(this, function() {\n            this.numItems = 50000;\n          }));\n        };\n\n        this.dynamicItems = new DynamicItems();\n      });\n})();\n"
  },
  {
    "path": "src/components/virtualRepeat/demoDeferredLoading/style.css",
    "content": "#vertical-container {\n  height: 292px;\n  width: 100%;\n  max-width: 400px;\n}\n\n.repeated-item {\n  border-bottom: 1px solid #ddd;\n  box-sizing: border-box;\n  height: 40px;\n  padding-top: 10px;\n}\n\nmd-content {\n  margin: 16px;\n}\n\nmd-virtual-repeat-container {\n  border: solid 1px grey;\n}\n\n.md-virtual-repeat-container .md-virtual-repeat-offsetter div {\n  padding-left: 16px;\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/demoHorizontalUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" ng-cloak>\n  <md-content layout=\"column\">\n    <p>\n       Display 1000 item in a virtual-list with viewport of only 16 columns (width=50px).\n       <br/><br/>\n       This demo shows scroll and rendering performance gains when using <code>md-virtual-repeat</code>;\n       achieved with the dynamic reuse of rows visible in the viewport area. Developers are required to\n       explicitly use <code>md-virtual-repeat-container</code> as a wrapping parent container.\n    </p>\n\n    <md-virtual-repeat-container id=\"horizontal-container\" md-orient-horizontal>\n      <div md-virtual-repeat=\"item in ctrl.items\"\n          class=\"repeated-item\" flex>\n        {{item}}\n      </div>\n    </md-virtual-repeat-container>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/virtualRepeat/demoHorizontalUsage/script.js",
    "content": "(function () {\n  'use strict';\n\n    angular\n      .module('virtualRepeatHorizontalDemo', ['ngMaterial'])\n      .controller('AppCtrl', function() {\n        this.items = [];\n        for (var i = 0; i < 1000; i++) {\n          this.items.push(i);\n        }\n      });\n\n})();\n"
  },
  {
    "path": "src/components/virtualRepeat/demoHorizontalUsage/style.css",
    "content": "#horizontal-container {\n  height: 100px;\n  width: 100%;\n  max-width: 830px;\n}\n\n.repeated-item {\n  border-right: 1px solid #ddd;\n  box-sizing: border-box;\n  display: inline-block;\n  height: 84px;\n  padding-top: 35px;\n  text-align: center;\n  width: 50px;\n}\n\nmd-content {\n  margin: 16px;\n}\n\nmd-virtual-repeat-container {\n  border: solid 1px grey;\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/demoInfiniteScroll/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" ng-cloak>\n  <md-content layout=\"column\">\n    <p>\n       Display an infinitely growing list of items in a viewport of only 7 rows (height=40px).\n       <br/><br/>\n       This demo shows scroll and rendering performance gains when using <code>md-virtual-repeat</code>;\n       achieved with the dynamic reuse of rows visible in the viewport area. Developers are required to\n       explicitly use <code>md-virtual-repeat-container</code> as a wrapping parent container.\n       <br/><br/>\n       To enable infinite scroll behavior, developers must pass in a custom instance of\n       mdVirtualRepeatModel (see the example's source for more info).\n    </p>\n\n    <md-virtual-repeat-container id=\"vertical-container\">\n      <div md-virtual-repeat=\"item in ctrl.infiniteItems\" md-on-demand\n          class=\"repeated-item\" flex>\n        {{item}}\n      </div>\n    </md-virtual-repeat-container>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/virtualRepeat/demoInfiniteScroll/script.js",
    "content": "(function () {\n  'use strict';\n\n    angular\n      .module('virtualRepeatInfiniteScrollDemo', ['ngMaterial'])\n      .controller('AppCtrl', function($timeout) {\n\n        // In this example, we set up our model using a plain object.\n        // Using a class works too. All that matters is that we implement\n        // getItemAtIndex and getLength.\n        this.infiniteItems = {\n          numLoaded_: 0,\n          toLoad_: 0,\n\n          // Required.\n          getItemAtIndex: function(index) {\n            if (index > this.numLoaded_) {\n              this.fetchMoreItems_(index);\n              return null;\n            }\n\n            return index;\n          },\n\n          // Required.\n          // For infinite scroll behavior, we always return a slightly higher\n          // number than the previously loaded items.\n          getLength: function() {\n            return this.numLoaded_ + 5;\n          },\n\n          fetchMoreItems_: function(index) {\n            // For demo purposes, we simulate loading more items with a timed\n            // promise. In real code, this function would likely contain an\n            // $http request.\n\n            if (this.toLoad_ < index) {\n              this.toLoad_ += 20;\n              $timeout(angular.noop, 300).then(angular.bind(this, function() {\n                this.numLoaded_ = this.toLoad_;\n              }));\n            }\n          }\n        };\n      });\n\n})();\n"
  },
  {
    "path": "src/components/virtualRepeat/demoInfiniteScroll/style.css",
    "content": "#vertical-container {\n  height: 292px;\n  width: 100%;\n  max-width: 400px;\n}\n\n.repeated-item {\n  border-bottom: 1px solid #ddd;\n  box-sizing: border-box;\n  height: 40px;\n  padding-top: 10px;\n}\n\nmd-content {\n  margin: 16px;\n}\n\nmd-virtual-repeat-container {\n  border: solid 1px grey;\n}\n\n.md-virtual-repeat-container .md-virtual-repeat-offsetter div {\n  padding-left: 16px;\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/demoScrollTo/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\">\n  <md-content layout=\"column\" class=\"md-padding\">\n    <p>\n      Use the <code>md-top-index</code> attribute to watch which item is at the top of the scroll\n      container, and also to jump to a specific item.\n    </p>\n\n    <div class=\"wrapper\">\n      <md-input-container>\n        <md-select ng-model=\"ctrl.selectedYear\" aria-label=\"Select a Year\">\n          <md-option ng-value=\"$index\" ng-repeat=\"year in ctrl.years\">{{ year }}</md-option>\n        </md-select>\n      </md-input-container>\n\n      <md-virtual-repeat-container id=\"vertical-container\" md-top-index=\"ctrl.topIndex\">\n        <div md-virtual-repeat=\"item in ctrl.items\"\n            class=\"repeated-item\" ng-class=\"{header: item.header}\" flex>\n          {{item.text}}\n        </div>\n      </md-virtual-repeat-container>\n    </div>\n\n  </md-content>\n</div>"
  },
  {
    "path": "src/components/virtualRepeat/demoScrollTo/script.js",
    "content": "(function () {\n  'use strict';\n\n    angular\n      .module('virtualRepeatScrollToDemo', ['ngMaterial'])\n      .controller('AppCtrl', function($scope) {\n        this.selectedYear = 0;\n        this.years = [];\n        this.items = [];\n        var currentYear = new Date().getFullYear();\n        var monthNames = ['January', 'February', 'March', 'April', 'May', 'June',\n          'July', 'August', 'September', 'October', 'November', 'December'];\n        // Build a list of months over 20 years\n        for (var y = currentYear; y >= (currentYear-20); y--) {\n          this.years.push(y);\n          this.items.push({year: y, text: y, header: true});\n          for (var m = 11; m >= 0; m--) {\n            this.items.push({year: y, month: m, text: monthNames[m]});\n          }\n        }\n        // Whenever a different year is selected, scroll to that year\n        $scope.$watch('ctrl.selectedYear', angular.bind(this, function(yearIndex) {\n          var scrollYear = Math.floor(this.topIndex / 13);\n          if (scrollYear !== yearIndex) {\n            this.topIndex = yearIndex * 13;\n          }\n        }));\n        // The selected year should follow the year that is at the top of the scroll container\n        $scope.$watch('ctrl.topIndex', angular.bind(this, function(topIndex) {\n          var scrollYear = Math.floor(topIndex / 13);\n          this.selectedYear = scrollYear;\n        }));\n      });\n\n})();\n"
  },
  {
    "path": "src/components/virtualRepeat/demoScrollTo/style.css",
    "content": ".wrapper {\n  width: 100%;\n  max-width: 400px;\n}\n\n#vertical-container {\n  height: 292px;\n  width: 100%;\n  max-width: 400px;\n}\n\n#vertical-container .repeated-item {\n  border-bottom: 1px solid #ddd;\n  box-sizing: border-box;\n  height: 40px;\n  padding-top: 10px;\n}\n\n#vertical-container .repeated-item.header {\n    background-color: #106CC8;\n    color: white;\n    text-align: center;\n    font-weight: bold;\n}\n\n#vertical-container md-content {\n  margin: 16px;\n}\n\nmd-virtual-repeat-container {\n  border: solid 1px grey;\n}\n\n.md-virtual-repeat-container .md-virtual-repeat-offsetter div:not(.header) {\n  padding-left: 16px;\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/demoVerticalUsage/index.html",
    "content": "<div ng-controller=\"AppCtrl as ctrl\" ng-cloak>\n  <md-content layout=\"column\">\n    <p>\n       Display 1000 item in a virtual-list with viewport of only 7 rows (height=40px).\n       <br/><br/>\n       This demo shows scroll and rendering performance gains when using <code>md-virtual-repeat</code>;\n       achieved with the dynamic reuse of rows visible in the viewport area. Developers are required to\n       explicitly use <code>md-virtual-repeat-container</code> as a wrapping parent container.\n    </p>\n\n    <md-virtual-repeat-container id=\"vertical-container\">\n      <div md-virtual-repeat=\"item in ctrl.items\"\n          class=\"repeated-item\" flex>\n        {{item}}\n      </div>\n    </md-virtual-repeat-container>\n  </md-content>\n\n</div>\n"
  },
  {
    "path": "src/components/virtualRepeat/demoVerticalUsage/script.js",
    "content": "(function () {\n  'use strict';\n\n    angular\n      .module('virtualRepeatVerticalDemo', ['ngMaterial'])\n      .controller('AppCtrl', function() {\n        this.items = [];\n        for (var i = 0; i < 1000; i++) {\n          this.items.push(i);\n        }\n      });\n\n})();\n"
  },
  {
    "path": "src/components/virtualRepeat/demoVerticalUsage/style.css",
    "content": "#vertical-container {\n  height: 292px;\n  width: 100%;\n  max-width: 400px;\n}\n\n.repeated-item {\n  border-bottom: 1px solid #ddd;\n  box-sizing: border-box;\n  height: 40px;\n  padding-top: 10px;\n}\n\nmd-content {\n  margin: 16px;\n}\n\nmd-virtual-repeat-container {\n  border: solid 1px grey;\n}\n\n.md-virtual-repeat-container .md-virtual-repeat-offsetter div {\n  padding-left: 16px;\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/virtual-repeater.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.virtualRepeat\n */\nangular.module('material.components.virtualRepeat', [\n  'material.core',\n  'material.components.showHide'\n])\n.directive('mdVirtualRepeatContainer', VirtualRepeatContainerDirective)\n.directive('mdVirtualRepeat', VirtualRepeatDirective)\n.directive('mdForceHeight', ForceHeightDirective);\n\n\n/**\n * @ngdoc directive\n * @name mdVirtualRepeatContainer\n * @module material.components.virtualRepeat\n * @restrict E\n * @description\n * `md-virtual-repeat-container` provides the scroll container for\n * <a ng-href=\"api/directive/mdVirtualRepeat\">md-virtual-repeat</a>.\n *\n * VirtualRepeat is a limited substitute for `ng-repeat` that renders only\n * enough DOM nodes to fill the container, recycling them as the user scrolls.\n *\n * Once an element is not visible anymore, the Virtual Repeat recycles the element and reuses it\n * for another visible item by replacing the previous data set with the set of currently visible\n * elements.\n *\n * ### Common Issues\n *\n * - When having one-time bindings inside of the view template, the Virtual Repeat will not properly\n *   update the bindings for new items, since the view will be recycled.\n * - Directives inside of a Virtual Repeat will be only compiled (linked) once, because those\n *   items will be recycled and used for other items.\n *   The Virtual Repeat just updates the scope bindings.\n *\n *\n * ### Notes\n *\n * > The VirtualRepeat is a similar implementation to the Android\n * [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html).\n *\n * <!-- This comment forces a break between blockquotes //-->\n *\n * > Please also review the <a ng-href=\"api/directive/mdVirtualRepeat\">mdVirtualRepeat</a>\n * documentation for more information.\n *\n *\n * @usage\n * <hljs lang=\"html\">\n *\n * <md-virtual-repeat-container md-top-index=\"topIndex\">\n *   <div md-virtual-repeat=\"i in items\" md-item-size=\"20\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n * </hljs>\n *\n * @param {boolean=} md-auto-shrink When present and the container will shrink to fit\n *     the number of items in the `md-virtual-repeat`.\n * @param {number=} md-auto-shrink-min Minimum number of items that md-auto-shrink\n *     will shrink to. Default: `0`.\n * @param {boolean=} md-orient-horizontal Whether the container should scroll horizontally.\n *     The default is `false` which indicates vertical orientation and scrolling.\n * @param {number=} md-top-index Binds the index of the item that is at the top of the scroll\n *     container to `$scope`. It can both read and set the scroll position.\n */\nfunction VirtualRepeatContainerDirective() {\n  return {\n    controller: VirtualRepeatContainerController,\n    template: virtualRepeatContainerTemplate,\n    compile: function virtualRepeatContainerCompile($element, $attrs) {\n      $element\n          .addClass('md-virtual-repeat-container')\n          .addClass($attrs.hasOwnProperty('mdOrientHorizontal')\n              ? 'md-orient-horizontal'\n              : 'md-orient-vertical');\n    }\n  };\n}\n\n\nfunction virtualRepeatContainerTemplate($element) {\n  return '<div class=\"md-virtual-repeat-scroller\" role=\"presentation\">' +\n    '<div class=\"md-virtual-repeat-sizer\" role=\"presentation\"></div>' +\n    '<div class=\"md-virtual-repeat-offsetter\" role=\"presentation\">' +\n      $element[0].innerHTML +\n    '</div></div>';\n}\n\n/**\n * Number of additional elements to render above and below the visible area inside\n * of the virtual repeat container. A higher number results in less flicker when scrolling\n * very quickly in Safari, but comes with a higher rendering and dirty-checking cost.\n * @const {number}\n */\nvar NUM_EXTRA = 3;\n\n/** @ngInject */\nfunction VirtualRepeatContainerController($$rAF, $mdUtil, $mdConstant, $parse, $rootScope, $window,\n                                          $scope, $element, $attrs) {\n  this.$rootScope = $rootScope;\n  this.$scope = $scope;\n  this.$element = $element;\n  this.$attrs = $attrs;\n\n  /** @type {number} The width or height of the container */\n  this.size = 0;\n  /** @type {number} The scroll width or height of the scroller */\n  this.scrollSize = 0;\n  /** @type {number} The scrollLeft or scrollTop of the scroller */\n  this.scrollOffset = 0;\n  /** @type {boolean} Whether the scroller is oriented horizontally */\n  this.horizontal = this.$attrs.hasOwnProperty('mdOrientHorizontal');\n  /** @type {!VirtualRepeatController} The repeater inside of this container */\n  this.repeater = null;\n  /** @type {boolean} Whether auto-shrink is enabled */\n  this.autoShrink = this.$attrs.hasOwnProperty('mdAutoShrink');\n  /** @type {number} Minimum number of items to auto-shrink to */\n  this.autoShrinkMin = parseInt(this.$attrs.mdAutoShrinkMin, 10) || 0;\n  /** @type {?number} Original container size when shrank */\n  this.originalSize = null;\n  /** @type {number} Amount to offset the total scroll size by. */\n  this.offsetSize = parseInt(this.$attrs.mdOffsetSize, 10) || 0;\n  /** @type {?string} height or width element style on the container prior to auto-shrinking. */\n  this.oldElementSize = null;\n  /** @type {!number} Maximum amount of pixels allowed for a single DOM element */\n  this.maxElementPixels = $mdConstant.ELEMENT_MAX_PIXELS;\n  /** @type {string}  Direction of the text */\n  this.ltr = !$mdUtil.isRtl(this.$attrs);\n\n  if (this.$attrs.mdTopIndex) {\n    /** @type {function(angular.Scope): number} Binds to topIndex on AngularJS scope */\n    this.bindTopIndex = $parse(this.$attrs.mdTopIndex);\n    /** @type {number} The index of the item that is at the top of the scroll container */\n    this.topIndex = this.bindTopIndex(this.$scope);\n\n    if (!angular.isDefined(this.topIndex)) {\n      this.topIndex = 0;\n      this.bindTopIndex.assign(this.$scope, 0);\n    }\n\n    this.$scope.$watch(this.bindTopIndex, angular.bind(this, function(newIndex) {\n      if (newIndex !== this.topIndex) {\n        this.scrollToIndex(newIndex);\n      }\n    }));\n  } else {\n    this.topIndex = 0;\n  }\n\n  this.scroller = $element[0].querySelector('.md-virtual-repeat-scroller');\n  this.sizer = this.scroller.querySelector('.md-virtual-repeat-sizer');\n  this.offsetter = this.scroller.querySelector('.md-virtual-repeat-offsetter');\n\n  // After the DOM stabilizes, measure the initial size of the container and\n  // make a best effort at re-measuring as it changes.\n  var boundUpdateSize = angular.bind(this, this.updateSize);\n\n  $$rAF(angular.bind(this, function() {\n    boundUpdateSize();\n\n    var debouncedUpdateSize = $mdUtil.debounce(boundUpdateSize, 10, null, false);\n    var jWindow = angular.element($window);\n\n    // Make one more attempt to get the size if it is 0.\n    // This is not by any means a perfect approach, but there's really no\n    // silver bullet here.\n    if (!this.size) {\n      debouncedUpdateSize();\n    }\n\n    jWindow.on('resize', debouncedUpdateSize);\n    $scope.$on('$destroy', function() {\n      jWindow.off('resize', debouncedUpdateSize);\n    });\n\n    $scope.$emit('$md-resize-enable');\n    $scope.$on('$md-resize', boundUpdateSize);\n  }));\n}\n\n\n/** Called by the md-virtual-repeat inside of the container at startup. */\nVirtualRepeatContainerController.prototype.register = function(repeaterCtrl) {\n  this.repeater = repeaterCtrl;\n\n  angular.element(this.scroller)\n      .on('scroll wheel touchmove touchend', angular.bind(this, this.handleScroll_));\n};\n\n\n/** @return {boolean} Whether the container is configured for horizontal scrolling. */\nVirtualRepeatContainerController.prototype.isHorizontal = function() {\n  return this.horizontal;\n};\n\n\n/** @return {number} The size (width or height) of the container. */\nVirtualRepeatContainerController.prototype.getSize = function() {\n  return this.size;\n};\n\n\n/**\n * Resizes the container.\n * @private\n * @param {number} size The new size to set.\n */\nVirtualRepeatContainerController.prototype.setSize_ = function(size) {\n  var dimension = this.getDimensionName_();\n\n  this.size = size;\n  this.$element[0].style[dimension] = size + 'px';\n};\n\n\nVirtualRepeatContainerController.prototype.unsetSize_ = function() {\n  this.$element[0].style[this.getDimensionName_()] = this.oldElementSize;\n  this.oldElementSize = null;\n};\n\n\n/** Instructs the container to re-measure its size. */\nVirtualRepeatContainerController.prototype.updateSize = function() {\n  // If the original size is already determined, we can skip the update.\n  if (this.originalSize) return;\n\n  var size = this.isHorizontal()\n      ? this.$element[0].clientWidth\n      : this.$element[0].clientHeight;\n\n  if (size) {\n    this.size = size;\n  }\n\n  // Recheck the scroll position after updating the size. This resolves\n  // problems that can result if the scroll position was measured while the\n  // element was display: none or detached from the document.\n  this.handleScroll_();\n\n  this.repeater && this.repeater.containerUpdated();\n};\n\n\n/** @return {number} The container's scrollHeight or scrollWidth. */\nVirtualRepeatContainerController.prototype.getScrollSize = function() {\n  return this.scrollSize;\n};\n\n/**\n * @returns {string} either width or height dimension\n * @private\n */\nVirtualRepeatContainerController.prototype.getDimensionName_ = function() {\n  return this.isHorizontal() ? 'width' : 'height';\n};\n\n\n/**\n * Sets the scroller element to the specified size.\n * @private\n * @param {number} size The new size.\n */\nVirtualRepeatContainerController.prototype.sizeScroller_ = function(size) {\n  var dimension =  this.getDimensionName_();\n  var crossDimension = this.isHorizontal() ? 'height' : 'width';\n\n  // Clear any existing dimensions.\n  this.sizer.innerHTML = '';\n\n  // If the size falls within the browser's maximum explicit size for a single element, we can\n  // set the size and be done. Otherwise, we have to create children that add up the the desired\n  // size.\n  if (size < this.maxElementPixels) {\n    this.sizer.style[dimension] = size + 'px';\n  } else {\n    this.sizer.style[dimension] = 'auto';\n    this.sizer.style[crossDimension] = 'auto';\n\n    // Divide the total size we have to render into N max-size pieces.\n    var numChildren = Math.floor(size / this.maxElementPixels);\n\n    // Element template to clone for each max-size piece.\n    var sizerChild = document.createElement('div');\n    sizerChild.style[dimension] = this.maxElementPixels + 'px';\n    sizerChild.style[crossDimension] = '1px';\n\n    for (var i = 0; i < numChildren; i++) {\n      this.sizer.appendChild(sizerChild.cloneNode(false));\n    }\n\n    // Re-use the element template for the remainder.\n    sizerChild.style[dimension] = (size - (numChildren * this.maxElementPixels)) + 'px';\n    this.sizer.appendChild(sizerChild);\n  }\n};\n\n\n/**\n * If auto-shrinking is enabled, shrinks or unshrinks as appropriate.\n * @private\n * @param {number} size The new size.\n */\nVirtualRepeatContainerController.prototype.autoShrink_ = function(size) {\n  var shrinkSize = Math.max(size, this.autoShrinkMin * this.repeater.getItemSize());\n\n  if (this.autoShrink && shrinkSize !== this.size) {\n    if (this.oldElementSize === null) {\n      this.oldElementSize = this.$element[0].style[this.getDimensionName_()];\n    }\n\n    var currentSize = this.originalSize || this.size;\n\n    if (!currentSize || shrinkSize < currentSize) {\n      if (!this.originalSize) {\n        this.originalSize = this.size;\n      }\n\n      // Now we update the containers size, because shrinking is enabled.\n      this.setSize_(shrinkSize);\n    } else if (this.originalSize !== null) {\n      // Set the size back to our initial size.\n      this.unsetSize_();\n\n      var _originalSize = this.originalSize;\n      this.originalSize = null;\n\n      // We determine the repeaters size again, if the original size was zero.\n      // The originalSize needs to be null, to be able to determine the size.\n      if (!_originalSize) this.updateSize();\n\n      // Apply the original size or the determined size back to the container, because\n      // it has been overwritten before, in the shrink block.\n      this.setSize_(_originalSize || this.size);\n    }\n\n    this.repeater.containerUpdated();\n  }\n};\n\n\n/**\n * Sets the scrollHeight or scrollWidth. Called by the repeater based on\n * its item count and item size.\n * @param {number} itemsSize The total size of the items.\n */\nVirtualRepeatContainerController.prototype.setScrollSize = function(itemsSize) {\n  var size = itemsSize + this.offsetSize;\n  if (this.scrollSize === size) return;\n\n  this.sizeScroller_(size);\n  this.autoShrink_(size);\n  this.scrollSize = size;\n};\n\n\n/** @return {number} The container's current scroll offset. */\nVirtualRepeatContainerController.prototype.getScrollOffset = function() {\n  return this.scrollOffset;\n};\n\n/**\n * Scrolls to a given scrollTop position.\n * @param {number} position\n */\nVirtualRepeatContainerController.prototype.scrollTo = function(position) {\n  this.scroller[this.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = position;\n  this.handleScroll_();\n};\n\n/**\n * Scrolls the item with the given index to the top of the scroll container.\n * @param {number} index\n */\nVirtualRepeatContainerController.prototype.scrollToIndex = function(index) {\n  var itemSize = this.repeater.getItemSize();\n  var itemsLength = this.repeater.itemsLength;\n  if (index > itemsLength) {\n    index = itemsLength - 1;\n  }\n  this.scrollTo(itemSize * index);\n};\n\nVirtualRepeatContainerController.prototype.resetScroll = function() {\n  this.scrollTo(0);\n};\n\n\nVirtualRepeatContainerController.prototype.handleScroll_ = function() {\n  if (!this.ltr && !this.maxSize) {\n    this.scroller.scrollLeft = this.scrollSize;\n    this.maxSize = this.scroller.scrollLeft;\n  }\n  var offset = this.isHorizontal() ?\n      (this.ltr ? this.scroller.scrollLeft : this.maxSize - this.scroller.scrollLeft)\n      : this.scroller.scrollTop;\n  if (this.scrollSize < this.size) return;\n  if (offset > this.scrollSize - this.size) {\n    offset = this.scrollSize - this.size;\n  }\n  if (offset === this.scrollOffset) return;\n\n  var itemSize = this.repeater.getItemSize();\n  if (!itemSize) return;\n\n  var numItems = Math.max(0, Math.floor(offset / itemSize) - NUM_EXTRA);\n\n  var transform = (this.isHorizontal() ? 'translateX(' : 'translateY(') +\n      (!this.isHorizontal() || this.ltr ? (numItems * itemSize) : - (numItems * itemSize))  + 'px)';\n\n  this.scrollOffset = offset;\n  this.offsetter.style.webkitTransform = transform;\n  this.offsetter.style.transform = transform;\n\n  if (this.bindTopIndex) {\n    var topIndex = Math.floor(offset / itemSize);\n    if (topIndex !== this.topIndex && topIndex < this.repeater.getItemCount()) {\n      this.topIndex = topIndex;\n      this.bindTopIndex.assign(this.$scope, topIndex);\n      if (!this.$rootScope.$$phase) this.$scope.$digest();\n    }\n  }\n\n  this.repeater.containerUpdated();\n};\n\n\n/**\n * @ngdoc directive\n * @name mdVirtualRepeat\n * @module material.components.virtualRepeat\n * @restrict A\n * @priority 1000\n * @description\n * The `md-virtual-repeat` attribute is applied to a template that is repeated using virtual\n * scrolling. This provides smooth and performant scrolling through very large lists of elements.\n *\n * Virtual repeat is a limited substitute for `ng-repeat` that renders only\n * enough DOM nodes to fill the container, recycling them as the user scrolls.\n *\n * ### Notes\n *\n * - Arrays are supported for iteration by default.\n * - An object can used use if `md-on-demand` is specified and the object implements the interface\n *   described in the `md-on-demand` <a ng-href=\"#attributes\">documentation</a>.\n * - `trackBy`, `as` alias, and `(key, value)` syntax from `ng-repeat` are not supported.\n *\n * ### On-Demand Async Item Loading\n *\n * When using the `md-on-demand` attribute and loading some asynchronous data,\n * the `getItemAtIndex` function will mostly return nothing.\n *\n * <hljs lang=\"js\">\n *   DynamicItems.prototype.getItemAtIndex = function(index) {\n *     if (this.pages[index]) {\n *       return this.pages[index];\n *     } else {\n *       // This is an asynchronous action and does not return any value.\n *       this.loadPage(index);\n *     }\n *   };\n * </hljs>\n *\n * This means that the Virtual Repeat will not have any value for the given index.<br/>\n * After the data loading completes, the user expects the Virtual Repeat to recognize the change.\n *\n * To make sure that the Virtual Repeat properly detects any change, you need to run the operation\n * in another digest.\n *\n * <hljs lang=\"js\">\n *   DynamicItems.prototype.loadPage = function(index) {\n *     var self = this;\n *\n *     // Trigger a new digest by using $timeout\n *     $timeout(function() {\n *       self.pages[index] = Data;\n *     });\n *   };\n * </hljs>\n *\n * > <b>Note:</b> Please also review the\n *   <a ng-href=\"api/directive/mdVirtualRepeatContainer\">VirtualRepeatContainer</a> documentation\n *   for more information.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-virtual-repeat-container>\n *   <div md-virtual-repeat=\"i in items\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n *\n * <md-virtual-repeat-container md-orient-horizontal>\n *   <div md-virtual-repeat=\"i in items\" md-item-size=\"20\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n * </hljs>\n *\n * @param {expression=} md-extra-name Evaluates to an additional name to which the current iterated\n *   item can be assigned on the repeated scope (needed for use in `md-autocomplete`).\n * @param {number=} md-item-size Optional height or width of the repeated elements (which **must be\n *   identical for each element**). Virtual repeat will attempt to read the size from the DOM,\n *   if missing, but it still assumes that all repeated nodes have the **same height**\n *   (when scrolling vertically) or **same width** (when scrolling horizontally).\n * @param {boolean=} md-on-demand When present, treats the `md-virtual-repeat` argument as an object\n *   that can fetch rows rather than an array.\n *\n *   **NOTE:** This object **must** implement the following interface with two methods:\n *\n *   - `getItemAtIndex` - `{function(index): Object}`: The item at that `index` or `null` if it is\n *     not yet loaded (it should start downloading the item in that case).\n *   - `getLength` - `{function(): number}`: The data length to which the repeater container\n *     should be sized. Ideally, when the count is known, this method should return it.\n *     Otherwise, return a higher number than the currently loaded items to produce an\n *     infinite-scroll behavior.\n */\nfunction VirtualRepeatDirective($parse) {\n  return {\n    controller: VirtualRepeatController,\n    priority: 1000,\n    require: ['mdVirtualRepeat', '^^mdVirtualRepeatContainer'],\n    restrict: 'A',\n    terminal: true,\n    transclude: 'element',\n    compile: function VirtualRepeatCompile($element, $attrs) {\n      var expression = $attrs.mdVirtualRepeat;\n      var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)\\s*$/);\n      var repeatName = match[1];\n      var repeatListExpression = $parse(match[2]);\n      var extraName = $attrs.mdExtraName && $parse($attrs.mdExtraName);\n\n      return function VirtualRepeatLink($scope, $element, $attrs, ctrl, $transclude) {\n        ctrl[0].link_(ctrl[1], $transclude, repeatName, repeatListExpression, extraName);\n      };\n    }\n  };\n}\n\n\n/** @ngInject */\nfunction VirtualRepeatController($scope, $element, $attrs, $browser, $document, $rootScope,\n    $$rAF, $mdUtil) {\n  this.$scope = $scope;\n  this.$element = $element;\n  this.$attrs = $attrs;\n  this.$browser = $browser;\n  this.$document = $document;\n  this.$mdUtil = $mdUtil;\n  this.$rootScope = $rootScope;\n  this.$$rAF = $$rAF;\n\n  /** @type {boolean} Whether we are in on-demand mode. */\n  this.onDemand = $mdUtil.parseAttributeBoolean($attrs.mdOnDemand);\n  /** @type {!Function} Backup reference to $browser.$$checkUrlChange */\n  this.browserCheckUrlChange = $browser.$$checkUrlChange;\n  /** @type {number} Most recent starting repeat index (based on scroll offset) */\n  this.newStartIndex = 0;\n  /** @type {number} Most recent ending repeat index (based on scroll offset) */\n  this.newEndIndex = 0;\n  /** @type {number} Most recent end visible index (based on scroll offset) */\n  this.newVisibleEnd = 0;\n  /** @type {number} Previous starting repeat index (based on scroll offset) */\n  this.startIndex = 0;\n  /** @type {number} Previous ending repeat index (based on scroll offset) */\n  this.endIndex = 0;\n  /** @type {?number} Height/width of repeated elements. */\n  this.itemSize = $scope.$eval($attrs.mdItemSize) || null;\n\n  /** @type {boolean} Whether this is the first time that items are rendered. */\n  this.isFirstRender = true;\n\n  /**\n   * @private {boolean} Whether the items in the list are already being updated. Used to prevent\n   *     nested calls to virtualRepeatUpdate_.\n   */\n  this.isVirtualRepeatUpdating_ = false;\n\n  /** @type {number} Most recently seen length of items. */\n  this.itemsLength = 0;\n\n  /**\n   * @type {!Function} Unwatch callback for item size (when md-items-size is\n   *     not specified), or angular.noop otherwise.\n   */\n  this.unwatchItemSize_ = angular.noop;\n\n  /**\n   * Presently rendered blocks by repeat index.\n   * @type {Object<number, !VirtualRepeatController.Block>}\n   */\n  this.blocks = {};\n  /** @type {Array<!VirtualRepeatController.Block>} A pool of presently unused blocks. */\n  this.pooledBlocks = [];\n\n  $scope.$on('$destroy', angular.bind(this, this.cleanupBlocks_));\n}\n\n\n/**\n * An object representing a repeated item.\n * @typedef {{element: !jqLite, new: boolean, scope: !angular.Scope}}\n */\nVirtualRepeatController.Block;\n\n\n/**\n * Called at startup by the md-virtual-repeat postLink function.\n * @param {!VirtualRepeatContainerController} container The container's controller.\n * @param {!Function} transclude The repeated element's bound transclude function.\n * @param {string} repeatName The left hand side of the repeat expression, indicating\n *     the name for each item in the array.\n * @param {!Function} repeatListExpression A compiled expression based on the right hand side\n *     of the repeat expression. Points to the array to repeat over.\n * @param {string|undefined} extraName The optional extra repeatName.\n */\nVirtualRepeatController.prototype.link_ =\n    function(container, transclude, repeatName, repeatListExpression, extraName) {\n  this.container = container;\n  this.transclude = transclude;\n  this.repeatName = repeatName;\n  this.rawRepeatListExpression = repeatListExpression;\n  this.extraName = extraName;\n  this.sized = false;\n\n  this.repeatListExpression = angular.bind(this, this.repeatListExpression_);\n\n  this.container.register(this);\n};\n\n\n/** @private Cleans up unused blocks. */\nVirtualRepeatController.prototype.cleanupBlocks_ = function() {\n  angular.forEach(this.pooledBlocks, function cleanupBlock(block) {\n    block.element.remove();\n  });\n};\n\n\n/** @private Attempts to set itemSize by measuring a repeated element in the dom */\nVirtualRepeatController.prototype.readItemSize_ = function() {\n  if (this.itemSize) {\n    // itemSize was successfully read in a different asynchronous call.\n    return;\n  }\n\n  this.items = this.repeatListExpression(this.$scope);\n  this.parentNode = this.$element[0].parentNode;\n  var block = this.getBlock_(0);\n  if (!block.element[0].parentNode) {\n    this.parentNode.appendChild(block.element[0]);\n  }\n\n  this.itemSize = block.element[0][\n      this.container.isHorizontal() ? 'offsetWidth' : 'offsetHeight'] || null;\n\n  this.blocks[0] = block;\n  this.poolBlock_(0);\n\n  if (this.itemSize) {\n    this.containerUpdated();\n  }\n};\n\n\n/**\n * Returns the user-specified repeat list, transforming it into an array-like\n * object in the case of infinite scroll/dynamic load mode.\n * @param {!angular.Scope} scope The scope.\n * @return {!Array|!Object} An array or array-like object for iteration.\n */\nVirtualRepeatController.prototype.repeatListExpression_ = function(scope) {\n  var repeatList = this.rawRepeatListExpression(scope);\n\n  if (this.onDemand && repeatList) {\n    var virtualList = new VirtualRepeatModelArrayLike(repeatList);\n    virtualList.$$includeIndexes(this.newStartIndex, this.newVisibleEnd);\n    return virtualList;\n  } else {\n    return repeatList;\n  }\n};\n\n\n/**\n * Called by the container. Informs us that the container's scroll or size has\n * changed.\n */\nVirtualRepeatController.prototype.containerUpdated = function() {\n  // If itemSize is unknown, attempt to measure it.\n  if (!this.itemSize) {\n    // Make sure to clean up watchers if we can (see #8178)\n    if (this.unwatchItemSize_ && this.unwatchItemSize_ !== angular.noop){\n      this.unwatchItemSize_();\n    }\n    this.unwatchItemSize_ = this.$scope.$watchCollection(\n        this.repeatListExpression,\n        angular.bind(this, function(items) {\n          if (items && items.length) {\n            this.readItemSize_();\n          }\n        }));\n    if (!this.$rootScope.$$phase) this.$scope.$digest();\n\n    return;\n  } else if (!this.sized) {\n    this.items = this.repeatListExpression(this.$scope);\n  }\n\n  if (!this.sized) {\n    this.unwatchItemSize_();\n    this.sized = true;\n    this.$scope.$watchCollection(this.repeatListExpression,\n        angular.bind(this, function(items, oldItems) {\n          if (!this.isVirtualRepeatUpdating_) {\n            this.virtualRepeatUpdate_(items, oldItems);\n          }\n        }));\n  }\n\n  this.updateIndexes_();\n\n  if (this.newStartIndex !== this.startIndex ||\n      this.newEndIndex !== this.endIndex ||\n      this.container.getScrollOffset() > this.container.getScrollSize()) {\n    if (this.items instanceof VirtualRepeatModelArrayLike) {\n      this.items.$$includeIndexes(this.newStartIndex, this.newEndIndex);\n    }\n    this.virtualRepeatUpdate_(this.items, this.items);\n  }\n};\n\n\n/**\n * Called by the container. Returns the size of a single repeated item.\n * @return {?number} size of a repeated item.\n */\nVirtualRepeatController.prototype.getItemSize = function() {\n  return this.itemSize;\n};\n\n\n/**\n * Called by the container.\n * @return {?number} the most recently seen length of items.\n */\nVirtualRepeatController.prototype.getItemCount = function() {\n  return this.itemsLength;\n};\n\n\n/**\n * Updates the order and visible offset of repeated blocks in response to scrolling\n * or updates to `items`.\n * @param {Array} items visible elements\n * @param {Array} oldItems previously visible elements\n * @private\n */\nVirtualRepeatController.prototype.virtualRepeatUpdate_ = function(items, oldItems) {\n  this.isVirtualRepeatUpdating_ = true;\n\n  var itemsLength = items && items.length || 0;\n  var lengthChanged = false;\n\n  // If the number of items shrank, keep the scroll position.\n  if (this.items && itemsLength < this.items.length && this.container.getScrollOffset() !== 0) {\n    this.items = items;\n    var previousScrollOffset = this.container.getScrollOffset();\n    this.container.resetScroll();\n    this.container.scrollTo(previousScrollOffset);\n  }\n\n  if (itemsLength !== this.itemsLength) {\n    lengthChanged = true;\n    this.itemsLength = itemsLength;\n  }\n\n  this.items = items;\n  if (items !== oldItems || lengthChanged) {\n    this.updateIndexes_();\n  }\n\n  this.parentNode = this.$element[0].parentNode;\n\n  if (lengthChanged) {\n    this.container.setScrollSize(itemsLength * this.itemSize);\n  }\n\n  // Detach and pool any blocks that are no longer in the viewport.\n  Object.keys(this.blocks).forEach(function(blockIndex) {\n    var index = parseInt(blockIndex, 10);\n    if (index < this.newStartIndex || index >= this.newEndIndex) {\n      this.poolBlock_(index);\n    }\n  }, this);\n\n  // Add needed blocks.\n  // For performance reasons, temporarily block browser url checks as we digest\n  // the restored block scopes ($$checkUrlChange reads window.location to\n  // check for changes and trigger route change, etc, which we don't need when\n  // trying to scroll at 60fps).\n  this.$browser.$$checkUrlChange = angular.noop;\n\n  var i, block,\n      newStartBlocks = [],\n      newEndBlocks = [];\n\n  // Collect blocks at the top.\n  for (i = this.newStartIndex; i < this.newEndIndex && this.blocks[i] == null; i++) {\n    block = this.getBlock_(i);\n    this.updateBlock_(block, i);\n    newStartBlocks.push(block);\n  }\n\n  // Update blocks that are already rendered.\n  for (; this.blocks[i] != null; i++) {\n    this.updateBlock_(this.blocks[i], i);\n  }\n  var maxIndex = i - 1;\n\n  // Collect blocks at the end.\n  for (; i < this.newEndIndex; i++) {\n    block = this.getBlock_(i);\n    this.updateBlock_(block, i);\n    newEndBlocks.push(block);\n  }\n\n  // Attach collected blocks to the document.\n  if (newStartBlocks.length) {\n    this.parentNode.insertBefore(\n        this.domFragmentFromBlocks_(newStartBlocks),\n        this.$element[0].nextSibling);\n  }\n  if (newEndBlocks.length) {\n    this.parentNode.insertBefore(\n        this.domFragmentFromBlocks_(newEndBlocks),\n        this.blocks[maxIndex] && this.blocks[maxIndex].element[0].nextSibling);\n  }\n\n  // Restore $$checkUrlChange.\n  this.$browser.$$checkUrlChange = this.browserCheckUrlChange;\n\n  this.startIndex = this.newStartIndex;\n  this.endIndex = this.newEndIndex;\n\n  if (this.isFirstRender) {\n    this.isFirstRender = false;\n    var firstRenderStartIndex = this.$attrs.mdStartIndex ?\n      this.$scope.$eval(this.$attrs.mdStartIndex) :\n      this.container.topIndex;\n\n    // The first call to virtualRepeatUpdate_ may not be when the virtual repeater is ready.\n    // Introduce a slight delay so that the update happens when it is actually ready.\n    this.$mdUtil.nextTick(function() {\n      this.container.scrollToIndex(firstRenderStartIndex);\n    }.bind(this));\n  }\n\n  this.isVirtualRepeatUpdating_ = false;\n};\n\n\n/**\n * @param {number} index Where the block is to be in the repeated list.\n * @return {!VirtualRepeatController.Block} A new or pooled block to place at the specified index.\n * @private\n */\nVirtualRepeatController.prototype.getBlock_ = function(index) {\n  if (this.pooledBlocks.length) {\n    return this.pooledBlocks.pop();\n  }\n\n  var block;\n  this.transclude(angular.bind(this, function(clone, scope) {\n    block = {\n      element: clone,\n      new: true,\n      scope: scope\n    };\n\n    this.updateScope_(scope, index);\n    this.parentNode.appendChild(clone[0]);\n  }));\n\n  return block;\n};\n\n\n/**\n * Updates and if not in a digest cycle, digests the specified block's scope to the data\n * at the specified index.\n * @param {!VirtualRepeatController.Block} block The block whose scope should be updated.\n * @param {number} index The index to set.\n * @private\n */\nVirtualRepeatController.prototype.updateBlock_ = function(block, index) {\n  this.blocks[index] = block;\n\n  if (!block.new &&\n      (block.scope.$index === index && block.scope[this.repeatName] === this.items[index])) {\n    return;\n  }\n  block.new = false;\n\n  // Update and digest the block's scope.\n  this.updateScope_(block.scope, index);\n\n  // Perform digest before reattaching the block.\n  // Any resulting synchronous DOM mutations should be much faster as a result.\n  // This might break some directives.\n  if (!this.$rootScope.$$phase) {\n    block.scope.$digest();\n  }\n};\n\n\n/**\n * Updates scope to the data at the specified index.\n * @param {!angular.Scope} scope The scope which should be updated.\n * @param {number} index The index to set.\n * @private\n */\nVirtualRepeatController.prototype.updateScope_ = function(scope, index) {\n  scope.$index = index;\n  scope[this.repeatName] = this.items && this.items[index];\n  if (this.extraName) scope[this.extraName(this.$scope)] = this.items[index];\n};\n\n\n/**\n * Pools the block at the specified index (Pulls its element out of the dom and stores it).\n * @param {number} index The index at which the block to pool is stored.\n * @private\n */\nVirtualRepeatController.prototype.poolBlock_ = function(index) {\n  this.pooledBlocks.push(this.blocks[index]);\n  this.parentNode.removeChild(this.blocks[index].element[0]);\n  delete this.blocks[index];\n};\n\n\n/**\n * Produces a dom fragment containing the elements from the list of blocks.\n * @param {!Array<!VirtualRepeatController.Block>} blocks The blocks whose elements\n *     should be added to the document fragment.\n * @return {DocumentFragment}\n * @private\n */\nVirtualRepeatController.prototype.domFragmentFromBlocks_ = function(blocks) {\n  var fragment = this.$document[0].createDocumentFragment();\n  blocks.forEach(function(block) {\n    fragment.appendChild(block.element[0]);\n  });\n  return fragment;\n};\n\n\n/**\n * Updates start and end indexes based on length of repeated items and container size.\n * @private\n */\nVirtualRepeatController.prototype.updateIndexes_ = function() {\n  var itemsLength = this.items ? this.items.length : 0;\n  var containerLength = Math.ceil(this.container.getSize() / this.itemSize);\n\n  this.newStartIndex = Math.max(0, Math.min(\n      itemsLength - containerLength,\n      Math.floor(this.container.getScrollOffset() / this.itemSize)));\n  this.newVisibleEnd = this.newStartIndex + containerLength + NUM_EXTRA;\n  this.newEndIndex = Math.min(itemsLength, this.newVisibleEnd);\n  this.newStartIndex = Math.max(0, this.newStartIndex - NUM_EXTRA);\n};\n\n/**\n * This VirtualRepeatModelArrayLike class enforces the interface requirements\n * for infinite scrolling within a mdVirtualRepeatContainer.\n *\n * @param {Object} model An object with this interface must implement the following interface with\n * two (2) methods:\n *\n * getItemAtIndex: function(index) -> item at that index or null if it is not yet\n *     loaded (It should start downloading the item in that case).\n *\n * getLength: function() -> number The data length to which the repeater container\n *     should be sized. Ideally, when the count is known, this method should return it.\n *     Otherwise, return a higher number than the currently loaded items to produce an\n *     infinite-scroll behavior.\n *\n * @usage\n * <hljs lang=\"html\">\n *  <md-virtual-repeat-container md-orient-horizontal>\n *    <div md-virtual-repeat=\"i in items\" md-on-demand>\n *      Hello {{i}}!\n *    </div>\n *  </md-virtual-repeat-container>\n * </hljs>\n *\n */\nfunction VirtualRepeatModelArrayLike(model) {\n  if (!angular.isFunction(model.getItemAtIndex) ||\n      !angular.isFunction(model.getLength)) {\n    throw Error('When md-on-demand is enabled, the Object passed to md-virtual-repeat must ' +\n        'implement functions getItemAtIndex() and getLength().');\n  }\n\n  this.model = model;\n}\n\n/**\n * @param {number} start\n * @param {number} end\n */\nVirtualRepeatModelArrayLike.prototype.$$includeIndexes = function(start, end) {\n  for (var i = start; i < end; i++) {\n    if (!this.hasOwnProperty(i)) {\n      this[i] = this.model.getItemAtIndex(i);\n    }\n  }\n  this.length = this.model.getLength();\n};\n\n/**\n * @ngdoc directive\n * @name mdForceHeight\n * @module material.components.virtualRepeat\n * @restrict A\n * @description\n *\n * Force an element to have a certain `px` height. This is used in place of a style tag in order to\n * conform to the\n * <a href=\"https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/script-src\">\n *   Content Security Policy</a> regarding `unsafe-inline` `<style>` tags.\n *\n * This directive is related to <a ng-href=\"api/directive/mdVirtualRepeat\">mdVirtualRepeat</a>.\n *\n * @usage\n * <hljs lang=\"html\">\n *   <div md-force-height=\"'100px'\"></div>\n * </hljs>\n */\nfunction ForceHeightDirective($mdUtil) {\n  return {\n    restrict: 'A',\n    link: function(scope, element, attrs) {\n      var height = scope.$eval(attrs.mdForceHeight) || null;\n\n      if (height && element) {\n        element[0].style.height = height;\n      }\n    }\n  };\n}\nForceHeightDirective.$inject = ['$mdUtil'];\n"
  },
  {
    "path": "src/components/virtualRepeat/virtual-repeater.scss",
    "content": "$virtual-repeat-scrollbar-width: 16px !default;\n\n.md-virtual-repeat-container {\n  box-sizing: border-box;\n  display: block;\n  margin: 0;\n  overflow: hidden;\n  padding: 0;\n  position: relative;\n\n  .md-virtual-repeat-scroller {\n    bottom: 0;\n    box-sizing: border-box;\n    left: 0;\n    margin: 0;\n    overflow-x: hidden;\n    padding: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n    -webkit-overflow-scrolling: touch;\n  }\n\n  .md-virtual-repeat-sizer {\n    box-sizing: border-box;\n    height: 1px;\n    display: block;\n    margin: 0;\n    padding: 0;\n    width: 1px;\n  }\n\n  .md-virtual-repeat-offsetter {\n    box-sizing: border-box;\n    left: 0;\n    margin: 0;\n    padding: 0;\n    position: absolute;\n    right: 0;\n    top: 0;\n  }\n}\n\n.md-virtual-repeat-container.md-orient-horizontal {\n  .md-virtual-repeat-scroller {\n    overflow-x: auto;\n    overflow-y: hidden;\n  }\n\n  .md-virtual-repeat-offsetter {\n    // Leave room for the scroll bar.\n    // TODO: Will probably need to perform measurements at runtime.\n    bottom: $virtual-repeat-scrollbar-width;\n    @include rtl-prop(right, left, auto, auto);\n    white-space: nowrap;\n  }\n}\n"
  },
  {
    "path": "src/components/virtualRepeat/virtual-repeater.spec.js",
    "content": "describe('<md-virtual-repeat>', function() {\n\n  var MAX_ELEMENT_PIXELS = 10000;\n\n  beforeEach(module('material.components.virtualRepeat', function($provide) {\n    /*\n     * Overwrite the $mdConstant ELEMENT_MAX_PIXELS property, because for testing it requires too much\n     * memory and crashes the tests sometimes.\n     */\n    $provide.decorator('$mdConstant', function($delegate) {\n\n      $delegate.ELEMENT_MAX_PIXELS = MAX_ELEMENT_PIXELS;\n\n      return $delegate;\n    })\n  }));\n\n  var VirtualRepeatController = { NUM_EXTRA : 3 };\n\n  var CONTAINER_HTML =\n      '<md-virtual-repeat-container style=\"height:100px; width:150px\">'+\n      '</md-virtual-repeat-container>';\n  var REPEATER_HTML = ''+\n      '<div md-virtual-repeat=\"i in items\" ' +\n      '     md-item-size=\"10\" ' +\n      '     md-start-index=\"startIndex\" ' +\n      '     style=\"height: 10px; width: 10px; box-sizing: border-box;\">' +\n      '       {{i}} {{$index}}' +\n      '</div>';\n  var container, repeater, component, $$rAF, $compile, $document, $mdUtil, $timeout,\n      $window, scope, scroller, sizer, offsetter;\n\n  var NUM_ITEMS = 110,\n      VERTICAL_PX = 100,\n      HORIZONTAL_PX = 150,\n      ITEM_SIZE = 10;\n\n  beforeEach(inject(function(\n      _$$rAF_, _$compile_, _$document_, _$mdUtil_, $rootScope, _$timeout_, _$window_, _$material_) {\n    repeater = angular.element(REPEATER_HTML);\n    container = angular.element(CONTAINER_HTML).append(repeater);\n    component = null;\n    $$rAF = _$$rAF_;\n    $material = _$material_;\n    $mdUtil = _$mdUtil_;\n    $compile = _$compile_;\n    $document = _$document_;\n    $timeout = _$timeout_;\n    $window = _$window_;\n    scope = $rootScope.$new();\n    scope.startIndex = 0;\n    scroller = null;\n    sizer = null;\n    offsetter = null;\n  }));\n\n  afterEach(function() {\n    container.remove();\n    component && component.remove();\n    scope.$destroy();\n  });\n\n  function createRepeater() {\n    angular.element($document[0].body).append(container);\n\n    component = $compile(container)(scope);\n\n    scroller  = angular.element(component[0].querySelector('.md-virtual-repeat-scroller'));\n    sizer     = angular.element(component[0].querySelector('.md-virtual-repeat-sizer'));\n    offsetter = angular.element(component[0].querySelector('.md-virtual-repeat-offsetter'));\n\n    $material.flushOutstandingAnimations();\n\n    return component;\n  }\n\n  function createItems(num, label) {\n    var items = [];\n\n    for (var i = 0; i < num; i++) {\n      items.push(label || 's' + (i * 2) + 's');\n    }\n\n    return items;\n  }\n\n  function getRepeated() {\n    return component[0].querySelectorAll('[md-virtual-repeat]');\n  }\n\n  it('should $emit $md-resize-enable at startup', function() {\n    var emitted = false;\n    scope.$on('$md-resize-enable', function() {\n      emitted = true;\n    });\n\n    createRepeater();\n\n    expect(emitted).toBe(true);\n  });\n\n  it('should render only enough items to fill the viewport + 3 (vertical)', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    var numItemRenderers = VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA;\n\n    expect(getRepeated().length).toBe(numItemRenderers);\n    expect(sizer[0].offsetHeight).toBe(NUM_ITEMS * ITEM_SIZE);\n  });\n\n  it('should render only enough items to fill the viewport + 3 (horizontal)', function() {\n    container.attr('md-orient-horizontal', '');\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    var numItemRenderers = HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA;\n\n    expect(getRepeated().length).toBe(numItemRenderers);\n    expect(sizer[0].offsetWidth).toBe(NUM_ITEMS * ITEM_SIZE);\n  });\n\n  it('should render only enough items to fill the viewport + 3 (vertical, no md-item-size)', function() {\n    repeater.removeAttr('md-item-size');\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    $material.flushInterimElement();\n\n    var numItemRenderers = VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA;\n\n    expect(getRepeated().length).toBe(numItemRenderers);\n    expect(sizer[0].offsetHeight).toBe(NUM_ITEMS * ITEM_SIZE);\n  });\n\n  it('should render only enough items to fill the viewport + 3 (horizontal, no md-item-size)', function() {\n\n    container.attr('md-orient-horizontal', '');\n    repeater.removeAttr('md-item-size');\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$digest();\n    $$rAF.flush();\n    $$rAF.flush();\n\n    var numItemRenderers = HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA;\n\n    expect(getRepeated().length).toBe(numItemRenderers);\n    expect(sizer[0].offsetWidth).toBe(NUM_ITEMS * ITEM_SIZE);\n  });\n\n  it('should reposition and swap items on scroll (vertical)', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    var repeated;\n\n    // Don't quite scroll past the first item.\n    scroller[0].scrollTop = ITEM_SIZE - 1;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateY(0px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA);\n    expect(repeated[0].textContent.trim()).toBe('s0s 0');\n\n    // Scroll past the first item.\n    // Expect that one new item is created.\n    scroller[0].scrollTop = ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateY(0px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA + 1);\n    expect(repeated[0].textContent.trim()).toBe('s0s 0');\n\n    // Scroll past the fourth item.\n    // Expect that we now have the full set of extra items above and below.\n    scroller[0].scrollTop = ITEM_SIZE * (VirtualRepeatController.NUM_EXTRA + 1);\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateY(10px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA * 2);\n    expect(repeated[0].textContent.trim()).toBe('s2s 1');\n\n    // Scroll to the end.\n    // Expect the bottom extra items to be removed (pooled).\n    scroller[0].scrollTop = 1000;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateY(970px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA);\n    expect(repeated[0].textContent.trim()).toBe('s194s 97');\n  });\n\n  it('should reposition and swap items on scroll (horizontal)', function() {\n    container.attr('md-orient-horizontal', '');\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    var repeated;\n\n    // Don't quite scroll past the first item.\n    scroller[0].scrollLeft = ITEM_SIZE - 1;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateX(0px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA);\n    expect(repeated[0].textContent.trim()).toBe('s0s 0');\n\n    // Scroll past the first item.\n    // Expect that we now have the full set of extra items above and below.\n    scroller[0].scrollLeft = ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateX(0px)');\n    repeated = getRepeated();\n    expect(repeated.length)\n        .toBe(HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA + 1);\n    expect(repeated[0].textContent.trim()).toBe('s0s 0');\n\n    // Scroll past the fourth item.\n    // Expect that one new item is created.\n    scroller[0].scrollLeft = ITEM_SIZE * (VirtualRepeatController.NUM_EXTRA + 1);\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateX(10px)');\n    repeated = getRepeated();\n    expect(repeated.length)\n        .toBe(HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA * 2);\n    expect(repeated[0].textContent.trim()).toBe('s2s 1');\n\n    // Scroll to the end.\n    // Expect the bottom extra items to be removed (pooled).\n    scroller[0].scrollLeft = 950;\n    scroller.triggerHandler('scroll');\n    expect(getTransform(offsetter)).toBe('translateX(920px)');\n    repeated = getRepeated();\n    expect(repeated.length).toBe(HORIZONTAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA);\n    expect(repeated[0].textContent.trim()).toBe('s184s 92');\n  });\n\n  it('should dirty-check only the swapped scope on scroll', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n    scroller[0].scrollTop = 100;\n    scroller.triggerHandler('scroll');\n\n    var scopes = Array.prototype.map.call(getRepeated(), function(elem) {\n      var s = angular.element(elem).scope();\n      spyOn(s, '$digest').and.callThrough();\n      return s;\n    });\n\n    // Scroll up by one.\n    // Expect only the last (index 15) scope to have $digested.\n    scroller[0].scrollTop = 90;\n    scroller.triggerHandler('scroll');\n    expect(scopes[15].$digest).toHaveBeenCalled();\n    expect(scopes[14].$digest).not.toHaveBeenCalled();\n\n    // Scroll down by two.\n    // Expect only the first scope to have $digested.\n    scroller[0].scrollTop = 110;\n    scroller.triggerHandler('scroll');\n    expect(scopes[0].$digest).toHaveBeenCalled();\n    expect(scopes[1].$digest).not.toHaveBeenCalled();\n  });\n\n  it('should update and preserve scroll position when the watched array increases length', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n    scroller[0].scrollTop = 100;\n    scroller.triggerHandler('scroll');\n\n    scope.items = createItems(NUM_ITEMS+1);\n    scope.$apply();\n\n    expect(scroller[0].scrollTop).toBe(100);\n    expect(getRepeated()[0].textContent.trim()).toBe('s14s 7');\n  });\n\n  it('should update and preserve scroll position when the watched array decreases length', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS+1);\n    scope.$apply();\n    $$rAF.flush();\n    scroller[0].scrollTop = 100;\n    scroller.triggerHandler('scroll');\n\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n\n    expect(scroller[0].scrollTop).toBe(100);\n    expect(getRepeated()[0].textContent.trim()).toBe('s14s 7');\n  });\n\n  it('should update and alter scroll position when the watched array decreases length (the remaining items do not fill the rest of the container)', function() {\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS+1);\n    scope.$apply();\n    $$rAF.flush();\n    scroller[0].scrollTop = 100;\n    scroller.triggerHandler('scroll');\n\n    scope.items = ['a', 'b', 'c'];\n    scope.$apply();\n\n    expect(scroller[0].scrollTop).toBe(0);\n    expect(getRepeated()[0].textContent.trim()).toBe('a 0');\n  });\n\n  it('should cap individual element size for the sizer in large item sets', function() {\n    // Create a larger number of items than will fit in one maximum element size.\n    var numItems = MAX_ELEMENT_PIXELS / ITEM_SIZE + 1;\n\n    createRepeater();\n    scope.items = createItems(numItems);\n    scope.$apply();\n    $$rAF.flush();\n\n    // Expect that the sizer as a whole is still exactly the height it should be.\n    // We expect the offset to be close to the exact height, because on IE there are some deviations.\n    expect(sizer[0].offsetHeight).toBeCloseTo(numItems * ITEM_SIZE, -1);\n\n    // Expect that sizer only adds as many children as it needs to.\n    var numChildren = sizer[0].childNodes.length;\n    expect(numChildren).toBe(Math.ceil(numItems * ITEM_SIZE / MAX_ELEMENT_PIXELS));\n\n    // Expect that every child of sizer does not exceed the maximum element size.\n    for (var i = 0; i < numChildren; i++) {\n      expect(sizer[0].childNodes[i].offsetHeight).toBeLessThan(MAX_ELEMENT_PIXELS + 1);\n    }\n  });\n\n  it('should clear scroller if large set of items is filtered to much smaller set', function() {\n    // Create a larger number of items than will fit in one maximum element size.\n    var numItems = MAX_ELEMENT_PIXELS / ITEM_SIZE + 1;\n\n    createRepeater();\n    scope.items = createItems(numItems);\n    scope.$apply();\n    $$rAF.flush();\n\n    // Expect that the sizer as a whole is still exactly the height it should be.\n    // We expect the offset to be close to the exact height, because on IE there are some deviations.\n    expect(sizer[0].offsetHeight).toBeCloseTo(numItems * ITEM_SIZE, -1);\n\n    // Expect the sizer to have children, because the the children are necessary to not exceed the maximum\n    // size of a DOM element.\n    expect(sizer[0].children.length).not.toBe(0);\n\n    // Now that the sizer is really big, change the the number of items to be very small.\n    numItems = 2;\n    scope.items = createItems(numItems);\n    scope.$apply();\n    $$rAF.flush();\n\n    // Expect that the sizer as a whole is still exactly the height it should be.\n    expect(sizer[0].offsetHeight).toBe(numItems * ITEM_SIZE);\n\n    // Expect that the sizer has no children, as all of items fit comfortably in a single element.\n    expect(sizer[0].children.length).toBe(0);\n  });\n\n  it('should start at the given scroll position', function() {\n    scope.startIndex = 10;\n    scope.items = createItems(200);\n    createRepeater();\n    scope.$apply();\n    $timeout.flush();\n    $$rAF.flush();\n\n    expect(scroller[0].scrollTop).toBe(10 * ITEM_SIZE);\n  });\n\n  it('should shrink the container when the number of items goes down (vertical)', function() {\n    container.attr('md-auto-shrink', '');\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    expect(container[0].offsetHeight).toBe(100);\n    expect(offsetter.children().length).toBe(13);\n\n    // With 5 items...\n    scope.items = createItems(5);\n    scope.$apply();\n    expect(container[0].offsetHeight).toBe(5 * ITEM_SIZE);\n    expect(offsetter.children().length).toBe(5);\n\n    // With 0 items...\n    scope.items = [];\n    scope.$apply();\n    expect(container[0].offsetHeight).toBe(0);\n    expect(offsetter.children().length).toBe(0);\n\n    // With lots of items again...\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    expect(container[0].offsetHeight).toBe(100);\n    expect(offsetter.children().length).toBe(13);\n  });\n\n  it('should shrink the container when the number of items goes down (horizontal)', function() {\n    container.attr({\n      'md-auto-shrink': '',\n      'md-orient-horizontal': ''\n    });\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    expect(container[0].offsetWidth).toBe(150);\n    expect(offsetter.children().length).toBe(18);\n\n    // With 5 items...\n    scope.items = createItems(5);\n    scope.$apply();\n    expect(container[0].offsetWidth).toBe(5 * ITEM_SIZE);\n    expect(offsetter.children().length).toBe(5);\n\n    // With 0 items...\n    scope.items = [];\n    scope.$apply();\n    expect(container[0].offsetWidth).toBe(0);\n    expect(offsetter.children().length).toBe(0);\n\n    // With lots of items again...\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    expect(container[0].offsetWidth).toBe(150);\n    expect(offsetter.children().length).toBe(18);\n  });\n\n  it('should not shrink below the specified md-auto-shrink-min (vertical)', function() {\n    container.attr({\n      'md-auto-shrink': '',\n      'md-auto-shrink-min': '2'\n    });\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    expect(container[0].offsetHeight).toBe(100);\n\n    // With 5 items...\n    scope.items = createItems(5);\n    scope.$apply();\n    expect(container[0].offsetHeight).toBe(5 * ITEM_SIZE);\n\n    // With 0 items...\n    scope.items = [];\n    scope.$apply();\n    expect(container[0].offsetHeight).toBe(2 * ITEM_SIZE);\n  });\n\n  it('should not shrink below the specified md-auto-shrink-min (horizontal)', function() {\n    container.attr({\n      'md-auto-shrink': '',\n      'md-auto-shrink-min': '2',\n      'md-orient-horizontal': ''\n    });\n    createRepeater();\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    expect(container[0].offsetWidth).toBe(150);\n\n    // With 5 items...\n    scope.items = createItems(5);\n    scope.$apply();\n    expect(container[0].offsetWidth).toBe(5 * ITEM_SIZE);\n\n    // With 0 items...\n    scope.items = [];\n    scope.$apply();\n    expect(container[0].offsetWidth).toBe(2 * ITEM_SIZE);\n  });\n\n  it('should measure item size after data has loaded (no md-item-size)', function() {\n    repeater.removeAttr('md-item-size');\n    createRepeater();\n    scope.$apply();\n    $$rAF.flush();\n\n    expect(getRepeated().length).toBe(0);\n\n    scope.items = createItems(NUM_ITEMS);\n    scope.$apply();\n    $$rAF.flush();\n\n    var numItemRenderers = VERTICAL_PX / ITEM_SIZE + VirtualRepeatController.NUM_EXTRA;\n    expect(getRepeated().length).toBe(numItemRenderers);\n  });\n\n  it('should resize the scroller correctly when item length changes (vertical)', function() {\n    scope.items = createItems(200);\n    createRepeater();\n    scope.$apply();\n    $$rAF.flush();\n    expect(sizer[0].offsetHeight).toBe(200 * ITEM_SIZE);\n\n    // Scroll down half way\n    scroller[0].scrollTop = 100 * ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    $$rAF.flush();\n\n    // Remove some items\n    scope.items = createItems(20);\n    scope.$apply();\n    $$rAF.flush();\n    expect(scroller[0].scrollTop).toBe(100);\n    expect(sizer[0].offsetHeight).toBe(20 * ITEM_SIZE);\n\n    // Scroll down half way\n    scroller[0].scrollTop = 10 * ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    $$rAF.flush();\n\n    // Add more items\n    scope.items = createItems(250);\n    scope.$apply();\n    $$rAF.flush();\n    expect(scroller[0].scrollTop).toBe(100);\n    expect(sizer[0].offsetHeight).toBe(250 * ITEM_SIZE);\n  });\n\n  it('should resize the scroller correctly when item length changes (horizontal)', function() {\n    container.attr({'md-orient-horizontal': ''});\n    scope.items = createItems(200);\n    createRepeater();\n    scope.$apply();\n    $$rAF.flush();\n    expect(sizer[0].offsetWidth).toBe(200 * ITEM_SIZE);\n\n    // Scroll right half way\n    scroller[0].scrollLeft = 100 * ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    $$rAF.flush();\n\n    // Remove some items\n    scope.items = createItems(20);\n    scope.$apply();\n    $$rAF.flush();\n    expect(scroller[0].scrollLeft).toBe(50);\n    expect(sizer[0].offsetWidth).toBe(20 * ITEM_SIZE);\n\n    // Scroll right half way\n    scroller[0].scrollLeft = 10 * ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    $$rAF.flush();\n\n    // Add more items\n    scope.items = createItems(250);\n    scope.$apply();\n    $$rAF.flush();\n    expect(sizer[0].offsetWidth).toBe(250 * ITEM_SIZE);\n  });\n\n  it('should update topIndex when scrolling', function() {\n    container.attr({'md-top-index': 'topIndex'});\n    scope.items = createItems(NUM_ITEMS);\n    createRepeater();\n\n    scope.$apply();\n    expect(scope.topIndex).toBe(0);\n\n    scroller[0].scrollTop = ITEM_SIZE * 50;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    expect(scope.topIndex).toBe(50);\n\n    scroller[0].scrollTop = 25 * ITEM_SIZE;\n    scroller.triggerHandler('scroll');\n    scope.$apply();\n    expect(scope.topIndex).toBe(25);\n  });\n\n  it('should start at the given topIndex position', function() {\n    container.attr({'md-top-index': 'topIndex'});\n    repeater.removeAttr('md-start-index');\n    scope.topIndex = 10;\n    scope.items = createItems(200);\n    createRepeater();\n    scope.$apply();\n    $timeout.flush();\n\n    expect(scroller[0].scrollTop).toBe(10 * ITEM_SIZE);\n  });\n\n  it('should scroll when topIndex is updated', function() {\n    container.attr({'md-top-index': 'topIndex'});\n    scope.items = createItems(200);\n    createRepeater();\n\n    scope.topIndex = 50;\n    scope.$apply();\n    expect(scroller[0].scrollTop).toBe(50 * ITEM_SIZE);\n\n    scope.topIndex = 25;\n    scope.$apply();\n    expect(scroller[0].scrollTop).toBe(25 * ITEM_SIZE);\n  });\n\n  it('should recheck container size on window resize', function() {\n    spyOn($mdUtil, 'debounce').and.callFake(angular.identity);\n    scope.items = createItems(100);\n    createRepeater();\n    // Expect 13 children (10 + 3 extra).\n    expect(offsetter.children().length).toBe(13);\n\n    container.css('height', '400px');\n    angular.element($window).triggerHandler('resize');\n\n    // Expect 43 children (40 + 3 extra).\n    expect(offsetter.children().length).toBe(43);\n  });\n\n  it('should recheck container size and scroll position on $md-resize scope ' +\n      'event', function() {\n    scope.items = createItems(100);\n    createRepeater();\n    // Expect 13 children (10 + 3 extra).\n    expect(offsetter.children().length).toBe(13);\n\n    container.css('height', '300px');\n    scope.$parent.$broadcast('$md-resize');\n\n    // Expect 33 children (30 + 3 extra).\n    expect(offsetter.children().length).toBe(33);\n\n    container.css('height', '400px');\n    scroller[0].scrollTop = 20;\n    scope.$parent.$broadcast('$md-resize');\n\n    // Expect 45 children (40 + 5 extra).\n    expect(offsetter.children().length).toBe(45);\n  });\n\n  it('should shrink when initial results require shrinking', inject(function() {\n    scope.items = [\n      { value: 'alabama', display: 'Alabama' },\n      { value: 'alaska', display: 'Alaska' },\n      { value: 'arizona', display: 'Arizona' }\n    ];\n    createRepeater();\n    var controller = component.controller('mdVirtualRepeatContainer');\n    controller.autoShrink = true;\n    controller.autoShrink_(50);\n\n    expect(component[0].clientHeight).toBe(50);\n    expect(offsetter.children().length).toBe(3);\n  }));\n\n  it('should not scroll past the bottom', function() {\n    scope.items = createItems(101);\n    createRepeater();\n\n    scroller[0].scrollTop = ITEM_SIZE * 91;\n    scroller.triggerHandler('scroll');\n\n    expect(getTransform(offsetter)).toBe('translateY(880px)');\n\n    scroller[0].scrollTop++;\n    scroller.triggerHandler('scroll');\n\n    expect(getTransform(offsetter)).toBe('translateY(880px)');\n  });\n\n  it('should re-render the list when switching to a smaller array', function() {\n    scope.items = createItems(50, 'list one');\n\n    createRepeater();\n    scroller[0].scrollTop = 5;\n    scroller.triggerHandler('scroll');\n\n    expect(offsetter.children().eq(0).text()).toContain('list one');\n\n    scope.$apply(function() {\n      scope.items = createItems(25, 'list two');\n    });\n\n    expect(offsetter.children().eq(0).text()).toContain('list two');\n  });\n\n  describe('md-on-demand', function() {\n\n    it('should validate an empty md-on-demand attribute value correctly', inject(function() {\n      repeater.attr('md-on-demand', '');\n      createRepeater();\n\n      var containerCtrl = component.controller('mdVirtualRepeatContainer');\n      expect(containerCtrl.repeater.onDemand).toBe(true);\n    }));\n\n    it('should validate md-on-demand attribute with `true` correctly', inject(function() {\n      repeater.attr('md-on-demand', 'true');\n      createRepeater();\n\n      var containerCtrl = component.controller('mdVirtualRepeatContainer');\n      expect(containerCtrl.repeater.onDemand).toBe(true);\n    }));\n\n    it('should validate md-on-demand attribute with `false` correctly', inject(function() {\n      repeater.attr('md-on-demand', 'false');\n      createRepeater();\n\n      var containerCtrl = component.controller('mdVirtualRepeatContainer');\n      expect(containerCtrl.repeater.onDemand).toBe(false);\n    }));\n  });\n\n  describe('when container scope is destroyed', function() {\n\n    it('should clean up unused blocks', function() {\n      createRepeater();\n      var containerCtrl = component.controller('mdVirtualRepeatContainer');\n      scope.items = createItems(NUM_ITEMS);\n      scope.$apply();\n\n      scope.items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];\n      scope.$apply();\n\n      scope.$destroy();\n\n      var dataCount = 0;\n      angular.forEach(containerCtrl.repeater.pooledBlocks, function(block) {\n        dataCount += Object.keys(block.element.data()).length;\n      });\n      expect(dataCount).toBe(0);\n    });\n  });\n\n  /**\n   * Facade to access transform properly even when jQuery is used;\n   * since jQuery's css function is obtaining the computed style (not wanted)\n   */\n  function getTransform(target) {\n    return target[0].style.webkitTransform || target.css('transform');\n  }\n});\n"
  },
  {
    "path": "src/components/whiteframe/demoBasicClassUsage/index.html",
    "content": "<div layout=\"row\" layout-padding layout-wrap layout-fill style=\"padding-bottom: 32px;\" ng-cloak>\n\n  <md-whiteframe class=\"md-whiteframe-1dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-1dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-2dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-2dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-3dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-3dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-4dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-4dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-5dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-5dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-6dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-6dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-7dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-7dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-8dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-8dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-9dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-9dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-10dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-10dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-11dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-11dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-12dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-12dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-13dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-13dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-14dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-14dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-15dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-15dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-16dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-16dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-17dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-17dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-18dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-18dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-19dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-19dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-20dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-20dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-21dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-21dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-22dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-22dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-23dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-23dp</span>\n  </md-whiteframe>\n\n  <md-whiteframe class=\"md-whiteframe-24dp\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>.md-whiteframe-24dp</span>\n  </md-whiteframe>\n\n</div>\n"
  },
  {
    "path": "src/components/whiteframe/demoBasicClassUsage/script.js",
    "content": "angular.module('whiteframeBasicUsage', ['ngMaterial']);\n"
  },
  {
    "path": "src/components/whiteframe/demoBasicClassUsage/style.css",
    "content": "md-whiteframe {\n  margin: 30px;\n  height: 100px;\n}\n\n/* For breakpoint `-xs` */\n@media (max-width: 599px) {\n  md-whiteframe {\n    margin: 7px;\n    height: 50px;\n  }\n  md-whiteframe > span {\n    font-size: 0.4em;\n  }\n}\n\n/* For breakpoint `-sm` */\n@media (min-width: 600px ) and (max-width: 959px) {\n  md-whiteframe {\n    margin: 20px;\n    height: 75px;\n  }\n  md-whiteframe > span {\n    font-size: 0.6em;\n  }\n}\n\n/* For breakpoint `-md` */\n@media (min-width: 960px ) and (max-width: 1279px) {\n  md-whiteframe {\n    margin: 20px;\n    height: 90px;\n  }\n  md-whiteframe > span {\n    font-size: 0.9em;\n  }\n}\n\n/* For breakpoint `-gt-md` */\n@media (min-width: 1280px) {\n  md-whiteframe {\n    margin: 25px;\n    height: 100px;\n  }\n  md-whiteframe > span {\n    font-size: 1.0em;\n  }\n}\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveAttributeUsage/index.html",
    "content": "<div layout=\"row\" layout-padding layout-wrap layout-fill style=\"padding-bottom: 32px;\" ng-cloak>\n\n  <div class=\"padded\" md-whiteframe=\"1\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"1\"</span>\n  </div>\n  \n  <div class=\"padded\" md-whiteframe=\"2\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"2\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"3\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"3\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"4\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"4\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"5\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"5\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"6\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"6\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"7\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"7\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"8\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"8\"</span>  \n  </div>  \n  \n  <div class=\"padded\" md-whiteframe=\"9\"   flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"9\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"10\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"10\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"11\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"11\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"12\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"12\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"13\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"13\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"14\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"14\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"15\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"15\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"16\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"16\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"17\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"17\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"18\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"18\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"19\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"19\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"20\" flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"20\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"21\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"21\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"22\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"22\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"23\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"23\"</span>\n  </div>\n\n  <div class=\"padded\" md-whiteframe=\"24\"  flex-sm=\"45\" flex-gt-sm=\"35\" flex-gt-md=\"25\" layout layout-align=\"center center\">\n    <span>md-whiteframe=\"24\"</span>\n  </div>\n\n</div>\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveAttributeUsage/script.js",
    "content": "angular.module('whiteframeDirectiveUsage', ['ngMaterial']);\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveAttributeUsage/style.css",
    "content": "md-whiteframe, div.padded {\n  margin: 30px;\n  height: 100px;\n}\n\n/* For breakpoint `-xs` */\n@media (max-width: 599px) {\n  md-whiteframe, div.padded {\n    margin: 7px;\n    height: 50px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.4em;\n  }\n}\n\n/* For breakpoint `-sm` */\n@media (min-width: 600px ) and (max-width: 959px) {\n  md-whiteframe, div.padded {\n    margin: 20px;\n    height: 75px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.6em;\n  }\n}\n\n/* For breakpoint `-md` */\n@media (min-width: 960px ) and (max-width: 1279px) {\n  md-whiteframe, div.padded {\n    margin: 20px;\n    height: 90px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.9em;\n  }\n}\n\n/* For breakpoint `-gt-md` */\n@media (min-width: 1280px) {\n  md-whiteframe, div.padded {\n    margin: 25px;\n    height: 100px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 1.0em;\n  }\n}\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveInterpolation/index.html",
    "content": "<div layout=\"row\" layout-padding layout-wrap layout-margin ng-cloak layout-align=\"space-around\" ng-controller=\"DemoCtrl as ctrl\">\n  <div class=\"padded\" md-whiteframe=\"{{ctrl.elevation}}\" flex=\"100\" flex-gt-sm=\"50\" layout=\"column\" layout-align=\"center center\">\n    <span ng-non-bindable>md-whiteframe=\"{{ctrl.elevation}}\"</span>\n    <span>md-whiteframe=\"{{ctrl.elevation}}\"</span>\n    <span>Increments through the available elevations</span>\n  </div>\n  <div class=\"padded\" md-whiteframe=\"{{height}}\" flex=\"100\" flex-gt-sm=\"50\" layout=\"column\" layout-align=\"center center\"\n      ng-init=\"height = 3\" ng-mouseenter=\"height = 6\" ng-mouseleave=\"height = 3\">\n    <span ng-non-bindable>md-whiteframe=\"{{height}}\"</span>\n    <span>md-whiteframe=\"{{height}}\"</span>\n    <span>Hover to toggle</span>\n  </div>\n  <div class=\"padded\" md-whiteframe=\"{{ctrl.showFrame}}\" flex=\"100\" flex-gt-sm=\"50\" layout=\"column\" layout-align=\"center center\"\n      ng-click=\"ctrl.toggleFrame()\">\n    <span ng-non-bindable>md-whiteframe=\"{{ctrl.showFrame}}\"</span>\n    <span>md-whiteframe=\"{{ctrl.showFrame}}\"</span>\n    <span>Set to -1 to remove elevation shadow, click to toggle</span>\n  </div>\n</div>\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveInterpolation/script.js",
    "content": "angular.module('whiteframeDirectiveUsage', ['ngMaterial'])\n    .controller('DemoCtrl', function($interval) {\n      this.elevation = 1;\n      this.showFrame = 3;\n\n      this.nextElevation = function() {\n        if (++this.elevation == 25) {\n          this.elevation = 1;\n        }\n      };\n\n      $interval(this.nextElevation.bind(this), 500);\n\n      this.toggleFrame = function() {\n        this.showFrame = this.showFrame == 3 ? -1 : 3;\n      };\n    });\n"
  },
  {
    "path": "src/components/whiteframe/demoDirectiveInterpolation/style.css",
    "content": "md-whiteframe, div.padded {\n  height: 100px;\n}\n\nmd-whiteframe:focus, div.padded:focus {\n  outline: none;\n}\n\n.layout-margin div.padded {\n  margin: 16px 8px;\n}\n\n/* For breakpoint `-xs` */\n@media (max-width: 599px) {\n  md-whiteframe, div.padded {\n    margin: 7px;\n    height: 50px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.4em;\n  }\n}\n\n/* For breakpoint `-sm` */\n@media (min-width: 600px ) and (max-width: 959px) {\n  md-whiteframe, div.padded {\n    height: 75px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.6em;\n  }\n}\n\n/* For breakpoint `-md` */\n@media (min-width: 960px ) and (max-width: 1279px) {\n  md-whiteframe, div.padded {\n    height: 90px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 0.9em;\n  }\n}\n\n/* For breakpoint `-gt-md` */\n@media (min-width: 1280px) {\n  md-whiteframe, div.padded {\n    height: 100px;\n  }\n  md-whiteframe > span, div.padded > span {\n    font-size: 1.0em;\n  }\n}\n"
  },
  {
    "path": "src/components/whiteframe/whiteframe.js",
    "content": "/**\n * @ngdoc module\n * @name material.components.whiteframe\n */\nangular\n  .module('material.components.whiteframe', ['material.core'])\n  .directive('mdWhiteframe', MdWhiteframeDirective);\n\n/**\n * @ngdoc directive\n * @module material.components.whiteframe\n * @name mdWhiteframe\n *\n * @description\n * The md-whiteframe directive allows you to apply an elevation shadow to an element.\n *\n * The attribute values needs to be a number between 1 and 24 or -1.\n * When set to -1 no style is applied.\n *\n * ### Notes\n * - If there is no value specified it defaults to 4dp.\n * - If the value is not valid it defaults to 4dp.\n\n * @usage\n * <hljs lang=\"html\">\n * <div md-whiteframe=\"3\">\n *   <span>Elevation of 3dp</span>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"html\">\n * <div md-whiteframe=\"-1\">\n *   <span>No elevation shadow applied</span>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"html\">\n * <div ng-init=\"elevation = 5\" md-whiteframe=\"{{elevation}}\">\n *   <span>Elevation of 5dp with an interpolated value</span>\n * </div>\n * </hljs>\n */\nfunction MdWhiteframeDirective($log) {\n  var DISABLE_DP = -1;\n  var MIN_DP = 1;\n  var MAX_DP = 24;\n  var DEFAULT_DP = 4;\n\n  return {\n    link: postLink\n  };\n\n  function postLink(scope, element, attr) {\n    var oldClass = '';\n\n    attr.$observe('mdWhiteframe', function(elevation) {\n      elevation = parseInt(elevation, 10) || DEFAULT_DP;\n\n      if (elevation != DISABLE_DP && (elevation > MAX_DP || elevation < MIN_DP)) {\n        $log.warn('md-whiteframe attribute value is invalid. It should be a number between ' + MIN_DP + ' and ' + MAX_DP, element[0]);\n        elevation = DEFAULT_DP;\n      }\n\n      var newClass = elevation == DISABLE_DP ? '' : 'md-whiteframe-' + elevation + 'dp';\n      attr.$updateClass(newClass, oldClass);\n      oldClass = newClass;\n    });\n  }\n}\n\n"
  },
  {
    "path": "src/components/whiteframe/whiteframe.scss",
    "content": ".md-whiteframe-1dp, .md-whiteframe-z1 {\n  box-shadow: $whiteframe-shadow-1dp;\n}\n.md-whiteframe-2dp {\n  box-shadow: $whiteframe-shadow-2dp;\n}\n.md-whiteframe-3dp {\n  box-shadow: $whiteframe-shadow-3dp;\n}\n.md-whiteframe-4dp, .md-whiteframe-z2{\n  box-shadow: $whiteframe-shadow-4dp;\n}\n.md-whiteframe-5dp {\n  box-shadow: $whiteframe-shadow-5dp;\n}\n.md-whiteframe-6dp {\n  box-shadow: $whiteframe-shadow-6dp;\n}\n.md-whiteframe-7dp, .md-whiteframe-z3 {\n  box-shadow: $whiteframe-shadow-7dp;\n}\n.md-whiteframe-8dp {\n  box-shadow: $whiteframe-shadow-8dp;\n}\n.md-whiteframe-9dp {\n  box-shadow: $whiteframe-shadow-9dp;\n}\n.md-whiteframe-10dp, .md-whiteframe-z4 {\n  box-shadow: $whiteframe-shadow-10dp;\n}\n.md-whiteframe-11dp {\n  box-shadow: $whiteframe-shadow-11dp;\n}\n.md-whiteframe-12dp {\n  box-shadow: $whiteframe-shadow-12dp;\n}\n.md-whiteframe-13dp, .md-whiteframe-z5{\n  box-shadow: $whiteframe-shadow-13dp;\n}\n.md-whiteframe-14dp {\n  box-shadow: $whiteframe-shadow-14dp;\n}\n.md-whiteframe-15dp {\n  box-shadow: $whiteframe-shadow-15dp;\n}\n.md-whiteframe-16dp {\n  box-shadow: $whiteframe-shadow-16dp;\n}\n.md-whiteframe-17dp {\n  box-shadow: $whiteframe-shadow-17dp;\n}\n.md-whiteframe-18dp {\n  box-shadow: $whiteframe-shadow-18dp;\n}\n.md-whiteframe-19dp {\n  box-shadow: $whiteframe-shadow-19dp;\n}\n.md-whiteframe-20dp {\n  box-shadow: $whiteframe-shadow-20dp;\n}\n.md-whiteframe-21dp {\n  box-shadow: $whiteframe-shadow-21dp;\n}\n.md-whiteframe-22dp {\n  box-shadow: $whiteframe-shadow-22dp;\n}\n.md-whiteframe-23dp {\n  box-shadow: $whiteframe-shadow-23dp;\n}\n.md-whiteframe-24dp {\n  box-shadow: $whiteframe-shadow-24dp;\n}\n\n@media screen and (-ms-high-contrast: active) {\n  md-whiteframe {\n    border: 1px solid #fff;\n  }\n}\n\n@media print {\n  md-whiteframe, [md-whiteframe] {\n    background-color: #ffffff;\n  }\n}\n"
  },
  {
    "path": "src/components/whiteframe/whiteframe.spec.js",
    "content": "describe('mdWhiteframe directive', function() {\n\n  beforeEach(module('material.components.whiteframe'));\n\n  function buildWhiteframe(elevation) {\n    var element;\n    inject(function($compile, $rootScope) {\n      element = $compile('<div md-whiteframe=\"' + (elevation || '') + '\">')($rootScope);\n      $rootScope.$digest();\n    });\n    return element;\n  }\n\n  it('should default to 4dp if no attribute value is specified', function() {\n    var element = buildWhiteframe();\n\n    expect(element).toHaveClass('md-whiteframe-4dp');\n  });\n\n  it('should default to 4dp if the attribute value is invalid', inject(function($log) {\n    spyOn($log, 'warn');\n    var element = buildWhiteframe('999');\n\n    expect($log.warn).toHaveBeenCalled();\n    expect(element).toHaveClass('md-whiteframe-4dp');\n  }));\n\n  it('should use the default dp and warn if the attribute value is to low', inject(function($log) {\n    spyOn($log, 'warn');\n    var element = buildWhiteframe('-2');\n\n    expect($log.warn).toHaveBeenCalled();\n    expect(element).toHaveClass('md-whiteframe-4dp');\n  }));\n\n  it('should not apply a whiteframe if the attribute value is -1', inject(function($log) {\n    spyOn($log, 'warn');\n    var element = buildWhiteframe('-1');\n\n    expect($log.warn).not.toHaveBeenCalled();\n    expect(element).not.toHaveClass('md-whiteframe-4dp');\n  }));\n\n  it('should apply the correct whiteframe if attribute value is valid', function() {\n    var element = buildWhiteframe('9');\n\n    expect(element).toHaveClass('md-whiteframe-9dp');\n  });\n\n  it('should default to 4dp if the attribute value is a text', function() {\n    var element = buildWhiteframe('invalid text');\n\n    expect(element).toHaveClass('md-whiteframe-4dp');\n  });\n\n  it('should not round a decimal number', function() {\n    var element = buildWhiteframe('1.8');\n\n    expect(element).toHaveClass('md-whiteframe-1dp');\n  });\n\n  it('should interpolate the elevation value', inject(function($rootScope) {\n    $rootScope.elevation = 6;\n\n    var element = buildWhiteframe('{{elevation}}');\n\n    expect(element).toHaveClass('md-whiteframe-6dp');\n\n    $rootScope.elevation = -1;\n    $rootScope.$digest();\n\n    expect(element).not.toHaveClass('md-whiteframe-6dp');\n    expect(element).not.toHaveClass('md-whiteframe-4dp');\n\n    $rootScope.elevation = 0;\n    $rootScope.$digest();\n\n    expect(element).toHaveClass('md-whiteframe-4dp');\n  }));\n});\n"
  },
  {
    "path": "src/core/core.js",
    "content": "/**\n * Initialization function that validates environment\n * requirements.\n */\nangular\n  .module('material.core', [\n    'ngAnimate',\n    'material.core.animate',\n    'material.core.layout',\n    'material.core.interaction',\n    'material.core.gestures',\n    'material.core.theming'\n  ])\n  .config(MdCoreConfigure)\n  .run(DetectNgTouch);\n\n\n/**\n * Detect if the ng-Touch module is also being used.\n * Warn if detected.\n * @ngInject\n */\nfunction DetectNgTouch($log, $injector) {\n  if ($injector.has('$swipe')) {\n    var msg = \"\" +\n      \"You are using the ngTouch module. \\n\" +\n      \"AngularJS Material already has mobile click, tap, and swipe support... \\n\" +\n      \"ngTouch is not supported with AngularJS Material!\";\n    $log.warn(msg);\n  }\n}\n\n/**\n * @ngInject\n */\nfunction MdCoreConfigure($provide, $mdThemingProvider) {\n\n  $provide.decorator('$$rAF', ['$delegate', rAFDecorator]);\n  $provide.decorator('$q', ['$delegate', qDecorator]);\n\n  $mdThemingProvider.theme('default')\n    .primaryPalette('indigo')\n    .accentPalette('pink')\n    .warnPalette('deep-orange')\n    .backgroundPalette('grey');\n}\n\n/**\n * @ngInject\n */\nfunction rAFDecorator($delegate) {\n  /**\n   * Use this to throttle events that come in often.\n   * The throttled function will always use the *last* invocation before the\n   * coming frame.\n   *\n   * For example, window resize events that fire many times a second:\n   * If we set to use an raf-throttled callback on window resize, then\n   * our callback will only be fired once per frame, with the last resize\n   * event that happened before that frame.\n   *\n   * @param {function} cb function to debounce\n   */\n  $delegate.throttle = function(cb) {\n    var queuedArgs, alreadyQueued, queueCb, context;\n    return function debounced() {\n      queuedArgs = arguments;\n      context = this;\n      queueCb = cb;\n      if (!alreadyQueued) {\n        alreadyQueued = true;\n        $delegate(function() {\n          queueCb.apply(context, Array.prototype.slice.call(queuedArgs));\n          alreadyQueued = false;\n        });\n      }\n    };\n  };\n  return $delegate;\n}\n\n/**\n * @ngInject\n */\nfunction qDecorator($delegate) {\n  /**\n   * Adds a shim for $q.resolve for AngularJS version that don't have it,\n   * so we don't have to think about it.\n   *\n   * via https://github.com/angular/angular.js/pull/11987\n   */\n\n  // TODO(crisbeto): this won't be necessary once we drop AngularJS 1.3\n  if (!$delegate.resolve) {\n    $delegate.resolve = $delegate.when;\n  }\n  return $delegate;\n}\n"
  },
  {
    "path": "src/core/core.spec.js",
    "content": "describe('material.core', function() {\n\n  describe(\"detect if ng-touch module is loaded\", function() {\n    beforeEach(module('ngTouch', 'material.core'));\n\n    it('should find ngTouch $swipe instance', inject(function($injector) {\n      // This is check in core.js#L22\n      expect($injector.has('$swipe')).toBe(true);\n    }));\n\n  });\n\n  describe(\"if ng-touch module is NOT loaded\", function() {\n    beforeEach(module('material.core'));\n\n    it('should find not find the ngTouch $swipe instance', inject(function($injector) {\n      // This is check in core.js#L22\n      expect($injector.has('$swipe')).toBe(false);\n    }));\n\n  });\n\n  it('should shim $q.resolve', inject(function($q) {\n    expect(angular.isFunction($q.resolve)).toBe(true);\n    expect($q.resolve).toBe($q.when);\n  }));\n});\n\n"
  },
  {
    "path": "src/core/services/aria/aria.js",
    "content": "/**\n * @ngdoc module\n * @name material.core.aria\n * @description\n * Aria Expectations for AngularJS Material components.\n */\nangular\n  .module('material.core')\n  .provider('$mdAria', MdAriaProvider);\n\n/**\n * @ngdoc service\n * @name $mdAriaProvider\n * @module material.core.aria\n *\n * @description\n *\n * Modify options of the `$mdAria` service, which will be used by most of the AngularJS Material\n * components.\n *\n * You are able to disable `$mdAria` warnings, by using the following markup.\n *\n * <hljs lang=\"js\">\n *   app.config(function($mdAriaProvider) {\n *     // Globally disables all ARIA warnings.\n *     $mdAriaProvider.disableWarnings();\n *   });\n * </hljs>\n *\n */\nfunction MdAriaProvider() {\n\n  var config = {\n    /** Whether we should show ARIA warnings in the console if labels are missing on the element */\n    showWarnings: true\n  };\n\n  return {\n    disableWarnings: disableWarnings,\n    $get: function($$rAF, $log, $window, $interpolate) {\n      return MdAriaService.apply(config, arguments);\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $mdAriaProvider#disableWarnings\n   * @description Disables all ARIA warnings generated by AngularJS Material.\n   */\n  function disableWarnings() {\n    config.showWarnings = false;\n  }\n}\n\n/*\n * @ngInject\n */\nfunction MdAriaService($$rAF, $log, $window, $interpolate) {\n\n  // Load the showWarnings option from the current context and store it inside of a scope variable,\n  // because the context will be probably lost in some function calls.\n  var showWarnings = this.showWarnings;\n\n  return {\n    expect: expect,\n    expectAsync: expectAsync,\n    expectWithText: expectWithText,\n    expectWithoutText: expectWithoutText,\n    getText: getText,\n    hasAriaLabel: hasAriaLabel,\n    parentHasAriaLabel: parentHasAriaLabel\n  };\n\n  /**\n   * Check if expected attribute has been specified on the target element or child\n   * @param {string|JQLite} element\n   * @param {string} attrName\n   * @param {string=} defaultValue What to set the attr to if no value is found\n   */\n  function expect(element, attrName, defaultValue) {\n\n    var node = angular.element(element)[0] || element;\n\n    // if node exists and neither it nor its children have the attribute\n    if (node &&\n       ((!node.hasAttribute(attrName) ||\n        node.getAttribute(attrName).length === 0) &&\n        !childHasAttribute(node, attrName))) {\n\n      defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : '';\n      if (defaultValue.length) {\n        element.attr(attrName, defaultValue);\n      } else if (showWarnings) {\n        $log.warn('ARIA: Attribute \"', attrName, '\", required for accessibility, is missing on node:', node);\n      }\n\n    }\n  }\n\n  function expectAsync(element, attrName, defaultValueGetter) {\n    // Problem: when retrieving the element's contents synchronously to find the label,\n    // the text may not be defined yet in the case of a binding.\n    // There is a higher chance that a binding will be defined if we wait one frame.\n    $$rAF(function() {\n        expect(element, attrName, defaultValueGetter());\n    });\n  }\n\n  function expectWithText(element, attrName) {\n    var content = getText(element) || \"\";\n    var hasBinding = content.indexOf($interpolate.startSymbol()) > -1;\n\n    if (hasBinding) {\n      expectAsync(element, attrName, function() {\n        return getText(element);\n      });\n    } else {\n      expect(element, attrName, content);\n    }\n  }\n\n  function expectWithoutText(element, attrName) {\n    var content = getText(element);\n    var hasBinding = content.indexOf($interpolate.startSymbol()) > -1;\n\n    if (!hasBinding && !content) {\n      expect(element, attrName, content);\n    }\n  }\n\n  /**\n   * @param {Element|JQLite} element\n   * @returns {string}\n   */\n  function getText(element) {\n    element = element[0] || element;\n    var walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null, false);\n    var text = '';\n\n    var node;\n    while (node = walker.nextNode()) {\n      if (!isAriaHiddenNode(node)) {\n        text += node.textContent;\n      }\n    }\n\n    return text.trim() || '';\n\n    /**\n     * @param {Node} node\n     * @returns {boolean}\n     */\n    function isAriaHiddenNode(node) {\n      while (node.parentNode && (node = node.parentNode) !== element) {\n        if (node.getAttribute && node.getAttribute('aria-hidden') === 'true') {\n          return true;\n        }\n      }\n    }\n  }\n\n  function childHasAttribute(node, attrName) {\n    var hasChildren = node.hasChildNodes(),\n        hasAttr = false;\n\n    function isHidden(el) {\n      var style = el.currentStyle ? el.currentStyle : $window.getComputedStyle(el);\n      return (style.display === 'none');\n    }\n\n    if (hasChildren) {\n      var children = node.childNodes;\n      for (var i=0; i < children.length; i++) {\n        var child = children[i];\n        if (child.nodeType === 1 && child.hasAttribute(attrName)) {\n          if (!isHidden(child)) {\n            hasAttr = true;\n          }\n        }\n      }\n    }\n    return hasAttr;\n  }\n\n  /**\n   * Check if expected element has aria label attribute\n   * @param element\n   */\n  function hasAriaLabel(element) {\n    var node = angular.element(element)[0] || element;\n\n    /* Check if compatible node type (ie: not HTML Document node) */\n    if (!node.hasAttribute) {\n      return false;\n    }\n\n    /* Check label or description attributes */\n    return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby');\n  }\n\n  /**\n   * Check if expected element's parent has aria label attribute and has valid role and tagName\n   * @param {string|JQLite|Node & ParentNode} element\n   * @param {number=} level Number of levels deep search should be performed\n   */\n  function parentHasAriaLabel(element, level) {\n    level = level || 1;\n    var node = angular.element(element)[0] || element;\n    if (!node.parentNode) {\n      return false;\n    }\n    if (performCheck(node.parentNode)) {\n      return true;\n    }\n    level--;\n    if (level) {\n      return parentHasAriaLabel(node.parentNode, level);\n    }\n    return false;\n\n    function performCheck(parentNode) {\n      if (!hasAriaLabel(parentNode)) {\n        return false;\n      }\n      /* Perform role block-list check */\n      if (parentNode.hasAttribute('role')) {\n        switch (parentNode.getAttribute('role').toLowerCase()) {\n          case 'command':\n          case 'definition':\n          case 'directory':\n          case 'grid':\n          case 'list':\n          case 'listitem':\n          case 'log':\n          case 'marquee':\n          case 'menu':\n          case 'menubar':\n          case 'note':\n          case 'presentation':\n          case 'separator':\n          case 'scrollbar':\n          case 'status':\n          case 'tablist':\n            return false;\n        }\n      }\n      /* Perform tagName block-list check */\n      switch (parentNode.tagName.toLowerCase()) {\n        case 'abbr':\n        case 'acronym':\n        case 'address':\n        case 'applet':\n        case 'audio':\n        case 'b':\n        case 'bdi':\n        case 'bdo':\n        case 'big':\n        case 'blockquote':\n        case 'br':\n        case 'canvas':\n        case 'caption':\n        case 'center':\n        case 'cite':\n        case 'code':\n        case 'col':\n        case 'data':\n        case 'dd':\n        case 'del':\n        case 'dfn':\n        case 'dir':\n        case 'div':\n        case 'dl':\n        case 'em':\n        case 'embed':\n        case 'fieldset':\n        case 'figcaption':\n        case 'font':\n        case 'h1':\n        case 'h2':\n        case 'h3':\n        case 'h4':\n        case 'h5':\n        case 'h6':\n        case 'hgroup':\n        case 'html':\n        case 'i':\n        case 'ins':\n        case 'isindex':\n        case 'kbd':\n        case 'keygen':\n        case 'label':\n        case 'legend':\n        case 'li':\n        case 'map':\n        case 'mark':\n        case 'menu':\n        case 'object':\n        case 'ol':\n        case 'output':\n        case 'pre':\n        case 'presentation':\n        case 'q':\n        case 'rt':\n        case 'ruby':\n        case 'samp':\n        case 'small':\n        case 'source':\n        case 'span':\n        case 'status':\n        case 'strike':\n        case 'strong':\n        case 'sub':\n        case 'sup':\n        case 'svg':\n        case 'tbody':\n        case 'td':\n        case 'th':\n        case 'thead':\n        case 'time':\n        case 'tr':\n        case 'track':\n        case 'tt':\n        case 'ul':\n        case 'var':\n          return false;\n      }\n      return true;\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/services/aria/aria.spec.js",
    "content": "describe('$mdAria service', function() {\n\n  beforeEach(module('material.core'));\n\n  describe('expecting attributes', function() {\n\n    it('should warn if an invalid element is specified', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var target = $compile('<div></div>')($rootScope);\n\n      $mdAria.expect(null,'aria-label');\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should warn if element is missing attribute', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button><md-icon></md-icon></button>')($rootScope);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should warn if element is missing attribute value', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button aria-label><md-icon></md-icon></button>')($rootScope);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should warn if element is empty attribute', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button aria-label=\"\"><md-icon></md-icon></button>')($rootScope);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).toHaveBeenCalled();\n    }));\n\n    it('should not warn if element has text', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button>Text</button>')($rootScope);\n\n      $mdAria.expectWithoutText(button, 'aria-label');\n\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should warn if control is missing text', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var radioButton = $compile('<md-radio-button>Text</md-radio-button>')($rootScope);\n\n      $mdAria.expectWithText(radioButton, 'aria-label');\n\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should not warn if child element has attribute', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button><md-icon aria-label=\"text\"></md-icon></button>')($rootScope);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n    it('should warn if child with attribute is hidden', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var container = angular.element(document.body);\n      var button = $compile('<button><md-icon aria-label=\"text\" style=\"display:none;\"></md-icon></button>')($rootScope);\n\n      container.append(button);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).toHaveBeenCalled();\n\n      button.remove();\n\n    }));\n\n    it('should correctly retrieve the aria-label text', inject(function($compile, $rootScope, $mdAria) {\n      var container = $compile(\n        '<div>' +\n          'PLAIN' +\n          '<span>SPAN</span>' +\n          '<div>DIV</div>' +\n        '</div>'\n      )($rootScope);\n\n      $mdAria.expectWithText(container, 'aria-label');\n\n      expect(container[0].textContent).toBe('PLAINSPANDIV');\n      expect(container.attr('aria-label')).toBe('PLAINSPANDIV');\n    }));\n\n    it('should ignore aria-hidden texts when retrieving aria-label', inject(function($compile, $rootScope, $mdAria) {\n      var container = $compile(\n        '<div>' +\n          'PLAIN' +\n          '<span aria-hidden=\"true\">SPAN</span>' +\n          '<div aria-hidden=\"true\">DIV</div>' +\n        '</div>'\n      )($rootScope);\n\n      $mdAria.expectWithText(container, 'aria-label');\n\n      expect(container[0].textContent).toBe('PLAINSPANDIV');\n      expect(container.attr('aria-label')).toBe('PLAIN');\n    }));\n\n  });\n\n  describe('aria label checks', function() {\n\n    it('should detect if element has valid aria-label string', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<div aria-label=\"hello\"></div>')($rootScope);\n      expect($mdAria.hasAriaLabel(container)).toBe(true);\n    }));\n\n    it('should detect if element has valid aria-labelledby string', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<div aria-labelledby=\"myOtherElementId\"></div>')($rootScope);\n      expect($mdAria.hasAriaLabel(container)).toBe(true);\n    }));\n\n    it('should detect if element has valid aria-describedby string', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<div aria-describedby=\"myOtherElementId\"></div>')($rootScope);\n      expect($mdAria.hasAriaLabel(container)).toBe(true);\n    }));\n\n  });\n\n  describe('aria label parent checks', function() {\n\n    it('should detect if parent of element has valid aria label', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<button aria-label=\"hello\"><img></img></button>')($rootScope);\n      var imgElement = container.find('img');\n      expect($mdAria.hasAriaLabel(imgElement)).toBe(false);\n      expect($mdAria.parentHasAriaLabel(imgElement)).toBe(true);\n    }));\n\n    it('should prevent aria-label on a parent of element based on role', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<button role=\"log\" aria-label=\"hello\"><img></img></button>')($rootScope);\n      var imgElement = container.find('img');\n      expect($mdAria.hasAriaLabel(imgElement)).toBe(false);\n      expect($mdAria.parentHasAriaLabel(imgElement)).toBe(false);\n    }));\n\n    it('should prevent aria-label on a parent of element based on tagName', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<span aria-label=\"hello\"><img></img></span>')($rootScope);\n      var imgElement = container.find('img');\n      expect($mdAria.hasAriaLabel(imgElement)).toBe(false);\n      expect($mdAria.parentHasAriaLabel(imgElement)).toBe(false);\n    }));\n\n    it('should detect if second parent of element has valid aria label', inject(function($compile, $rootScope, $log, $mdAria) {\n      var container = $compile('<button aria-label=\"hello\"><div><img></img></div></button>')($rootScope);\n      var imgElement = container.find('img');\n      expect($mdAria.hasAriaLabel(imgElement)).toBe(false);\n      expect($mdAria.parentHasAriaLabel(imgElement)).toBe(false);\n      expect($mdAria.parentHasAriaLabel(imgElement, 2)).toBe(true);\n    }));\n\n  });\n\n  describe('with disabled warnings', function() {\n\n    beforeEach(module('material.core', function($mdAriaProvider) {\n      $mdAriaProvider.disableWarnings();\n    }));\n\n    it('should not warn if warnings are disabled', inject(function($compile, $rootScope, $log, $mdAria) {\n      spyOn($log, 'warn');\n      var button = $compile('<button aria-label><md-icon></md-icon></button>')($rootScope);\n\n      $mdAria.expect(button, 'aria-label');\n\n      expect($log.warn).not.toHaveBeenCalled();\n    }));\n\n  })\n\n});\n"
  },
  {
    "path": "src/core/services/compiler/compiler.js",
    "content": "/**\n * @ngdoc module\n * @name material.core.compiler\n * @description\n * AngularJS Material template and element compiler.\n */\nangular\n  .module('material.core')\n  .provider('$mdCompiler', MdCompilerProvider);\n\nMdCompilerProvider.$inject = ['$compileProvider'];\nfunction MdCompilerProvider() {\n\n  this.$get = [\"$q\", \"$templateRequest\", \"$injector\", \"$compile\", \"$controller\",\n    function($q, $templateRequest, $injector, $compile, $controller) {\n      return new MdCompilerService($q, $templateRequest, $injector, $compile, $controller);\n    }];\n\n  /**\n   * @ngdoc service\n   * @name $mdCompiler\n   * @module material.core.compiler\n   * @description\n   * The $mdCompiler service is an abstraction of AngularJS's compiler, that allows developers\n   * to compile an element with options like in a Directive Definition Object.\n   *\n   * > The compiler powers a lot of components inside of AngularJS Material.\n   * > Like the `$mdPanel` or `$mdDialog` services.\n   *\n   * @usage\n   *\n   * Basic Usage with a template\n   *\n   * <hljs lang=\"js\">\n   *   $mdCompiler.compile({\n   *     templateUrl: 'modal.html',\n   *     controller: 'ModalCtrl',\n   *     locals: {\n   *       modal: myModalInstance;\n   *     }\n   *   }).then(function (compileData) {\n   *     compileData.element; // Compiled DOM element\n   *     compileData.link(myScope); // Instantiate controller and link element to scope.\n   *   });\n   * </hljs>\n   *\n   * Example with a content element\n   *\n   * <hljs lang=\"js\">\n   *\n   *   // Create a virtual element and link it manually.\n   *   // The compiler doesn't need to recompile the element each time.\n   *   var myElement = $compile('<span>Test</span>')(myScope);\n   *\n   *   $mdCompiler.compile({\n   *     contentElement: myElement\n   *   }).then(function (compileData) {\n   *     compileData.element // Content Element (same as above)\n   *     compileData.link // This does nothing when using a contentElement.\n   *   });\n   * </hljs>\n   *\n   * > Content Element is a significant performance improvement when the developer already knows\n   * > that the compiled element will be always the same and the scope will not change either.\n   *\n   * The `contentElement` option also supports DOM elements which will be temporary removed and\n   * restored at its old position.\n   *\n   * <hljs lang=\"js\">\n   *   var domElement = document.querySelector('#myElement');\n   *\n   *   $mdCompiler.compile({\n   *     contentElement: myElement\n   *   }).then(function (compileData) {\n   *     compileData.element // Content Element (same as above)\n   *     compileData.link // This does nothing when using a contentElement.\n   *   });\n   * </hljs>\n   *\n   * The `$mdCompiler` can also query for the element in the DOM itself.\n   *\n   * <hljs lang=\"js\">\n   *   $mdCompiler.compile({\n   *     contentElement: '#myElement'\n   *   }).then(function (compileData) {\n   *     compileData.element // Content Element (same as above)\n   *     compileData.link // This does nothing when using a contentElement.\n   *   });\n   * </hljs>\n   *\n   */\n  function MdCompilerService($q, $templateRequest, $injector, $compile, $controller) {\n\n    /**\n     * @private @const\n     * @type {!IQService}\n     */\n    this.$q = $q;\n\n    /**\n     * @private @const\n     * @type {!ITemplateRequestService}\n     */\n    this.$templateRequest = $templateRequest;\n\n    /**\n     * @private @const\n     * @type {!IInjectorService}\n     */\n    this.$injector = $injector;\n\n    /**\n     * @private @const\n     * @type{!ICompileService}\n     */\n    this.$compile = $compile;\n\n    /**\n     * @private @const\n     * @type {!IControllerService}\n     */\n    this.$controller = $controller;\n  }\n\n  /**\n   * @ngdoc method\n   * @name $mdCompiler#compile\n   * @description\n   *\n   * A method to compile a HTML template with the AngularJS compiler.\n   * The `$mdCompiler` is wrapper around the AngularJS compiler and provides extra functionality\n   * like controller instantiation or async resolves.\n   *\n   * @param {!Object} options An options object, with the following properties:\n   *\n   *    - `controller` - `{string|function}` Controller fn that should be associated with\n   *         newly created scope or the name of a registered controller if passed as a string.\n   *    - `controllerAs` - `{string=}` A controller alias name. If present the controller will be\n   *         published to scope under the `controllerAs` name.\n   *    - `contentElement` - `{string|Element}`: Instead of using a template, which will be\n   *         compiled each time, you can also use a DOM element.<br/>\n   *    - `template` - `{string=}` An html template as a string.\n   *    - `templateUrl` - `{string=}` A path to an html template.\n   *    - `transformTemplate` - `{function(template)=}` A function which transforms the template after\n   *        it is loaded. It will be given the template string as a parameter, and should\n   *        return a a new string representing the transformed template.\n   *    - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should\n   *        be injected into the controller. If any of these dependencies are promises, the compiler\n   *        will wait for them all to be resolved, or if one is rejected before the controller is\n   *        instantiated `compile()` will fail..\n   *      * `key` - `{string}`: a name of a dependency to be injected into the controller.\n   *      * `factory` - `{string|function}`: If `string` then it is an alias for a service.\n   *        Otherwise if function, then it is injected and the return value is treated as the\n   *        dependency. If the result is a promise, it is resolved before its value is\n   *        injected into the controller.\n   *\n   * @returns {Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any,\n   *  controller: Object=}>} promise A promise, which will be resolved with a `compileData` object.\n   *  `compileData` has the following properties:\n   *\n   *   - `element` - `{JQLite}`: an uncompiled element matching the provided template.\n   *   - `link` - `{function(scope)}`: A link function, which, when called, will compile\n   *     the element and instantiate the provided controller (if given).\n   *   - `locals` - `{Object}`: The locals which will be passed into the controller once `link` is\n   *     called. If `bindToController` is true, they will be copied to the ctrl instead\n   */\n  MdCompilerService.prototype.compile = function(options) {\n    if (options.contentElement) {\n      return this._prepareContentElement(options);\n    } else {\n      return this._compileTemplate(options);\n    }\n  };\n\n  /**\n   * Instead of compiling any template, the compiler just fetches an existing HTML element from the\n   * DOM and provides a restore function to put the element back it old DOM position.\n   * @param {!Object} options Options to be used for the compiler.\n   * @returns {Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any}>}\n   */\n  MdCompilerService.prototype._prepareContentElement = function(options) {\n\n    var contentElement = this._fetchContentElement(options);\n\n    return this.$q.resolve({\n      element: contentElement.element,\n      cleanup: contentElement.restore,\n      locals: {},\n      link: function() {\n        return contentElement.element;\n      }\n    });\n\n  };\n\n  /**\n   * Compiles a template by considering all options and waiting for all resolves to be ready.\n   * @param {!Object} options Compile options\n   * @returns {!Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any}>} Compile\n   *  data with link function.\n   */\n  MdCompilerService.prototype._compileTemplate = function(options) {\n\n    var self = this;\n    var templateUrl = options.templateUrl;\n    var template = options.template || '';\n    var resolve = angular.extend({}, options.resolve);\n    var locals = angular.extend({}, options.locals);\n    var transformTemplate = options.transformTemplate || angular.identity;\n\n    // Take resolve values and invoke them.\n    // Resolves can either be a string (value: 'MyRegisteredAngularConst'),\n    // or an invokable 'factory' of sorts: (value: function ValueGetter($dependency) {})\n    angular.forEach(resolve, function(value, key) {\n      if (angular.isString(value)) {\n        resolve[key] = self.$injector.get(value);\n      } else {\n        resolve[key] = self.$injector.invoke(value);\n      }\n    });\n\n    // Add the locals, which are just straight values to inject\n    // eg locals: { three: 3 }, will inject three into the controller\n    angular.extend(resolve, locals);\n\n    if (templateUrl) {\n      resolve.$$ngTemplate = this.$templateRequest(templateUrl);\n    } else {\n      resolve.$$ngTemplate = this.$q.when(template);\n    }\n\n\n    // Wait for all the resolves to finish if they are promises\n    return this.$q.all(resolve).then(function(locals) {\n\n      var template = transformTemplate(locals.$$ngTemplate, options);\n      var element = options.element || angular.element('<div>').html(template.trim()).contents();\n\n      return self._compileElement(locals, element, options);\n    });\n\n  };\n\n  /**\n   * Method to compile an element with the given options.\n   * @param {!Object} locals Locals to be injected to the controller if present\n   * @param {!JQLite} element Element to be compiled and linked\n   * @param {!Object} options Options to be used for linking.\n   * @returns {!{element: JQLite, link: Function, locals: Object, cleanup: any, controller: Object}} Compile data with link function.\n   */\n  MdCompilerService.prototype._compileElement = function(locals, element, options) {\n    var self = this;\n    var ngLinkFn = this.$compile(element);\n\n    var compileData = {\n      element: element,\n      cleanup: element.remove.bind(element),\n      locals: locals,\n      link: linkFn\n    };\n\n    function linkFn(scope) {\n      locals.$scope = scope;\n\n      // Instantiate controller if the developer provided one.\n      if (options.controller) {\n\n        var injectLocals = angular.extend({}, locals, {\n          $element: element\n        });\n\n        // Create the specified controller instance.\n        var ctrl = self._createController(options, injectLocals, locals);\n\n        // Registering extra $destroy listeners should be avoided.\n        // Only register the listener if the controller implements a $onDestroy hook.\n        if (angular.isFunction(ctrl.$onDestroy)) {\n          scope.$on('$destroy', function() {\n            // Call the $onDestroy hook if it's present on the controller.\n            angular.isFunction(ctrl.$onDestroy) && ctrl.$onDestroy();\n          });\n        }\n\n        // Unique identifier for AngularJS Route ngView controllers.\n        element.data('$ngControllerController', ctrl);\n        element.children().data('$ngControllerController', ctrl);\n\n        // Expose the instantiated controller to the compile data\n        compileData.controller = ctrl;\n      }\n\n      // Invoke the AngularJS $compile link function.\n      return ngLinkFn(scope);\n    }\n\n    return compileData;\n\n  };\n\n  /**\n   * Creates and instantiates a new controller with the specified options.\n   * @param {!Object} options Options that include the controller function or string.\n   * @param {!Object} injectLocals Locals to to be provided in the controller DI.\n   * @param {!Object} locals Locals to be injected to the controller.\n   * @returns {!Object} Created controller instance.\n   */\n  MdCompilerService.prototype._createController = function(options, injectLocals, locals) {\n    var ctrl = this.$controller(options.controller, injectLocals);\n\n    if (options.bindToController) {\n      angular.extend(ctrl, locals);\n    }\n\n    if (options.controllerAs) {\n      injectLocals.$scope[options.controllerAs] = ctrl;\n    }\n\n    // Call the $onInit hook if it's present on the controller.\n    angular.isFunction(ctrl.$onInit) && ctrl.$onInit();\n\n    return ctrl;\n  };\n\n  /**\n   * Fetches an element removing it from the DOM and using it temporary for the compiler.\n   * Elements which were fetched will be restored after use.\n   * @param {!Object} options Options to be used for the compilation.\n   * @returns {{element: !JQLite, restore: !function}}\n   */\n  MdCompilerService.prototype._fetchContentElement = function(options) {\n    var contentEl = options.contentElement;\n    var restoreFn;\n\n    if (angular.isString(contentEl)) {\n      contentEl = document.querySelector(contentEl);\n      restoreFn = createRestoreFn(contentEl);\n    } else {\n      contentEl = contentEl[0] || contentEl;\n\n      // When the element is visible in the DOM, then we restore it at close of the dialog.\n      // Otherwise it will be removed from the DOM after close.\n      if (document.contains(contentEl)) {\n        restoreFn = createRestoreFn(contentEl);\n      } else {\n        restoreFn = function() {\n          if (contentEl.parentNode) {\n            contentEl.parentNode.removeChild(contentEl);\n          }\n        };\n      }\n    }\n\n    return {\n      element: angular.element(contentEl),\n      restore: restoreFn\n    };\n\n    function createRestoreFn(element) {\n      var parent = element.parentNode;\n      var nextSibling = element.nextElementSibling;\n\n      return function() {\n        if (!nextSibling) {\n          // When the element didn't had any sibling, then it can be simply appended to the\n          // parent, because it plays no role, which index it had before.\n          parent.appendChild(element);\n        } else {\n          // When the element had a sibling, which marks the previous position of the element\n          // in the DOM, we insert it correctly before the sibling, to have the same index as\n          // before.\n          parent.insertBefore(element, nextSibling);\n        }\n      };\n    }\n  };\n}\n\n"
  },
  {
    "path": "src/core/services/compiler/compiler.spec.js",
    "content": "describe('$mdCompiler service', function() {\n  beforeEach(module('material.core'));\n\n  function compile(options) {\n    var compileData = null;\n    inject(function($mdCompiler, $rootScope) {\n      $mdCompiler.compile(options).then(function(data) {\n        compileData = data;\n      });\n      $rootScope.$apply();\n    });\n    return compileData;\n  }\n\n  describe('setup', function() {\n\n    it('element should use templateUrl', inject(function($templateCache) {\n      var tpl = '<span>hola</span>';\n      $templateCache.put('template.html', tpl);\n      var data = compile({\n        templateUrl: 'template.html'\n      });\n\n      expect(data.element.html()).toBe('hola');\n    }));\n\n    it('element should use template', function() {\n      var tpl = 'hello';\n      var data = compile({\n        template: tpl\n      });\n\n      // .html() returns the “inner” HTML\n      // but  inner HTML of \"hello\" is `undefined`\n      // so use .text()\n      expect(data.element.text()).toBe(tpl);\n    });\n\n    it('should support a custom element', function() {\n      var data = compile({\n        element: angular.element('<h1>Hello world</h1>')\n      });\n      expect(data.element.html()).toBe('Hello world');\n    });\n\n    it('element should use template with whitespace', function() {\n      var tpl = '  \\nhello\\n\\t  ';\n      var data = compile({\n        template: tpl\n      });\n      expect(data.element.text()).toBe('hello');\n    });\n\n    it('transformTemplate should work with template', function() {\n      var data = compile({\n        template: 'world',\n        transformTemplate: function(tpl) { return 'hello ' + tpl; }\n      });\n      expect(data.element.text()).toBe('hello world');\n    });\n\n    it('transformTemplate receives the options', function() {\n      var data = compile({\n        template: 'world',\n        someArg: 'foo',\n        transformTemplate: function(tpl, options) { return 'hello ' + tpl + ': ' + options.someArg; }\n      });\n      expect(data.element.text()).toBe('hello world: foo');\n    });\n\n    describe('with resolve and locals options', function() {\n      var options;\n\n      beforeEach(function() {\n        module(function($provide) {\n          $provide.constant('StrawberryColor', 'red');\n        });\n\n        options = {\n          resolve: {\n            //Resolve a factory inline\n            fruit: function($q) {\n              return $q.when('apple');\n            },\n            //Resolve a DI token's value\n            color: 'StrawberryColor'\n          },\n          locals: {\n            vegetable: 'carrot'\n          }\n        };\n      });\n\n      it('should work', function() {\n        var data = compile(options);\n        expect(data.locals.fruit).toBe('apple');\n        expect(data.locals.vegetable).toBe('carrot');\n        expect(data.locals.color).toBe('red');\n      });\n\n      it('should not overwrite the original values', function() {\n        var clone = angular.copy(options);\n        compile(options);\n        expect(options).toEqual(clone);\n      });\n    });\n\n    describe('after link()', function() {\n\n      it('should compile with scope', inject(function($rootScope) {\n        var data = compile({\n          template: '<span>hello</span>'\n        });\n        var scope = $rootScope.$new(false);\n        data.link(scope);\n        expect(data.element.scope()).toBe(scope);\n      }));\n\n      it('should compile with controller & locals', inject(function($rootScope) {\n        var data = compile({\n          template: '<span>hello</span>',\n          locals: {\n            one: 1\n          },\n          controller: function Ctrl($scope, one) {\n            this.injectedOne = one;\n          }\n        });\n        var scope = $rootScope.$new(false);\n        data.link(scope);\n        expect(data.element.controller()).toBeTruthy();\n        expect(data.element.controller().injectedOne).toBe(1);\n      }));\n\n      it('should instantiate the controller with $element as local', inject(function($rootScope) {\n        var ctrlElement = null;\n\n        var data = compile({\n          template: '<span>hello</span>',\n          controller: function Ctrl($scope, $element) {\n            ctrlElement = $element;\n          }\n        });\n\n        var scope = $rootScope.$new(false);\n        data.link(scope);\n\n        expect(ctrlElement).toBe(data.element);\n      }));\n\n      it('should compile with controllerAs', inject(function($rootScope) {\n        var data = compile({\n          template: '<span>hello</span>',\n          controller: function Ctrl() {},\n          controllerAs: 'myControllerAs'\n        });\n        var scope = $rootScope.$new(false);\n        data.link(scope);\n        expect(scope.myControllerAs).toBe(data.element.controller());\n      }));\n    });\n  });\n\n  function compileAndLink(options) {\n    var compileData = null;\n\n    inject(function($mdCompiler, $rootScope) {\n      $mdCompiler.compile(options).then(function(data) {\n        data.link($rootScope);\n        compileData = data;\n      });\n\n      $rootScope.$apply();\n    });\n\n    return compileData;\n  }\n\n  it('should call $onInit even if bindToController is set to false', function() {\n    var isInstantiated = false;\n\n    function TestController($scope, name) {\n      isInstantiated = true;\n      expect($scope.$apply).toBeTruthy();\n      expect(name).toBe('Bob');\n    }\n\n    TestController.prototype.$onInit = jasmine.createSpy('$onInit');\n\n    compileAndLink({\n      template: 'hello',\n      controller: TestController,\n      bindToController: false,\n      locals: {name: 'Bob'}\n    });\n\n    expect(TestController.prototype.$onInit).toHaveBeenCalledTimes(1);\n    expect(isInstantiated).toBe(true);\n  });\n\n  it('should assign bindings after constructor', function() {\n    var isInstantiated = false;\n\n    function TestController($scope) {\n      isInstantiated = true;\n      expect($scope.$apply).toBeTruthy();\n      expect(this.name).toBeUndefined();\n    }\n\n    TestController.prototype.$onInit = function() {\n      expect(this.name).toBe('Bob');\n    };\n\n    spyOn(TestController.prototype, '$onInit').and.callThrough();\n\n    compileAndLink({\n      template: 'hello',\n      controller: TestController,\n      controllerAs: 'ctrl',\n      bindToController: true,\n      locals: {name: 'Bob'}\n    });\n\n    expect(TestController.prototype.$onInit).toHaveBeenCalledTimes(1);\n    expect(isInstantiated).toBe(true);\n  });\n\n  describe('with contentElement', function() {\n\n    var $rootScope, $compile = null;\n    var element, parent = null;\n\n    beforeEach(inject(function($injector) {\n      $rootScope = $injector.get('$rootScope');\n      $compile = $injector.get('$compile');\n\n      parent = angular.element('<div>');\n      element = angular.element('<div class=\"contentEl\">Content Element</div>');\n\n      parent.append(element);\n\n      // Append the content parent to the document, otherwise contentElement is not able\n      // to detect it properly.\n      document.body.appendChild(parent[0]);\n\n    }));\n\n    afterEach(function() {\n      parent.remove();\n    });\n\n    it('should also work with a virtual DOM element', function() {\n\n      var virtualEl = angular.element('<div>Virtual</div>');\n\n      var data = compile({\n        contentElement: virtualEl\n      });\n\n      var contentElement = data.link($rootScope);\n\n      expect(contentElement[0]).toBe(virtualEl[0]);\n      expect(contentElement.parentNode).toBeFalsy();\n\n      data.cleanup();\n\n      expect(contentElement.parentNode).toBeFalsy();\n    });\n\n    it('should also support a CSS selector as query', function() {\n\n      var data = compile({\n        contentElement: '.contentEl'\n      });\n\n      var contentElement = data.link($rootScope);\n\n      expect(element[0].parentNode).toBe(parent[0]);\n      expect(contentElement[0]).toBe(element[0]);\n\n      // Remove the element from the DOM to simulate a element move.\n      contentElement.remove();\n\n      expect(element[0].parentNode).not.toBe(parent[0]);\n\n      // Cleanup the compilation by restoring it at its old DOM position.\n      data.cleanup();\n\n      expect(element[0].parentNode).toBe(parent[0]);\n    });\n\n    it('should restore the contentElement at its previous position', function() {\n\n      var data = compile({\n        contentElement: element\n      });\n\n      var contentElement = data.link($rootScope);\n\n      expect(element[0].parentNode).toBe(parent[0]);\n      expect(contentElement[0]).toBe(element[0]);\n\n      // Remove the element from the DOM to simulate a element move.\n      contentElement.remove();\n\n      expect(element[0].parentNode).not.toBe(parent[0]);\n\n      // Cleanup the compilation by restoring it at its old DOM position.\n      data.cleanup();\n\n      expect(element[0].parentNode).toBe(parent[0]);\n    });\n\n    it('should not link to a new scope', function() {\n\n      var data = compile({\n        contentElement: element\n      });\n\n      var contentElement = data.link($rootScope);\n\n      expect(contentElement.scope()).toBeFalsy();\n    });\n\n    it('should preserve a previous linked scope', function() {\n\n      var scope = $rootScope.$new(false);\n\n      var data = compile({\n        contentElement: $compile('<div>With Scope</div>')(scope)\n      });\n\n      var contentElement = data.link($rootScope);\n\n      expect(contentElement.scope()).toBe(scope);\n    });\n\n    it('should not instantiate a new controller', function() {\n\n      var controllerSpy = jasmine.createSpy('Controller Function');\n\n      var data = compile({\n        contentElement: element,\n        controller: controllerSpy\n      });\n\n      data.link($rootScope);\n\n      expect(controllerSpy).not.toHaveBeenCalled();\n    });\n\n  });\n\n  describe('with ES6 classes', function() {\n    var $mdCompiler, pageScope, $rootScope;\n\n    beforeEach(module('material.core'));\n\n    beforeEach(inject(function($injector) {\n      $mdCompiler = $injector.get('$mdCompiler');\n      $rootScope = $injector.get('$rootScope');\n      pageScope = $rootScope.$new(false);\n    }));\n\n    it('should assign bindings by $onInit for ES6 classes', function(done) {\n      // This will not work in IE11, but the AngularJS Material CI is only running Chrome.\n      class PizzaController {\n        $onInit() { this.isInitialized = true; }\n      }\n\n      var compileResult = $mdCompiler.compile({\n        template: '<span>Pizza</span>',\n        controller: PizzaController,\n        controllerAs: 'pizzaCtrl',\n        bindToController: true,\n        locals: {topping: 'Cheese'},\n      });\n\n      compileResult.then(function(compileOutput) {\n        var ctrl = compileOutput.link(pageScope).scope().pizzaCtrl;\n        expect(ctrl.isInitialized).toBe(true);\n        expect(ctrl.topping).toBe('Cheese');\n        done();\n      });\n\n      $rootScope.$apply();\n    });\n  });\n\n  describe('AngularJS 1.6+ lifecycle hooks', function() {\n    var $mdCompiler, pageScope, $rootScope;\n\n    beforeEach(module('material.core'));\n\n    beforeEach(inject(function($injector) {\n      $mdCompiler = $injector.get('$mdCompiler');\n      $rootScope = $injector.get('$rootScope');\n      pageScope = $rootScope.$new(false);\n    }));\n\n    it('calls $onInit on initialization', function(done) {\n      var passed = false;\n\n      class TestController {\n        $onInit() { passed = true; }\n      }\n\n      var compileResult = $mdCompiler.compile({\n        template: '<span></span>',\n        controller: TestController,\n        controllerAs: 'vm',\n        bindToController: true\n      });\n\n      compileResult.then(function(compileOutput) {\n        compileOutput.link(pageScope).scope();\n        expect(passed).toBe(true);\n        done();\n      });\n\n      $rootScope.$apply();\n    });\n\n    it('calls $onDestroy on destruction', function(done) {\n      var passed = false;\n\n      class TestController {\n        $onDestroy() { passed = true; }\n      }\n\n      var compileResult = $mdCompiler.compile({\n        template: '<span></span>',\n        controller: TestController,\n        controllerAs: 'vm',\n        bindToController: true\n      });\n\n      compileResult.then(function(compileOutput) {\n        compileOutput.link(pageScope).scope().$destroy();\n        expect(passed).toBe(true);\n        done();\n      });\n\n      $rootScope.$apply();\n    });\n  });\n});\n"
  },
  {
    "path": "src/core/services/gesture/gesture.js",
    "content": "var HANDLERS = {};\n\n/**\n * The state of the current 'pointer'. The pointer represents the state of the current touch.\n * It contains normalized x and y coordinates from DOM events,\n * as well as other information abstracted from the DOM.\n */\nvar pointer, lastPointer, maxClickDistance = 6;\nvar forceSkipClickHijack = false, disableAllGestures = false;\n\n/**\n * The position of the most recent click if that click was on a label element.\n * @type {{x: number, y: number}|null}\n */\nvar lastLabelClickPos = null;\n\n/**\n * Used to attach event listeners once when multiple ng-apps are running.\n * @type {boolean}\n */\nvar isInitialized = false;\n\n/**\n * @ngdoc module\n * @name material.core.gestures\n * @description\n * AngularJS Material Gesture handling for touch devices.\n * This module replaced the usage of the HammerJS library.\n */\nangular\n  .module('material.core.gestures', [])\n  .provider('$mdGesture', MdGestureProvider)\n  .factory('$$MdGestureHandler', MdGestureHandler)\n  .run(attachToDocument);\n\n/**\n * @ngdoc service\n * @name $mdGestureProvider\n * @module material.core.gestures\n *\n * @description\n * In some scenarios on mobile devices (without jQuery), the click events should NOT be hijacked.\n * `$mdGestureProvider` is used to configure the Gesture module to ignore or skip click hijacking\n * on mobile devices.\n *\n * You can also change the max click distance, `6px` by default, if you have issues on some touch\n * screens.\n *\n * <hljs lang=\"js\">\n *   app.config(function($mdGestureProvider) {\n *\n *     // For mobile devices without jQuery loaded, do not\n *     // intercept click events during the capture phase.\n *     $mdGestureProvider.skipClickHijack();\n *\n *     // If hijacking clicks, you may want to change the default click distance\n *     $mdGestureProvider.setMaxClickDistance(12);\n *   });\n * </hljs>\n *\n */\nfunction MdGestureProvider() { }\n\nMdGestureProvider.prototype = {\n\n  /**\n   * @ngdoc method\n   * @name $mdGestureProvider#disableAll\n   *\n   * @description\n   * Disable all gesture detection. This can be beneficial to application performance\n   * and memory usage.\n   */\n  disableAll: function () {\n    disableAllGestures = true;\n  },\n\n  // Publish access to setter to configure a variable BEFORE the\n  // $mdGesture service is instantiated...\n  /**\n   * @ngdoc method\n   * @name $mdGestureProvider#skipClickHijack\n   *\n   * @description\n   * Tell the AngularJS Material Gesture module to skip (or ignore) click hijacking on mobile devices.\n   */\n  skipClickHijack: function() {\n    return forceSkipClickHijack = true;\n  },\n\n  /**\n   * @ngdoc method\n   * @name $mdGestureProvider#setMaxClickDistance\n   * @param clickDistance {string} Distance in pixels. I.e. `12px`.\n   * @description\n   * Set the max distance from the origin of the touch event to trigger touch handlers.\n   */\n  setMaxClickDistance: function(clickDistance) {\n    maxClickDistance = parseInt(clickDistance);\n  },\n\n  /**\n   * $get is used to build an instance of $mdGesture\n   * @ngInject\n   */\n  $get : function($$MdGestureHandler, $$rAF, $timeout, $mdUtil) {\n       return new MdGesture($$MdGestureHandler, $$rAF, $timeout, $mdUtil);\n  }\n};\n\n\n\n/**\n * MdGesture factory construction function\n * @ngInject\n */\nfunction MdGesture($$MdGestureHandler, $$rAF, $timeout, $mdUtil) {\n  var touchActionProperty = $mdUtil.getTouchAction();\n  var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n  var self = {\n    handler: addHandler,\n    register: register,\n    isAndroid: $mdUtil.isAndroid,\n    isIos: $mdUtil.isIos,\n    // On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n    isHijackingClicks: ($mdUtil.isIos || $mdUtil.isAndroid) && !hasJQuery && !forceSkipClickHijack\n  };\n\n  if (self.isHijackingClicks) {\n    self.handler('click', {\n      options: {\n        maxDistance: maxClickDistance\n      },\n      onEnd: checkDistanceAndEmit('click')\n    });\n\n    self.handler('focus', {\n      options: {\n        maxDistance: maxClickDistance\n      },\n      onEnd: function(ev, pointer) {\n        if (pointer.distance < this.state.options.maxDistance && canFocus(ev.target)) {\n          this.dispatchEvent(ev, 'focus', pointer);\n          ev.target.focus();\n        }\n      }\n    });\n\n    self.handler('mouseup', {\n      options: {\n        maxDistance: maxClickDistance\n      },\n      onEnd: checkDistanceAndEmit('mouseup')\n    });\n\n    self.handler('mousedown', {\n      onStart: function(ev) {\n        this.dispatchEvent(ev, 'mousedown');\n      }\n    });\n  }\n\n  function checkDistanceAndEmit(eventName) {\n    return function(ev, pointer) {\n      if (pointer.distance < this.state.options.maxDistance) {\n        this.dispatchEvent(ev, eventName, pointer);\n      }\n    };\n  }\n\n  /**\n   * Register an element to listen for a handler.\n   * This allows an element to override the default options for a handler.\n   * Additionally, some handlers like drag and hold only dispatch events if\n   * the domEvent happens inside an element that's registered to listen for these events.\n   *\n   * @see GestureHandler for how overriding of default options works.\n   * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horizontal: false })\n   */\n  function register(element, handlerName, options) {\n    var handler = HANDLERS[handlerName.replace(/^\\$md./, '')];\n    if (!handler) {\n      throw new Error('Failed to register element with handler ' + handlerName + '. ' +\n      'Available handlers: ' + Object.keys(HANDLERS).join(', '));\n    }\n    return handler.registerElement(element, options);\n  }\n\n  /*\n   * add a handler to $mdGesture. see below.\n   */\n  function addHandler(name, definition) {\n    var handler = new $$MdGestureHandler(name);\n    angular.extend(handler, definition);\n    HANDLERS[name] = handler;\n\n    return self;\n  }\n\n  /**\n   * Register handlers. These listen to touch/start/move events, interpret them,\n   * and dispatch gesture events depending on options & conditions. These are all\n   * instances of GestureHandler.\n   * @see GestureHandler\n   */\n  return self\n    /*\n     * The press handler dispatches an event on touchdown/touchend.\n     * It's a simple abstraction of touch/mouse/pointer start and end.\n     */\n    .handler('press', {\n      onStart: function (ev, pointer) {\n        this.dispatchEvent(ev, '$md.pressdown');\n      },\n      onEnd: function (ev, pointer) {\n        this.dispatchEvent(ev, '$md.pressup');\n      }\n    })\n\n    /*\n     * The hold handler dispatches an event if the user keeps their finger within\n     * the same <maxDistance> area for <delay> ms.\n     * The hold handler will only run if a parent of the touch target is registered\n     * to listen for hold events through $mdGesture.register()\n     */\n    .handler('hold', {\n      options: {\n        maxDistance: 6,\n        delay: 500\n      },\n      onCancel: function () {\n        $timeout.cancel(this.state.timeout);\n      },\n      onStart: function (ev, pointer) {\n        // For hold, require a parent to be registered with $mdGesture.register()\n        // Because we prevent scroll events, this is necessary.\n        if (!this.state.registeredParent) return this.cancel();\n\n        this.state.pos = {x: pointer.x, y: pointer.y};\n        this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() {\n          this.dispatchEvent(ev, '$md.hold');\n          this.cancel(); // we're done!\n        }), this.state.options.delay, false);\n      },\n      onMove: function (ev, pointer) {\n        // Don't scroll while waiting for hold.\n        // If we don't preventDefault touchmove events here, Android will assume we don't\n        // want to listen to anymore touch events. It will start scrolling and stop sending\n        // touchmove events.\n        if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault();\n\n        // If the user moves greater than <maxDistance> pixels, stop the hold timer\n        // set in onStart\n        var dx = this.state.pos.x - pointer.x;\n        var dy = this.state.pos.y - pointer.y;\n        if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) {\n          this.cancel();\n        }\n      },\n      onEnd: function () {\n        this.onCancel();\n      }\n    })\n\n    /*\n     * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n     * <minDistance> px in the x or y direction, depending on options.horizontal.\n     * The drag will be cancelled if the user moves his finger greater than <minDistance>*<cancelMultiplier> in\n     * the perpendicular direction. Eg if the drag is horizontal and the user moves his finger <minDistance>*<cancelMultiplier>\n     * pixels vertically, this handler won't consider the move part of a drag.\n     */\n    .handler('drag', {\n      options: {\n        minDistance: 6,\n        horizontal: true,\n        cancelMultiplier: 1.5\n      },\n      /**\n       * @param {angular.JQLite} element where touch action styles need to be adjusted\n       * @param {{horizontal: boolean}=} options object whose horizontal property can specify to\n       *  apply 'pan-y' or 'pan-x' touch actions.\n       */\n      onSetup: function(element, options) {\n        if (touchActionProperty) {\n          // We check for horizontal to be false, because otherwise we would overwrite the default opts.\n          this.oldTouchAction = element[0].style[touchActionProperty];\n          element[0].style[touchActionProperty] = options.horizontal ? 'pan-y' : 'pan-x';\n        }\n      },\n      /**\n       * @param {angular.JQLite} element where styles need to be cleaned up\n       */\n      onCleanup: function(element) {\n        if (this.oldTouchAction) {\n          element[0].style[touchActionProperty] = this.oldTouchAction;\n        } else {\n          element[0].style[touchActionProperty] = null;\n        }\n      },\n      onStart: function (ev) {\n        // For drag, require a parent to be registered with $mdGesture.register()\n        if (!this.state.registeredParent) this.cancel();\n      },\n      onMove: function (ev, pointer) {\n        var shouldStartDrag, shouldCancel;\n        // Don't scroll while deciding if this touchmove qualifies as a drag event.\n        // If we don't preventDefault touchmove events here, Android will assume we don't\n        // want to listen to anymore touch events. It will start scrolling and stop sending\n        // touchmove events.\n        if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault();\n\n        if (!this.state.dragPointer) {\n          if (this.state.options.horizontal) {\n            shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance;\n            shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n          } else {\n            shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance;\n            shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n          }\n\n          if (shouldStartDrag) {\n            // Create a new pointer representing this drag, starting at this point where the drag started.\n            this.state.dragPointer = makeStartPointer(ev);\n            updatePointerState(ev, this.state.dragPointer);\n            this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer);\n\n          } else if (shouldCancel) {\n            this.cancel();\n          }\n        } else {\n          this.dispatchDragMove(ev);\n        }\n      },\n      // Only dispatch dragmove events every frame; any more is unnecessary\n      dispatchDragMove: $$rAF.throttle(function (ev) {\n        // Make sure the drag didn't stop while waiting for the next frame\n        if (this.state.isRunning) {\n          updatePointerState(ev, this.state.dragPointer);\n          this.dispatchEvent(ev, '$md.drag', this.state.dragPointer);\n        }\n      }),\n      onEnd: function (ev, pointer) {\n        if (this.state.dragPointer) {\n          updatePointerState(ev, this.state.dragPointer);\n          this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer);\n        }\n      }\n    })\n\n    /*\n     * The swipe handler will dispatch a swipe event if, on the end of a touch,\n     * the velocity and distance were high enough.\n     */\n    .handler('swipe', {\n      options: {\n        minVelocity: 0.65,\n        minDistance: 10\n      },\n      onEnd: function (ev, pointer) {\n        var eventType;\n\n        if (Math.abs(pointer.velocityX) > this.state.options.minVelocity &&\n          Math.abs(pointer.distanceX) > this.state.options.minDistance) {\n          eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight';\n          this.dispatchEvent(ev, eventType);\n        }\n        else if (Math.abs(pointer.velocityY) > this.state.options.minVelocity &&\n          Math.abs(pointer.distanceY) > this.state.options.minDistance) {\n          eventType = pointer.directionY == 'up' ? '$md.swipeup' : '$md.swipedown';\n          this.dispatchEvent(ev, eventType);\n        }\n      }\n    });\n}\n\n/**\n * MdGestureHandler\n * A GestureHandler is an object which is able to dispatch custom dom events\n * based on native dom {touch,pointer,mouse}{start,move,end} events.\n *\n * A gesture will manage its lifecycle through the start,move,end, and cancel\n * functions, which are called by native dom events.\n *\n * A gesture has the concept of 'options' (eg. a swipe's required velocity), which can be\n * overridden by elements registering through $mdGesture.register().\n */\nfunction GestureHandler (name) {\n  this.name = name;\n  this.state = {};\n}\n\nfunction MdGestureHandler() {\n  var hasJQuery =  (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n  GestureHandler.prototype = {\n    options: {},\n    // jQuery listeners don't work with custom DOMEvents, so we have to dispatch events\n    // differently when jQuery is loaded\n    dispatchEvent: hasJQuery ?  jQueryDispatchEvent : nativeDispatchEvent,\n\n    // These are overridden by the registered handler\n    onSetup: angular.noop,\n    onCleanup: angular.noop,\n    onStart: angular.noop,\n    onMove: angular.noop,\n    onEnd: angular.noop,\n    onCancel: angular.noop,\n\n    // onStart sets up a new state for the handler, which includes options from the\n    // nearest registered parent element of ev.target.\n    start: function (ev, pointer) {\n      if (this.state.isRunning) return;\n      var parentTarget = this.getNearestParent(ev.target);\n      // Get the options from the nearest registered parent\n      var parentTargetOptions = parentTarget && parentTarget.$mdGesture[this.name] || {};\n\n      this.state = {\n        isRunning: true,\n        // Override the default options with the nearest registered parent's options\n        options: angular.extend({}, this.options, parentTargetOptions),\n        // Pass in the registered parent node to the state so the onStart listener can use\n        registeredParent: parentTarget\n      };\n      this.onStart(ev, pointer);\n    },\n    move: function (ev, pointer) {\n      if (!this.state.isRunning) return;\n      this.onMove(ev, pointer);\n    },\n    end: function (ev, pointer) {\n      if (!this.state.isRunning) return;\n      this.state.isRunning = false;\n      this.onEnd(ev, pointer);\n    },\n    cancel: function (ev, pointer) {\n      this.onCancel(ev, pointer);\n      this.state = {};\n    },\n\n    // Find and return the nearest parent element that has been registered to\n    // listen for this handler via $mdGesture.register(element, 'handlerName').\n    getNearestParent: function (node) {\n      var current = node;\n      while (current) {\n        if ((current.$mdGesture || {})[this.name]) {\n          return current;\n        }\n        current = current.parentNode;\n      }\n      return null;\n    },\n\n    // Called from $mdGesture.register when an element registers itself with a handler.\n    // Store the options the user gave on the DOMElement itself. These options will\n    // be retrieved with getNearestParent when the handler starts.\n    registerElement: function (element, options) {\n      var self = this;\n      element[0].$mdGesture = element[0].$mdGesture || {};\n      element[0].$mdGesture[this.name] = options || {};\n      element.on('$destroy', onDestroy);\n\n      self.onSetup(element, options || {});\n\n      return onDestroy;\n\n      function onDestroy() {\n        delete element[0].$mdGesture[self.name];\n        element.off('$destroy', onDestroy);\n\n        self.onCleanup(element, options || {});\n      }\n    }\n  };\n\n  return GestureHandler;\n\n  /**\n   * Dispatch an event with jQuery\n   * TODO: Make sure this sends bubbling events\n   *\n   * @param srcEvent the original DOM touch event that started this.\n   * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n   * @param eventPointer the pointer object that matches this event.\n   */\n  function jQueryDispatchEvent(srcEvent, eventType, eventPointer) {\n    eventPointer = eventPointer || pointer;\n    var eventObj = new angular.element.Event(eventType);\n\n    eventObj.$material = true;\n    eventObj.pointer = eventPointer;\n    eventObj.srcEvent = srcEvent;\n\n    angular.extend(eventObj, {\n      clientX: eventPointer.x,\n      clientY: eventPointer.y,\n      screenX: eventPointer.x,\n      screenY: eventPointer.y,\n      pageX: eventPointer.x,\n      pageY: eventPointer.y,\n      ctrlKey: srcEvent.ctrlKey,\n      altKey: srcEvent.altKey,\n      shiftKey: srcEvent.shiftKey,\n      metaKey: srcEvent.metaKey\n    });\n    angular.element(eventPointer.target).trigger(eventObj);\n  }\n\n  /**\n   * NOTE: nativeDispatchEvent is very performance sensitive.\n   * @param srcEvent the original DOM touch event that started this.\n   * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n   * @param eventPointer the pointer object that matches this event.\n   */\n  function nativeDispatchEvent(srcEvent, eventType, eventPointer) {\n    eventPointer = eventPointer || pointer;\n    var eventObj;\n\n    if (eventType === 'click' || eventType === 'mouseup' || eventType === 'mousedown') {\n      if (typeof window.MouseEvent === \"function\") {\n        eventObj = new MouseEvent(eventType, {\n          bubbles: true,\n          cancelable: true,\n          screenX: Number(srcEvent.screenX),\n          screenY: Number(srcEvent.screenY),\n          clientX: Number(eventPointer.x),\n          clientY: Number(eventPointer.y),\n          ctrlKey: srcEvent.ctrlKey,\n          altKey: srcEvent.altKey,\n          shiftKey: srcEvent.shiftKey,\n          metaKey: srcEvent.metaKey,\n          button: srcEvent.button,\n          buttons: srcEvent.buttons,\n          relatedTarget: srcEvent.relatedTarget || null\n        });\n      } else {\n        eventObj = document.createEvent('MouseEvents');\n        // This has been deprecated\n        // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n        eventObj.initMouseEvent(\n          eventType, true, true, window, srcEvent.detail,\n          eventPointer.x, eventPointer.y, eventPointer.x, eventPointer.y,\n          srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey,\n          srcEvent.button, srcEvent.relatedTarget || null\n        );\n      }\n    } else {\n      if (typeof window.CustomEvent === \"function\") {\n        eventObj = new CustomEvent(eventType, {\n          bubbles: true,\n          cancelable: true,\n          detail: {}\n        });\n      } else {\n        // This has been deprecated\n        // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent\n        eventObj = document.createEvent('CustomEvent');\n        eventObj.initCustomEvent(eventType, true, true, {});\n      }\n    }\n    eventObj.$material = true;\n    eventObj.pointer = eventPointer;\n    eventObj.srcEvent = srcEvent;\n    eventPointer.target.dispatchEvent(eventObj);\n  }\n}\n\n/**\n * Attach Gestures: hook document and check shouldHijack clicks\n * @ngInject\n */\nfunction attachToDocument($mdGesture, $$MdGestureHandler, $mdUtil) {\n  if (disableAllGestures) {\n    return;\n  }\n\n  if (!isInitialized && $mdGesture.isHijackingClicks) {\n    /*\n     * If hijack clicks is true, we preventDefault any click that wasn't\n     * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost',\n     * click event will be sent ~400ms after a touchend event happens.\n     * The only way to know if this click is real is to prevent any normal\n     * click events, and add a flag to events sent by material so we know not to prevent those.\n     *\n     * Two exceptions to click events that should be prevented are:\n     *  - click events sent by the keyboard (eg form submit)\n     *  - events that originate from an Ionic app\n     */\n    document.addEventListener('click'    , clickHijacker     , true);\n    document.addEventListener('mouseup'  , mouseInputHijacker, true);\n    document.addEventListener('mousedown', mouseInputHijacker, true);\n    document.addEventListener('focus'    , mouseInputHijacker, true);\n\n    isInitialized = true;\n  }\n\n  function mouseInputHijacker(ev) {\n    var isKeyClick = !ev.clientX && !ev.clientY;\n\n    if (\n      !isKeyClick &&\n      !ev.$material &&\n      !ev.isIonicTap &&\n      !isInputEventFromLabelClick(ev) &&\n      (ev.type !== 'mousedown' || (!canFocus(ev.target) && !canFocus(document.activeElement)))\n    ) {\n      ev.preventDefault();\n      ev.stopPropagation();\n    }\n  }\n\n  /**\n   * Ignore click events that don't come from AngularJS Material, Ionic, Input Label clicks,\n   * or key presses that generate click events. This helps to ignore the ghost tap events on\n   * older mobile browsers that get sent after a 300-400ms delay.\n   * @param ev MouseEvent or modified MouseEvent with $material, pointer, and other fields\n   */\n  function clickHijacker(ev) {\n    var isKeyClick;\n    if ($mdUtil.isIos) {\n      isKeyClick = angular.isDefined(ev.webkitForce) && ev.webkitForce === 0;\n    } else {\n      isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n    }\n    if (!isKeyClick && !ev.$material && !ev.isIonicTap && !isInputEventFromLabelClick(ev)) {\n      ev.preventDefault();\n      ev.stopPropagation();\n      lastLabelClickPos = null;\n    } else {\n      lastLabelClickPos = null;\n      if (ev.target.tagName.toLowerCase() === 'label') {\n        lastLabelClickPos = {x: ev.x, y: ev.y};\n      }\n    }\n  }\n\n\n  // Listen to all events to cover all platforms.\n  var START_EVENTS = 'mousedown touchstart pointerdown';\n  var MOVE_EVENTS = 'mousemove touchmove pointermove';\n  var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n  angular.element(document)\n    .on(START_EVENTS, gestureStart)\n    .on(MOVE_EVENTS, gestureMove)\n    .on(END_EVENTS, gestureEnd)\n    // For testing\n    .on('$$mdGestureReset', function gestureClearCache () {\n      lastPointer = pointer = null;\n    });\n\n  /**\n   * When a DOM event happens, run all registered gesture handlers' lifecycle\n   * methods which match the DOM event.\n   * Eg. when a 'touchstart' event happens, runHandlers('start') will call and\n   * run `handler.cancel()` and `handler.start()` on all registered handlers.\n   */\n  function runHandlers(handlerEvent, event) {\n    var handler;\n    for (var name in HANDLERS) {\n      handler = HANDLERS[name];\n      if (handler instanceof $$MdGestureHandler) {\n\n        if (handlerEvent === 'start') {\n          // Run cancel to reset any handlers' state\n          handler.cancel();\n        }\n        handler[handlerEvent](event, pointer);\n      }\n    }\n  }\n\n  /*\n   * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n   * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n   * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n   * won't effect it.\n   */\n  function gestureStart(ev) {\n    // If we're already touched down, abort\n    if (pointer) return;\n\n    var now = +Date.now();\n\n    // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n    // If <400ms have passed, don't allow an event of a different type than the previous event\n    if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n      return;\n    }\n\n    pointer = makeStartPointer(ev);\n\n    runHandlers('start', ev);\n  }\n\n  /**\n   * If a move event happens of the right type, update the pointer and run all the move handlers.\n   * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do\n   * nothing.\n   */\n  function gestureMove(ev) {\n    if (!pointer || !typesMatch(ev, pointer)) return;\n\n    updatePointerState(ev, pointer);\n    runHandlers('move', ev);\n  }\n\n  /**\n   * If an end event happens of the right type, update the pointer, run endHandlers, and save the\n   * pointer as 'lastPointer'.\n   */\n  function gestureEnd(ev) {\n    if (!pointer || !typesMatch(ev, pointer)) return;\n\n    updatePointerState(ev, pointer);\n    pointer.endTime = +Date.now();\n\n    if (ev.type !== 'pointercancel') {\n      runHandlers('end', ev);\n    }\n\n    lastPointer = pointer;\n    pointer = null;\n  }\n\n}\n\n// ********************\n// Module Functions\n// ********************\n\n/*\n * Initiate the pointer. x, y, and the pointer's type.\n */\nfunction makeStartPointer(ev) {\n  var point = getEventPoint(ev);\n  var startPointer = {\n    startTime: +Date.now(),\n    target: ev.target,\n    // 'p' for pointer events, 'm' for mouse, 't' for touch\n    type: ev.type.charAt(0)\n  };\n  startPointer.startX = startPointer.x = point.pageX;\n  startPointer.startY = startPointer.y = point.pageY;\n  return startPointer;\n}\n\n/*\n * return whether the pointer's type matches the event's type.\n * Eg if a touch event happens but the pointer has a mouse type, return false.\n */\nfunction typesMatch(ev, pointer) {\n  return ev && pointer && ev.type.charAt(0) === pointer.type;\n}\n\n/**\n * Gets whether the given event is an input event that was caused by clicking on an\n * associated label element.\n *\n * This is necessary because the browser will, upon clicking on a label element, fire an\n * *extra* click event on its associated input (if any). mdGesture is able to flag the label\n * click as with `$material` correctly, but not the second input click.\n *\n * In order to determine whether an input event is from a label click, we compare the (x, y) for\n * the event to the (x, y) for the most recent label click (which is cleared whenever a non-label\n * click occurs). Unfortunately, there are no event properties that tie the input and the label\n * together (such as relatedTarget).\n *\n * @param {MouseEvent} event\n * @returns {boolean}\n */\nfunction isInputEventFromLabelClick(event) {\n  return lastLabelClickPos\n      && lastLabelClickPos.x === event.x\n      && lastLabelClickPos.y === event.y;\n}\n\n/*\n * Update the given pointer based upon the given DOMEvent.\n * Distance, velocity, direction, duration, etc\n */\nfunction updatePointerState(ev, pointer) {\n  var point = getEventPoint(ev);\n  var x = pointer.x = point.pageX;\n  var y = pointer.y = point.pageY;\n\n  pointer.distanceX = x - pointer.startX;\n  pointer.distanceY = y - pointer.startY;\n  pointer.distance = Math.sqrt(\n    pointer.distanceX * pointer.distanceX + pointer.distanceY * pointer.distanceY\n  );\n\n  pointer.directionX = pointer.distanceX > 0 ? 'right' : pointer.distanceX < 0 ? 'left' : '';\n  pointer.directionY = pointer.distanceY > 0 ? 'down' : pointer.distanceY < 0 ? 'up' : '';\n\n  pointer.duration = +Date.now() - pointer.startTime;\n  pointer.velocityX = pointer.distanceX / pointer.duration;\n  pointer.velocityY = pointer.distanceY / pointer.duration;\n}\n\n/**\n * Normalize the point where the DOM event happened whether it's touch or mouse.\n * @returns point event obj with pageX and pageY on it.\n */\nfunction getEventPoint(ev) {\n  ev = ev.originalEvent || ev; // support jQuery events\n  return (ev.touches && ev.touches[0]) ||\n    (ev.changedTouches && ev.changedTouches[0]) ||\n    ev;\n}\n\n/** Checks whether an element can be focused. */\nfunction canFocus(element) {\n  return (\n    !!element &&\n    element.getAttribute('tabindex') !== '-1' &&\n    !element.hasAttribute('disabled') &&\n    (\n      element.hasAttribute('tabindex') ||\n      element.hasAttribute('href') ||\n      element.isContentEditable ||\n      ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'].indexOf(element.nodeName) !== -1\n    )\n  );\n}\n"
  },
  {
    "path": "src/core/services/gesture/gesture.spec.js",
    "content": "describe('$mdGesture', function() {\n\n  beforeEach(module('material.core', function() {\n    angular.element(document).triggerHandler('$$mdGestureReset');\n  }));\n\n  describe('custom gesture', function() {\n\n    var startSpy1, moveSpy1, endSpy1;\n    var startSpy2, moveSpy2, endSpy2;\n    var childEl, middleEl, parentEl;\n    beforeEach(function() {\n      inject(function($mdGesture) {\n        startSpy1 = jasmine.createSpy('start1');\n        moveSpy1 = jasmine.createSpy('move1');\n        endSpy1 = jasmine.createSpy('end1');\n        startSpy2 = jasmine.createSpy('start2');\n        moveSpy2 = jasmine.createSpy('move2');\n        endSpy2 = jasmine.createSpy('end2');\n        $mdGesture.handler('gesture1', {\n          options: {\n            defaultKey: 'defaultVal'\n          },\n          onStart: startSpy1,\n          onMove: moveSpy1,\n          onEnd: endSpy1\n        });\n        $mdGesture.handler('gesture2', {\n          onStart: startSpy2,\n          onMove: moveSpy2,\n          onEnd: endSpy2\n        });\n        childEl = angular.element('<child>');\n        middleEl = angular.element('<middle>').append(childEl);\n        parentEl = angular.element('<parent>').append(middleEl);\n      });\n    });\n\n    it('should pass provided options', inject(function($document, $mdGesture) {\n      $mdGesture.register(childEl, 'gesture1', { optKey: 'optValue' });\n\n      startSpy1.and.callFake(function() {\n        return {\n          isRunning: true,\n          options: {\n            optKey: 'optValue',\n            defaultKey: 'defaultVal'\n          },\n          registeredParent: childEl[0]\n        };\n      });\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      expect(startSpy2).toHaveBeenCalled();\n    }));\n\n    it('touch{start,move,end,cancel}', inject(function($document) {\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('touchmove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('touchend');\n      expect(endSpy1).toHaveBeenCalled();\n\n      startSpy1.calls.reset();\n      moveSpy1.calls.reset();\n      endSpy1.calls.reset();\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('touchmove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('touchcancel');\n      expect(endSpy1).toHaveBeenCalled();\n    }));\n\n    it('gesture{down,move,up}', inject(function($document) {\n      $document.triggerHandler({\n        type: 'pointerdown',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('pointermove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('pointerup');\n      expect(endSpy1).toHaveBeenCalled();\n\n      startSpy1.calls.reset();\n      moveSpy1.calls.reset();\n      endSpy1.calls.reset();\n\n      $document.triggerHandler({\n        type: 'pointerdown',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('pointermove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('pointercancel');\n      expect(endSpy1).not.toHaveBeenCalled();\n    }));\n\n    it('mouse{down,move,up,leave}', inject(function($document) {\n      $document.triggerHandler({\n        type: 'mousedown',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('mousemove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('mouseup');\n      expect(endSpy1).toHaveBeenCalled();\n\n      startSpy1.calls.reset();\n      moveSpy1.calls.reset();\n      endSpy1.calls.reset();\n\n      $document.triggerHandler({\n        type: 'mousedown',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n      $document.triggerHandler('mousemove');\n      expect(moveSpy1).toHaveBeenCalled();\n      $document.triggerHandler('mouseleave');\n      expect(endSpy1).toHaveBeenCalled();\n    }));\n\n    it('should not call start on an event with different type if <400ms have passed', inject(function($document) {\n      var now = 0;\n      spyOn(Date, 'now').and.callFake(function() { return now; });\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: childEl[0]\n      });\n      $document.triggerHandler('touchmove');\n      $document.triggerHandler('touchend');\n\n      startSpy1.calls.reset();\n      $document.triggerHandler({\n        type: 'mousedown',\n        target: childEl[0]\n      });\n      expect(startSpy1).not.toHaveBeenCalled();\n\n      now = 1500;\n      $document.triggerHandler({\n        type: 'mousedown',\n        target: childEl[0]\n      });\n      expect(startSpy1).toHaveBeenCalled();\n    }));\n\n  });\n\n  describe('click', function() {\n\n    // Click tests should only be enabled when `$$hijackClicks == true` (for mobile)\n\n    it('should click if distance < options.maxDistance', inject(function($document, $mdGesture) {\n      if ($mdGesture.$$hijackClicks) {\n        var spy = jasmine.createSpy('click');\n        var el = angular.element('<div>');\n\n        el.on('click', spy);\n\n        expect(spy).not.toHaveBeenCalled();\n        $document.triggerHandler({\n          type: 'touchstart',\n          target: el[0],\n          touches: [{pageX: 100, pageY: 100 }]\n        });\n        expect(spy).not.toHaveBeenCalled();\n        $document.triggerHandler({\n          type: 'touchend',\n          target: el[0],\n          touches: [{pageX: 97, pageY: 102 }]\n        });\n        expect(spy).toHaveBeenCalled();\n      }\n\n    }));\n\n    it('should not click if distance > options.maxDistance', inject(function($mdGesture, $document) {\n      if ($mdGesture.$$hijackClicks) {\n        var spy = jasmine.createSpy('click');\n        var el = angular.element('<div>');\n\n        el.on('click', spy);\n\n        $document.triggerHandler({\n          type: 'touchstart',\n          target: el[0],\n          touches: [{pageX: 100, pageY: 100 }]\n        });\n        expect(spy).not.toHaveBeenCalled();\n\n        $document.triggerHandler({\n          type: 'touchend',\n          target: el[0],\n          touches: [{pageX: 90, pageY: 110 }]\n        });\n        expect(spy).not.toHaveBeenCalled();\n      }\n\n    }));\n\n  });\n\n  describe('press', function() {\n\n    beforeEach(function() {\n      // Make sure `unexpected` prototype/inherited methods do not impact gestures\n      Object.prototype.test123 = function(x) {  };\n    });\n\n    afterEach(function() {\n       delete Object.prototype.test123;\n    });\n\n    it('should pressdown/up on touchstart/end', inject(function($mdGesture, $document) {\n      var downSpy = jasmine.createSpy('pressdown');\n      var upSpy = jasmine.createSpy('pressup');\n      var el = angular.element('<div>');\n\n      el.on('$md.pressdown', downSpy)\n        .on('$md.pressup', upSpy);\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: el[0]\n      });\n      expect(downSpy).toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n\n      downSpy.calls.reset();\n\n      $document.triggerHandler({\n        type: 'touchmove',\n        target: el[0]\n      });\n      expect(downSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchend',\n        target: el[0]\n      });\n      expect(downSpy).not.toHaveBeenCalled();\n      expect(upSpy).toHaveBeenCalled();\n    }));\n\n  });\n\n  describe('hold', function() {\n\n    it('should call hold after options number of ms', inject(function($mdGesture, $document, $timeout) {\n      var holdSpy = jasmine.createSpy('hold');\n      var el = angular.element('<div>');\n      $mdGesture.register(el, 'hold', {\n        delay: 333\n      });\n\n      el.on('$md.hold', holdSpy);\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: el[0]\n      });\n\n      // Make sure the timeout was set to exactly 333\n      $timeout.flush(332);\n      expect(holdSpy).not.toHaveBeenCalled();\n      $timeout.flush(1);\n      expect(holdSpy).toHaveBeenCalled();\n\n      $timeout.verifyNoPendingTasks();\n    }));\n\n    it('should reset timeout if moving > options.maxDistance', inject(function($mdGesture, $document, $timeout) {\n      var holdSpy = jasmine.createSpy('hold');\n      var el = angular.element('<div>');\n      $mdGesture.register(el, 'hold', {\n        delay: 333,\n        maxDistance: 10\n      });\n\n      // Setup our spies and trigger our first action (touchstart)\n      el.on('$md.hold', holdSpy);\n      spyOn($timeout, 'cancel').and.callThrough();\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: el[0],\n        touches: [{pageX: 100, pageY: 100}]\n      });\n\n      // The $md.hold spy should NOT have been called since the user has not lifted their finger\n      expect(holdSpy).not.toHaveBeenCalled();\n\n      // Reset calls to $timeout.cancel so that we can ensure (below) that it is called and\n      // trigger our second action (touchmove)\n      $timeout.cancel.calls.reset();\n\n      $document.triggerHandler({\n        type: 'touchmove',\n        target: el[0],\n        touches: [{pageX: 90, pageY: 90}]\n      });\n\n      // Because the user moves their finger instead of lifting, expect cancel to have been called\n      // and the $md.hold spy NOT to have been called\n      expect($timeout.cancel).toHaveBeenCalled();\n      expect(holdSpy).not.toHaveBeenCalled();\n\n      // We originally also called `$timeout.verifyNoPendingTasks();` here, however, changes made to\n      // $timeout.cancel() in 1.6 adds more tasks to the deferredQueue, so this will fail.\n    }));\n\n    it('should not reset timeout if moving < options.maxDistance', inject(function($mdGesture, $document, $timeout) {\n      var holdSpy = jasmine.createSpy('hold');\n      var el = angular.element('<div>');\n      $mdGesture.register(el, 'hold', {\n        delay: 333,\n        maxDistance: 10\n      });\n\n      el.on('$md.hold', holdSpy);\n\n      $document.triggerHandler({\n        type: 'touchstart',\n        target: el[0],\n        touches: [{pageX: 100, pageY: 100}]\n      });\n\n      spyOn($timeout, 'cancel');\n      expect(holdSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchmove',\n        target: el[0],\n        touches: [{pageX: 96, pageY: 96}]\n      });\n\n      expect(holdSpy).not.toHaveBeenCalled();\n      expect($timeout.cancel).not.toHaveBeenCalled();\n\n      $timeout.flush(333);\n      expect(holdSpy).toHaveBeenCalled();\n      $timeout.verifyNoPendingTasks();\n    }));\n\n  });\n\n  describe('drag', function() {\n\n    var startDragSpy, el, dragSpy, endDragSpy, doc, deRegisterEvents, touchAction;\n\n    beforeEach(function() {\n      inject(function($mdGesture, $document, $mdUtil) {\n        doc = $document;\n        startDragSpy = jasmine.createSpy('dragstart');\n        dragSpy = jasmine.createSpy('drag');\n        endDragSpy = jasmine.createSpy('dragend');\n        el = angular.element('<div>');\n\n        touchAction = $mdUtil.getTouchAction();\n        deRegisterEvents = $mdGesture.register(el, 'drag');\n        el.on('$md.dragstart', startDragSpy)\n          .on('$md.drag'     , dragSpy)\n          .on('$md.dragend'  , endDragSpy);\n      });\n    });\n\n    it('should only start after distanceX > minDistance', inject(function($mdGesture, $document) {\n\n      doc.triggerHandler({\n        type: 'touchstart',\n        target: el[0],\n        touches: [{pageX: 100, pageY: 100}]\n      });\n      expect(startDragSpy).not.toHaveBeenCalled();\n      expect(dragSpy).not.toHaveBeenCalled();\n      expect(endDragSpy).not.toHaveBeenCalled();\n\n      // Move 5 distanceX, no trigger\n      doc.triggerHandler({\n        type: 'touchmove',\n        target: el[0],\n        touches: [{pageX: 95, pageY: 100}]\n      });\n      expect(startDragSpy).not.toHaveBeenCalled();\n      expect(dragSpy).not.toHaveBeenCalled();\n      expect(endDragSpy).not.toHaveBeenCalled();\n\n      // Move 11 distanceX, trigger\n      doc.triggerHandler({\n        type: 'touchmove',\n        target: el[0],\n        touches: [{pageX: 89, pageY: 100}]\n      });\n      expect(startDragSpy).toHaveBeenCalled();\n\n      expect(startDragSpy.calls.mostRecent().args[0].pointer).toHaveFields({\n        startX: 89,\n        startY: 100,\n        x: 89,\n        y: 100,\n        distanceX: 0\n      });\n      expect(endDragSpy).not.toHaveBeenCalled();\n\n      startDragSpy.calls.reset();\n      doc.triggerHandler({\n        type: 'touchmove',\n        target: el[0],\n        touches: [{pageX: 90, pageY: 99}]\n      });\n      expect(startDragSpy).not.toHaveBeenCalled();\n      expect(dragSpy).toHaveBeenCalled();\n      expect(endDragSpy).not.toHaveBeenCalled();\n\n      dragSpy.calls.reset();\n      doc.triggerHandler({\n        type: 'touchend',\n        target: el[0],\n        changedTouches: [{pageX: 200, pageY: 0}]\n      });\n      expect(startDragSpy).not.toHaveBeenCalled();\n      expect(dragSpy).not.toHaveBeenCalled();\n      expect(endDragSpy).toHaveBeenCalled();\n\n      var pointer = endDragSpy.calls.mostRecent().args[0].pointer;\n      expect(pointer).toHaveFields({\n        distanceX: 111,\n        distanceY: -100,\n        x: 200,\n        y: 0\n      });\n    }));\n\n\n    it('should clean up styles when de-registered', inject(function($mdGesture, $document) {\n      deRegisterEvents();\n      // Ensure that no 'pan-x' or 'pan-y' values are left behind.\n      expect(el[0].style[touchAction]).toBe('');\n    }));\n  });\n\n  describe('swipe', function() {\n    var now;\n    var leftSpy;\n    var rightSpy;\n    var upSpy;\n    var downSpy;\n    var el;\n\n    beforeEach(function () {\n      now = 0;\n\n      spyOn(Date, 'now').and.callFake(function() { return now; });\n\n      leftSpy = jasmine.createSpy('left');\n      rightSpy = jasmine.createSpy('right');\n      upSpy = jasmine.createSpy('up');\n      downSpy = jasmine.createSpy('down');\n      el = angular.element('<div>');\n\n      el.on('$md.swipeleft', leftSpy)\n        .on('$md.swiperight', rightSpy)\n        .on('$md.swipeup', upSpy)\n        .on('$md.swipedown', downSpy);\n\n    });\n\n    it('should swipeleft if velocityX > minVelocity and distanceX > maxDistance', inject(function($mdGesture, $document) {\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      now = 1;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: -100, pageY: 0\n      });\n      expect(leftSpy).toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      var pointer = leftSpy.calls.mostRecent().args[0].pointer;\n      expect(pointer.velocityX).toBe(-100);\n      expect(pointer.distanceX).toBe(-100);\n    }));\n\n    it('should swiperight if velocityX > minVelocity and distanceX > maxDistance', inject(function($mdGesture, $document) {\n      $document.triggerHandler('$$mdGestureReset');\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      now = 1;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 100, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      var pointer = rightSpy.calls.mostRecent().args[0].pointer;\n      expect(pointer.velocityX).toBe(100);\n      expect(pointer.distanceX).toBe(100);\n\n    }));\n\n    it('should swipeup if velocityY > minVelocity and distanceY > maxDistance', inject(function($mdGesture, $document) {\n      $document.triggerHandler('$$mdGestureReset');\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      now = 1;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: -100\n      });\n      expect(upSpy).toHaveBeenCalled();\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      var pointer = upSpy.calls.mostRecent().args[0].pointer;\n      expect(pointer.velocityY).toBe(-100);\n      expect(pointer.distanceY).toBe(-100);\n    }));\n\n    it('should swipedown if velocityY > minVelocity and distanceY > maxDistance', inject(function($mdGesture, $document) {\n      $document.triggerHandler('$$mdGestureReset');\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      now = 1;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: 100\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).toHaveBeenCalled();\n\n      var pointer = downSpy.calls.mostRecent().args[0].pointer;\n      expect(pointer.velocityY).toBe(100);\n      expect(pointer.distanceY).toBe(100);\n\n    }));\n\n    it('should not swipeleft when velocity is too low', inject(function($document) {\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 100ms and 50 distance = velocity of 0.5, below the boundary. no swipe.\n      now = 100;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: -50, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 101ms and 100 distance = velocity of 1.0001, just fast enough for a swipe.\n      now = 101;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: -100, pageY: 0\n      });\n      expect(leftSpy).toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n    }));\n\n    it('should not swiperight when distance is too low', inject(function($document) {\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      now = 1;\n      // 10 distance = boundary. no swipe.\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 10, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 11 distance = enough. swipe.\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 11, pageY: 0\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n    }));\n\n    it('should not swipeup when velocity is too low', inject(function($document) {\n      $document.triggerHandler('$$mdGestureReset');\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 100ms and 50 distance = velocity of 0.5, below the boundary. no swipe.\n      now = 100;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: -50\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 101ms and 100 distance = velocity of 1.0001, just fast enough for a swipe.\n      now = 101;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: -100\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n    }));\n\n    it('should not swipedown when velocity is too low', inject(function($document) {\n      $document.triggerHandler('$$mdGestureReset');\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 100ms and 50 distance = velocity of 0.5, below the boundary. no swipe.\n      now = 100;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: 50\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).not.toHaveBeenCalled();\n\n      $document.triggerHandler({\n        type: 'touchstart', target: el[0], pageX: 0, pageY: 0\n      });\n      // 101ms and 100 distance = velocity of 1.0001, just fast enough for a swipe.\n      now = 101;\n      $document.triggerHandler({\n        type: 'touchend', target: el[0], pageX: 0, pageY: 100\n      });\n      expect(leftSpy).not.toHaveBeenCalled();\n      expect(rightSpy).not.toHaveBeenCalled();\n      expect(upSpy).not.toHaveBeenCalled();\n      expect(downSpy).toHaveBeenCalled();\n    }));\n\n  });\n\n});\n"
  },
  {
    "path": "src/core/services/interaction/interaction.js",
    "content": "/**\n * @ngdoc module\n * @name material.core.interaction\n * @description\n * User interaction detection to provide proper accessibility.\n */\nangular\n  .module('material.core.interaction', [])\n  .service('$mdInteraction', MdInteractionService);\n\n\n/**\n * @ngdoc service\n * @name $mdInteraction\n * @module material.core.interaction\n *\n * @description\n *\n * Service which keeps track of the last interaction type and validates them for several browsers.\n * The service hooks into the document's body and listens for touch, mouse and keyboard events.\n *\n * The most recent interaction type can be retrieved by calling the `getLastInteractionType` method.\n *\n * Here is an example markup for using the interaction service.\n *\n * <hljs lang=\"js\">\n *   var lastType = $mdInteraction.getLastInteractionType();\n *\n *   if (lastType === 'keyboard') {\n *     // We only restore the focus for keyboard users.\n *     restoreFocus();\n *   }\n * </hljs>\n *\n */\nfunction MdInteractionService($timeout, $mdUtil, $rootScope) {\n  this.$timeout = $timeout;\n  this.$mdUtil = $mdUtil;\n  this.$rootScope = $rootScope;\n\n  // IE browsers can also trigger pointer events, which also leads to an interaction.\n  this.pointerEvent = 'MSPointerEvent' in window ? 'MSPointerDown' : 'PointerEvent' in window ? 'pointerdown' : null;\n  this.bodyElement = angular.element(document.body);\n  this.isBuffering = false;\n  this.bufferTimeout = null;\n  this.lastInteractionType = null;\n  this.lastInteractionTime = null;\n  this.inputHandler = this.onInputEvent.bind(this);\n  this.bufferedInputHandler = this.onBufferInputEvent.bind(this);\n\n  // Type Mappings for the different events\n  // There will be three three interaction types\n  // `keyboard`, `mouse` and `touch`\n  // type `pointer` will be evaluated in `pointerMap` for IE Browser events\n  this.inputEventMap = {\n    'keydown': 'keyboard',\n    'mousedown': 'mouse',\n    'mouseenter': 'mouse',\n    'touchstart': 'touch',\n    'pointerdown': 'pointer',\n    'MSPointerDown': 'pointer'\n  };\n\n  // IE PointerDown events will be validated in `touch` or `mouse`\n  // Index numbers referenced here: https://msdn.microsoft.com/library/windows/apps/hh466130.aspx\n  this.iePointerMap = {\n    2: 'touch',\n    3: 'touch',\n    4: 'mouse'\n  };\n\n  this.initializeEvents();\n  this.$rootScope.$on('$destroy', this.deregister.bind(this));\n}\n\n/**\n * Removes all event listeners created by $mdInteration on the\n * body element.\n */\nMdInteractionService.prototype.deregister = function() {\n\n    this.bodyElement.off('keydown mousedown', this.inputHandler);\n\n    if ('ontouchstart' in document.documentElement) {\n      this.bodyElement.off('touchstart', this.bufferedInputHandler);\n    }\n\n    if (this.pointerEvent) {\n      this.bodyElement.off(this.pointerEvent, this.inputHandler);\n    }\n\n};\n\n/**\n * Initializes the interaction service, by registering all interaction events to the\n * body element.\n */\nMdInteractionService.prototype.initializeEvents = function() {\n\n  this.bodyElement.on('keydown mousedown', this.inputHandler);\n\n  if ('ontouchstart' in document.documentElement) {\n    this.bodyElement.on('touchstart', this.bufferedInputHandler);\n  }\n\n  if (this.pointerEvent) {\n    this.bodyElement.on(this.pointerEvent, this.inputHandler);\n  }\n\n};\n\n/**\n * Event listener for normal interaction events, which should be tracked.\n * @param event {MouseEvent|KeyboardEvent|PointerEvent|TouchEvent}\n */\nMdInteractionService.prototype.onInputEvent = function(event) {\n  if (this.isBuffering) {\n    return;\n  }\n\n  var type = this.inputEventMap[event.type];\n\n  if (type === 'pointer') {\n    type = this.iePointerMap[event.pointerType] || event.pointerType;\n  }\n\n  this.lastInteractionType = type;\n  this.lastInteractionTime = this.$mdUtil.now();\n};\n\n/**\n * Event listener for interaction events which should be buffered (touch events).\n * @param event {TouchEvent}\n */\nMdInteractionService.prototype.onBufferInputEvent = function(event) {\n  this.$timeout.cancel(this.bufferTimeout);\n\n  this.onInputEvent(event);\n  this.isBuffering = true;\n\n  // The timeout of 650ms is needed to delay the touchstart, because otherwise the touch will call\n  // the `onInput` function multiple times.\n  this.bufferTimeout = this.$timeout(function() {\n    this.isBuffering = false;\n  }.bind(this), 650, false);\n\n};\n\n/**\n * @ngdoc method\n * @name $mdInteraction#getLastInteractionType\n * @description Retrieves the last interaction type triggered in body.\n * @returns {string|null} Last interaction type.\n */\nMdInteractionService.prototype.getLastInteractionType = function() {\n  return this.lastInteractionType;\n};\n\n/**\n * @ngdoc method\n * @name $mdInteraction#isUserInvoked\n * @description Method to detect whether any interaction happened recently or not.\n * @param {number=} checkDelay Time to check for any interaction to have been triggered.\n * @returns {boolean} Whether there was any interaction or not.\n */\nMdInteractionService.prototype.isUserInvoked = function(checkDelay) {\n  var delay = angular.isNumber(checkDelay) ? checkDelay : 15;\n\n  // Check for any interaction to be within the specified check time.\n  return this.lastInteractionTime >= this.$mdUtil.now() - delay;\n};\n"
  },
  {
    "path": "src/core/services/interaction/interaction.spec.js",
    "content": "describe(\"$mdInteraction service\", function() {\n\n  var $mdInteraction = null;\n  var $rootScope = null;\n  var bodyElement = null;\n  var $timeout = null;\n\n  beforeEach(module('material.core'));\n\n  beforeEach(inject(function($injector) {\n    $mdInteraction = $injector.get('$mdInteraction');\n    $rootScope = $injector.get('$rootScope');\n    $timeout = $injector.get('$timeout');\n\n    bodyElement = angular.element(document.body);\n  }));\n\n  describe(\"last interaction type\", function() {\n\n\n    it(\"should detect a keyboard interaction\", function() {\n\n      bodyElement.triggerHandler('keydown');\n\n      expect($mdInteraction.getLastInteractionType()).toBe('keyboard');\n    });\n\n    it(\"should detect a mouse interaction\", function() {\n\n      bodyElement.triggerHandler('mousedown');\n\n      expect($mdInteraction.getLastInteractionType()).toBe(\"mouse\");\n    });\n\n  });\n\n  describe('isUserInvoked', function() {\n\n    var element = null;\n\n    beforeEach(function() {\n      element = angular.element('<button>Click</button>');\n\n      bodyElement.append(element);\n    });\n\n    afterEach(function() {\n      element.remove();\n    });\n\n    it('should be true when programmatically focusing an element', function() {\n      element.focus();\n\n      expect($mdInteraction.isUserInvoked()).toBe(false);\n    });\n\n    it('should be false when focusing an element through keyboard', function() {\n\n      // Fake a focus event triggered by a keyboard interaction.\n      bodyElement.triggerHandler('keydown');\n      element.focus();\n\n      expect($mdInteraction.isUserInvoked()).toBe(true);\n    });\n\n    it('should allow passing a custom check delay', function(done) {\n      bodyElement.triggerHandler('keydown');\n\n      // The keyboard interaction is still in the same tick, so the interaction happened earlier than 15ms (as default)\n      expect($mdInteraction.isUserInvoked()).toBe(true);\n\n      setTimeout(function() {\n        // Expect the keyboard interaction to be older than 5ms (safer than exactly 10ms) as check time.\n        expect($mdInteraction.isUserInvoked(5)).toBe(false);\n\n        done();\n      }, 10);\n    });\n\n  });\n\n  describe('when $rootScope is destroyed', function () {\n\n    var _initialTouchStartEvent = document.documentElement.ontouchstart;\n\n    beforeAll(function () {\n      document.documentElement.ontouchstart = function () {};\n    });\n\n    beforeEach(function () {\n      $mdInteraction.lastInteractionType = 'initial';\n      $rootScope.$destroy();\n    });\n\n    afterAll(function () {\n      document.documentElement.ontouchstart = _initialTouchStartEvent;\n    });\n\n    it('should remove mousedown events', function () {\n      bodyElement.triggerHandler('mousedown');\n      expect($mdInteraction.getLastInteractionType()).toEqual('initial');\n    });\n\n    it('should remove keydown events', function () {\n      bodyElement.triggerHandler('keydown');\n      expect($mdInteraction.getLastInteractionType()).toEqual('initial');\n    });\n\n    it('should remove touchstart events', function () {\n      bodyElement.triggerHandler('touchstart');\n      expect($mdInteraction.getLastInteractionType()).toEqual('initial');\n    });\n\n  });\n\n});\n"
  },
  {
    "path": "src/core/services/interimElement/interimElement.js",
    "content": "angular.module('material.core')\n  .provider('$$interimElement', InterimElementProvider);\n\n/**\n * @ngdoc service\n * @name $$interimElementProvider\n * @module material.core.interimElement\n *\n * @description\n *\n * Factory that constructs `$$interimElement.$service` services.\n * Used internally in material design for elements that appear on screen temporarily.\n * The service provides a promise-like API for interacting with the temporary\n * elements.\n *\n * <hljs lang=\"js\">\n *   app.service('$mdToast', function($$interimElement) {\n *     var $mdToast = $$interimElement(toastDefaultOptions);\n *     return $mdToast;\n *   });\n * </hljs>\n *\n * @param {object=} defaultOptions Options used by default for the `show` method on the service.\n *\n * @returns {$$interimElement.$service}\n */\n\nfunction InterimElementProvider() {\n  createInterimElementProvider.$get = InterimElementFactory;\n  return createInterimElementProvider;\n\n  /**\n   * Returns a new provider which allows configuration of a new interimElement\n   * service. Allows configuration of default options & methods for options,\n   * as well as configuration of 'preset' methods (eg dialog.basic(): basic is a preset method)\n   */\n  function createInterimElementProvider(interimFactoryName) {\n    var EXPOSED_METHODS = ['onHide', 'onShow', 'onRemove'];\n\n    var customMethods = {};\n    var providerConfig = {\n      presets: {}\n    };\n\n    var provider = {\n      setDefaults: setDefaults,\n      addPreset: addPreset,\n      addMethod: addMethod,\n      $get: factory\n    };\n\n    /**\n     * all interim elements will come with the 'build' preset\n     */\n    provider.addPreset('build', {\n      methods: ['controller', 'controllerAs', 'resolve', 'multiple',\n        'template', 'templateUrl', 'themable', 'transformTemplate', 'parent', 'contentElement']\n    });\n\n    return provider;\n\n    /**\n     * Save the configured defaults to be used when the factory is instantiated\n     */\n    function setDefaults(definition) {\n      providerConfig.optionsFactory = definition.options;\n      providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n      return provider;\n    }\n\n    /**\n     * Add a method to the factory that isn't specific to any interim element operations\n     */\n    function addMethod(name, fn) {\n      customMethods[name] = fn;\n      return provider;\n    }\n\n    /**\n     * Save the configured preset to be used when the factory is instantiated\n     */\n    function addPreset(name, definition) {\n      definition = definition || {};\n      definition.methods = definition.methods || [];\n      definition.options = definition.options || function() { return {}; };\n\n      if (/^cancel|hide|show$/.test(name)) {\n        throw new Error(\"Preset '\" + name + \"' in \" + interimFactoryName + \" is reserved!\");\n      }\n      if (definition.methods.indexOf('_options') > -1) {\n        throw new Error(\"Method '_options' in \" + interimFactoryName + \" is reserved!\");\n      }\n      providerConfig.presets[name] = {\n        methods: definition.methods.concat(EXPOSED_METHODS),\n        optionsFactory: definition.options,\n        argOption: definition.argOption\n      };\n      return provider;\n    }\n\n    function addPresetMethod(presetName, methodName, method) {\n      providerConfig.presets[presetName][methodName] = method;\n    }\n\n    /**\n     * Create a factory that has the given methods & defaults implementing interimElement\n     */\n    /* @ngInject */\n    function factory($$interimElement, $injector) {\n      var defaultMethods;\n      var defaultOptions;\n      var interimElementService = $$interimElement();\n\n      /*\n       * publicService is what the developer will be using.\n       * It has methods hide(), cancel(), show(), build(), and any other\n       * presets which were set during the config phase.\n       */\n      var publicService = {\n        hide: interimElementService.hide,\n        cancel: interimElementService.cancel,\n        show: showInterimElement,\n\n        // Special internal method to destroy an interim element without animations\n        // used when navigation changes causes a $scope.$destroy() action\n        destroy : destroyInterimElement\n      };\n\n\n      defaultMethods = providerConfig.methods || [];\n      // This must be invoked after the publicService is initialized\n      defaultOptions = invokeFactory(providerConfig.optionsFactory, {});\n\n      // Copy over the simple custom methods\n      angular.forEach(customMethods, function(fn, name) {\n        publicService[name] = fn;\n      });\n\n      angular.forEach(providerConfig.presets, function(definition, name) {\n        var presetDefaults = invokeFactory(definition.optionsFactory, {});\n        var presetMethods = (definition.methods || []).concat(defaultMethods);\n\n        // Every interimElement built with a preset has a field called `$type`,\n        // which matches the name of the preset.\n        // Eg in preset 'confirm', options.$type === 'confirm'\n        angular.extend(presetDefaults, { $type: name });\n\n        // This creates a preset class which has setter methods for every\n        // method given in the `.addPreset()` function, as well as every\n        // method given in the `.setDefaults()` function.\n        //\n        // @example\n        // .setDefaults({\n        //   methods: ['hasBackdrop', 'clickOutsideToClose', 'escapeToClose', 'targetEvent'],\n        //   options: dialogDefaultOptions\n        // })\n        // .addPreset('alert', {\n        //   methods: ['title', 'ok'],\n        //   options: alertDialogOptions\n        // })\n        //\n        // Set values will be passed to the options when interimElement.show() is called.\n        function Preset(opts) {\n          this._options = angular.extend({}, presetDefaults, opts);\n        }\n        angular.forEach(presetMethods, function(name) {\n          Preset.prototype[name] = function(value) {\n            this._options[name] = value;\n            return this;\n          };\n        });\n\n        // Create shortcut method for one-linear methods\n        if (definition.argOption) {\n          var methodName = 'show' + name.charAt(0).toUpperCase() + name.slice(1);\n          publicService[methodName] = function(arg) {\n            var config = publicService[name](arg);\n            return publicService.show(config);\n          };\n        }\n\n        // eg $mdDialog.alert() will return a new alert preset\n        publicService[name] = function(arg) {\n          // If argOption is supplied, eg `argOption: 'content'`, then we assume\n          // if the argument is not an options object then it is the `argOption` option.\n          //\n          // @example `$mdToast.simple('hello')` // sets options.content to hello\n          //                                     // because argOption === 'content'\n          if (arguments.length && definition.argOption &&\n              !angular.isObject(arg) && !angular.isArray(arg))  {\n\n            return (new Preset())[definition.argOption](arg);\n\n          } else {\n            return new Preset(arg);\n          }\n\n        };\n      });\n\n      return publicService;\n\n      /**\n       *\n       */\n      function showInterimElement(opts) {\n        // opts is either a preset which stores its options on an _options field,\n        // or just an object made up of options\n        opts = opts || { };\n        if (opts._options) opts = opts._options;\n\n        return interimElementService.show(\n          angular.extend({}, defaultOptions, opts)\n        );\n      }\n\n      /**\n       *  Special method to hide and destroy an interimElement WITHOUT\n       *  any 'leave` or hide animations ( an immediate force hide/remove )\n       *\n       *  NOTE: This calls the onRemove() subclass method for each component...\n       *  which must have code to respond to `options.$destroy == true`\n       */\n      function destroyInterimElement(opts) {\n          return interimElementService.destroy(opts);\n      }\n\n      /**\n       * Helper to call $injector.invoke with a local of the factory name for\n       * this provider.\n       * If an $mdDialog is providing options for a dialog and tries to inject\n       * $mdDialog, a circular dependency error will happen.\n       * We get around that by manually injecting $mdDialog as a local.\n       */\n      function invokeFactory(factory, defaultVal) {\n        var locals = {};\n        locals[interimFactoryName] = publicService;\n        return $injector.invoke(factory || function() { return defaultVal; }, {}, locals);\n      }\n    }\n  }\n\n  /* @ngInject */\n  function InterimElementFactory($document, $q, $rootScope, $timeout, $rootElement, $animate,\n                                 $mdUtil, $mdCompiler, $mdTheming, $injector, $exceptionHandler) {\n    return function createInterimElementService() {\n      var SHOW_CANCELLED = false;\n\n      /**\n       * @ngdoc service\n       * @name $$interimElementProvider.$service\n       *\n       * @description\n       * A service used to control inserting and removing of an element from the DOM.\n       * It is used by $mdBottomSheet, $mdDialog, $mdToast, $mdMenu, $mdPanel, and $mdSelect.\n       */\n      var service;\n\n      var showPromises = []; // Promises for the interim's which are currently opening.\n      var hidePromises = []; // Promises for the interim's which are currently hiding.\n      var showingInterims = []; // Interim elements which are currently showing up.\n\n      // Publish instance $$interimElement service;\n      return service = {\n        show: show,\n        hide: waitForInterim(hide),\n        cancel: waitForInterim(cancel),\n        destroy : destroy,\n        $injector_: $injector\n      };\n\n      /**\n       * @ngdoc method\n       * @name $$interimElementProvider.$service#show\n       * @kind function\n       *\n       * @description\n       * Adds the `$interimElement` to the DOM and returns a special promise that will be resolved\n       * or rejected with hide or cancel, respectively.\n       *\n       * @param {Object} options map of options and values\n       * @returns {Promise} a Promise that will be resolved when hide() is called or rejected when\n       *  cancel() is called.\n       */\n      function show(options) {\n        options = options || {};\n        var interimElement = new InterimElement(options || {});\n\n        // When an interim element is currently showing, we have to cancel it.\n        // Just hiding it, will resolve the InterimElement's promise, the promise should be\n        // rejected instead.\n        var hideAction = options.multiple ? $q.resolve() : $q.all(showPromises);\n\n        if (!options.multiple) {\n          // Wait for all opening interim's to finish their transition.\n          hideAction = hideAction.then(function() {\n            // Wait for all closing and showing interim's to be completely closed.\n            var promiseArray = hidePromises.concat(showingInterims.map(service.cancel));\n            return $q.all(promiseArray);\n          });\n        }\n\n        var showAction = hideAction.then(function() {\n\n          return interimElement\n            .show()\n            .then(function () {\n              showingInterims.push(interimElement);\n            })\n            .catch(function (reason) {\n              return reason;\n            })\n            .finally(function() {\n              showPromises.splice(showPromises.indexOf(showAction), 1);\n            });\n\n        });\n\n        showPromises.push(showAction);\n\n        // In AngularJS 1.6+, exceptions inside promises will cause a rejection. We need to handle\n        // the rejection and only log it if it's an error.\n        interimElement.deferred.promise.catch(function(fault) {\n          if (fault instanceof Error) {\n            $exceptionHandler(fault);\n          }\n\n          return fault;\n        });\n\n        // Return a promise that will be resolved when the interim\n        // element is hidden or cancelled...\n        return interimElement.deferred.promise;\n      }\n\n      /**\n       * @ngdoc method\n       * @name $$interimElementProvider.$service#hide\n       * @kind function\n       *\n       * @description\n       * Removes the `$interimElement` from the DOM and resolves the Promise returned from `show()`.\n       *\n       * @param {*} reason Data used to resolve the Promise\n       * @param {object} options map of options and values\n       * @returns {Promise} a Promise that will be resolved after the element has been removed\n       *  from the DOM.\n       */\n      function hide(reason, options) {\n        options = options || {};\n\n        if (options.closeAll) {\n          // We have to make a shallow copy of the array, because otherwise the map will break.\n          return $q.all(showingInterims.slice().reverse().map(closeElement));\n        } else if (options.closeTo !== undefined) {\n          return $q.all(showingInterims.slice(options.closeTo).map(closeElement));\n        }\n\n        // Hide the latest showing interim element.\n        return closeElement(showingInterims[showingInterims.length - 1]);\n\n        /**\n         * @param {InterimElement} interim element to close\n         * @returns {Promise<InterimElement>}\n         */\n        function closeElement(interim) {\n          if (!interim) {\n            return $q.when(reason);\n          }\n\n          var hideAction = interim\n            .remove(reason, false, options || { })\n            .catch(function(reason) { return reason; })\n            .finally(function() {\n              hidePromises.splice(hidePromises.indexOf(hideAction), 1);\n            });\n\n          showingInterims.splice(showingInterims.indexOf(interim), 1);\n          hidePromises.push(hideAction);\n\n          return interim.deferred.promise;\n        }\n      }\n\n      /**\n       * @ngdoc method\n       * @name $$interimElementProvider.$service#cancel\n       * @kind function\n       *\n       * @description\n       * Removes the `$interimElement` from the DOM and rejects the Promise returned from `show()`.\n       *\n       * @param {*} reason Data used to resolve the Promise\n       * @param {object} options map of options and values\n       * @returns {Promise} Promise that will be resolved after the element has been removed\n       *  from the DOM.\n       */\n      function cancel(reason, options) {\n        var interim = showingInterims.pop();\n        if (!interim) {\n          return $q.when(reason);\n        }\n\n        var cancelAction = interim\n          .remove(reason, true, options || {})\n          .catch(function(reason) { return reason; })\n          .finally(function() {\n            hidePromises.splice(hidePromises.indexOf(cancelAction), 1);\n          });\n\n        hidePromises.push(cancelAction);\n\n        // Since AngularJS 1.6.7, promises will be logged to $exceptionHandler when the promise\n        // is not handling the rejection. We create a pseudo catch handler, which will prevent the\n        // promise from being logged to the $exceptionHandler.\n        return interim.deferred.promise.catch(angular.noop);\n      }\n\n      /**\n       * Creates a function to wait for at least one interim element to be available.\n       * @param callbackFn Function to be used as callback\n       * @returns {Function}\n       */\n      function waitForInterim(callbackFn) {\n        return function() {\n          var fnArguments = arguments;\n\n          if (!showingInterims.length) {\n            // When there are still interim's opening, then wait for the first interim element to\n            // finish its open animation.\n            if (showPromises.length) {\n              return showPromises[0].finally(function () {\n                return callbackFn.apply(service, fnArguments);\n              });\n            }\n\n            return $q.when(\"No interim elements currently showing up.\");\n          }\n\n          return callbackFn.apply(service, fnArguments);\n        };\n      }\n\n      /**\n       * @ngdoc method\n       * @name $$interimElementProvider.$service#destroy\n       * @kind function\n       *\n       * Special method to quick-remove the interim element without running animations. This is\n       * useful when the parent component has been or is being destroyed.\n       *\n       * Note: interim elements are in \"interim containers\".\n       */\n      function destroy(targetEl) {\n        var interim = !targetEl ? showingInterims.shift() : null;\n\n        var parentEl = angular.element(targetEl).length && angular.element(targetEl)[0].parentNode;\n\n        if (parentEl) {\n          // Try to find the interim in the stack which corresponds to the supplied DOM element.\n          var filtered = showingInterims.filter(function(entry) {\n            return entry.options.element[0] === parentEl;\n          });\n\n          // Note: This function might be called when the element already has been removed,\n          // in which case we won't find any matches.\n          if (filtered.length) {\n            interim = filtered[0];\n            showingInterims.splice(showingInterims.indexOf(interim), 1);\n          }\n        }\n\n        return interim ? interim.remove(SHOW_CANCELLED, false, { '$destroy': true }) :\n                         $q.when(SHOW_CANCELLED);\n      }\n\n      /*\n       * Internal Interim Element Object\n       * Used internally to manage the DOM element and related data\n       */\n      function InterimElement(options) {\n        var self, element, showAction = $q.when(true);\n\n        options = configureScopeAndTransitions(options);\n\n        return self = {\n          options : options,\n          deferred: $q.defer(),\n          show    : createAndTransitionIn,\n          remove  : transitionOutAndRemove\n        };\n\n        /**\n         * Compile, link, and show this interim element. Use optional autoHide and transition-in\n         * effects.\n         * @return {Q.Promise}\n         */\n        function createAndTransitionIn() {\n          return $q(function(resolve, reject) {\n\n            // Trigger onCompiling callback before the compilation starts.\n            // This is useful, when modifying options, which can be influenced by developers.\n            options.onCompiling && options.onCompiling(options);\n\n            compileElement(options)\n              .then(function(compiledData) {\n                element = linkElement(compiledData, options);\n\n                // Expose the cleanup function from the compiler.\n                options.cleanupElement = compiledData.cleanup;\n\n                showAction = showElement(element, options, compiledData.controller)\n                  .then(resolve, rejectAll);\n              }).catch(rejectAll);\n\n            function rejectAll(fault) {\n              // Force the '$md<xxx>.show()' promise to reject\n              self.deferred.reject(fault);\n\n              // Continue rejection propagation\n              reject(fault);\n            }\n          });\n        }\n\n        /**\n         * After the show process has finished/rejected:\n         * - announce 'removing',\n         * - perform the transition-out, and\n         * - perform optional clean up scope.\n         */\n        function transitionOutAndRemove(response, isCancelled, opts) {\n\n          // abort if the show() and compile failed\n          if (!element) return $q.when(false);\n\n          options = angular.extend(options || {}, opts || {});\n          options.cancelAutoHide && options.cancelAutoHide();\n          options.element.triggerHandler('$mdInterimElementRemove');\n\n          if (options.$destroy === true) {\n\n            return hideElement(options.element, options).then(function(){\n              (isCancelled && rejectAll(response)) || resolveAll(response);\n            });\n\n          } else {\n            $q.when(showAction).finally(function() {\n              hideElement(options.element, options).then(function() {\n                isCancelled ? rejectAll(response) : resolveAll(response);\n              }, rejectAll);\n            });\n\n            return self.deferred.promise;\n          }\n\n\n          /**\n           * The `show()` returns a promise that will be resolved when the interim\n           * element is hidden or cancelled...\n           */\n          function resolveAll(response) {\n            self.deferred.resolve(response);\n          }\n\n          /**\n           * Force the '$md<xxx>.show()' promise to reject\n           */\n          function rejectAll(fault) {\n            self.deferred.reject(fault);\n          }\n        }\n\n        /**\n         * Prepare optional isolated scope and prepare $animate with default enter and leave\n         * transitions for the new element instance.\n         */\n        function configureScopeAndTransitions(options) {\n          options = options || { };\n          if (options.template) {\n            options.template = $mdUtil.processTemplate(options.template);\n          }\n\n          return angular.extend({\n            preserveScope: false,\n            cancelAutoHide : angular.noop,\n            scope: options.scope || $rootScope.$new(options.isolateScope),\n\n            /**\n             * Default usage to enable $animate to transition-in; can be easily overridden via 'options'\n             */\n            onShow: function transitionIn(scope, element, options) {\n              return $animate.enter(element, options.parent);\n            },\n\n            /**\n             * Default usage to enable $animate to transition-out; can be easily overridden via 'options'\n             */\n            onRemove: function transitionOut(scope, element) {\n              // Element could be undefined if a new element is shown before\n              // the old one finishes compiling.\n              return element && $animate.leave(element) || $q.when();\n            }\n          }, options);\n\n        }\n\n        /**\n         * Compile an element with a templateUrl, controller, and locals\n         * @param {Object} options\n         * @return {Q.Promise<{element: JQLite=, link: Function, locals: Object, cleanup: any=,\n         *  controller: Object=}>}\n         */\n        function compileElement(options) {\n\n          var compiled = !options.skipCompile ? $mdCompiler.compile(options) : null;\n\n          return compiled || $q(function (resolve) {\n              resolve({\n                locals: {},\n                link: function () {\n                  return options.element;\n                }\n              });\n            });\n        }\n\n        /**\n         * Link an element with compiled configuration\n         * @param {{element: JQLite=, link: Function, locals: Object, controller: Object=}} compileData\n         * @param {Object} options\n         * @return {JQLite}\n         */\n        function linkElement(compileData, options) {\n          angular.extend(compileData.locals, options);\n\n          var element = compileData.link(options.scope);\n\n          // Search for parent at insertion time, if not specified\n          options.element = element;\n          options.parent = findParent(element, options);\n          if (options.themable) $mdTheming(element);\n\n          return element;\n        }\n\n        /**\n         * Search for parent at insertion time, if not specified.\n         * @param {JQLite} element\n         * @param {Object} options\n         * @return {JQLite}\n         */\n        function findParent(element, options) {\n          var parent = options.parent;\n\n          // Search for parent at insertion time, if not specified\n          if (angular.isFunction(parent)) {\n            parent = parent(options.scope, element, options);\n          } else if (angular.isString(parent)) {\n            parent = angular.element($document[0].querySelector(parent));\n          } else {\n            parent = angular.element(parent);\n          }\n\n          // If parent querySelector/getter function fails, or it's just null,\n          // find a default.\n          if (!(parent || {}).length) {\n            var el;\n            if ($rootElement[0] && $rootElement[0].querySelector) {\n              el = $rootElement[0].querySelector(':not(svg) > body');\n            }\n            if (!el) el = $rootElement[0];\n            if (el.nodeName === '#comment') {\n              el = $document[0].body;\n            }\n            return angular.element(el);\n          }\n\n          return parent;\n        }\n\n        /**\n         * If auto-hide is enabled, start timer and prepare cancel function\n         */\n        function startAutoHide() {\n          var autoHideTimer, cancelAutoHide = angular.noop;\n\n          if (options.hideDelay) {\n            autoHideTimer = $timeout(service.hide, options.hideDelay) ;\n            cancelAutoHide = function() {\n              $timeout.cancel(autoHideTimer);\n            };\n          }\n\n          // Cache for subsequent use\n          options.cancelAutoHide = function() {\n            cancelAutoHide();\n            options.cancelAutoHide = undefined;\n          };\n        }\n\n        /**\n         * Show the element (with transitions), notify complete and start optional auto hiding\n         * timer.\n         * @param {JQLite} element\n         * @param {Object} options\n         * @param {Object} controller\n         * @return {Q.Promise<JQLite>}\n         */\n        function showElement(element, options, controller) {\n          // Trigger onShowing callback before the `show()` starts\n          var notifyShowing = options.onShowing || angular.noop;\n          // Trigger onComplete callback when the `show()` finishes\n          var notifyComplete = options.onComplete || angular.noop;\n\n          // Necessary for consistency between AngularJS 1.5 and 1.6.\n          try {\n            // This fourth controller parameter is used by $mdDialog in beforeShow().\n            notifyShowing(options.scope, element, options, controller);\n          } catch (e) {\n            return $q.reject(e);\n          }\n\n          return $q(function (resolve, reject) {\n            try {\n              // Start transitionIn\n              $q.when(options.onShow(options.scope, element, options))\n                .then(function () {\n                  notifyComplete(options.scope, element, options);\n                  startAutoHide();\n\n                  resolve(element);\n                }, reject);\n\n            } catch (e) {\n              reject(e.message);\n            }\n          });\n        }\n\n        function hideElement(element, options) {\n          var announceRemoving = options.onRemoving || angular.noop;\n\n          return $q(function (resolve, reject) {\n            try {\n              // Start transitionIn\n              var action = $q.when(options.onRemove(options.scope, element, options) || true);\n\n              // Trigger callback *before* the remove operation starts\n              announceRemoving(element, action);\n\n              if (options.$destroy) {\n                // For $destroy, onRemove should be synchronous\n                resolve(element);\n\n                if (!options.preserveScope && options.scope) {\n                  // scope destroy should still be be done after the current digest is done\n                  action.then(function() { options.scope.$destroy(); });\n                }\n              } else {\n                // Wait until transition-out is done\n                action.then(function () {\n                  if (!options.preserveScope && options.scope) {\n                    options.scope.$destroy();\n                  }\n\n                  resolve(element);\n                }, reject);\n              }\n            } catch (e) {\n              reject(e.message);\n            }\n          });\n        }\n\n      }\n    };\n  }\n}\n"
  },
  {
    "path": "src/core/services/interimElement/interimElement.spec.js",
    "content": "describe('$$interimElement service', function() {\n\n  beforeEach(module('material.core'));\n\n  var $rootScope, $q, $timeout;\n  var $compilerSpy, $themingSpy;\n\n  describe('provider', function() {\n\n    it('by default create a factory with default methods', function() {\n      createInterimProvider('interimTest');\n      inject(function(interimTest) {\n        expect(interimTest.hide).toBeOfType('function');\n        expect(interimTest.build).toBeOfType('function');\n        expect(interimTest.cancel).toBeOfType('function');\n        expect(interimTest.show).toBeOfType('function');\n\n        var builder = interimTest.build();\n        ['controller', 'controllerAs', 'onRemove', 'onShow', 'resolve',\n          'template', 'templateUrl', 'themable', 'transformTemplate', 'parent'\n        ].forEach(function(methodName) {\n          expect(builder[methodName]).toBeOfType('function');\n        });\n      });\n    });\n\n    it('should show with provided builder', function() {\n      createInterimProvider('interimTest');\n      inject(function(interimTest, $rootScope) {\n        var shown = false;\n        interimTest.show(\n          interimTest.build({\n            controller: 'test ctrl',\n          })\n          .onShow(function(scope, element, options) {\n            shown = true;\n            expect(options.controller).toBe('test ctrl');\n          })\n        );\n\n        $rootScope.$apply();\n        expect(shown).toBe(true);\n      });\n    });\n\n    it('should not call onShow or onRemove on failing to load templates', function() {\n      createInterimProvider('interimTest');\n      inject(function($q, $rootScope, $rootElement, interimTest, $httpBackend) {\n        var templateCompiled = true;\n\n        $compilerSpy.and.callFake(function(reason) {\n          return $q(function(resolve,reject){\n            templateCompiled = false;\n            reject(500 || false);\n          });\n        });\n        $httpBackend.when('GET', '/fail-url.html').respond(500, '');\n\n        var onShowCalled = false, onHideCalled = false;\n\n        interimTest.show({\n          templateUrl: '/fail-url.html',\n          onShow: function() { onShowCalled = true; },\n          onRemove: function() { onHideCalled = true; }\n        });\n\n        $material.flushOutstandingAnimations();\n        interimTest.cancel();\n        $material.flushOutstandingAnimations();\n\n        expect(onShowCalled).toBe(false);\n        expect(onHideCalled).toBe(false);\n        expect(templateCompiled).toBe(false);\n      });\n    });\n\n    it('should add specified defaults', function() {\n      createInterimProvider('interimTest').setDefaults({\n        options: function($rootScope) {\n          return {\n            id: $rootScope.$id\n          };\n        },\n        methods: ['foo', 'bar']\n      });\n      inject(function(interimTest, $rootScope) {\n        var builder = interimTest.build({\n          onShow: function(scope, element, options) {\n            shown = true;\n            expect(options.id).toBe($rootScope.$id);\n          }\n        });\n        expect(builder.foo).toBeOfType('function');\n        expect(builder.bar).toBeOfType('function');\n\n        var shown = false;\n        interimTest.show(builder);\n        $rootScope.$apply();\n        shown = true;\n      });\n    });\n\n    it('should allow custom methods', function() {\n      var called = false;\n      createInterimProvider('testCustomMethods')\n        .addMethod('helloWorld', function() { called = true; });\n\n      inject(function(testCustomMethods) {\n        testCustomMethods.helloWorld();\n      });\n      expect(called).toBe(true);\n    });\n\n    it('should add specified builder with defaults', function() {\n      createInterimProvider('interimTest')\n        .setDefaults({\n          options: function() {\n            return {\n              pizza: 'pepperoni'\n            };\n          },\n          methods: ['banana']\n        })\n        .addPreset('bob', {\n          options: function() {\n            return {\n              nut: 'almond'\n            };\n          },\n          methods: ['mango']\n        });\n      inject(function(interimTest, $rootScope) {\n        var shown = false;\n        var builder = interimTest.bob({\n          onShow: function(scope, element, options) {\n            expect(options.pizza).toBe('pepperoni');\n            expect(options.nut).toBe('almond');\n            expect(options.banana).toBe(1);\n            expect(options.mango).toBe(2);\n            shown = true;\n          }\n        });\n        builder.banana(1);\n        builder.mango(2);\n        interimTest.show(builder);\n        $rootScope.$apply();\n        expect(shown).toBe(true);\n\n      });\n    });\n\n    it('should allow argOption in a custom builder', function() {\n      createInterimProvider('interimTest')\n        .addPreset('banana', {\n          argOption: 'color',\n          methods: ['color']\n        });\n      inject(function(interimTest, $rootScope) {\n        var shown = false;\n        var builder = interimTest.banana('yellow').onShow(function(scope, element, options) {\n          expect(options.color).toBe('yellow');\n          shown = true;\n        });\n        interimTest.show(builder);\n        $rootScope.$apply();\n        expect(shown).toBe(true);\n      });\n    });\n\n    it('should create a shortcut show method with arg options', function() {\n      var shown = false;\n      createInterimProvider('interimTest')\n        .addPreset('banana', {\n          argOption: 'color',\n          methods: ['color'],\n          options: function() {\n            return {\n              onShow: function(scope, el, opts) {\n                shown = true;\n                expect(opts.color).toBe('yellow');\n              }\n            };\n          }\n        });\n      inject(function(interimTest, $rootScope) {\n        interimTest.showBanana('yellow');\n        $rootScope.$apply();\n        expect(shown).toBe(true);\n      });\n    });\n\n    it('should show with proper options', function() {\n      createInterimProvider('interimTest')\n        .setDefaults({\n          options: function() {\n            return { key: 'defaultValue' };\n          }\n        })\n        .addPreset('preset', {\n          options: function() {\n            return { key2: 'defaultValue2' };\n          },\n          methods: ['key2']\n        });\n      inject(function(interimTest) {\n        interimTest.show();\n\n        flush();\n        expect($compilerSpy.calls.mostRecent().args[0].key).toBe('defaultValue');\n        $compilerSpy.calls.reset();\n\n        interimTest.show({\n          key: 'newValue'\n        });\n        flush();\n        flush();\n        expect($compilerSpy.calls.mostRecent().args[0].key).toBe('newValue');\n        $compilerSpy.calls.reset();\n\n        interimTest.show(interimTest.preset());\n        flush();\n        flush();\n        expect($compilerSpy.calls.mostRecent().args[0].key).toBe('defaultValue');\n        expect($compilerSpy.calls.mostRecent().args[0].key2).toBe('defaultValue2');\n\n        $compilerSpy.calls.reset();\n        interimTest.show(\n          interimTest.preset({\n            key: 'newValue',\n            key2: 'newValue2'\n          })\n        );\n        flush();\n        flush();\n        expect($compilerSpy.calls.mostRecent().args[0].key).toBe('newValue');\n        expect($compilerSpy.calls.mostRecent().args[0].key2).toBe('newValue2');\n\n        $compilerSpy.calls.reset();\n        flush();\n        flush();\n        interimTest.show(\n          interimTest.preset({\n            key2: 'newValue2'\n          }).key2('superNewValue2')\n        );\n        flush();\n        flush();\n        expect($compilerSpy.calls.mostRecent().args[0].key).toBe('defaultValue');\n        expect($compilerSpy.calls.mostRecent().args[0].key2).toBe('superNewValue2');\n      });\n    });\n\n    it('should support multiple interims as a preset method', function() {\n\n      var showCount = 0;\n\n      createInterimProvider('interimTest');\n\n      inject(function(interimTest) {\n\n        showInterim(interimTest);\n        expect(showCount).toBe(1);\n\n        showInterim(interimTest);\n        expect(showCount).toBe(2);\n\n        interimTest.hide();\n        flush();\n\n        expect(showCount).toBe(1);\n\n        interimTest.hide();\n        flush();\n\n        expect(showCount).toBe(0);\n\n      });\n\n      function showInterim(service) {\n\n        var preset = service\n          .build()\n          .template('<div>Interim Element</div>')\n          .multiple(true);\n\n        preset._options.onShow = function() {\n          showCount++;\n        };\n\n        preset._options.onRemove = function() {\n          showCount--;\n        };\n\n        service.show(preset);\n        flush();\n      }\n\n    });\n\n  });\n\n  describe('a service', function() {\n    var Service, ieShow;\n\n    beforeEach(function() {\n      setup();\n      inject(function($$interimElement, _$q_, _$timeout_) {\n        $q = _$q_;\n        $timeout = _$timeout_;\n\n        Service = $$interimElement();\n\n        ieShow = Service.show;\n\n        Service.show = tailHook(Service.show, flush);\n        Service.hide = tailHook(Service.hide, flush);\n        Service.cancel = tailHook(Service.cancel, flush);\n      });\n\n    });\n\n\n    describe('instance#show', function() {\n\n\n      it('inherits default options', inject(function() {\n        var defaults = { templateUrl: 'testing.html' };\n        Service.show(defaults);\n        expect($compilerSpy.calls.mostRecent().args[0].templateUrl).toBe('testing.html');\n      }));\n\n      describe('captures and fails with ',function(){\n\n       it('internal reject during show()', inject(function($q,$timeout) {\n         var showFailed, onShowFail = function() {\n           showFailed = true;\n         };\n\n         // `templateUrl` is invalid; element will not be created\n\n         // We use the original $$interimElement.show so that we ignore the tailhook and manually\n         // run it\n         ieShow({\n           templateUrl: 'testing.html',\n           onShow : function() { return $q.reject(\"failed\"); }\n         })\n         .catch(onShowFail);\n         $timeout.flush();\n\n         expect(showFailed).toBe(true);\n       }));\n\n       it('internal exception during show()', inject(function($q,$timeout) {\n         var showFailed, onShowFail = function(reason) {\n           showFailed = reason;\n         };\n\n         // We use the original $$interimElement.show so that we ignore the tailhook and manually\n         // run it\n         ieShow({\n           templateUrl: 'testing.html',\n           onShow : function() {   throw new Error(\"exception\"); }\n         })\n         .catch(onShowFail);\n         $timeout.flush();\n\n         expect(showFailed).toBe('exception');\n       }));\n\n      });\n\n      it('show() captures pending promise that resolves with hide()', inject(function($q) {\n        var showFinished;\n\n        Service.show({\n          template: '<div></div>',\n          onShow : function() {\n            return $q.when(true);\n          }\n        })\n        .then(function() {\n          showFinished = true;\n        });\n\n        expect(showFinished).toBeUndefined();\n        Service.hide('confirmed');\n\n        expect(showFinished).toBe(true);\n\n      }));\n\n      it('should show multiple interim elements', function() {\n        var showCount = 0;\n\n        showInterim();\n        expect(showCount).toBe(1);\n\n        showInterim();\n        expect(showCount).toBe(2);\n\n        function showInterim() {\n          Service.show({\n            template: '<div>First Interim</div>',\n            onShow: function() {\n              showCount++;\n            },\n            onRemove: function() {\n              showCount--;\n            },\n            multiple: true\n          });\n        }\n      });\n\n      it('should hide multiple elements', function() {\n        var showCount = 0;\n\n        showInterim();\n        expect(showCount).toBe(1);\n\n        showInterim();\n        expect(showCount).toBe(2);\n\n        Service.hide();\n        expect(showCount).toBe(1);\n\n        Service.hide();\n        expect(showCount).toBe(0);\n\n        function showInterim() {\n          Service.show({\n            template: '<div>Interim Element</div>',\n            onShow: function() {\n              showCount++;\n            },\n            onRemove: function() {\n              showCount--;\n            },\n            multiple: true\n          });\n        }\n\n      });\n\n      it('should not show multiple interim elements by default', function() {\n        var showCount = 0;\n\n        showInterim();\n        expect(showCount).toBe(1);\n\n        showInterim();\n        expect(showCount).toBe(1);\n\n        function showInterim() {\n          Service.show({\n            template: '<div>First Interim</div>',\n            onShow: function() {\n              showCount++;\n            },\n            onRemove: function() {\n              showCount--;\n            }\n          });\n        }\n      });\n\n      it('should cancel a previous interim after a second shows up', inject(function($q, $timeout) {\n        var hidePromise = $q.defer();\n        var isShown = false;\n\n        Service.show({\n          template: '<div>First Interim</div>',\n          onRemove: function() {\n            return hidePromise.promise;\n          }\n        });\n\n        // Once we show the second interim, the first interim should be cancelled and new interim\n        // will successfully show up after the first interim hides completely.\n        Service.show({\n          template: '<div>Second Interim</div>',\n          onShow: function() {\n            isShown = true;\n          }\n        });\n\n        expect(isShown).toBe(false);\n\n        hidePromise.resolve();\n        $timeout.flush();\n\n        expect(isShown).toBe(true);\n      }));\n\n      it('should cancel a previous shown interim element', inject(function() {\n        var isCancelled = false;\n\n        Service.show({\n          template: '<div>First Interim</div>'\n        }).catch(function() {\n          isCancelled = true;\n        });\n\n        // Once we show the second interim, the first interim should be cancelled and the promise\n        // should be rejected with no reason.\n        Service.show({\n          template: '<div>Second Interim</div>'\n        });\n\n        expect(isCancelled).toBe(true);\n      }));\n\n      it('forwards options to $mdCompiler', inject(function() {\n        var options = {template: '<testing />'};\n        Service.show(options);\n        expect($compilerSpy.calls.mostRecent().args[0].template).toBe('<testing />');\n      }));\n\n      it('supports theming', inject(function() {\n        Service.show({themable: true});\n        expect($themingSpy).toHaveBeenCalled();\n      }));\n\n      it('calls hide after hideDelay', inject(function() {\n        var autoClosed;\n        Service\n          .show({hideDelay: 1000})\n          .then(function(closed){\n            autoClosed = true;\n          })\n          .catch(function(fault){\n            var i = fault;\n          });\n\n        flush();\n        $timeout.flush();\n        expect(autoClosed).toBe(true);\n      }));\n\n      it('calls onCompiling before onShowing', inject(function() {\n        var onCompilingCalled = false;\n\n        Service.show({\n          template: '<div>My Element</div>',\n          onCompiling: beforeCompile,\n          onShowing: beforeShow\n        });\n\n        function beforeCompile() {\n          onCompilingCalled = true;\n        }\n\n        function beforeShow() {\n          expect(onCompilingCalled).toBe(true);\n        }\n\n      }));\n\n      it('calls onShowing before onShow', inject(function() {\n        var onShowingCalled = false;\n\n        Service.show({\n          template: '<some-element />',\n          passingOptions: true,\n          onShowing: onShowing,\n          onShow: onShow\n        });\n\n        expect(onShowingCalled).toBe(true);\n\n        function onShowing(scope, el, options) {\n          onShowingCalled = true;\n        }\n\n        function onShow(scope, el, options) {\n          expect(onShowingCalled).toBe(true);\n        }\n      }));\n\n      it('calls onRemove', inject(function() {\n        var onRemoveCalled = false;\n        Service.show({\n          template: '<some-element />',\n          isPassingOptions: true,\n          onRemove: onRemove\n        });\n\n        Service.hide();\n\n        expect(onRemoveCalled).toBe(true);\n\n        function onRemove(scope, el, options) {\n          onRemoveCalled = true;\n          expect(options.isPassingOptions).toBe(true);\n          expect(el[0]).toBeTruthy();\n        }\n      }));\n\n      it('returns a promise', inject(function() {\n        expect(typeof Service.show().then).toBe('function');\n      }));\n\n      it('defaults parent to $rootElement', inject(function($rootElement) {\n        var shown = false;\n        Service.show({\n          onShow: function(scope, element, options) {\n            expect(options.parent[0]).toBe($rootElement[0]);\n            shown = true;\n          }\n        });\n        expect(shown).toBe(true);\n      }));\n\n      it('does not select svg body tags', inject(function($rootScope, $rootElement) {\n        var shown = false;\n        var originalRoot = $rootElement[0];\n        var svgEl = angular.element('<div><svg><body></body></svg></div>');\n        $rootElement[0] = svgEl[0];\n        Service.show({\n          onShow: function(scope, element, options) {\n            expect(options.parent[0]).toBe(svgEl[0]);\n            shown = true;\n          }\n        });\n        $rootElement[0] = originalRoot;\n        expect(shown).toBe(true);\n      }));\n\n      it('falls back to $document.body if $rootElement was removed', inject(function($document, $rootElement) {\n        var shown = false;\n        var originalRoot = $rootElement[0];\n        var commentEl = angular.element('<!-- I am a comment -->');\n        $rootElement[0] = commentEl[0];\n        Service.show({\n          onShow: function(scope, element, options) {\n            expect(options.parent[0]).toBe($document[0].body);\n            shown = true;\n          }\n        });\n        $rootElement[0] = originalRoot;\n        expect(shown).toBe(true);\n      }));\n\n      it('allows parent reference', inject(function() {\n        var parent = angular.element('<div>');\n\n        var shown = false;\n        Service.show({\n          parent: parent,\n          onShow: function(scope, element, options) {\n            expect(options.parent[0]).toBe(parent[0]);\n            shown = true;\n          }\n        });\n        expect(shown).toBe(true);\n      }));\n\n      it('allows parent getter', inject(function() {\n        var parent = angular.element('<div>');\n        var parentGetter = jasmine.createSpy('parentGetter').and.returnValue(parent);\n\n        var shown = false;\n        Service.show({\n          parent: parentGetter,\n          onShow: function(scope, element, options) {\n            expect(parentGetter).toHaveBeenCalledWith(scope, element, options);\n            expect(options.parent[0]).toBe(parent[0]);\n            shown = true;\n          }\n        });\n        expect(shown).toBe(true);\n      }));\n\n      it('allows string parent selector', inject(function($rootScope, $document) {\n        var parent = angular.element('<div id=\"super-parent\">');\n        spyOn($document[0], 'querySelector').and.returnValue(parent[0]);\n\n        var shown = false;\n        Service.show({\n          parent: '#super-parent',\n          onShow: function(scope, element, options) {\n            expect($document[0].querySelector).toHaveBeenCalledWith('#super-parent');\n            expect(options.parent[0]).toBe(parent[0]);\n            shown = true;\n          }\n        });\n        expect(shown).toBe(true);\n      }));\n    });\n\n\n    describe('#hide', function() {\n\n      it('calls onRemove', inject(function() {\n        var onRemoveCalled = false;\n        Service.show({\n          template: '<some-element />',\n          passingOptions: true,\n          onRemove: onRemove\n        });\n\n        Service.hide();\n\n        expect(onRemoveCalled).toBe(true);\n\n        function onRemove(scope, el, options) {\n          onRemoveCalled = true;\n          expect(options.passingOptions).toBe(true);\n          expect(el[0]).toBeTruthy();\n        }\n      }));\n\n      it('calls onRemoving', inject(function() {\n        var onRemoveStarted = false;\n        Service.show({\n          template: '<some-element />',\n          passingOptions: true,\n          onRemoving: onRemoving\n        });\n\n        Service.hide();\n\n        expect(onRemoveStarted).toBe(true);\n\n        function onRemoving(scope, el) {\n          onRemoveStarted = true;\n        }\n      }));\n\n      it('resolves the show promise with string', inject(function() {\n        var resolved = false;\n\n        Service.show().then(function(arg) {\n          expect(arg).toBe('test');\n          resolved = true;\n        });\n\n        Service.hide('test');\n\n        expect(resolved).toBe(true);\n      }));\n\n      it('resolves the show promise with false', inject(function() {\n        var resolved = false;\n\n        Service.show().then(function(arg) {\n          expect(arg).toBe(false);\n          resolved = true;\n        });\n\n        Service.hide(false);\n\n        expect(resolved).toBe(true);\n      }));\n\n      it('resolves the show promise with undefined', inject(function() {\n        var resolved = false;\n\n        Service.show().then(function(arg) {\n          expect(arg).toBe(undefined);\n          resolved = true;\n        });\n\n        Service.hide();\n\n        expect(resolved).toBe(true);\n      }));\n\n      describe('captures and fails with ',function(){\n\n       it('internal exception during hide()', inject(function($q, $timeout) {\n         var showGood, hideFail,\n             onShowHandler = function(reason) {  showGood = true;},\n             onHideHandler = function(reason) {\n               hideFail  = true;\n             };\n         var options = {\n               templateUrl: 'testing.html',\n               onShow   : function() {  return $q.when(true)  },\n               onRemove : function() {  throw new Error(\"exception\"); }\n             };\n\n         Service.show(options).then(onShowHandler, onHideHandler);\n         $timeout.flush();\n\n         expect(showGood).toBeUndefined();\n         expect(hideFail).toBeUndefined();\n\n         Service.hide().then(onShowHandler, onHideHandler);\n         $timeout.flush();\n\n         expect(showGood).toBeUndefined();\n         expect(hideFail).toBe(true);\n       }));\n\n       it('internal reject during hide()', inject(function($q, $timeout) {\n          var showGood, hideFail,\n              onShowHandler = function(reason) {  showGood = true;},\n              onHideHandler = function(reason) {\n                hideFail  = reason;\n              };\n          var options = {\n                templateUrl: 'testing.html',\n                onShow   : function() {  return $q.when(true)  },\n                onRemove : function() {  return $q.reject(\"failed\");  }\n              };\n\n          Service.show(options).then(onShowHandler, onHideHandler);\n          $timeout.flush();\n\n          expect(showGood).toBeUndefined();\n          expect(hideFail).toBeUndefined();\n\n          Service.hide().then(onShowHandler, onHideHandler);\n          $timeout.flush();\n\n          expect(showGood).toBeUndefined();\n          expect(hideFail).toBe(\"failed\");\n        }));\n\n      });\n\n\n    });\n\n    describe('#cancel', function() {\n      it('calls onRemove', inject(function() {\n        var onRemoveCalled = false;\n        Service.show({\n          template: '<some-element />',\n          passingOptions: true,\n          onRemove: onRemove\n        });\n\n        Service.cancel();\n\n        expect(onRemoveCalled).toBe(true);\n\n        function onRemove(scope, el, options) {\n          onRemoveCalled = true;\n          expect(options.passingOptions).toBe(true);\n          expect(el[0]).toBeTruthy();\n        }\n      }));\n\n      it('rejects the show promise', inject(function() {\n        var rejected = false;\n\n        Service.show().catch(function(arg) {\n          expect(arg).toBe('test');\n          rejected = true;\n        });\n\n        Service.cancel('test');\n        expect(rejected).toBe(true);\n      }));\n    });\n  });\n\n\n  // ************************************************\n  // Internal utility methods\n  // ************************************************\n\n  function setup() {\n    module('material.core', function($provide) {\n      var $mdCompiler = { compile: angular.noop };\n      $compilerSpy = spyOn($mdCompiler, 'compile');\n      $themingSpy = jasmine.createSpy('$mdTheming');\n\n      $provide.value('$mdCompiler', $mdCompiler);\n      $provide.value('$mdTheming', $themingSpy);\n    });\n    inject(function($q, $compile, _$rootScope_, _$timeout_, _$material_) {\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n      $material = _$material_;\n\n      $compilerSpy.and.callFake(function(opts) {\n        var el = $compile(opts.template || \"<div></div>\");\n        return $q(function(resolve){\n          resolve({\n            link: el,\n            locals: {}\n          });\n          !$rootScope.$$phase && $rootScope.$apply();\n        });\n      });\n    });\n  }\n\n  function createInterimProvider(providerName) {\n    var interimProvider;\n    module(function($$interimElementProvider, $provide) {\n      interimProvider = $$interimElementProvider(providerName);\n      $provide.provider(providerName, interimProvider);\n    });\n\n    setup();\n    return interimProvider;\n  }\n\n  function flush() {\n    $material.flushInterimElement();\n  }\n\n  function tailHook(sourceFn, hookFn) {\n    return function() {\n      var args = Array.prototype.slice.call(arguments);\n      var results = sourceFn.apply(null, args);\n\n      hookFn();\n\n      return results;\n    }\n  }\n});\n\n"
  },
  {
    "path": "src/core/services/layout/ie_fixes.css",
    "content": "/*  IE mediaQuery hack for 8,9,10 to set the flex-basis properly for 'flex' values  */\n/*  Details:  */\n/*  Do not use unitless flex-basis values in the flex shorthand because IE 10-11 will error.  */\n/*  Also use 0% instead of 0px since minifiers will often convert 0px to 0 (which is unitless and will have the same problem).  */\n/*  Safari, however, fails with flex-basis : 0% and requires flex-basis : 0px  */\n\n@media screen\\0 {\n    .flex {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0 {\n    .flex {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (max-width: 599px) {\n    .flex-xs {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 600px) {\n    .flex-gt-xs {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 600px) and (max-width: 959px) {\n    .flex-sm {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 960px) {\n    .flex-gt-sm {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 960px) and (max-width: 1279px) {\n    .flex-md {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 1280px) {\n    .flex-gt-md {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 1280px) and (max-width: 1919px) {\n    .flex-lg {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 1920px) {\n    .flex-gt-lg {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n@media screen\\0\nand (min-width: 1920px) {\n    .flex-xl {\n        -webkit-flex: 1 1 0%;\n        -ms-flex: 1 1 0%;\n        flex: 1 1 0%;\n    }\n}\n\n\n"
  },
  {
    "path": "src/core/services/layout/layout-attributes.scss",
    "content": "/*\n*  Responsive attributes\n*\n*  References:\n*  1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex\n*  2) https://css-tricks.com/almanac/properties/f/flex/\n*  3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/\n*  4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items\n*  5) http://godban.com.ua/projects/flexgrid\n*/\n\n// Layout\n// ------------------------------\n\n\n$baseline-grid:            8px !default;\n$layout-gutter-width:      ($baseline-grid * 2) !default;\n\n$layout-breakpoint-xs:     600px !default;\n$layout-breakpoint-sm:     960px !default;\n$layout-breakpoint-md:     1280px !default;\n$layout-breakpoint-lg:     1920px !default;\n\n@-moz-document url-prefix() {\n  [layout-fill] {\n    margin: 0;\n    width: 100%;\n    min-height: 100%;\n    height: 100%;\n  }\n}\n\n\n@mixin flex-order-for-name($sizes:null) {\n  @if $sizes == null {\n    $sizes : '';\n\n    [flex-order] {\n     order : 0;\n    }\n  }\n\n  @for $i from -20 through 20 {\n    $order : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' { $suffix : '-#{$s}=\"#{$i}\"'; }\n      @else        { $suffix : '=\"#{$i}\"';       }\n\n      $order : '[flex-order#{$suffix}]';\n    }\n\n    #{$order} {\n      order: #{$i};\n    }\n  }\n}\n@mixin offset-for-name($sizes:null) {\n  @if $sizes == null { $sizes : ''; }\n\n  @for $i from 0 through 19 {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' { $suffix : '-#{$s}=\"#{$i * 5}\"'; }\n      @else        { $suffix : '=\"#{$i * 5}\"';       }\n\n      $offsets : $offsets + '[flex-offset#{$suffix}], ';\n    }\n\n    #{$offsets} {\n      margin-left: #{$i * 5 + '%'};\n    }\n  }\n\n  @each $i in 33 {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' {  $suffix : '-#{$s}=\"#{$i}\"';   }\n      @else        {  $suffix : '=\"#{$i}\"';         }\n\n      $offsets : '[flex-offset#{$suffix}], ';\n    }\n\n    #{$offsets} {\n      margin-left: calc(100% / 3);\n    }\n  }\n\n  @each $i in 66  {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' {  $suffix : '-#{$s}=\"#{$i}\"';   }\n      @else        {  $suffix : '=\"#{$i}\"';         }\n\n      $offsets : '[flex-offset#{$suffix}]';\n    }\n\n    #{$offsets} {\n      margin-left: calc(200% / 3);\n    }\n  }\n}\n\n@mixin layout-for-name($name: null) {\n  @if $name == null { $name : '';          }\n  @if $name != ''   { $name : '-#{$name}'; }\n\n  [layout#{$name}], [layout#{$name}=\"column\"], [layout#{$name}=\"row\"] {\n    box-sizing: border-box;\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -ms-flexbox;\n    display: flex;\n  }\n  [layout#{$name}=\"column\"] {  flex-direction: column;  }\n  [layout#{$name}=\"row\"]    {  flex-direction: row;     }\n}\n\n@mixin flex-properties-for-name($name: null) {\n  $flexName: 'flex';\n  @if $name != null {\n    $flexName: 'flex-#{$name}';\n    $name : '-#{$name}';\n  } @else {\n    $name : '';\n  }\n\n  [#{$flexName}]             { flex: 1;         box-sizing: border-box; }  // === flex: 1 1 0%;\n\n  [#{$flexName}-grow]        { flex: 1 1 100%;  box-sizing: border-box; }\n  [#{$flexName}-initial]     { flex: 0 1 auto;  box-sizing: border-box; }\n  [#{$flexName}-auto]        { flex: 1 1 auto;  box-sizing: border-box; }\n  [#{$flexName}-none]        { flex: 0 0 auto;  box-sizing: border-box; }\n\n  // (1-20) * 5 = 0-100%\n  @for $i from 0 through 20 {\n    $value : #{$i * 5 + '%'};\n\n    [#{$flexName}=\"#{$i * 5}\"] {\n      flex: 1 1 #{$value};\n      max-width: #{$value};\n      max-height: 100%;\n      box-sizing: border-box;\n    }\n\n    [layout=\"row\"] > [#{$flexName}=\"#{$i * 5}\"] {\n      flex: 1 1 #{$value};\n      max-width: #{$value};\n      max-height: 100%;\n      box-sizing: border-box;\n    }\n\n    [layout=\"column\"] > [#{$flexName}=\"#{$i * 5}\"] {\n      flex: 1 1 #{$value};\n      max-width: 100%;\n      max-height: #{$value};\n      box-sizing: border-box;\n    }\n\n    [layout=\"row\"] {\n\t    > [#{$flexName}=\"33\"]   , > [#{$flexName}=\"33\"]     {  flex: 1 1 33.33%;  max-width: 33.33%;  max-height: 100%; box-sizing: border-box; }\n\t    > [#{$flexName}=\"66\"]   , > [#{$flexName}=\"66\"]     {  flex: 1 1 66.66%;  max-width: 66.66%;  max-height: 100%; box-sizing: border-box; }\n\t  }\n\n\t  [layout=\"column\"] {\n\t    > [#{$flexName}=\"33\"]   , > [#{$flexName}=\"33\"]     {  flex: 1 1 33.33%;  max-width: 100%;  max-height: 33.33%; box-sizing: border-box; }\n\t    > [#{$flexName}=\"66\"]   , > [#{$flexName}=\"66\"]     {  flex: 1 1 66.66%;  max-width: 100%;  max-height: 66.66%; box-sizing: border-box; }\n\t  }\n\n    [layout#{$name}=\"row\"] > [#{$flexName}=\"#{$i * 5}\"] {\n      flex: 1 1 #{$value};\n      max-width: #{$value};\n      max-height: 100%;\n      box-sizing: border-box;\n    }\n\n    [layout#{$name}=\"column\"] > [#{$flexName}=\"#{$i * 5}\"] {\n      flex: 1 1 #{$value};\n      max-width: 100%;\n      max-height: #{$value};\n      box-sizing: border-box;\n    }\n  }\n\n  [layout#{$name}=\"row\"] {\n    > [#{$flexName}=\"33\"]   , > [#{$flexName}=\"33\"]     {  flex: 1 1 33.33%;  max-width: 33.33%;  max-height: 100%; box-sizing: border-box; }\n    > [#{$flexName}=\"66\"]   , > [#{$flexName}=\"66\"]     {  flex: 1 1 66.66%;  max-width: 66.66%;  max-height: 100%; box-sizing: border-box; }\n  }\n\n  [layout#{$name}=\"column\"] {\n    > [#{$flexName}=\"33\"]   , > [#{$flexName}=\"33\"]     {  flex: 1 1 33.33%;  max-width: 100%;  max-height: 33.33%; box-sizing: border-box; }\n    > [#{$flexName}=\"66\"]   , > [#{$flexName}=\"66\"]     {  flex: 1 1 66.66%;  max-width: 100%;  max-height: 66.66%; box-sizing: border-box; }\n  }\n\n}\n@mixin layout-align-for-name($suffix: null) {\n\n  // Alignment attributes for layout containers' children\n  // Arrange on the Main Axis\n  // center, start, end, space-between, space-around\n  // flex-start is the default for justify-content\n  // ------------------------------\n\n  $name: 'layout-align';\n  @if $suffix != null {\n    $name: 'layout-align-#{$suffix}';\n  }\n\n  [#{$name}],\n  [#{$name}=\"start stretch\"] // defaults\n  {\n    justify-content :flex-start;\n    align-content : stretch;\n    align-items: stretch;\n  }\n  // Main Axis Center\n  [#{$name}=\"start\"],\n  [#{$name}=\"start start\"],\n  [#{$name}=\"start center\"],\n  [#{$name}=\"start end\"],\n  [#{$name}=\"start stretch\"]\n  {\n    justify-content: flex-start;\n  }\n\n  // Main Axis Center\n  [#{$name}=\"center\"],\n  [#{$name}=\"center start\"],\n  [#{$name}=\"center center\"],\n  [#{$name}=\"center end\"],\n  [#{$name}=\"center stretch\"]\n  {\n    justify-content: center;\n  }\n\n  // Main Axis End\n  [#{$name}=\"end\"], //stretch\n  [#{$name}=\"end center\"],\n  [#{$name}=\"end start\"],\n  [#{$name}=\"end end\"],\n  [#{$name}=\"end stretch\"]\n  {\n    justify-content: flex-end;\n  }\n\n  // Main Axis Space Around\n  [#{$name}=\"space-around\"], //stretch\n  [#{$name}=\"space-around center\"],\n  [#{$name}=\"space-around start\"],\n  [#{$name}=\"space-around end\"],\n    [#{$name}=\"space-around stretch\"]\n  {\n    justify-content: space-around;\n  }\n\n  // Main Axis Space Between\n  [#{$name}=\"space-between\"], //stretch\n  [#{$name}=\"space-between center\"],\n  [#{$name}=\"space-between start\"],\n  [#{$name}=\"space-between end\"],\n    [#{$name}=\"space-between stretch\"]\n  {\n    justify-content: space-between;\n  }\n\n\n  // Arrange on the Cross Axis\n  // center, start, end\n  // stretch is the default for align-items\n  // ------------------------------\n\n  // Cross Axis Start\n  [#{$name}=\"start start\"],\n  [#{$name}=\"center start\"],\n  [#{$name}=\"end start\"],\n  [#{$name}=\"space-between start\"],\n  [#{$name}=\"space-around start\"]\n  {\n    align-items: flex-start;\n    align-content: flex-start;\n  }\n\n  // Cross Axis Center\n  [#{$name}=\"start center\"],\n  [#{$name}=\"center center\"],\n  [#{$name}=\"end center\"],\n  [#{$name}=\"space-between center\"],\n  [#{$name}=\"space-around center\"]\n  {\n    align-items: center;\n    align-content: center;\n    max-width: 100%;\n  }\n\n  // Cross Axis Center IE overflow fix\n  [#{$name}=\"start center\"] > *,\n  [#{$name}=\"center center\"] > *,\n  [#{$name}=\"end center\"] > *,\n  [#{$name}=\"space-between center\"] > *,\n  [#{$name}=\"space-around center\"] > *\n  {\n    max-width: 100%;\n    box-sizing: border-box;\n  }\n\n  // Cross Axis End\n  [#{$name}=\"start end\"],\n  [#{$name}=\"center end\"],\n  [#{$name}=\"end end\"],\n  [#{$name}=\"space-between end\"],\n  [#{$name}=\"space-around end\"]\n  {\n    align-items: flex-end;\n    align-content: flex-end;\n  }\n\n  // Cross Axis  stretch\n  [#{$name}=\"start stretch\"],\n  [#{$name}=\"center stretch\"],\n  [#{$name}=\"end stretch\"],\n  [#{$name}=\"space-between stretch\"],\n  [#{$name}=\"space-around stretch\"]\n  {\n    align-items: stretch;\n    align-content: stretch;\n  }\n}\n@mixin layout-padding-margin() {\n\n  [layout-padding] > [flex-sm] {\n    padding: $layout-gutter-width * 0.25;\n  }\n  [layout-padding],\n  [layout-padding] > [flex],\n  [layout-padding] > [flex-gt-sm],\n  [layout-padding] > [flex-md]\n  {\n    padding: $layout-gutter-width * 0.5;\n  }\n  [layout-padding] > [flex-gt-md],\n  [layout-padding] > [flex-lg]\n  {\n    padding: math.div($layout-gutter-width, 1);\n  }\n\n  [layout-margin] > [flex-sm]\n  {\n    margin: $layout-gutter-width * 0.25;\n  }\n\n  [layout-margin],\n  [layout-margin]  > [flex],\n  [layout-margin]  > [flex-gt-sm],\n  [layout-margin]  > [flex-md]\n  {\n    margin: $layout-gutter-width * 0.5;\n  }\n\n  [layout-margin]  > [flex-gt-md],\n  [layout-margin]  > [flex-lg]\n  {\n    margin: math.div($layout-gutter-width, 1);\n  }\n\n  [layout-wrap] {\n    flex-wrap: wrap;\n  }\n\n  [layout-nowrap] {\n      flex-wrap: nowrap;\n  }\n\n  [layout-fill] {\n    margin: 0;\n    width: 100%;\n    min-height: 100%;\n    height: 100%;\n  }\n}\n\n@mixin layouts_for_breakpoint($name:null) {\n    @include flex-order-for-name($name);\n    @include offset-for-name($name);\n    @include layout-align-for-name($name);\n\n    @include flex-properties-for-name($name);\n    @include layout-for-name($name);\n}\n\n/*\n *  Apply Mixins to create Layout/Flexbox styles\n *\n */\n\n\n@include layouts_for_breakpoint();\n@include layout-padding-margin();\n\n\n/**\n * `hide-gt-sm show-gt-lg` should hide from 600px to 1200px\n * `show-md hide-gt-sm` should show from 0px to 960px and hide at >960px\n * `hide-gt-md show-gt-sm` should show everywhere (show overrides hide)`\n *\n *  hide means hide everywhere\n *  Sizes:\n *         $layout-breakpoint-xs:     600px !default;\n *         $layout-breakpoint-sm:     960px !default;\n *         $layout-breakpoint-md:     1280px !default;\n *         $layout-breakpoint-lg:     1920px !default;\n */\n\n\n@media (max-width: $layout-breakpoint-xs - 1) {\n  // Xtra-SMALL  SCREEN\n  [hide-xs], [hide] {\n    &:not([show-xs]):not([show]) {\n      display: none;\n    }\n  }\n  @include layouts_for_breakpoint(xs);\n}\n\n@media (min-width: $layout-breakpoint-xs) {\n  // BIGGER THAN Xtra-SMALL SCREEN\n  @include layouts_for_breakpoint(gt-xs);\n\n}\n\n@media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {\n  // SMALL SCREEN\n  [hide], [hide-gt-xs] {\n    &:not([show-gt-xs]):not([show-sm]):not([show]) {\n      display: none;\n    }\n  }\n  [hide-sm]:not([show-gt-xs]):not([show-sm]):not([show]) {\n    display: none;\n  }\n  @include layouts_for_breakpoint(sm);\n}\n\n@media (min-width: $layout-breakpoint-sm) {\n  // BIGGER THAN SMALL SCREEN\n  @include layouts_for_breakpoint(gt-sm);\n\n}\n\n@media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {\n  // MEDIUM SCREEN\n  [hide], [hide-gt-xs], [hide-gt-sm] {\n      &:not([show-gt-xs]):not([show-gt-sm]):not([show-md]):not([show]) {\n        display: none;\n      }\n    }\n    [hide-md]:not([show-md]):not([show]) {\n      display: none;\n    }\n  @include layouts_for_breakpoint(md);\n}\n\n@media (min-width: $layout-breakpoint-md) {\n  // BIGGER THAN MEDIUM SCREEN\n  @include layouts_for_breakpoint(gt-md);\n}\n\n@media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {\n  // LARGE SCREEN\n  [hide],[hide-gt-xs], [hide-gt-sm], [hide-gt-md] {\n      &:not([show-gt-xs]):not([show-gt-sm]):not([show-gt-md]):not([show-lg]):not([show]) {\n        display: none;\n      }\n    }\n    [hide-lg]:not([show-lg]):not([show]) {\n      display: none;\n    }\n\n  @include layouts_for_breakpoint(lg);\n}\n\n@media (min-width: $layout-breakpoint-lg) {\n  // BIGGER THAN LARGE SCREEN\n  @include layouts_for_breakpoint(gt-lg);\n  @include layouts_for_breakpoint(xl);\n\n  // BIGGER THAN LARGE SCREEN\n  [hide], [hide-gt-xs], [hide-gt-sm], [hide-gt-md], [hide-gt-lg] {\n    &:not([show-gt-xs]):not([show-gt-sm]):not([show-gt-md]):not([show-gt-lg]):not([show-xl]):not([show]) {\n      display: none;\n    }\n  }\n  [hide-xl]:not([show-xl]):not([show-gt-lg]):not([show]) {\n    display: none;\n  }\n}\n\n@media print {\n  // PRINT\n  @include layouts_for_breakpoint(print);\n\n  [hide-print]:not([show-print]):not([show]) {\n    display: none;\n  }\n}\n\n\n"
  },
  {
    "path": "src/core/services/layout/layout.js",
    "content": "(function() {\n  'use strict';\n\n  var $mdUtil, $interpolate, $log;\n\n  var SUFFIXES = /(-gt)?-(sm|md|lg|print)/g;\n  var WHITESPACE = /\\s+/g;\n\n  var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none', 'noshrink', 'nogrow'];\n  var LAYOUT_OPTIONS = ['row', 'column'];\n  var ALIGNMENT_MAIN_AXIS= [\"\", \"start\", \"center\", \"end\", \"stretch\", \"space-around\", \"space-between\"];\n  var ALIGNMENT_CROSS_AXIS= [\"\", \"start\", \"center\", \"end\", \"stretch\"];\n\n  var config = {\n    /**\n     * Enable directive attribute-to-class conversions\n     * Developers can use `<body md-layout-css />` to quickly\n     * disable the Layout directives and prohibit the injection of Layout classNames\n     */\n    enabled: true,\n\n    /**\n     * List of mediaQuery breakpoints and associated suffixes\n     *   [\n     *    { suffix: \"sm\", mediaQuery: \"screen and (max-width: 599px)\" },\n     *    { suffix: \"md\", mediaQuery: \"screen and (min-width: 600px) and (max-width: 959px)\" }\n     *   ]\n     */\n    breakpoints: []\n  };\n\n  registerLayoutAPI(angular.module('material.core.layout', ['ng']));\n\n  /**\n   *   registerLayoutAPI()\n   *\n   *   The original AngularJS Material Layout solution used attribute selectors and CSS.\n   *\n   *  ```html\n   *  <div layout=\"column\"> My Content </div>\n   *  ```\n   *\n   *  ```css\n   *  [layout] {\n   *    box-sizing: border-box;\n   *    display:flex;\n   *  }\n   *  [layout=column] {\n   *    flex-direction : column\n   *  }\n   *  ```\n   *\n   *  Use of attribute selectors creates significant performance impacts in some\n   *  browsers... mainly IE.\n   *\n   *  This module registers directives that allow the same layout attributes to be\n   *  interpreted and converted to class selectors. The directive will add equivalent classes to\n   *  each element that contains a Layout directive.\n   *\n   * ```html\n   *   <div layout=\"column\" class=\"layout layout-column\"> My Content </div>\n   * ```\n   *\n   *  ```css\n   *  .layout {\n   *    box-sizing: border-box;\n   *    display:flex;\n   *  }\n   *  .layout-column {\n   *    flex-direction : column\n   *  }\n   *  ```\n   */\n  function registerLayoutAPI(module){\n    var PREFIX_REGEXP = /^((?:x|data)[:\\-_])/i;\n    var SPECIAL_CHARS_REGEXP = /([:\\-_]+(.))/g;\n\n    // NOTE: these are also defined in constants::MEDIA_PRIORITY and constants::MEDIA\n    var BREAKPOINTS     = [\"\", \"xs\", \"gt-xs\", \"sm\", \"gt-sm\", \"md\", \"gt-md\", \"lg\", \"gt-lg\", \"xl\", \"print\"];\n    var API_WITH_VALUES = [\"layout\", \"flex\", \"flex-order\", \"flex-offset\", \"layout-align\"];\n    var API_NO_VALUES   = [\"show\", \"hide\", \"layout-padding\", \"layout-margin\"];\n\n\n    // Build directive registration functions for the standard Layout API... for all breakpoints.\n    angular.forEach(BREAKPOINTS, function(mqb) {\n\n      // Attribute directives with expected, observable value(s)\n      angular.forEach(API_WITH_VALUES, function(name){\n        var fullName = mqb ? name + \"-\" + mqb : name;\n        module.directive(directiveNormalize(fullName), attributeWithObserve(fullName));\n      });\n\n      // Attribute directives with no expected value(s)\n      angular.forEach(API_NO_VALUES, function(name){\n        var fullName = mqb ? name + \"-\" + mqb : name;\n        module.directive(directiveNormalize(fullName), attributeWithoutValue(fullName));\n      });\n\n    });\n\n    // Register other, special directive functions for the Layout features:\n    module\n      .provider('$$mdLayout', function() {\n        // Publish internal service for Layouts\n        return {\n          $get : angular.noop,\n          validateAttributeValue : validateAttributeValue,\n          validateAttributeUsage : validateAttributeUsage,\n          /**\n           * Easy way to disable/enable the Layout API.\n           * When disabled, this stops all attribute-to-classname generations\n           */\n          disableLayouts  : function(isDisabled) {\n            config.enabled =  (isDisabled !== true);\n          }\n        };\n      })\n\n      .directive('mdLayoutCss'        , disableLayoutDirective)\n      .directive('ngCloak'            , buildCloakInterceptor('ng-cloak'))\n\n      .directive('layoutWrap'   , attributeWithoutValue('layout-wrap'))\n      .directive('layoutNowrap' , attributeWithoutValue('layout-nowrap'))\n      .directive('layoutNoWrap' , attributeWithoutValue('layout-no-wrap'))\n      .directive('layoutFill'   , attributeWithoutValue('layout-fill'))\n\n      // Determine if\n      .config(detectDisabledLayouts);\n\n    /**\n     * Converts snake_case to camelCase.\n     * Also there is special case for Moz prefix starting with upper case letter.\n     * @param name Name to normalize\n     */\n    function directiveNormalize(name) {\n      return name\n        .replace(PREFIX_REGEXP, '')\n        .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n          return offset ? letter.toUpperCase() : letter;\n        });\n    }\n  }\n\n\n  /**\n    * Detect if any of the HTML tags has a [md-layouts-disabled] attribute;\n    * If yes, then immediately disable all layout API features\n    *\n    * Note: this attribute should be specified on either the HTML or BODY tags\n    * @ngInject\n    */\n   function detectDisabledLayouts() {\n     var isDisabled = !!document.querySelector('[md-layouts-disabled]');\n     config.enabled = !isDisabled;\n   }\n\n  /**\n   * Special directive that will disable ALL Layout conversions of layout\n   * attribute(s) to classname(s).\n   *\n   * <link rel=\"stylesheet\" href=\"angular-material.min.css\">\n   * <link rel=\"stylesheet\" href=\"angular-material.layout.css\">\n   *\n   * <body md-layout-css>\n   *  ...\n   * </body>\n   *\n   * Note: Using md-layout-css directive requires the developer to load the Material\n   * Layout Attribute stylesheet (which only uses attribute selectors):\n   *\n   *       `angular-material.layout.css`\n   *\n   * Another option is to use the LayoutProvider to configure and disable the attribute\n   * conversions; this would obviate the use of the `md-layout-css` directive\n   */\n  function disableLayoutDirective() {\n    // Return a 1x-only, first-match attribute directive\n    config.enabled = false;\n\n    return {\n      restrict : 'A',\n      priority : '900'\n    };\n  }\n\n  /**\n   * Tail-hook ngCloak to delay the uncloaking while Layout transformers\n   * finish processing. Eliminates flicker with Material.Layouts\n   */\n  function buildCloakInterceptor(className) {\n    return ['$timeout', function($timeout){\n      return {\n        restrict : 'A',\n        priority : -10,   // run after normal ng-cloak\n        compile  : function(element) {\n          if (!config.enabled) return angular.noop;\n\n          // Re-add the cloak\n          element.addClass(className);\n\n          return function(scope, element) {\n            // Wait while layout injectors configure, then uncloak\n            // NOTE: $rAF does not delay enough... and this is a 1x-only event,\n            //       $timeout is acceptable.\n            $timeout(function(){\n              element.removeClass(className);\n            }, 10, false);\n          };\n        }\n      };\n    }];\n  }\n\n\n  // *********************************************************************************\n  //\n  // These functions create registration functions for AngularJS Material Layout attribute\n  // directives. This provides easy translation to switch AngularJS Material attribute selectors to\n  // CLASS selectors and directives; which has huge performance implications for IE Browsers.\n  //\n  // *********************************************************************************\n\n  /**\n   * Creates a directive registration function where a possible dynamic attribute\n   * value will be observed/watched.\n   * @param {string} className attribute name; eg `layout-gt-md` with value =\"row\"\n   */\n  function attributeWithObserve(className) {\n\n    return ['$mdUtil', '$interpolate', \"$log\", function(_$mdUtil_, _$interpolate_, _$log_) {\n      $mdUtil = _$mdUtil_;\n      $interpolate = _$interpolate_;\n      $log = _$log_;\n\n      return {\n        restrict: 'A',\n        compile: function(element, attr) {\n          var linkFn;\n          if (config.enabled) {\n            // immediately replace static (non-interpolated) invalid values...\n\n            validateAttributeUsage(className, attr, element, $log);\n\n            validateAttributeValue(className,\n              getNormalizedAttrValue(className, attr, \"\"),\n              buildUpdateFn(element, className, attr)\n            );\n\n            linkFn = translateWithValueToCssClass;\n          }\n\n          // Use for postLink to account for transforms after ng-transclude.\n          return linkFn || angular.noop;\n        }\n      };\n    }];\n\n    /**\n     * Observe deprecated layout attributes and update the element's layout classes to match.\n     */\n    function translateWithValueToCssClass(scope, element, attrs) {\n      var updateFn = updateClassWithValue(element, className, attrs);\n      var unwatch = attrs.$observe(attrs.$normalize(className), updateFn);\n\n      updateFn(getNormalizedAttrValue(className, attrs, \"\"));\n      scope.$on(\"$destroy\", function() { unwatch(); });\n    }\n  }\n\n  /**\n   * Creates a registration function for AngularJS Material Layout attribute directive.\n   * This is a `simple` transpose of attribute usage to class usage; where we ignore\n   * any attribute value.\n   */\n  function attributeWithoutValue(className) {\n    return ['$mdUtil', '$interpolate', \"$log\", function(_$mdUtil_, _$interpolate_, _$log_) {\n      $mdUtil = _$mdUtil_;\n      $interpolate = _$interpolate_;\n      $log = _$log_;\n\n      return {\n        restrict: 'A',\n        compile: function(element, attr) {\n          var linkFn;\n          if (config.enabled) {\n            // immediately replace static (non-interpolated) invalid values...\n\n            validateAttributeValue(className,\n              getNormalizedAttrValue(className, attr, \"\"),\n              buildUpdateFn(element, className, attr)\n            );\n\n            translateToCssClass(null, element);\n\n            // Use for postLink to account for transforms after ng-transclude.\n            linkFn = translateToCssClass;\n          }\n\n          return linkFn || angular.noop;\n        }\n      };\n    }];\n\n    /**\n     * Add transformed class selector.\n     */\n    function translateToCssClass(scope, element) {\n      element.addClass(className);\n    }\n  }\n\n  /**\n   * After link-phase, do NOT remove deprecated layout attribute selector.\n   * Instead watch the attribute so interpolated data-bindings to layout\n   * selectors will continue to be supported.\n   *\n   * $observe() the className and update with new class (after removing the last one)\n   *\n   * e.g. `layout=\"{{layoutDemo.direction}}\"` will update...\n   *\n   * NOTE: The value must match one of the specified styles in the CSS.\n   * For example `flex-gt-md=\"{{size}}`  where `scope.size == 47` will NOT work since\n   * only breakpoints for 0, 5, 10, 15... 100, 33, 34, 66, 67 are defined.\n   */\n  function updateClassWithValue(element, className) {\n    var lastClass;\n\n    return function updateClassFn(newValue) {\n      var value = validateAttributeValue(className, newValue || \"\");\n      if (angular.isDefined(value)) {\n        if (lastClass) element.removeClass(lastClass);\n        lastClass = !value ? className : className + \"-\" + value.trim().replace(WHITESPACE, \"-\");\n        element.addClass(lastClass);\n      }\n    };\n  }\n\n  /**\n   * Centralize warnings for known flexbox issues (especially IE-related issues)\n   */\n  function validateAttributeUsage(className, attr, element, $log){\n    var message, usage, url;\n    var nodeName = element[0].nodeName.toLowerCase();\n\n    switch (className.replace(SUFFIXES,\"\")) {\n      case \"flex\":\n        if ((nodeName === \"md-button\") || (nodeName === \"fieldset\")){\n          // @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\n          // Use <div flex> wrapper inside (preferred) or outside\n\n          usage = \"<\" + nodeName + \" \" + className + \"></\" + nodeName + \">\";\n          url = \"https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\";\n          message = \"Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.\";\n\n          $log.warn($mdUtil.supplant(message, [usage, url]));\n        }\n    }\n  }\n\n\n  /**\n   * For the Layout attribute value, validate or replace with default fallback value.\n   */\n  function validateAttributeValue(className, value, updateFn) {\n    var origValue = value;\n\n    if (!needsInterpolation(value)) {\n      switch (className.replace(SUFFIXES,\"\")) {\n        case 'layout'        :\n          if (!findIn(value, LAYOUT_OPTIONS)) {\n            value = LAYOUT_OPTIONS[0];    // 'row';\n          }\n          break;\n\n        case 'flex'          :\n          if (!findIn(value, FLEX_OPTIONS)) {\n            if (isNaN(value)) {\n              value = '';\n            }\n          }\n          break;\n\n        case 'flex-offset' :\n        case 'flex-order'    :\n          if (!value || isNaN(+value)) {\n            value = '0';\n          }\n          break;\n\n        case 'layout-align'  :\n          var axis = extractAlignAxis(value);\n          value = $mdUtil.supplant(\"{main}-{cross}\",axis);\n          break;\n\n        case 'layout-padding' :\n        case 'layout-margin'  :\n        case 'layout-fill'    :\n        case 'layout-wrap'    :\n        case 'layout-nowrap' :\n          value = '';\n          break;\n      }\n\n      if (value !== origValue) {\n        (updateFn || angular.noop)(value);\n      }\n    }\n\n    return value ? value.trim() : \"\";\n  }\n\n  /**\n   * Replace current attribute value with fallback value\n   */\n  function buildUpdateFn(element, className, attrs) {\n    return function updateAttrValue(fallback) {\n      if (!needsInterpolation(fallback)) {\n        // Do not modify the element's attribute value; so\n        // uses '<ui-layout layout=\"/api/sidebar.html\" />' will not\n        // be affected. Just update the attrs value.\n        attrs[attrs.$normalize(className)] = fallback;\n      }\n    };\n  }\n\n  /**\n   * See if the original value has interpolation symbols:\n   * e.g.  flex-gt-md=\"{{triggerPoint}}\"\n   */\n  function needsInterpolation(value) {\n    return (value || \"\").indexOf($interpolate.startSymbol()) > -1;\n  }\n\n  function getNormalizedAttrValue(className, attrs, defaultVal) {\n    var normalizedAttr = attrs.$normalize(className);\n    return attrs[normalizedAttr] ? attrs[normalizedAttr].trim().replace(WHITESPACE, \"-\") :\n      defaultVal || null;\n  }\n\n  function findIn(item, list, replaceWith) {\n    item = replaceWith && item ? item.replace(WHITESPACE, replaceWith) : item;\n\n    var found = false;\n    if (item) {\n      list.forEach(function(it) {\n        it = replaceWith ? it.replace(WHITESPACE, replaceWith) : it;\n        found = found || (it === item);\n      });\n    }\n    return found;\n  }\n\n  function extractAlignAxis(attrValue) {\n    var axis = {\n      main : \"start\",\n      cross: \"stretch\"\n    }, values;\n\n    attrValue = (attrValue || \"\");\n\n    if (attrValue.indexOf(\"-\") === 0 || attrValue.indexOf(\" \") === 0) {\n      // For missing main-axis values\n      attrValue = \"none\" + attrValue;\n    }\n\n    values = attrValue.toLowerCase().trim().replace(WHITESPACE, \"-\").split(\"-\");\n    if (values.length && (values[0] === \"space\")) {\n      // for main-axis values of \"space-around\" or \"space-between\"\n      values = [values[0]+\"-\"+values[1],values[2]];\n    }\n\n    if (values.length > 0) axis.main  = values[0] || axis.main;\n    if (values.length > 1) axis.cross = values[1] || axis.cross;\n\n    if (ALIGNMENT_MAIN_AXIS.indexOf(axis.main) < 0)   axis.main = \"start\";\n    if (ALIGNMENT_CROSS_AXIS.indexOf(axis.cross) < 0) axis.cross = \"stretch\";\n\n    return axis;\n  }\n})();\n"
  },
  {
    "path": "src/core/services/layout/layout.scss",
    "content": "/*\n* Since Layout API uses ng-cloak to hide the dom elements while layouts are adjusted\n*/\n[ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n  display: none !important;\n}\n\n/*\n*  Responsive attributes\n*\n*  References:\n*  1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex\n*  2) https://css-tricks.com/almanac/properties/f/flex/\n*  3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/\n*  4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items\n*  5) http://godban.com.ua/projects/flexgrid\n*/\n@-moz-document url-prefix() {\n  .layout-fill {\n    margin: 0;\n    width: 100%;\n    min-height: 100%;\n    height: 100%;\n  }\n}\n\n/*\n *  Apply Mixins to create Layout/Flexbox styles\n */\n@include layouts_for_breakpoint();\n@include layout-padding-margin();\n\n/**\n * `hide-gt-sm show-gt-lg` should hide from 600px to 1200px\n * `show-md hide-gt-sm` should show from 0px to 960px and hide at >960px\n * `hide-gt-md show-gt-sm` should show everywhere (show overrides hide)`\n *\n *  hide means hide everywhere\n *  Sizes:\n *         $layout-breakpoint-xs:     600px !default;\n *         $layout-breakpoint-sm:     960px !default;\n *         $layout-breakpoint-md:     1280px !default;\n *         $layout-breakpoint-lg:     1920px !default;\n */\n@media (max-width: $layout-breakpoint-xs - 1) {\n  // Xtra-SMALL SCREEN\n  .hide-xs, .hide {\n    &:not(.show-xs):not(.show) {\n      display: none;\n    }\n  }\n  @include layouts_for_breakpoint(xs);\n}\n\n@media (min-width: $layout-breakpoint-xs) {\n  // BIGGER THAN Xtra-SMALL SCREEN\n  @include layouts_for_breakpoint(gt-xs);\n\n}\n\n@media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {\n  .hide, .hide-gt-xs {\n    &:not(.show-gt-xs):not(.show-sm):not(.show) {\n      display: none;\n    }\n  }\n  .hide-sm:not(.show-gt-xs):not(.show-sm):not(.show) {\n    display: none;\n  }\n\n  @include layouts_for_breakpoint(sm);\n}\n\n@media (min-width: $layout-breakpoint-sm) {\n  // BIGGER THAN SMALL SCREEN\n  @include layouts_for_breakpoint(gt-sm);\n\n}\n\n@media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {\n  // MEDIUM SCREEN\n  .hide, .hide-gt-xs, .hide-gt-sm {\n    &:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show) {\n      display: none;\n    }\n  }\n  .hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {\n    display: none;\n  }\n  @include layouts_for_breakpoint(md);\n}\n\n@media (min-width: $layout-breakpoint-md) {\n  // BIGGER THAN MEDIUM SCREEN\n  @include layouts_for_breakpoint(gt-md);\n}\n\n@media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {\n  // LARGE SCREEN\n  .hide,.hide-gt-xs, .hide-gt-sm, .hide-gt-md {\n    &:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show) {\n      display: none;\n    }\n  }\n  .hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {\n    display: none;\n  }\n\n  @include layouts_for_breakpoint(lg);\n}\n\n@media (min-width: $layout-breakpoint-lg) {\n  @include layouts_for_breakpoint(gt-lg);\n  @include layouts_for_breakpoint(xl);\n\n  // BIGGER THAN LARGE SCREEN\n  .hide, .hide-gt-xs, .hide-gt-sm, .hide-gt-md, .hide-gt-lg {\n    &:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show) {\n      display: none;\n    }\n  }\n  .hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {\n    display: none;\n  }\n\n}\n\n// General printing Rules\n@media print {\n\n  .hide-print:not(.show-print):not(.show) {\n    display: none !important;\n  }\n}\n"
  },
  {
    "path": "src/core/services/layout/layout.spec.js",
    "content": "// AngularJS Component test setup\nangular.module('layoutTestApp', [])\n.component('testComponent', {\n  bindings: {\n    show: '=',\n  },\n  controller: function() {}\n});\n\ndescribe(\"Layout API \", function() {\n\n  describe(\"can be globally disabled with 'md-layouts-disabled' \", function() {\n    var disableLayouts = angular.noop,\n        activateLayouts = function() {\n          var el = document.body;\n              el.removeAttribute('md-layouts-disabled');\n\n          disableLayouts(false);\n        };\n\n    beforeEach(function() {\n      var el = document.body;\n          el.setAttribute('md-layouts-disabled', '');\n\n      // Load the core module\n      module('material.core', function($$mdLayoutProvider) {\n          disableLayouts = angular.bind($$mdLayoutProvider, $$mdLayoutProvider.disableLayouts);\n      });\n    });\n\n    afterEach(activateLayouts);\n\n    it('should not set any classnames', inject(function($compile, $rootScope) {\n      var el = $compile('<div layout>content</div>')($rootScope.$new());\n\n      expect(el[0].getAttribute('layout')).toBe('');\n\n      expect(el.hasClass(\"layout\")).toBeFalsy();\n      expect(el.hasClass(\"layout-row\")).toBeFalsy();\n      expect(el.hasClass(\"layout-column\")).toBeFalsy();\n    }));\n\n    it('should not set any classnames for layout=\"column\" ', inject(function($compile, $rootScope) {\n      var el = $compile('<div layout=\"column\">content</div>')($rootScope.$new());\n\n      expect(el[0].getAttribute('layout')).toBe('column');\n\n      expect(el.hasClass(\"layout\")).toBeFalsy();\n      expect(el.hasClass(\"layout-row\")).toBeFalsy();\n      expect(el.hasClass(\"layout-column\")).toBeFalsy();\n    }));\n  });\n\n  describe('layout directives', function() {\n    var suffixes = ['xs', 'gt-xs', 'sm', 'gt-sm', 'md', 'gt-md', 'lg', 'gt-lg', 'xl', 'print'],\n      $mdUtil, $compile, pageScope;\n\n    beforeEach(module('layoutTestApp'));\n    beforeEach(inject(function(_$compile_, _$rootScope_, _$mdUtil_) {\n      $mdUtil = _$mdUtil_;\n      $compile = _$compile_;\n      pageScope = _$rootScope_.$new();\n    }));\n\n    describe('using [layout] attributes', function() {\n\n      it(\"should support attribute without value '<div layout>'\", function() {\n        var element = $compile('<div layout>Layout</div>')(pageScope);\n        expect(element.hasClass(\"layout\")).toBeFalsy();\n        expect(element.hasClass(\"layout-row\")).toBeTruthy();\n      });\n\n      it('should ignore invalid values', function() {\n        var element = $compile('<div layout=\"humpty\">Layout</div>')(pageScope);\n\n        expect(element.attr('layout')).toBe('humpty');        // original attribute value unmodified\n        expect(element.hasClass('layout-humpty')).toBeFalsy();\n        expect(element.hasClass(\"layout-row\")).toBeTruthy();    // injected className based on fallback value\n      });\n\n      it('should support interpolated values layout-gt-sm=\"{{direction}}\"', function() {\n        var element = $compile('<div layout-gt-sm=\"{{direction}}\">Layout</div>')(pageScope);\n\n        pageScope.$apply('direction = \"row\"');\n        expect(element.hasClass('layout-gt-sm-row')).toBeTruthy();\n\n        pageScope.$apply('direction = undefined');\n        expect(element.hasClass('layout-gt-sm-row')).toBeTruthy();\n\n        pageScope.$apply('direction = \"column\"');\n        expect(element.hasClass('layout-gt-sm-column')).toBeTruthy();\n      });\n\n\n      /**\n       * For all breakpoints,\n       *  - Test percentage values\n       *  - Test valid non-numerics\n       *\n       * NOTE: include the '' suffix:  layout='' === layout-row\n       */\n      var directionValues = ['row', 'column'];\n\n      angular.forEach(directionValues, function(direction) {\n        angular.forEach([''].concat(suffixes), function(suffix) {\n          var className = suffix ? 'layout-' + suffix : 'layout';\n          testWithValue(className, direction);\n        });\n      });\n\n    });\n\n    describe('using [flex] attributes', function() {\n      var allowedValues = [\n        'grow', 'initial', 'auto', 'none',\n        0, 5, 10, 15, 20, 25,\n        30, 33, 34, 35, 40, 45,\n        50, 55, 60, 65, 66, 67,\n        70, 75, 80, 85, 90, 95, 100\n      ];\n\n      it('should support attribute without value \"<div flex>\"', function() {\n        var element = $compile('<div flex>Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex\")).toBeTruthy();\n        expect(element.hasClass(\"flex-flex\")).toBeFalsy();\n      });\n\n      it('should ignore invalid values non-numericals like flex=\"flex\"', function() {\n        var element = $compile('<div flex=\"flex\">Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex\")).toBeTruthy();\n        expect(element.hasClass('flex-flex')).toBeFalsy();\n      });\n\n      it('should support interpolated values flex-gt-sm=\"{{columnSize}}\"', function() {\n        var scope = pageScope,\n          element = $compile('<div flex-gt-sm=\"{{columnSize}}\">Layout</div>')(scope);\n\n        scope.$apply('columnSize = 33');\n        expect(element.hasClass('flex-gt-sm-33')).toBeTruthy();\n\n        scope.$apply('columnSize = undefined');\n        expect(element.hasClass('flex-gt-sm')).toBeTruthy();\n      });\n\n      it('should support untrimmed attribute values with spaces', inject(function($rootScope, $compile) {\n        var scope = pageScope;\n        var element = angular.element($compile('<div flex-gt-xs=\"50 \"></div>')(scope));\n\n        expect(element.hasClass('flex-gt-xs-50')).toBe(true);\n      }));\n\n      it('should observe the attribute value and update the layout class(es)', inject(function($rootScope, $compile) {\n        var scope = pageScope;\n        var element = angular.element($compile('<div flex-gt-md=\"{{size}}\"></div>')(scope));\n\n        expect(element.hasClass('flex-gt-md')).toBe(true);\n        expect(element.hasClass('flex-gt-md-size')).toBe(false);\n\n        scope.$apply(function() {\n          scope.size = 32;\n        });\n\n        expect(element.hasClass('flex-gt-md-32')).toBe(true);\n\n        scope.$apply(function() {\n          // This should be rejected/ignored and the fallback \"\" value used\n          scope.size = \"fishCheeks\";\n        });\n\n        expect(element.hasClass('flex-gt-md')).toBe(true);\n        expect(element.hasClass('flex-gt-md-fishCheeks')).toBe(false);\n      }));\n\n      testAllSuffixesWithValues(\"flex\", allowedValues);\n    });\n\n    describe('using [flex-order] attributes', function() {\n      var flexOrderValues = [\n        -9, -8, -7, -6, -5, -4, -3, -2, -1,\n        0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n      ];\n\n      it('should support attribute without value \"<div flex-order>\"', function() {\n        var element = $compile('<div flex-order>Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex-order-0\")).toBeTruthy();\n        expect(element.hasClass(\"flex-order\")).toBeFalsy();\n      });\n\n      it('should ignore invalid values non-numericals like flex-order=\"humpty\"', function() {\n        var element = $compile('<div flex-order=\"humpty\">Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex-order-0\")).toBeTruthy();\n        expect(element.hasClass('flex-order-humpty')).toBeFalsy();\n      });\n\n      it('should support interpolated values flex-order-gt-sm=\"{{index}}\"', function() {\n        var scope = pageScope,\n          element = $compile('<div flex-order-gt-sm=\"{{index}}\">Layout</div>')(scope);\n\n        scope.$apply('index = 3');\n        expect(element.hasClass('flex-order-gt-sm-3')).toBeTruthy();\n      });\n\n      testAllSuffixesWithValues(\"flex-order\", flexOrderValues);\n    });\n\n    describe('using [flex-offset] attributes', function() {\n      var offsetValues = [\n        5, 10, 15, 20, 25,\n        30, 35, 40, 45, 50,\n        55, 60, 65, 70, 75,\n        80, 85, 90, 95,\n        33, 34, 66, 67\n      ];\n\n      it('should support attribute without value \"<div flex-offset>\"', function() {\n        var element = $compile('<div flex-offset>Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex-offset-0\")).toBeTruthy();\n        expect(element.hasClass(\"flex-offset\")).toBeFalsy();\n      });\n\n      it('should ignore invalid values non-numericals like flex-offset=\"humpty\"', function() {\n        var element = $compile('<div flex-offset=\"humpty\">Layout</div>')(pageScope);\n        expect(element.hasClass(\"flex-offset-0\")).toBeTruthy();\n        expect(element.hasClass('flex-offset-humpty')).toBeFalsy();\n      });\n\n      it('should support interpolated values flex-offset-gt-sm=\"{{padding}}\"', function() {\n        var scope = pageScope,\n          element = $compile('<div flex-offset-gt-sm=\"{{padding}}\">Layout</div>')(scope);\n\n        scope.$apply('padding = 15');\n        expect(element.hasClass('flex-offset-gt-sm-15')).toBeTruthy();\n      });\n\n      testAllSuffixesWithValues(\"flex-offset\", offsetValues);\n    });\n\n    describe('using [layout-align] attributes', function() {\n      var attrName = \"layout-align\";\n      var alignmentValues = [\n        \"start start\", \"start center\", \"start end\",\n        \"center stretch\", \"center start\", \"center center\", \"center end\",\n        \"end stretch\", \"end center\", \"end start\", \"end end\",\n        \"space-around stretch\", \"space-around start\", \"space-around center\", \"space-around end\",\n        \"space-between stretch\", \"space-between start\", \"space-between center\", \"space-between end\"\n      ];\n\n      it('should support attribute without value \"<div layout-align>\"', function() {\n        var markup = $mdUtil.supplant('<div {0}>Layout</div>', [attrName]);\n        var element = $compile(markup)(pageScope);\n\n        expect(element.hasClass(attrName + \"-start-stretch\")).toBeTruthy();\n        expect(element.hasClass(attrName)).toBeFalsy();\n      });\n\n      it('should ignore invalid values non-numericals like layout-align=\"humpty\"', function() {\n        var markup = $mdUtil.supplant('<div {0}=\"humpty\">Layout</div>', [attrName]);\n        var element = $compile(markup)(pageScope);\n\n        expect(element.hasClass(attrName + \"-start-stretch\")).toBeTruthy();\n        expect(element.hasClass(attrName + '-humpty')).toBeFalsy();\n      });\n\n      it('should support interpolated values layout-align-gt-sm=\"{{alignItems}}\"', function() {\n        var scope = pageScope,\n          markup = $mdUtil.supplant('<div {0}-gt-sm=\"{{alignItems}}\">Layout</div>', [attrName]),\n          element = $compile(markup)(scope);\n\n        scope.$apply('alignItems = \"center center\"');\n        expect(element.hasClass(attrName + '-gt-sm-center-center')).toBeTruthy();\n      });\n\n      testAllSuffixesWithValues(attrName, alignmentValues);\n    });\n\n    describe('using [layout-] padding, fill, margin, wrap, and nowrap attributes', function() {\n      var allowedAttrsNoValues = [\n        \"layout-padding\",\n        \"layout-margin\",\n        \"layout-fill\",\n        \"layout-wrap\",\n        \"layout-no-wrap\",\n        \"layout-nowrap\"\n      ];\n\n      angular.forEach(allowedAttrsNoValues, function(name) {\n        testNoValueAllowed(name);\n      });\n    });\n\n    describe('using [hide] attributes', function() {\n      var attrName = \"hide\",\n        breakpoints = [''].concat(suffixes);\n\n      angular.forEach(breakpoints, function(suffix) {\n        var className = suffix ? attrName + \"-\" + suffix : attrName;\n        testNoValueAllowed(className);\n      });\n\n    });\n\n    describe('using [show] attributes', function() {\n      var attrName = \"show\",\n        breakpoints = [''].concat(suffixes);\n\n      angular.forEach(breakpoints, function(suffix) {\n        var className = suffix ? attrName + \"-\" + suffix : attrName;\n        testNoValueAllowed(className);\n      });\n\n      it('should not throw Token \\'&&\\' not a primary expression', inject(function($rootScope, $compile) {\n        var scope = pageScope;\n        scope.left = true;\n        scope.right = true;\n        var element = angular.element($compile('<test-component show=\"left && right\"></test-component>')(scope));\n        expect(element.attr('show')).toBe('left && right');\n      }));\n    });\n\n    // *****************************************************************\n    // Internal Test methods for the angular.forEach( ) loops\n    // *****************************************************************\n\n    /**\n     * For the specified attrName (e.g. flex) test all breakpoints\n     * with all allowed values.\n     */\n    function testAllSuffixesWithValues(attrName, allowedValues) {\n      var breakpoints = [''].concat(suffixes);\n\n      angular.forEach(breakpoints, function(suffix) {\n        angular.forEach(allowedValues, function(value) {\n          var className = suffix ? attrName + \"-\" + suffix : attrName;\n          testWithValue(className, value, attrName);\n        });\n      });\n    }\n\n    /**\n     * Test other Layout directives (e.g. flex, flex-order, flex-offset)\n     */\n    function testWithValue(className, value, raw) {\n      var title = 'should allow valid values `' + className + '=' + value + '`';\n\n      it(title, function() {\n\n        var expected = $mdUtil.supplant('{0}-{1}', [className, value ? String(value).replace(/\\s+/g, \"-\") : value]);\n        var markup = $mdUtil.supplant('<div {0}=\"{1}\">Layout</div>', [className, value]);\n\n        var element = $compile(markup)(pageScope);\n        if (!element.hasClass(expected)) {\n          expect(expected).toBe(element[0].classList[1]);\n        }\n\n        if (raw) {\n          // Is the raw value also present?\n          expect(element.hasClass(raw)).toBeFalsy();\n        }\n\n      });\n    }\n\n    /**\n     * Layout directives do NOT support values nor breakpoint usages:\n     *\n     * - layout-margin,\n     * - layout-padding,\n     * - layout-fill,\n     * - layout-wrap,\n     * - layout-nowrap\n     *\n     */\n    function testNoValueAllowed(attrName) {\n\n      it('should support attribute without value \"<div ' + attrName + '>\"', function() {\n        var markup = $mdUtil.supplant('<div {0}>Layout</div>', [attrName]);\n        var element = $compile(markup)(pageScope);\n\n        expect(element.hasClass(attrName)).toBeTruthy();\n      });\n\n      it('should ignore invalid values non-numericals like ' + attrName + '=\"humpty\"', function() {\n        var markup = $mdUtil.supplant('<div {0}=\"humpty\">Layout</div>', [attrName]);\n        var element = $compile(markup)(pageScope);\n\n        expect(element.hasClass(attrName)).toBeTruthy();\n        expect(element.hasClass(attrName + '-humpty')).toBeFalsy();\n      });\n\n      it('should ignore interpolated values ' + attrName + '=\"{{someVal}}\"', function() {\n        var markup = $mdUtil.supplant('<div {0}=\"{{someVal}}\">Layout</div>', [attrName]),\n          element = $compile(markup)(pageScope);\n\n        pageScope.$apply('someVal = \"30\"');\n\n        expect(element.hasClass(attrName)).toBeTruthy();\n        expect(element.hasClass($mdUtil.supplant(\"{0}-30\", [attrName]))).toBeFalsy();\n\n      });\n    }\n\n  });\n});\n"
  },
  {
    "path": "src/core/services/liveAnnouncer/live-announcer.js",
    "content": "/**\r\n * @ngdoc module\r\n * @name material.core.liveannouncer\r\n * @description\r\n * AngularJS Material Live Announcer to provide accessibility for Voice Readers.\r\n */\r\nangular\r\n  .module('material.core')\r\n  .service('$mdLiveAnnouncer', MdLiveAnnouncer);\r\n\r\n/**\r\n * @ngdoc service\r\n * @name $mdLiveAnnouncer\r\n * @module material.core.liveannouncer\r\n *\r\n * @description\r\n *\r\n * Service to announce messages to supported screenreaders.\r\n *\r\n * > The `$mdLiveAnnouncer` service is internally used for components to provide proper accessibility.\r\n *\r\n * <hljs lang=\"js\">\r\n *   module.controller('AppCtrl', function($mdLiveAnnouncer) {\r\n *     // Basic announcement (Polite Mode)\r\n *     $mdLiveAnnouncer.announce('Hey Google');\r\n *\r\n *     // Custom announcement (Assertive Mode)\r\n *     $mdLiveAnnouncer.announce('Hey Google', 'assertive');\r\n *   });\r\n * </hljs>\r\n *\r\n */\r\nfunction MdLiveAnnouncer($timeout) {\r\n  /** @private @const @type {!angular.$timeout} */\r\n  this._$timeout = $timeout;\r\n\r\n  /** @private @const @type {!HTMLElement} */\r\n  this._liveElement = this._createLiveElement();\r\n\r\n  /** @private @const @type {!number} */\r\n  this._announceTimeout = 100;\r\n}\r\n\r\n/**\r\n * @ngdoc method\r\n * @name $mdLiveAnnouncer#announce\r\n * @description Announces messages to supported screenreaders.\r\n * @param {string} message Message to be announced to the screenreader\r\n * @param {'off'|'polite'|'assertive'} politeness The politeness of the announcer element.\r\n */\r\nMdLiveAnnouncer.prototype.announce = function(message, politeness) {\r\n  if (!politeness) {\r\n    politeness = 'polite';\r\n  }\r\n\r\n  var self = this;\r\n\r\n  self._liveElement.textContent = '';\r\n  self._liveElement.setAttribute('aria-live', politeness);\r\n\r\n  // This 100ms timeout is necessary for some browser + screen-reader combinations:\r\n  // - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.\r\n  // - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a\r\n  //   second time without clearing and then using a non-zero delay.\r\n  // (using JAWS 17 at time of this writing).\r\n  self._$timeout(function() {\r\n    self._liveElement.textContent = message;\r\n  }, self._announceTimeout, false);\r\n};\r\n\r\n/**\r\n * Creates a live announcer element, which listens for DOM changes and announces them\r\n * to the screenreaders.\r\n * @returns {!HTMLElement}\r\n * @private\r\n */\r\nMdLiveAnnouncer.prototype._createLiveElement = function() {\r\n  var liveEl = document.createElement('div');\r\n\r\n  liveEl.classList.add('md-visually-hidden');\r\n  liveEl.setAttribute('role', 'status');\r\n  liveEl.setAttribute('aria-atomic', 'true');\r\n  liveEl.setAttribute('aria-live', 'polite');\r\n\r\n  document.body.appendChild(liveEl);\r\n\r\n  return liveEl;\r\n};\r\n"
  },
  {
    "path": "src/core/services/liveAnnouncer/live-announcer.spec.js",
    "content": "describe('$mdLiveAnnouncer', function() {\r\n\r\n  var $mdLiveAnnouncer, $timeout = null;\r\n  var liveEl = null;\r\n\r\n  beforeEach(module('material.core'));\r\n\r\n  beforeEach(inject(function ($injector) {\r\n    $mdLiveAnnouncer = $injector.get('$mdLiveAnnouncer');\r\n    $timeout = $injector.get('$timeout');\r\n\r\n    liveEl = $mdLiveAnnouncer._liveElement;\r\n  }));\r\n\r\n  it('should correctly update the announce text', function() {\r\n    $mdLiveAnnouncer.announce('Hey Google');\r\n\r\n    expect(liveEl.textContent).toBe('');\r\n\r\n    $timeout.flush();\r\n\r\n    expect(liveEl.textContent).toBe('Hey Google');\r\n  });\r\n\r\n  it('should correctly update the politeness attribute', function() {\r\n    $mdLiveAnnouncer.announce('Hey Google', 'assertive');\r\n\r\n    $timeout.flush();\r\n\r\n    expect(liveEl.textContent).toBe('Hey Google');\r\n    expect(liveEl.getAttribute('aria-live')).toBe('assertive');\r\n  });\r\n\r\n  it('should apply the aria-live value polite by default', function() {\r\n    $mdLiveAnnouncer.announce('Hey Google');\r\n\r\n    $timeout.flush();\r\n\r\n    expect(liveEl.textContent).toBe('Hey Google');\r\n    expect(liveEl.getAttribute('aria-live')).toBe('polite');\r\n  });\r\n\r\n  it('should have proper aria attributes to be detected', function() {\r\n    expect(liveEl.getAttribute('aria-atomic')).toBe('true');\r\n    expect(liveEl.getAttribute('role')).toBe('status');\r\n  });\r\n\r\n});\r\n"
  },
  {
    "path": "src/core/services/meta/meta.js",
    "content": "/**\n * @ngdoc service\n * @name $$mdMeta\n * @module material.core.meta\n *\n * @description\n *\n * A provider and a service that simplifies meta tags access\n *\n * Note: This is intended only for use with dynamic meta tags such as browser color and title.\n * Tags that are only processed when the page is rendered (such as `charset`, and `http-equiv`)\n * will not work since `$$mdMeta` adds the tags after the page has already been loaded.\n *\n * ```js\n * app.config(function($$mdMetaProvider) {\n *   var removeMeta = $$mdMetaProvider.setMeta('meta-name', 'content');\n *   var metaValue  = $$mdMetaProvider.getMeta('meta-name'); // -> 'content'\n *\n *   removeMeta();\n * });\n *\n * app.controller('myController', function($$mdMeta) {\n *   var removeMeta = $$mdMeta.setMeta('meta-name', 'content');\n *   var metaValue  = $$mdMeta.getMeta('meta-name'); // -> 'content'\n *\n *   removeMeta();\n * });\n * ```\n *\n * @returns {$$mdMeta.$service}\n *\n */\nangular.module('material.core.meta', [])\n  .provider('$$mdMeta', function () {\n    var head = angular.element(document.head);\n    var metaElements = {};\n\n    /**\n     * Checks if the requested element was written manually and maps it\n     *\n     * @param {string} name meta tag 'name' attribute value\n     * @returns {boolean} returns true if there is an element with the requested name\n     */\n    function mapExistingElement(name) {\n      if (metaElements[name]) {\n        return true;\n      }\n\n      var element = document.getElementsByName(name)[0];\n\n      if (!element) {\n        return false;\n      }\n\n      metaElements[name] = angular.element(element);\n\n      return true;\n    }\n\n    /**\n     * @ngdoc method\n     * @name $$mdMeta#setMeta\n     *\n     * @description\n     * Creates meta element with the 'name' and 'content' attributes,\n     * if the meta tag is already created than we replace the 'content' value\n     *\n     * @param {string} name meta tag 'name' attribute value\n     * @param {string} content meta tag 'content' attribute value\n     * @returns {function} remove function\n     *\n     */\n    function setMeta(name, content) {\n      mapExistingElement(name);\n\n      if (!metaElements[name]) {\n        var newMeta = angular.element('<meta name=\"' + name + '\" content=\"' + content + '\"/>');\n        head.append(newMeta);\n        metaElements[name] = newMeta;\n      }\n      else {\n        metaElements[name].attr('content', content);\n      }\n\n      return function () {\n        metaElements[name].attr('content', '');\n        metaElements[name].remove();\n        delete metaElements[name];\n      };\n    }\n\n    /**\n     * @ngdoc method\n     * @name $$mdMeta#getMeta\n     *\n     * @description\n     * Gets the 'content' attribute value of the wanted meta element\n     *\n     * @param {string} name meta tag 'name' attribute value\n     * @returns {string} content attribute value\n     */\n    function getMeta(name) {\n      if (!mapExistingElement(name)) {\n        throw Error('$$mdMeta: could not find a meta tag with the name \\'' + name + '\\'');\n      }\n\n      return metaElements[name].attr('content');\n    }\n\n    var module = {\n      setMeta: setMeta,\n      getMeta: getMeta\n    };\n\n    return angular.extend({}, module, {\n      $get: function () {\n        return module;\n      }\n    });\n  });"
  },
  {
    "path": "src/core/services/meta/meta.spec.js",
    "content": "describe('$$mdMeta', function() {\n  var $$mdMeta;\n\n  beforeEach(module('material.core'));\n\n  beforeEach(function() {\n    inject(function(_$$mdMeta_) {\n      $$mdMeta = _$$mdMeta_;\n    });\n  });\n\n  describe('set meta', function () {\n    beforeEach(function () {\n      angular.element(document.getElementsByTagName('meta')).remove();\n    });\n\n    it('should create the element and append it to the body', function() {\n      var name = 'test';\n      var content = 'value';\n\n      expect(document.getElementsByName(name).length).toEqual(0);\n\n      $$mdMeta.setMeta(name, content);\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n    });\n\n    it('should update the existing meta tag', function() {\n      var name = 'test';\n      var content = 'value';\n\n      $$mdMeta.setMeta(name, content);\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n\n      $$mdMeta.setMeta(name, content + '2');\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content + '2');\n    });\n\n    it('should map existing meta tag', function() {\n      var name = 'test';\n      var content = 'value';\n\n      var element = angular.element('<meta name=\"' + name + '\" content=\"' + content + '\"/>');\n      angular.element(document.head).append(element);\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n\n      $$mdMeta.setMeta(name, content + '2');\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content + '2');\n    });\n\n    it('should return a remove function', function() {\n      var name = 'test';\n      var content = 'value';\n\n      var remove = $$mdMeta.setMeta(name, content);\n\n      expect(document.getElementsByName(name).length).toBe(1);\n\n      remove();\n\n      expect(document.getElementsByName(name).length).toBe(0);\n\n    });\n  });\n\n  describe('get meta', function () {\n    beforeEach(function () {\n      angular.element(document.getElementsByTagName('meta')).remove();\n    });\n\n    it('should return the meta content', function() {\n      var name = 'test';\n      var content = 'value';\n\n      $$mdMeta.setMeta(name, content);\n\n      expect($$mdMeta.getMeta(name)).toBe(content);\n    });\n\n    it('should reject unavailable meta tags', function() {\n      var name = 'test';\n\n      expect(function () {\n        $$mdMeta.getMeta(name);\n      }).toThrowError('$$mdMeta: could not find a meta tag with the name \\'' + name + '\\'');\n    });\n\n    it('should add not mapped meta tag to the hashmap', function() {\n      var name = 'test';\n      var content = 'value';\n\n      var element = angular.element('<meta name=\"' + name + '\" content=\"' + content + '\"/>');\n      angular.element(document.head).append(element);\n\n      expect($$mdMeta.getMeta(name)).toBe(content);\n    });\n  });\n});"
  },
  {
    "path": "src/core/services/registry/componentRegistry.js",
    "content": "  /**\n   * @ngdoc module\n   * @name material.core.componentRegistry\n   *\n   * @description\n   * A component instance registration service.\n   * Note: currently this as a private service in the SideNav component.\n   */\n  angular.module('material.core')\n    .factory('$mdComponentRegistry', ComponentRegistry);\n\n  /*\n   * @private\n   * @ngdoc factory\n   * @name ComponentRegistry\n   * @module material.core.componentRegistry\n   *\n   */\n  function ComponentRegistry($log, $q) {\n\n    var self;\n    var instances = [];\n    var pendings = { };\n\n    return self = {\n      /**\n       * Used to print an error when an instance for a handle isn't found.\n       */\n      notFoundError: function(handle, msgContext) {\n        $log.error((msgContext || \"\") + 'No instance found for handle', handle);\n      },\n      /**\n       * Return all registered instances as an array.\n       */\n      getInstances: function() {\n        return instances;\n      },\n\n      /**\n       * Get a registered instance.\n       * @param handle the String handle to look up for a registered instance.\n       */\n      get: function(handle) {\n        if (!isValidID(handle)) return null;\n\n        var i, j, instance;\n        for (i = 0, j = instances.length; i < j; i++) {\n          instance = instances[i];\n          if (instance.$$mdHandle === handle) {\n            return instance;\n          }\n        }\n        return null;\n      },\n\n      /**\n       * Register an instance.\n       * @param instance the instance to register\n       * @param handle the handle to identify the instance under.\n       */\n      register: function(instance, handle) {\n        if (!handle) return angular.noop;\n\n        instance.$$mdHandle = handle;\n        instances.push(instance);\n        resolveWhen();\n\n        return deregister;\n\n        /**\n         * Remove registration for an instance\n         */\n        function deregister() {\n          var index = instances.indexOf(instance);\n          if (index !== -1) {\n            instances.splice(index, 1);\n          }\n        }\n\n        /**\n         * Resolve any pending promises for this instance\n         */\n        function resolveWhen() {\n          var dfd = pendings[handle];\n          if (dfd) {\n            dfd.forEach(function (promise) {\n              promise.resolve(instance);\n            });\n            delete pendings[handle];\n          }\n        }\n      },\n\n      /**\n       * Async accessor to registered component instance\n       * If not available then a promise is created to notify\n       * all listeners when the instance is registered.\n       */\n      when : function(handle) {\n        if (isValidID(handle)) {\n          var deferred = $q.defer();\n          var instance = self.get(handle);\n\n          if (instance)  {\n            deferred.resolve(instance);\n          } else {\n            if (pendings[handle] === undefined) {\n              pendings[handle] = [];\n            }\n            pendings[handle].push(deferred);\n          }\n\n          return deferred.promise;\n        }\n        return $q.reject(\"Invalid `md-component-id` value.\");\n      }\n\n    };\n\n    function isValidID(handle){\n      return handle && (handle !== \"\");\n    }\n\n  }\n"
  },
  {
    "path": "src/core/services/registry/componentRegistry.spec.js",
    "content": "describe('$mdComponentRegistry Service', function() {\n  beforeEach(module('material.core', 'material.components.sidenav'));\n\n  /**\n   * SideNav element construction macro\n   */\n  function setup(attrs) {\n    var el;\n    inject(function($compile, $rootScope) {\n      var parent = angular.element('<div>');\n      el = angular.element('<md-sidenav ' + (attrs||'') + '>');\n      parent.append(el);\n      $compile(parent)($rootScope);\n      $rootScope.$apply();\n    });\n    return el;\n  }\n\n  describe('registration', function() {\n    var $mdComponentRegistry, $timeout;\n\n    beforeEach(inject(function(_$mdComponentRegistry_, _$timeout_) {\n      $mdComponentRegistry = _$mdComponentRegistry_;\n      $timeout = _$timeout_;\n    }));\n\n    it('should print error on no handle', inject(function($log) {\n      spyOn($log, 'error');\n      $mdComponentRegistry.notFoundError('badHandle');\n      expect($log.error).toHaveBeenCalled();\n    }));\n\n    it('Should register handle', function() {\n      $mdComponentRegistry.register({needle: true}, 'test');\n      var instance = $mdComponentRegistry.get('test');\n      expect(instance).toBeTruthy();\n      expect(instance.needle).not.toBe(undefined);\n      expect($mdComponentRegistry.getInstances().length).toBe(1);\n    });\n\n    it('Should deregister', function() {\n      var deregister = $mdComponentRegistry.register({needle: true}, 'test');\n      expect($mdComponentRegistry.getInstances().length).toBe(1);\n      deregister();\n      expect($mdComponentRegistry.getInstances().length).toBe(0);\n    });\n\n    it('should register component when element is created', function() {\n      var el = setup('md-component-id=\"left\"');\n      var instance = $mdComponentRegistry.get('left');\n\n      expect(instance).not.toBe(null);\n    });\n\n    it('should deregister component when element is destroyed', function() {\n      var el = setup('md-component-id=\"left\"');\n      el.triggerHandler('$destroy');\n\n      var instance = $mdComponentRegistry.get('left');\n      expect(instance).toBe(null);\n    });\n\n    it('should wait for component registration', function() {\n      var promise = $mdComponentRegistry.when('left');\n      var el = setup('md-component-id=\"left\"');\n      var instance = $mdComponentRegistry.get('left');\n      var resolved = false;\n\n      promise.then(function(inst){   resolved = inst;  });\n      $timeout.flush();\n\n      expect(instance).toBe(resolved);\n    });\n\n    it('should allow multiple registrations', function() {\n      var promise = $mdComponentRegistry.when('left');\n      var promise1 = $mdComponentRegistry.when('left');\n      var el = setup('md-component-id=\"left\"');\n      var instance = $mdComponentRegistry.get('left');\n      var resolved = false;\n      var resolved1 = false;\n\n      promise.then(function(inst){   resolved = inst;  });\n      promise1.then(function(inst){   resolved1 = inst;  });\n      $timeout.flush();\n\n      expect(instance).toBe(resolved);\n      expect(instance).toBe(resolved1);\n    });\n\n    it('should wait for next component registration', function() {\n      var resolved;\n      var count = 0;\n      var promise = $mdComponentRegistry.when('left');\n      var el = setup('md-component-id=\"left\"');\n\n      promise.then(function(inst){ count += 1; });\n      $timeout.flush();\n\n      el.triggerHandler('$destroy');\n\n      el = setup('md-component-id=\"left\"');\n      promise = $mdComponentRegistry.when('left');\n      promise.then(function(inst){\n        resolved = inst;\n        count += 1;\n      });\n\n      $timeout.flush();\n\n      expect(resolved).toBeDefined();\n      expect(count).toBe(2);\n\n    });\n\n  });\n\n  describe('component ids', function() {\n    var $mdComponentRegistry, $timeout;\n\n    beforeEach(inject(function(_$mdComponentRegistry_, _$timeout_) {\n      $mdComponentRegistry = _$mdComponentRegistry_;\n      $timeout = _$timeout_;\n    }));\n\n    it('should not find a component without an id', function() {\n      var el = setup();\n\n      var resolved;\n      var count = 0;\n      var promise = $mdComponentRegistry.when('left');\n      var instance = $mdComponentRegistry.get('left');\n\n      promise.then(function(inst){ resolved = inst; count += 1; });\n      $timeout.flush();\n\n      expect(count).toBe(0);\n      expect(instance).toBe(null);\n      expect(resolved).toBeUndefined();\n\n    });\n\n    it('should not wait for a component with an invalid id', function() {\n      var el = setup();\n      var fail, componentID;\n      var onFail = function() { fail = true;};\n\n\n      fail = false;\n      $mdComponentRegistry.when(componentID = undefined).catch(onFail);\n      $timeout.flush();\n\n      expect(fail).toBe(true);\n\n      fail = false;\n      $mdComponentRegistry.when(componentID = \"\").catch(onFail);\n      $timeout.flush();\n\n      expect(fail).toBe(true);\n\n    });\n\n    it('should properly destroy without a id', function() {\n      var el = setup();\n      el.triggerHandler('$destroy');\n    });\n\n  });\n\n});\n"
  },
  {
    "path": "src/core/services/ripple/button_ripple.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc service\n   * @name $mdButtonInkRipple\n   * @module material.core\n   *\n   * @description\n   * Provides ripple effects for md-button.  See $mdInkRipple service for all possible configuration options.\n   *\n   * @param {object=} scope Scope within the current context\n   * @param {object=} element The element the ripple effect should be applied to\n   * @param {object=} options (Optional) Configuration options to override the default ripple configuration\n   */\n\n  angular.module('material.core')\n    .factory('$mdButtonInkRipple', MdButtonInkRipple);\n\n  function MdButtonInkRipple($mdInkRipple) {\n    return {\n      attach: function attachRipple(scope, element, options) {\n        options = angular.extend(optionsForElement(element), options);\n\n        return $mdInkRipple.attach(scope, element, options);\n      }\n    };\n\n    function optionsForElement(element) {\n      if (element.hasClass('md-icon-button')) {\n        return {\n          isMenuItem: element.hasClass('md-menu-item'),\n          fitRipple: true,\n          center: true\n        };\n      } else {\n        return {\n          isMenuItem: element.hasClass('md-menu-item'),\n          dimBackground: true\n        };\n      }\n    }\n  }\n})();\n"
  },
  {
    "path": "src/core/services/ripple/button_ripple.spec.js",
    "content": "describe('MdButtonInkRipple', function() {\n\n  beforeEach(module('material.components.button', 'material.core'));\n\n  var $element, $rootScope, $mdButtonInkRipple, $mdInkRipple;\n  beforeEach(inject(function(_$rootScope_, _$mdButtonInkRipple_, _$mdInkRipple_) {\n    $rootScope = _$rootScope_;\n    $mdButtonInkRipple = _$mdButtonInkRipple_;\n    $mdInkRipple = _$mdInkRipple_;\n\n    $element = angular.element('<button></button>');\n    spyOn($mdInkRipple, 'attach');\n  }));\n\n  it('applies the correct ripple configuration for a md-icon-button', function() {\n    $element.addClass('md-icon-button');\n\n    $mdButtonInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      isMenuItem: false,\n      fitRipple: true,\n      center: true\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('applies the correct ripple configuration for all other buttons', function() {\n    $mdButtonInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      isMenuItem: false,\n      dimBackground: true\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('configures the button as a menu item when it is a md-menu-item', function() {\n    $element.addClass('md-menu-item');\n\n    $mdButtonInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      isMenuItem: true,\n      dimBackground: true\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('allows ripple configuration to be overridden', function() {\n    $mdButtonInkRipple.attach($rootScope, $element, { dimBackground: false });\n\n    var expected = {\n      isMenuItem: false,\n      dimBackground: false\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n});\n"
  },
  {
    "path": "src/core/services/ripple/checkbox_ripple.js",
    "content": "(function() {\n  'use strict';\n\n    /**\n   * @ngdoc service\n   * @name $mdCheckboxInkRipple\n   * @module material.core\n   *\n   * @description\n   * Provides ripple effects for md-checkbox.  See $mdInkRipple service for all possible configuration options.\n   *\n   * @param {object=} scope Scope within the current context\n   * @param {object=} element The element the ripple effect should be applied to\n   * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n   */\n\n  angular.module('material.core')\n    .factory('$mdCheckboxInkRipple', MdCheckboxInkRipple);\n\n  function MdCheckboxInkRipple($mdInkRipple) {\n    return {\n      attach: attach\n    };\n\n    function attach(scope, element, options) {\n      return $mdInkRipple.attach(scope, element, angular.extend({\n        center: true,\n        dimBackground: false,\n        fitRipple: true\n      }, options));\n    }\n  }\n})();\n"
  },
  {
    "path": "src/core/services/ripple/checkbox_ripple.spec.js",
    "content": "describe('MdCheckboxInkRipple', function() {\n\n  beforeEach(module('material.core'));\n\n  var $element, $rootScope, $mdCheckboxInkRipple, $mdInkRipple;\n  beforeEach(inject(function(_$rootScope_, _$mdCheckboxInkRipple_, _$mdInkRipple_) {\n    $rootScope = _$rootScope_;\n    $mdCheckboxInkRipple = _$mdCheckboxInkRipple_;\n    $mdInkRipple = _$mdInkRipple_;\n\n    $element = jasmine.createSpy('element');\n    spyOn($mdInkRipple, 'attach');\n  }));\n\n  it('applies the correct ripple configuration', function() {\n    $mdCheckboxInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      center: true,\n      dimBackground: false,\n      fitRipple: true\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('allows ripple configuration to be overridden', function() {\n    $mdCheckboxInkRipple.attach($rootScope, $element, { center: false, fitRipple: false });\n\n    var expected = {\n      center: false,\n      dimBackground: false,\n      fitRipple: false\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n});\n"
  },
  {
    "path": "src/core/services/ripple/list_ripple.js",
    "content": "(function() {\n  'use strict';\n\n  /**\n   * @ngdoc service\n   * @name $mdListInkRipple\n   * @module material.core\n   *\n   * @description\n   * Provides ripple effects for md-list.  See $mdInkRipple service for all possible configuration options.\n   *\n   * @param {object=} scope Scope within the current context\n   * @param {object=} element The element the ripple effect should be applied to\n   * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n   */\n\n  angular.module('material.core')\n    .factory('$mdListInkRipple', MdListInkRipple);\n\n  function MdListInkRipple($mdInkRipple) {\n    return {\n      attach: attach\n    };\n\n    function attach(scope, element, options) {\n      return $mdInkRipple.attach(scope, element, angular.extend({\n        center: false,\n        dimBackground: true,\n        outline: false,\n        rippleSize: 'full'\n      }, options));\n    }\n  }\n})();\n"
  },
  {
    "path": "src/core/services/ripple/list_ripple.spec.js",
    "content": "describe('MdListInkRipple', function() {\n\n  beforeEach(module('material.core'));\n\n  var $element, $rootScope, $mdListInkRipple, $mdInkRipple;\n  beforeEach(inject(function(_$rootScope_, _$mdListInkRipple_, _$mdInkRipple_) {\n    $rootScope = _$rootScope_;\n    $mdListInkRipple = _$mdListInkRipple_;\n    $mdInkRipple = _$mdInkRipple_;\n\n    $element = jasmine.createSpy('element');\n    spyOn($mdInkRipple, 'attach');\n  }));\n\n  it('applies the correct ripple configuration', function() {\n    $mdListInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      center: false,\n      dimBackground: true,\n      outline: false,\n      rippleSize: 'full'\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('allows ripple configuration to be overridden', function() {\n    $mdListInkRipple.attach($rootScope, $element, { center: true, outline: true });\n\n    var expected = {\n      center: true,\n      dimBackground: true,\n      outline: true,\n      rippleSize: 'full'\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n});\n"
  },
  {
    "path": "src/core/services/ripple/ripple.js",
    "content": "/**\n * @ngdoc module\n * @name material.core.ripple\n * @description\n * Ripple\n */\nangular.module('material.core')\n    .provider('$mdInkRipple', InkRippleProvider)\n    .directive('mdInkRipple', InkRippleDirective)\n    .directive('mdNoInk', attrNoDirective)\n    .directive('mdNoBar', attrNoDirective)\n    .directive('mdNoStretch', attrNoDirective);\n\nvar DURATION = 450;\n\n/**\n * @ngdoc directive\n * @name mdInkRipple\n * @module material.core.ripple\n *\n * @description\n * The `md-ink-ripple` directive allows you to specify the ripple color or if a ripple is allowed.\n *\n * @param {string|boolean} md-ink-ripple A color string `#FF0000` or boolean (`false` or `0`) for\n *  preventing ripple\n *\n * @usage\n * ### String values\n * <hljs lang=\"html\">\n *   <ANY md-ink-ripple=\"#FF0000\">\n *     Ripples in red\n *   </ANY>\n *\n *   <ANY md-ink-ripple=\"false\">\n *     Not rippling\n *   </ANY>\n * </hljs>\n *\n * ### Interpolated values\n * <hljs lang=\"html\">\n *   <ANY md-ink-ripple=\"{{ randomColor() }}\">\n *     Ripples with the return value of 'randomColor' function\n *   </ANY>\n *\n *   <ANY md-ink-ripple=\"{{ canRipple() }}\">\n *     Ripples if 'canRipple' function return value is not 'false' or '0'\n *   </ANY>\n * </hljs>\n */\nfunction InkRippleDirective ($mdButtonInkRipple, $mdCheckboxInkRipple) {\n  return {\n    controller: angular.noop,\n    link:       function (scope, element, attr) {\n      attr.hasOwnProperty('mdInkRippleCheckbox')\n          ? $mdCheckboxInkRipple.attach(scope, element)\n          : $mdButtonInkRipple.attach(scope, element);\n    }\n  };\n}\n\n/**\n * @ngdoc service\n * @name $mdInkRipple\n * @module material.core.ripple\n *\n * @description\n * `$mdInkRipple` is a service for adding ripples to any element.\n *\n * @usage\n * <hljs lang=\"js\">\n * app.factory('$myElementInkRipple', function($mdInkRipple) {\n *   return {\n *     attach: function (scope, element, options) {\n *       return $mdInkRipple.attach(scope, element, angular.extend({\n *         center: false,\n *         dimBackground: true\n *       }, options));\n *     }\n *   };\n * });\n *\n * app.controller('myController', function ($scope, $element, $myElementInkRipple) {\n *   $scope.onClick = function (ev) {\n *     $myElementInkRipple.attach($scope, angular.element(ev.target), { center: true });\n *   }\n * });\n * </hljs>\n */\n\n/**\n * @ngdoc service\n * @name $mdInkRippleProvider\n * @module material.core.ripple\n *\n * @description\n  * If you want to disable ink ripples globally, for all components, you can call the\n * `disableInkRipple` method in your app's config.\n *\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function ($mdInkRippleProvider) {\n *   $mdInkRippleProvider.disableInkRipple();\n * });\n * </hljs>\n */\n\nfunction InkRippleProvider () {\n  var isDisabledGlobally = false;\n\n  return {\n    disableInkRipple: disableInkRipple,\n    $get: function($injector) {\n      return { attach: attach };\n\n      /**\n       * @ngdoc method\n       * @name $mdInkRipple#attach\n       *\n       * @description\n       * Attaching given scope, element and options to inkRipple controller\n       *\n       * @param {object=} scope Scope within the current context\n       * @param {object=} element The element the ripple effect should be applied to\n       * @param {object=} options (Optional) Configuration options to override the defaultRipple configuration\n       * * `center` -  Whether the ripple should start from the center of the container element\n       * * `dimBackground` - Whether the background should be dimmed with the ripple color\n       * * `colorElement` - The element the ripple should take its color from, defined by css property `color`\n       * * `fitRipple` - Whether the ripple should fill the element\n       */\n      function attach (scope, element, options) {\n        if (isDisabledGlobally || element.controller('mdNoInk')) return angular.noop;\n        return $injector.instantiate(InkRippleCtrl, {\n          $scope:        scope,\n          $element:      element,\n          rippleOptions: options\n        });\n      }\n    }\n  };\n\n  /**\n   * @ngdoc method\n   * @name $mdInkRippleProvider#disableInkRipple\n   *\n   * @description\n   * A config-time method that, when called, disables ripples globally.\n   */\n  function disableInkRipple () {\n    isDisabledGlobally = true;\n  }\n}\n\n/**\n * Controller used by the ripple service in order to apply ripples\n * @ngInject\n */\nfunction InkRippleCtrl ($scope, $element, rippleOptions, $window, $timeout, $mdUtil, $mdColorUtil) {\n  this.$window    = $window;\n  this.$timeout   = $timeout;\n  this.$mdUtil    = $mdUtil;\n  this.$mdColorUtil    = $mdColorUtil;\n  this.$scope     = $scope;\n  this.$element   = $element;\n  this.options    = rippleOptions;\n  this.mousedown  = false;\n  this.ripples    = [];\n  this.timeout    = null; // Stores a reference to the most-recent ripple timeout\n  this.lastRipple = null;\n\n  $mdUtil.valueOnUse(this, 'container', this.createContainer);\n\n  this.$element.addClass('md-ink-ripple');\n\n  // attach method for unit tests\n  ($element.controller('mdInkRipple') || {}).createRipple = angular.bind(this, this.createRipple);\n  ($element.controller('mdInkRipple') || {}).setColor = angular.bind(this, this.color);\n\n  this.bindEvents();\n}\n\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (either by\n * mouseup or mouseleave event)\n */\nfunction autoCleanup (self, cleanupFn) {\n  if (self.mousedown || self.lastRipple) {\n    self.mousedown = false;\n    self.$mdUtil.nextTick(angular.bind(self, cleanupFn), false);\n  }\n}\n\n\n/**\n * Returns the color that the ripple should be (either based on CSS or hard-coded)\n * @returns {string}\n */\nInkRippleCtrl.prototype.color = function (value) {\n  var self = this;\n\n  // If assigning a color value, apply it to background and the ripple color\n  if (angular.isDefined(value)) {\n    self._color = self._parseColor(value);\n  }\n\n  // If color lookup, use assigned, defined, or inherited\n  return self._color || self._parseColor(self.inkRipple()) || self._parseColor(getElementColor());\n\n  /**\n   * Finds the color element and returns its text color for use as default ripple color\n   * @returns {string}\n   */\n  function getElementColor () {\n    var items = self.options && self.options.colorElement ? self.options.colorElement : [];\n    var elem =  items.length ? items[ 0 ] : self.$element[ 0 ];\n\n    return elem ? self.$window.getComputedStyle(elem).color : 'rgb(0,0,0)';\n  }\n};\n\n/**\n * Updating the ripple colors based on the current inkRipple value\n * or the element's computed style color\n */\nInkRippleCtrl.prototype.calculateColor = function () {\n  return this.color();\n};\n\n\n/**\n * Takes a string color and converts it to RGBA format\n * @param {string} color\n * @param {number} multiplier\n * @returns {string}\n */\nInkRippleCtrl.prototype._parseColor = function parseColor (color, multiplier) {\n  multiplier = multiplier || 1;\n  var colorUtil = this.$mdColorUtil;\n\n  if (!color) return;\n  if (color.indexOf('rgba') === 0) return color.replace(/\\d?\\.?\\d*\\s*\\)\\s*$/, (0.1 * multiplier).toString() + ')');\n  if (color.indexOf('rgb') === 0) return colorUtil.rgbToRgba(color);\n  if (color.indexOf('#') === 0) return colorUtil.hexToRgba(color);\n\n};\n\n/**\n * Binds events to the root element for\n */\nInkRippleCtrl.prototype.bindEvents = function () {\n  this.$element.on('mousedown', angular.bind(this, this.handleMousedown));\n  this.$element.on('mouseup touchend', angular.bind(this, this.handleMouseup));\n  this.$element.on('mouseleave', angular.bind(this, this.handleMouseup));\n  this.$element.on('touchmove', angular.bind(this, this.handleTouchmove));\n};\n\n/**\n * Create a new ripple on every mousedown event from the root element\n * @param event {MouseEvent}\n */\nInkRippleCtrl.prototype.handleMousedown = function (event) {\n  if (this.mousedown) return;\n\n  // When jQuery is loaded, we have to get the original event\n  if (event.hasOwnProperty('originalEvent')) event = event.originalEvent;\n  this.mousedown = true;\n  if (this.options.center) {\n    this.createRipple(this.container.prop('clientWidth') / 2, this.container.prop('clientWidth') / 2);\n  } else {\n\n    // We need to calculate the relative coordinates if the target is a sublayer of the ripple element\n    if (event.srcElement !== this.$element[0]) {\n      var layerRect = this.$element[0].getBoundingClientRect();\n      var layerX = event.clientX - layerRect.left;\n      var layerY = event.clientY - layerRect.top;\n\n      this.createRipple(layerX, layerY);\n    } else {\n      this.createRipple(event.offsetX, event.offsetY);\n    }\n  }\n};\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (either by\n * mouseup, touchend or mouseleave event)\n */\nInkRippleCtrl.prototype.handleMouseup = function () {\n  this.$timeout(function () {\n    autoCleanup(this, this.clearRipples);\n  }.bind(this));\n};\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (by\n * touchmove)\n */\nInkRippleCtrl.prototype.handleTouchmove = function () {\n  autoCleanup(this, this.deleteRipples);\n};\n\n/**\n * Cycles through all ripples and attempts to remove them.\n */\nInkRippleCtrl.prototype.deleteRipples = function () {\n  for (var i = 0; i < this.ripples.length; i++) {\n    this.ripples[ i ].remove();\n  }\n};\n\n/**\n * Cycles through all ripples and attempts to remove them with fade.\n * Depending on logic within `fadeInComplete`, some removals will be postponed.\n */\nInkRippleCtrl.prototype.clearRipples = function () {\n  for (var i = 0; i < this.ripples.length; i++) {\n    this.fadeInComplete(this.ripples[ i ]);\n  }\n};\n\n/**\n * Creates the ripple container element\n * @returns {*}\n */\nInkRippleCtrl.prototype.createContainer = function () {\n  var container = angular.element('<div class=\"md-ripple-container\"></div>');\n  this.$element.append(container);\n  return container;\n};\n\nInkRippleCtrl.prototype.clearTimeout = function () {\n  if (this.timeout) {\n    this.$timeout.cancel(this.timeout);\n    this.timeout = null;\n  }\n};\n\nInkRippleCtrl.prototype.isRippleAllowed = function () {\n  var element = this.$element[0];\n  do {\n    if (!element.tagName || element.tagName === 'BODY') break;\n\n    if (element && angular.isFunction(element.hasAttribute)) {\n      if (element.hasAttribute('disabled')) return false;\n      if (this.inkRipple() === 'false' || this.inkRipple() === '0') return false;\n    }\n\n  } while (element = element.parentNode);\n  return true;\n};\n\n/**\n * The attribute `md-ink-ripple` may be a static or interpolated\n * color value OR a boolean indicator (used to disable ripples)\n */\nInkRippleCtrl.prototype.inkRipple = function () {\n  return this.$element.attr('md-ink-ripple');\n};\n\n/**\n * Creates a new ripple and adds it to the container.  Also tracks ripple in `this.ripples`.\n * @param left\n * @param top\n */\nInkRippleCtrl.prototype.createRipple = function (left, top) {\n  if (!this.isRippleAllowed()) return;\n\n  var ctrl        = this;\n  var colorUtil   = ctrl.$mdColorUtil;\n  var ripple      = angular.element('<div class=\"md-ripple\"></div>');\n  var width       = this.$element.prop('clientWidth');\n  var height      = this.$element.prop('clientHeight');\n  var x           = Math.max(Math.abs(width - left), left) * 2;\n  var y           = Math.max(Math.abs(height - top), top) * 2;\n  var size        = getSize(this.options.fitRipple, x, y);\n  var color       = this.calculateColor();\n\n  ripple.css({\n    left:            left + 'px',\n    top:             top + 'px',\n    background:      'black',\n    width:           size + 'px',\n    height:          size + 'px',\n    backgroundColor: colorUtil.rgbaToRgb(color),\n    borderColor:     colorUtil.rgbaToRgb(color)\n  });\n  this.lastRipple = ripple;\n\n  // we only want one timeout to be running at a time\n  this.clearTimeout();\n  this.timeout    = this.$timeout(function () {\n    ctrl.clearTimeout();\n    if (!ctrl.mousedown) ctrl.fadeInComplete(ripple);\n  }, DURATION * 0.35, false);\n\n  if (this.options.dimBackground) this.container.css({ backgroundColor: color });\n  this.container.append(ripple);\n  this.ripples.push(ripple);\n  ripple.addClass('md-ripple-placed');\n\n  this.$mdUtil.nextTick(function () {\n\n    ripple.addClass('md-ripple-scaled md-ripple-active');\n    ctrl.$timeout(function () {\n      ctrl.clearRipples();\n    }, DURATION, false);\n\n  }, false);\n\n  function getSize (fit, x, y) {\n    return fit\n        ? Math.max(x, y)\n        : Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n  }\n};\n\n\n\n/**\n * After fadeIn finishes, either kicks off the fade-out animation or queues the element for removal on mouseup\n * @param ripple\n */\nInkRippleCtrl.prototype.fadeInComplete = function (ripple) {\n  if (this.lastRipple === ripple) {\n    if (!this.timeout && !this.mousedown) {\n      this.removeRipple(ripple);\n    }\n  } else {\n    this.removeRipple(ripple);\n  }\n};\n\n/**\n * Kicks off the animation for removing a ripple\n * @param ripple {Element}\n */\nInkRippleCtrl.prototype.removeRipple = function (ripple) {\n  var ctrl  = this;\n  var index = this.ripples.indexOf(ripple);\n  if (index < 0) return;\n  this.ripples.splice(this.ripples.indexOf(ripple), 1);\n  ripple.removeClass('md-ripple-active');\n  ripple.addClass('md-ripple-remove');\n  if (this.ripples.length === 0) this.container.css({ backgroundColor: '' });\n  // use a 2-second timeout in order to allow for the animation to finish\n  // we don't actually care how long the animation takes\n  this.$timeout(function () {\n    ctrl.fadeOutComplete(ripple);\n  }, DURATION, false);\n};\n\n/**\n * Removes the provided ripple from the DOM\n * @param ripple\n */\nInkRippleCtrl.prototype.fadeOutComplete = function (ripple) {\n  ripple.remove();\n  this.lastRipple = null;\n};\n\n/**\n * Used to create an empty directive.  This is used to track flag-directives whose children may have\n * functionality based on them.\n *\n * Example: `md-no-ink` will potentially be used by all child directives.\n */\nfunction attrNoDirective () {\n  return { controller: angular.noop };\n}\n"
  },
  {
    "path": "src/core/services/ripple/ripple.spec.js",
    "content": "describe('mdInkRipple directive', function() {\n\n  beforeEach(module('material.core'));\n\n  describe('with string values', function () {\n    it('should support custom colors', inject(function ($compile, $rootScope) {\n      var elem = $compile('<div md-ink-ripple=\"#bbb\"></div>')($rootScope.$new()),\n        container, ripple;\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      elem.controller('mdInkRipple').createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(1);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(1);\n      expect(ripple.css('backgroundColor')).toBe('rgb(187, 187, 187)');\n    }));\n\n    it('should support true', inject(function ($compile, $rootScope) {\n      var elem = $compile('<div md-ink-ripple=\"true\"></div>')($rootScope.$new()),\n        container, ripple;\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      elem.controller('mdInkRipple').createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(1);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(1);\n      expect(ripple.css('backgroundColor')).toBe('rgb(0, 0, 0)');\n    }));\n\n    it('should support false', inject(function ($compile, $rootScope) {\n      var elem = $compile('<div md-ink-ripple=\"false\"></div>')($rootScope.$new()),\n        container, ripple;\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      elem.controller('mdInkRipple').createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(0);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(0);\n    }));\n  });\n\n  describe('with interpolated false values', function () {\n    it('should not ripple with \\'false\\'', inject(function ($compile, $rootScope) {\n      var scope = $rootScope.$new();\n      scope.value = false;\n\n      var elem = $compile('<div md-ink-ripple=\"{{value}}\"></div>')(scope),\n        container, ripple;\n\n      scope.$apply();\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      elem.controller('mdInkRipple').createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(0);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(0);\n    }));\n\n    it('should not ripple with \\'0\\'', inject(function ($compile, $rootScope) {\n      var scope = $rootScope.$new();\n      scope.value = 0;\n\n      var elem = $compile('<div md-ink-ripple=\"{{value}}\"></div>')(scope),\n        container, ripple;\n\n      scope.$apply();\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      elem.controller('mdInkRipple').createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(0);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(0);\n    }));\n  });\n\n  describe('with interpolated color values', function () {\n    it('should create a ripple', inject(function ($compile, $rootScope) {\n      var scope = $rootScope.$new();\n      scope.value = '#FF0000';\n\n      var elem = $compile('<div md-ink-ripple=\"{{value}}\"></div>')(scope),\n        container, ripple;\n\n      scope.$apply();\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      var controller = elem.controller('mdInkRipple');\n\n      controller.createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(1);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(1);\n      expect(ripple.css('backgroundColor')).toBe('rgb(255, 0, 0)');\n    }));\n  });\n\n  describe('with css color', function () {\n    it('should create a ripple', inject(function ($compile, $rootScope, $window) {\n      spyOn($window, 'getComputedStyle').and.callFake(function() {\n        return { color: '#FF0000' };\n      });\n\n      var elem = $compile('<div style=\"color: #FF0000\" md-ink-ripple></div>')($rootScope.$new()),\n        container, ripple;\n\n      expect(elem.children('.md-ripple-container').length).toBe(0);\n\n      var controller = elem.controller('mdInkRipple');\n\n      controller.createRipple(0, 0);\n      container = elem.children('.md-ripple-container');\n      expect(container.length).toBe(1);\n\n      ripple = container.children('.md-ripple');\n      expect(ripple.length).toBe(1);\n      expect(ripple[0].style.backgroundColor).toBe('rgb(255, 0, 0)');\n    }));\n  });\n});\n\ndescribe('disabling ripples globally', function() {\n  beforeEach(function() {\n    module('material.core', function($mdInkRippleProvider) {\n      $mdInkRippleProvider.disableInkRipple();\n    });\n  });\n\n  it('should not instantiate the ripple controller', inject(function ($compile, $rootScope) {\n    var elem = $compile('<div md-ink-ripple=\"true\"></div>')($rootScope.$new());\n    var controller = elem.controller('mdInkRipple');\n    expect(Object.keys(controller).length).toBe(0);\n  }));\n});\n"
  },
  {
    "path": "src/core/services/ripple/tab_ripple.js",
    "content": "(function() {\n  'use strict';\n\n    /**\n   * @ngdoc service\n   * @name $mdTabInkRipple\n   * @module material.core\n   *\n   * @description\n   * Provides ripple effects for md-tabs.  See $mdInkRipple service for all possible configuration options.\n   *\n   * @param {object=} scope Scope within the current context\n   * @param {object=} element The element the ripple effect should be applied to\n   * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n   */\n\n  angular.module('material.core')\n    .factory('$mdTabInkRipple', MdTabInkRipple);\n\n  function MdTabInkRipple($mdInkRipple) {\n    return {\n      attach: attach\n    };\n\n    function attach(scope, element, options) {\n      return $mdInkRipple.attach(scope, element, angular.extend({\n        center: false,\n        dimBackground: true,\n        outline: false,\n        rippleSize: 'full'\n      }, options));\n    }\n  }\n})();\n"
  },
  {
    "path": "src/core/services/ripple/tab_ripple.spec.js",
    "content": "describe('MdTabInkRipple', function() {\n\n  beforeEach(module('material.core'));\n\n  var $element, $rootScope, $mdTabInkRipple, $mdInkRipple;\n  beforeEach(inject(function(_$rootScope_, _$mdTabInkRipple_, _$mdInkRipple_) {\n    $rootScope = _$rootScope_;\n    $mdTabInkRipple = _$mdTabInkRipple_;\n    $mdInkRipple = _$mdInkRipple_;\n\n    $element = jasmine.createSpy('element');\n    spyOn($mdInkRipple, 'attach');\n  }));\n\n  it('applies the correct ripple configuration', function() {\n    $mdTabInkRipple.attach($rootScope, $element);\n\n    var expected = {\n      center: false,\n      dimBackground: true,\n      outline: false,\n      rippleSize: 'full'\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n\n  it('allows ripple configuration to be overridden', function() {\n    $mdTabInkRipple.attach($rootScope, $element, { center: true, outline: true });\n\n    var expected = {\n      center: true,\n      dimBackground: true,\n      outline: true,\n      rippleSize: 'full'\n    };\n\n    expect($mdInkRipple.attach).toHaveBeenCalledWith($rootScope, $element, expected);\n  });\n});\n"
  },
  {
    "path": "src/core/services/theming/theme.palette.js",
    "content": "angular.module('material.core.theming.palette', [])\n.constant('$mdColorPalette', {\n  'red': {\n    '50': '#ffebee',\n    '100': '#ffcdd2',\n    '200': '#ef9a9a',\n    '300': '#e57373',\n    '400': '#ef5350',\n    '500': '#f44336',\n    '600': '#e53935',\n    '700': '#d32f2f',\n    '800': '#c62828',\n    '900': '#b71c1c',\n    'A100': '#ff8a80',\n    'A200': '#ff5252',\n    'A400': '#ff1744',\n    'A700': '#d50000',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 400 500 600 A100 A200 A400',\n    'contrastStrongLightColors': '700 800 900 A700'\n  },\n  'pink': {\n    '50': '#fce4ec',\n    '100': '#f8bbd0',\n    '200': '#f48fb1',\n    '300': '#f06292',\n    '400': '#ec407a',\n    '500': '#e91e63',\n    '600': '#d81b60',\n    '700': '#c2185b',\n    '800': '#ad1457',\n    '900': '#880e4f',\n    'A100': '#ff80ab',\n    'A200': '#ff4081',\n    'A400': '#f50057',\n    'A700': '#c51162',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 400 A100 A200 A400',\n    // White on 500 does not meet the minimum 4.5 contrast ratio (at 4.34),\n    // but it's worse with a dark foreground (3.61).\n    'contrastStrongLightColors': '500 600 700 800 900 A700'\n  },\n  'purple': {\n    '50': '#f3e5f5',\n    '100': '#e1bee7',\n    '200': '#ce93d8',\n    '300': '#ba68c8',\n    '400': '#ab47bc',\n    '500': '#9c27b0',\n    '600': '#8e24aa',\n    '700': '#7b1fa2',\n    '800': '#6a1b9a',\n    '900': '#4a148c',\n    'A100': '#ea80fc',\n    'A200': '#e040fb',\n    'A400': '#d500f9',\n    'A700': '#aa00ff',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 A100 A200 A400',\n    'contrastStrongLightColors': '400 500 600 700 800 900 A700'\n  },\n  'deep-purple': {\n    '50': '#ede7f6',\n    '100': '#d1c4e9',\n    '200': '#b39ddb',\n    '300': '#9575cd',\n    '400': '#7e57c2',\n    '500': '#673ab7',\n    '600': '#5e35b1',\n    '700': '#512da8',\n    '800': '#4527a0',\n    '900': '#311b92',\n    'A100': '#b388ff',\n    'A200': '#7c4dff',\n    'A400': '#651fff',\n    'A700': '#6200ea',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 A100',\n    'contrastStrongLightColors': '400 500 600 700 800 900 A200 A400 A700'\n  },\n  'indigo': {\n    '50': '#e8eaf6',\n    '100': '#c5cae9',\n    '200': '#9fa8da',\n    '300': '#7986cb',\n    '400': '#5c6bc0',\n    '500': '#3f51b5',\n    '600': '#3949ab',\n    '700': '#303f9f',\n    '800': '#283593',\n    '900': '#1a237e',\n    'A100': '#8c9eff',\n    'A200': '#536dfe',\n    'A400': '#3d5afe',\n    'A700': '#304ffe',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 A100 A200',\n    'contrastStrongLightColors': '400 500 600 700 800 900 A400 A700'\n  },\n  'blue': {\n    '50': '#e3f2fd',\n    '100': '#bbdefb',\n    '200': '#90caf9',\n    '300': '#64b5f6',\n    '400': '#42a5f5',\n    '500': '#2196f3',\n    '600': '#1e88e5',\n    '700': '#1976d2',\n    '800': '#1565c0',\n    '900': '#0d47a1',\n    'A100': '#82b1ff',\n    'A200': '#448aff',\n    'A400': '#2979ff',\n    'A700': '#2962ff',\n    'contrastDefaultColor': 'light',\n    // White on A400 does not meet the minimum 4.5 contrast ratio (at 3.98),\n    // but it's worse with a dark foreground (3.94).\n    'contrastDarkColors': '50 100 200 300 400 500 600 A100 A200',\n    'contrastStrongLightColors': '700 800 900 A400 A700'\n  },\n  'light-blue': {\n    '50': '#e1f5fe',\n    '100': '#b3e5fc',\n    '200': '#81d4fa',\n    '300': '#4fc3f7',\n    '400': '#29b6f6',\n    '500': '#03a9f4',\n    '600': '#039be5',\n    '700': '#0288d1',\n    '800': '#0277bd',\n    '900': '#01579b',\n    'A100': '#80d8ff',\n    'A200': '#40c4ff',\n    'A400': '#00b0ff',\n    'A700': '#0091ea',\n    'contrastDefaultColor': 'dark',\n    // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.07),\n    // but it's worse with a white foreground (3.85).\n    'contrastStrongLightColors': '800 900 A700'\n  },\n  'cyan': {\n    '50': '#e0f7fa',\n    '100': '#b2ebf2',\n    '200': '#80deea',\n    '300': '#4dd0e1',\n    '400': '#26c6da',\n    '500': '#00bcd4',\n    '600': '#00acc1',\n    '700': '#0097a7',\n    '800': '#00838f',\n    '900': '#006064',\n    'A100': '#84ffff',\n    'A200': '#18ffff',\n    'A400': '#00e5ff',\n    'A700': '#00b8d4',\n    'contrastDefaultColor': 'dark',\n    // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.47),\n    // but it's worse with a white foreground (3.5).\n    'contrastStrongLightColors': '800 900'\n  },\n  'teal': {\n    '50': '#e0f2f1',\n    '100': '#b2dfdb',\n    '200': '#80cbc4',\n    '300': '#4db6ac',\n    '400': '#26a69a',\n    '500': '#009688',\n    '600': '#00897b',\n    '700': '#00796b',\n    '800': '#00695c',\n    '900': '#004d40',\n    'A100': '#a7ffeb',\n    'A200': '#64ffda',\n    'A400': '#1de9b6',\n    'A700': '#00bfa5',\n    'contrastDefaultColor': 'dark',\n    // Dark on 500 does not meet the minimum 4.5 contrast ratio (at 4.27),\n    // but it's worse with a white foreground (3.67).\n    // White on 600 does not meet the minimum 4.5 contrast ratio (at 4.31),\n    // but it's worse with a dark foreground (3.64).\n    'contrastStrongLightColors': '600 700 800 900'\n  },\n  'green': {\n    '50': '#e8f5e9',\n    '100': '#c8e6c9',\n    '200': '#a5d6a7',\n    '300': '#81c784',\n    '400': '#66bb6a',\n    '500': '#4caf50',\n    '600': '#43a047',\n    '700': '#388e3c',\n    '800': '#2e7d32',\n    '900': '#1b5e20',\n    'A100': '#b9f6ca',\n    'A200': '#69f0ae',\n    'A400': '#00e676',\n    'A700': '#00c853',\n    'contrastDefaultColor': 'dark',\n    // White on 700 does not meet the minimum 4.5 contrast ratio (at 4.11),\n    // but it's worse with a dark foreground (3.81).\n    'contrastStrongLightColors': '700 800 900'\n  },\n  'light-green': {\n    '50': '#f1f8e9',\n    '100': '#dcedc8',\n    '200': '#c5e1a5',\n    '300': '#aed581',\n    '400': '#9ccc65',\n    '500': '#8bc34a',\n    '600': '#7cb342',\n    '700': '#689f38',\n    '800': '#558b2f',\n    '900': '#33691e',\n    'A100': '#ccff90',\n    'A200': '#b2ff59',\n    'A400': '#76ff03',\n    'A700': '#64dd17',\n    'contrastDefaultColor': 'dark',\n    'contrastStrongLightColors': '800 900'\n  },\n  'lime': {\n    '50': '#f9fbe7',\n    '100': '#f0f4c3',\n    '200': '#e6ee9c',\n    '300': '#dce775',\n    '400': '#d4e157',\n    '500': '#cddc39',\n    '600': '#c0ca33',\n    '700': '#afb42b',\n    '800': '#9e9d24',\n    '900': '#827717',\n    'A100': '#f4ff81',\n    'A200': '#eeff41',\n    'A400': '#c6ff00',\n    'A700': '#aeea00',\n    'contrastDefaultColor': 'dark',\n    'contrastStrongLightColors': '900'\n  },\n  'yellow': {\n    '50': '#fffde7',\n    '100': '#fff9c4',\n    '200': '#fff59d',\n    '300': '#fff176',\n    '400': '#ffee58',\n    '500': '#ffeb3b',\n    '600': '#fdd835',\n    '700': '#fbc02d',\n    '800': '#f9a825',\n    '900': '#f57f17',\n    'A100': '#ffff8d',\n    'A200': '#ffff00',\n    'A400': '#ffea00',\n    'A700': '#ffd600',\n    'contrastDefaultColor': 'dark'\n  },\n  'amber': {\n    '50': '#fff8e1',\n    '100': '#ffecb3',\n    '200': '#ffe082',\n    '300': '#ffd54f',\n    '400': '#ffca28',\n    '500': '#ffc107',\n    '600': '#ffb300',\n    '700': '#ffa000',\n    '800': '#ff8f00',\n    '900': '#ff6f00',\n    'A100': '#ffe57f',\n    'A200': '#ffd740',\n    'A400': '#ffc400',\n    'A700': '#ffab00',\n    'contrastDefaultColor': 'dark'\n  },\n  'orange': {\n    '50': '#fff3e0',\n    '100': '#ffe0b2',\n    '200': '#ffcc80',\n    '300': '#ffb74d',\n    '400': '#ffa726',\n    '500': '#ff9800',\n    '600': '#fb8c00',\n    '700': '#f57c00',\n    '800': '#ef6c00',\n    '900': '#e65100',\n    'A100': '#ffd180',\n    'A200': '#ffab40',\n    'A400': '#ff9100',\n    'A700': '#ff6d00',\n    'contrastDefaultColor': 'dark',\n    'contrastStrongLightColors': '900'\n  },\n  'deep-orange': {\n    '50': '#fbe9e7',\n    '100': '#ffccbc',\n    '200': '#ffab91',\n    '300': '#ff8a65',\n    '400': '#ff7043',\n    '500': '#ff5722',\n    '600': '#f4511e',\n    '700': '#e64a19',\n    '800': '#d84315',\n    '900': '#bf360c',\n    'A100': '#ff9e80',\n    'A200': '#ff6e40',\n    'A400': '#ff3d00',\n    'A700': '#dd2c00',\n    'contrastDefaultColor': 'dark',\n    // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.01),\n    // but it's worse with a white foreground (3.91).\n    // White on 800 does not meet the minimum 4.5 contrast ratio (at 4.43),\n    // but it's worse with a dark foreground (3.54).\n    'contrastStrongLightColors': '800 900 A400 A700',\n  },\n  'brown': {\n    '50': '#efebe9',\n    '100': '#d7ccc8',\n    '200': '#bcaaa4',\n    '300': '#a1887f',\n    '400': '#8d6e63',\n    '500': '#795548',\n    '600': '#6d4c41',\n    '700': '#5d4037',\n    '800': '#4e342e',\n    '900': '#3e2723',\n    'A100': '#d7ccc8',\n    'A200': '#bcaaa4',\n    'A400': '#8d6e63',\n    'A700': '#5d4037',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 A100 A200',\n    'contrastStrongLightColors': '400 500 600 700 800 900 A400 A700'\n  },\n  'grey': {\n    '50': '#fafafa',\n    '100': '#f5f5f5',\n    '200': '#eeeeee',\n    '300': '#e0e0e0',\n    '400': '#bdbdbd',\n    '500': '#9e9e9e',\n    '600': '#757575',\n    '700': '#616161',\n    '800': '#424242',\n    '900': '#212121',\n    'A100': '#ffffff',\n    'A200': '#000000',\n    'A400': '#303030',\n    'A700': '#616161',\n    'contrastDefaultColor': 'dark',\n    'contrastLightColors': '700 800 900 A200 A400 A700',\n    'contrastStrongLightColors': '600'\n  },\n  'blue-grey': {\n    '50': '#eceff1',\n    '100': '#cfd8dc',\n    '200': '#b0bec5',\n    '300': '#90a4ae',\n    '400': '#78909c',\n    '500': '#607d8b',\n    '600': '#546e7a',\n    '700': '#455a64',\n    '800': '#37474f',\n    '900': '#263238',\n    'A100': '#cfd8dc',\n    'A200': '#b0bec5',\n    'A400': '#78909c',\n    'A700': '#455a64',\n    'contrastDefaultColor': 'light',\n    'contrastDarkColors': '50 100 200 300 400 A100 A200 A400',\n    // White on 500 does not meet the minimum 4.5 contrast ratio (at 4.37),\n    // but it's worse with a dark foreground.\n    'contrastStrongLightColors': '500 600 700 800 900 A700'\n  }\n});\n"
  },
  {
    "path": "src/core/services/theming/theming.js",
    "content": "(function(angular) {\n  'use strict';\n/**\n * @ngdoc module\n * @name material.core.theming\n * @description\n * Theming\n */\nangular.module('material.core.theming', ['material.core.theming.palette', 'material.core.meta'])\n  .directive('mdTheme', ThemingDirective)\n  .directive('mdThemable', ThemableDirective)\n  .directive('mdThemesDisabled', disableThemesDirective)\n  .provider('$mdTheming', ThemingProvider)\n  .config(detectDisabledThemes)\n  .run(generateAllThemes);\n\n/**\n * Detect if the HTML or the BODY tags has a [md-themes-disabled] attribute\n * If yes, then immediately disable all theme stylesheet generation and DOM injection\n */\n/**\n * @ngInject\n */\nfunction detectDisabledThemes($mdThemingProvider) {\n  var isDisabled = !!document.querySelector('[md-themes-disabled]');\n  $mdThemingProvider.disableTheming(isDisabled);\n}\n\n/**\n * @ngdoc service\n * @name $mdThemingProvider\n * @module material.core.theming\n *\n * @description Provider to configure the `$mdTheming` service.\n *\n * ### Default Theme\n * The `$mdThemingProvider` uses by default the following theme configuration:\n *\n * - Primary Palette: `Blue`\n * - Accent Palette: `Pink`\n * - Warn Palette: `Deep-Orange`\n * - Background Palette: `Grey`\n *\n * If you don't want to use the `md-theme` directive on the elements itself, you may want to overwrite\n * the default theme.<br/>\n * This can be done by using the following markup.\n *\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdThemingProvider) {\n *     $mdThemingProvider\n *       .theme('default')\n *       .primaryPalette('blue')\n *       .accentPalette('teal')\n *       .warnPalette('red')\n *       .backgroundPalette('grey');\n *   });\n * </hljs>\n *\n\n * ### Dynamic Themes\n *\n * By default, if you change a theme at runtime, the `$mdTheming` service will not detect those changes.<br/>\n * If you have an application, which changes its theme on runtime, you have to enable theme watching.\n *\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdThemingProvider) {\n *     // Enable theme watching.\n *     $mdThemingProvider.alwaysWatchTheme(true);\n *   });\n * </hljs>\n *\n * ### Custom Theme Styles\n *\n * Sometimes you may want to use your own theme styles for some custom components.<br/>\n * You are able to register your own styles by using the following markup.\n *\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdThemingProvider) {\n *     // Register our custom stylesheet into the theming provider.\n *     $mdThemingProvider.registerStyles(STYLESHEET);\n *   });\n * </hljs>\n *\n * The `registerStyles` method only accepts strings as value, so you're actually not able to load an external\n * stylesheet file into the `$mdThemingProvider`.\n *\n * If it's necessary to load an external stylesheet, we suggest using a bundler, which supports including raw content,\n * like [raw-loader](https://github.com/webpack/raw-loader) for `webpack`.\n *\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdThemingProvider) {\n *     // Register your custom stylesheet into the theming provider.\n *     $mdThemingProvider.registerStyles(require('../styles/my-component.theme.css'));\n *   });\n * </hljs>\n *\n * ### Browser color\n *\n * Enables browser header coloring\n * for more info please visit:\n * https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color\n *\n * Options parameter: <br/>\n * `theme`   - A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme. <br/>\n * `palette` - Can be any one of the basic material design palettes, extended defined palettes and 'primary',\n *             'accent', 'background' and 'warn'. Default is `primary`. <br/>\n * `hue`     - The hue from the selected palette. Default is `800`<br/>\n *\n * <hljs lang=\"js\">\n *   myAppModule.config(function($mdThemingProvider) {\n *     // Enable browser color\n *     $mdThemingProvider.enableBrowserColor({\n *       theme: 'myTheme', // Default is 'default'\n *       palette: 'accent', // Default is 'primary', any basic material palette and extended palettes are available\n *       hue: '200' // Default is '800'\n *     });\n *   });\n * </hljs>\n */\n\n/**\n * Some Example Valid Theming Expressions\n * =======================================\n *\n * Intention group expansion: (valid for primary, accent, warn, background)\n *\n * {{primary-100}} - grab shade 100 from the primary palette\n * {{primary-100-0.7}} - grab shade 100, apply opacity of 0.7\n * {{primary-100-contrast}} - grab shade 100's contrast color\n * {{primary-hue-1}} - grab the shade assigned to hue-1 from the primary palette\n * {{primary-hue-1-0.7}} - apply 0.7 opacity to primary-hue-1\n * {{primary-color}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured shades set for each hue\n * {{primary-color-0.7}} - Apply 0.7 opacity to each of the above rules\n * {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue\n * {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules\n * {{primary-contrast-divider}} - Apply divider opacity to contrast color\n *\n * Foreground expansion: Applies rgba to black/white foreground text\n *\n * Old Foreground Expressions:\n * {{foreground-1}} - used for primary text\n * {{foreground-2}} - used for secondary text/divider\n * {{foreground-3}} - used for disabled text\n * {{foreground-4}} - used for dividers\n *\n * New Foreground Expressions:\n *\n * Apply primary text color for contrasting with default background\n *  {{background-default-contrast}} - default opacity\n *  {{background-default-contrast-secondary}} - opacity for secondary text\n *  {{background-default-contrast-hint}} - opacity for hints and placeholders\n *  {{background-default-contrast-disabled}} - opacity for disabled text\n *  {{background-default-contrast-divider}} - opacity for dividers\n *\n * Apply contrast color for specific shades\n *  {{background-50-contrast-icon}} - Apply contrast color for icon on background's shade 50 hue\n */\n\n// In memory generated CSS rules; registered by theme.name\nvar GENERATED = { };\n\n// In memory storage of defined themes and color palettes (both loaded by CSS, and user specified)\nvar PALETTES;\n\n// Text colors are automatically generated based on background color when not specified\n// Custom palettes can provide override colors\n// @see https://material.io/archive/guidelines/style/color.html#color-usability\nvar DARK_FOREGROUND = {\n  name: 'dark',\n};\nvar LIGHT_FOREGROUND = {\n  name: 'light',\n};\n\nvar DARK_SHADOW = '1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)';\nvar LIGHT_SHADOW = '';\n\nvar DARK_CONTRAST_COLOR = colorToRgbaArray('rgba(0,0,0,0.87)');\nvar LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgba(255,255,255,0.87)');\nvar STRONG_LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgb(255,255,255)');\n\nvar THEME_COLOR_TYPES = ['primary', 'accent', 'warn', 'background'];\nvar DEFAULT_COLOR_TYPE = 'primary';\n\n// A color in a theme will use these hues by default, if not specified by user.\nvar LIGHT_DEFAULT_HUES = {\n  'accent': {\n    'default': 'A200',\n    'hue-1': 'A100',\n    'hue-2': 'A400',\n    'hue-3': 'A700'\n  },\n  'background': {\n    'default': '50',\n    'hue-1': 'A100',\n    'hue-2': '100',\n    'hue-3': '300'\n  }\n};\n\nvar DARK_DEFAULT_HUES = {\n  'background': {\n    'default': 'A400',\n    'hue-1': '800',\n    'hue-2': '900',\n    'hue-3': 'A200'\n  }\n};\n\n// Icon opacity values (active/inactive) from\n// https://material.io/archive/guidelines/style/color.html#color-usability\nvar DARK_CONTRAST_OPACITY = {\n  'icon': 0.54,\n  'secondary': 0.54,\n  'disabled': 0.38,\n  'hint': 0.38,\n  'divider': 0.12,\n};\n\nvar LIGHT_CONTRAST_OPACITY = {\n  'icon': 0.87,\n  'secondary': 0.7,\n  'disabled': 0.5,\n  'hint': 0.5,\n  'divider': 0.12\n};\n\n// Icon opacity values (active/inactive) from\n// https://material.io/archive/guidelines/style/color.html#color-usability\nvar STRONG_LIGHT_CONTRAST_OPACITY = {\n  'icon': 1.0,\n  'secondary': 0.7,\n  'disabled': 0.5,\n  'hint': 0.5,\n  'divider': 0.12\n};\n\nTHEME_COLOR_TYPES.forEach(function(colorType) {\n  // Color types with unspecified default hues will use these default hue values\n  var defaultDefaultHues = {\n    'default': '500',\n    'hue-1': '300',\n    'hue-2': '800',\n    'hue-3': 'A100'\n  };\n  if (!LIGHT_DEFAULT_HUES[colorType]) LIGHT_DEFAULT_HUES[colorType] = defaultDefaultHues;\n  if (!DARK_DEFAULT_HUES[colorType]) DARK_DEFAULT_HUES[colorType] = defaultDefaultHues;\n});\n\nvar VALID_HUE_VALUES = [\n  '50', '100', '200', '300', '400', '500', '600',\n  '700', '800', '900', 'A100', 'A200', 'A400', 'A700'\n];\n\nvar themeConfig = {\n  disableTheming : false,   // Generate our themes at run time; also disable stylesheet DOM injection\n  generateOnDemand : false, // Whether or not themes are to be generated on-demand (vs. eagerly).\n  registeredStyles : [],    // Custom styles registered to be used in the theming of custom components.\n  nonce : null              // Nonce to be added as an attribute to the generated themes style tags.\n};\n\n/**\n *\n */\nfunction ThemingProvider($mdColorPalette, $$mdMetaProvider) {\n  PALETTES = { };\n  var THEMES = { };\n\n  var themingProvider;\n\n  var alwaysWatchTheme = false;\n  var defaultTheme = 'default';\n\n  // Load JS Defined Palettes\n  angular.extend(PALETTES, $mdColorPalette);\n\n  // Default theme defined in core.js\n\n  /**\n   * Adds `theme-color` and `msapplication-navbutton-color` meta tags with the color parameter\n   * @param {string} color Hex value of the wanted browser color\n   * @returns {function} Remove function of the meta tags\n   */\n  var setBrowserColor = function (color) {\n    // Chrome, Firefox OS and Opera\n    var removeChrome = $$mdMetaProvider.setMeta('theme-color', color);\n    // Windows Phone\n    var removeWindows = $$mdMetaProvider.setMeta('msapplication-navbutton-color', color);\n\n    return function () {\n      removeChrome();\n      removeWindows();\n    };\n  };\n\n  /**\n   * @ngdoc method\n   * @name $mdThemingProvider#enableBrowserColor\n   * @description\n   * Enables browser header coloring. For more info please visit\n   * <a href=\"https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color\">\n   *   Web Fundamentals</a>.\n   * @param {object=} options Options for the browser color, which include:<br/>\n   * - `theme` - `{string}`: A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme. <br/>\n   * - `palette` - `{string}`:  Can be any one of the basic material design palettes, extended defined palettes, or `primary`,\n   *  `accent`, `background`, and `warn`. Default is `primary`.<br/>\n   * - `hue` -  `{string}`: The hue from the selected palette. Default is `800`.<br/>\n   * @returns {function} Function that removes the browser coloring when called.\n   */\n  var enableBrowserColor = function (options) {\n    options = angular.isObject(options) ? options : {};\n\n    var theme = options.theme || 'default';\n    var hue = options.hue || '800';\n\n    var palette = PALETTES[options.palette] ||\n      PALETTES[THEMES[theme].colors[options.palette || 'primary'].name];\n\n    var color = angular.isObject(palette[hue]) ? palette[hue].hex : palette[hue];\n    if (color.substr(0, 1) !== '#') color = '#' + color;\n\n    return setBrowserColor(color);\n  };\n\n  return themingProvider = {\n    definePalette: definePalette,\n    extendPalette: extendPalette,\n    theme: registerTheme,\n\n    /**\n     * return a read-only clone of the current theme configuration\n     */\n    configuration : function() {\n      return angular.extend({ }, themeConfig, {\n        defaultTheme : defaultTheme,\n        alwaysWatchTheme : alwaysWatchTheme,\n        registeredStyles : [].concat(themeConfig.registeredStyles)\n      });\n    },\n\n    /**\n     * @ngdoc method\n     * @name $mdThemingProvider#disableTheming\n     * @description\n     * An easier way to disable theming without having to use `.constant(\"$MD_THEME_CSS\",\"\");`.\n     * This disables all dynamic theme style sheet generations and injections.\n     * @param {boolean=} isDisabled Disable all dynamic theme style sheet generations and injections\n     *  if `true` or `undefined`.\n     */\n    disableTheming: function(isDisabled) {\n      themeConfig.disableTheming = angular.isUndefined(isDisabled) || !!isDisabled;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $mdThemingProvider#registerStyles\n     * @param {string} styles The styles to be appended to AngularJS Material's built in theme CSS.\n     */\n    registerStyles: function(styles) {\n      themeConfig.registeredStyles.push(styles);\n    },\n\n    /**\n     * @ngdoc method\n     * @name $mdThemingProvider#setNonce\n     * @param {string} nonceValue The nonce to be added as an attribute to the theme style tags.\n     * Setting a value allows the use of CSP policy without using the `'unsafe-inline'` directive.\n     * The string must already be base64 encoded. You can use `btoa(string)` to do this encoding.\n     * In your CSP's `style-src`, you would then add an entry for `'nonce-nonceValue'`.\n     */\n    setNonce: function(nonceValue) {\n      themeConfig.nonce = nonceValue;\n    },\n\n    generateThemesOnDemand: function(onDemand) {\n      themeConfig.generateOnDemand = onDemand;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $mdThemingProvider#setDefaultTheme\n     * @param {string} theme Default theme name to be applied to elements.\n     *  Default value is `default`.\n     */\n    setDefaultTheme: function(theme) {\n      defaultTheme = theme;\n    },\n\n    /**\n     * @ngdoc method\n     * @name $mdThemingProvider#alwaysWatchTheme\n     * @param {boolean} alwaysWatch Whether or not to always watch themes for changes and re-apply\n     * classes when they change. Default is `false`. Enabling can reduce performance.\n     */\n    alwaysWatchTheme: function(alwaysWatch) {\n      alwaysWatchTheme = alwaysWatch;\n    },\n\n    enableBrowserColor: enableBrowserColor,\n\n    $get: ThemingService,\n    _LIGHT_DEFAULT_HUES: LIGHT_DEFAULT_HUES,\n    _DARK_DEFAULT_HUES: DARK_DEFAULT_HUES,\n    _PALETTES: PALETTES,\n    _THEMES: THEMES,\n    _parseRules: parseRules,\n    _rgba: rgba\n  };\n\n  /**\n   * @ngdoc method\n   * @name $mdThemingProvider#definePalette\n   * @description\n   * In the event that you need to define a custom color palette, you can use this function to\n   * make it available to your theme for use in its intention groups.<br>\n   * Note that you must specify all hues in the definition map.\n   * @param {string} name Name of palette being defined\n   * @param {object} map Palette definition that includes hue definitions and contrast colors:\n   * - `'50'` - `{string}`: HEX color\n   * - `'100'` - `{string}`: HEX color\n   * - `'200'` - `{string}`: HEX color\n   * - `'300'` - `{string}`: HEX color\n   * - `'400'` - `{string}`: HEX color\n   * - `'500'` - `{string}`: HEX color\n   * - `'600'` - `{string}`: HEX color\n   * - `'700'` - `{string}`: HEX color\n   * - `'800'` - `{string}`: HEX color\n   * - `'900'` - `{string}`: HEX color\n   * - `'A100'` - `{string}`: HEX color\n   * - `'A200'` - `{string}`: HEX color\n   * - `'A400'` - `{string}`: HEX color\n   * - `'A700'` - `{string}`: HEX color\n   * - `'contrastDefaultColor'` - `{string}`: `light` or `dark`\n   * - `'contrastDarkColors'` - `{string[]}`: Hues which should use dark contrast colors (i.e. raised button text).\n   *  For example: `['50', '100', '200', '300', '400', 'A100']`.\n   * - `'contrastLightColors'` - `{string[]}`: Hues which should use light contrast colors (i.e. raised button text).\n   *  For example: `['500', '600', '700', '800', '900', 'A200', 'A400', 'A700']`.\n   */\n  function definePalette(name, map) {\n    map = map || {};\n    PALETTES[name] = checkPaletteValid(name, map);\n    return themingProvider;\n  }\n\n  /**\n   * @ngdoc method\n   * @name $mdThemingProvider#extendPalette\n   * @description\n   * Sometimes it is easier to extend an existing color palette and then change a few properties,\n   * rather than defining a whole new palette.\n   * @param {string} name Name of palette being extended\n   * @param {object} map Palette definition that includes optional hue definitions and contrast colors:\n   * - `'50'` - `{string}`: HEX color\n   * - `'100'` - `{string}`: HEX color\n   * - `'200'` - `{string}`: HEX color\n   * - `'300'` - `{string}`: HEX color\n   * - `'400'` - `{string}`: HEX color\n   * - `'500'` - `{string}`: HEX color\n   * - `'600'` - `{string}`: HEX color\n   * - `'700'` - `{string}`: HEX color\n   * - `'800'` - `{string}`: HEX color\n   * - `'900'` - `{string}`: HEX color\n   * - `'A100'` - `{string}`: HEX color\n   * - `'A200'` - `{string}`: HEX color\n   * - `'A400'` - `{string}`: HEX color\n   * - `'A700'` - `{string}`: HEX color\n   * - `'contrastDefaultColor'` - `{string}`: `light` or `dark`\n   * - `'contrastDarkColors'` - `{string[]}`: Hues which should use dark contrast colors (i.e. raised button text).\n   *  For example: `['50', '100', '200', '300', '400', 'A100']`.\n   * - `'contrastLightColors'` - `{string[]}`: Hues which should use light contrast colors (i.e. raised button text).\n   *  For example: `['500', '600', '700', '800', '900', 'A200', 'A400', 'A700']`.\n   *  @returns {object} A new object which is a copy of the given palette, `name`,\n   *    with variables from `map` overwritten.\n   */\n  function extendPalette(name, map) {\n    return checkPaletteValid(name,  angular.extend({}, PALETTES[name] || {}, map));\n  }\n\n  // Make sure that palette has all required hues\n  function checkPaletteValid(name, map) {\n    var missingColors = VALID_HUE_VALUES.filter(function(field) {\n      return !map[field];\n    });\n    if (missingColors.length) {\n      throw new Error(\"Missing colors %1 in palette %2!\"\n                      .replace('%1', missingColors.join(', '))\n                      .replace('%2', name));\n    }\n\n    return map;\n  }\n\n  /**\n   * @ngdoc method\n   * @name $mdThemingProvider#theme\n   * @description\n   * Register a theme (which is a collection of color palettes); i.e. `warn`, `accent`,\n   * `background`, and `primary`.<br>\n   * Optionally inherit from an existing theme.\n   * @param {string} name Name of theme being registered\n   * @param {string=} inheritFrom Existing theme name to inherit from\n   */\n  function registerTheme(name, inheritFrom) {\n    if (THEMES[name]) return THEMES[name];\n\n    inheritFrom = inheritFrom || 'default';\n\n    var parentTheme = typeof inheritFrom === 'string' ? THEMES[inheritFrom] : inheritFrom;\n    var theme = new Theme(name);\n\n    if (parentTheme) {\n      angular.forEach(parentTheme.colors, function(color, colorType) {\n        theme.colors[colorType] = {\n          name: color.name,\n          // Make sure a COPY of the hues is given to the child color,\n          // not the same reference.\n          hues: angular.extend({}, color.hues)\n        };\n      });\n    }\n    THEMES[name] = theme;\n\n    return theme;\n  }\n\n  function Theme(name) {\n    var self = this;\n    self.name = name;\n    self.colors = {};\n\n    self.dark = setDark;\n    setDark(false);\n\n    function setDark(isDark) {\n      isDark = arguments.length === 0 ? true : !!isDark;\n\n      // If no change, abort\n      if (isDark === self.isDark) return;\n\n      self.isDark = isDark;\n\n      self.foregroundPalette = self.isDark ? LIGHT_FOREGROUND : DARK_FOREGROUND;\n      self.foregroundShadow = self.isDark ? DARK_SHADOW : LIGHT_SHADOW;\n\n      // Light and dark themes have different default hues.\n      // Go through each existing color type for this theme, and for every\n      // hue value that is still the default hue value from the previous light/dark setting,\n      // set it to the default hue value from the new light/dark setting.\n      var newDefaultHues = self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES;\n      var oldDefaultHues = self.isDark ? LIGHT_DEFAULT_HUES : DARK_DEFAULT_HUES;\n      angular.forEach(newDefaultHues, function(newDefaults, colorType) {\n        var color = self.colors[colorType];\n        var oldDefaults = oldDefaultHues[colorType];\n        if (color) {\n          for (var hueName in color.hues) {\n            if (color.hues[hueName] === oldDefaults[hueName]) {\n              color.hues[hueName] = newDefaults[hueName];\n            }\n          }\n        }\n      });\n\n      return self;\n    }\n\n    THEME_COLOR_TYPES.forEach(function(colorType) {\n      var defaultHues = (self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES)[colorType];\n      self[colorType + 'Palette'] = function setPaletteType(paletteName, hues) {\n        var color = self.colors[colorType] = {\n          name: paletteName,\n          hues: angular.extend({}, defaultHues, hues)\n        };\n\n        Object.keys(color.hues).forEach(function(name) {\n          if (!defaultHues[name]) {\n            throw new Error(\"Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4\"\n              .replace('%1', name)\n              .replace('%2', self.name)\n              .replace('%3', paletteName)\n              .replace('%4', Object.keys(defaultHues).join(', '))\n            );\n          }\n        });\n        Object.keys(color.hues).map(function(key) {\n          return color.hues[key];\n        }).forEach(function(hueValue) {\n          if (VALID_HUE_VALUES.indexOf(hueValue) === -1) {\n            throw new Error(\"Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5\"\n              .replace('%1', hueValue)\n              .replace('%2', self.name)\n              .replace('%3', colorType)\n              .replace('%4', paletteName)\n              .replace('%5', VALID_HUE_VALUES.join(', '))\n            );\n          }\n        });\n        return self;\n      };\n    });\n  }\n\n  /**\n   * @ngdoc service\n   * @name $mdTheming\n   * @module material.core.theming\n   * @description\n   * Service that makes an element apply theming related <b>classes</b> to itself.\n   *\n   * For more information on the hue objects, their default values, as well as valid hue values, please visit <a ng-href=\"Theming/03_configuring_a_theme#specifying-custom-hues-for-color-intentions\">the custom hues section of Configuring a Theme</a>.\n   *\n   * <hljs lang=\"js\">\n   * // Example component directive that we want to apply theming classes to.\n   * app.directive('myFancyDirective', function($mdTheming) {\n   *   return {\n   *     restrict: 'AE',\n   *     link: function(scope, element, attrs) {\n   *       // Initialize the service using our directive's element\n   *       $mdTheming(element);\n   *\n   *       $mdTheming.defineTheme('myTheme', {\n   *         primary: 'blue',\n   *         primaryHues: {\n   *           default: '500',\n   *           hue-1: '300',\n   *           hue-2: '900',\n   *           hue-3: 'A100'\n   *         },\n   *         accent: 'pink',\n   *         accentHues: {\n   *           default: '600',\n   *           hue-1: '300',\n   *           hue-2: '200',\n   *           hue-3: 'A500'\n   *         },\n   *         warn: 'red',\n   *         // It's not necessary to specify all hues in the object.\n   *         warnHues: {\n   *           default: '200',\n   *           hue-3: 'A100'\n   *         },\n   *         // It's not necessary to specify custom hues at all.\n   *         background: 'grey',\n   *         dark: true\n   *       });\n   *       // Your directive's custom code here.\n   *     }\n   *   };\n   * });\n   * </hljs>\n   * @param {element=} element Element that will have theming classes applied to it.\n   */\n\n  /**\n   * @ngdoc property\n   * @name $mdTheming#THEMES\n   * @description\n   * Property to get all the themes defined\n   * @returns {object} All the themes defined with their properties.\n   */\n\n  /**\n   * @ngdoc property\n   * @name $mdTheming#PALETTES\n   * @description\n   * Property to get all the palettes defined\n   * @returns {object} All the palettes defined with their colors.\n   */\n\n  /**\n   * @ngdoc method\n   * @name $mdTheming#registered\n   * @description\n   * Determine is specified theme name is a valid, registered theme\n   * @param {string} themeName the theme to check if registered\n   * @returns {boolean} whether the theme is registered or not\n   */\n\n  /**\n   * @ngdoc method\n   * @name $mdTheming#defaultTheme\n   * @description\n   * Returns the default theme\n   * @returns {string} The default theme\n   */\n\n  /**\n   * @ngdoc method\n   * @name $mdTheming#generateTheme\n   * @description\n   * Lazy generate themes - by default, every theme is generated when defined.\n   * You can disable this in the configuration section using the\n   * `$mdThemingProvider.generateThemesOnDemand(true);`\n   *\n   * The theme name that is passed in must match the name of the theme that was defined as part of\n   * the configuration block.\n   *\n   * @param {string} name theme name to generate\n   */\n\n  /**\n   * @ngdoc method\n   * @name $mdTheming#setBrowserColor\n   * @description\n   * Enables browser header coloring. For more info please visit\n   * <a href=\"https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color\">\n   *   Web Fundamentals</a>.\n   * @param {object=} options Options for the browser color, which include:<br/>\n   * - `theme` - `{string}`: A defined theme via `$mdThemeProvider` to use the palettes from.\n   *    Default is `default` theme. <br/>\n   * - `palette` - `{string}`:  Can be any one of the basic material design palettes, extended\n   *    defined palettes, or `primary`, `accent`, `background`, and `warn`. Default is `primary`.\n   * <br/>\n   * - `hue` -  `{string}`: The hue from the selected palette. Default is `800`.<br/>\n   * @returns {function} Function that removes the browser coloring when called.\n   */\n\n  /**\n   * @ngdoc method\n   * @name $mdTheming#defineTheme\n   * @description\n   * Dynamically define a theme by using an options object that contains palette names.\n   *\n   * @param {string} name Theme name to define\n   * @param {object} options Theme definition options\n   *\n   * Options are:<br/>\n   * - `primary` - `{string}`: The name of the primary palette to use in the theme.<br/>\n   * - `primaryHues` - `{object=}`: Override hues for primary palette.<br/>\n   * - `accent` - `{string}`: The name of the accent palette to use in the theme.<br/>\n   * - `accentHues` - `{object=}`: Override hues for accent palette.<br/>\n   * - `warn` - `{string}`: The name of the warn palette to use in the theme.<br/>\n   * - `warnHues` - `{object=}`: Override hues for warn palette.<br/>\n   * - `background` - `{string}`: The name of the background palette to use in the theme.<br/>\n   * - `backgroundHues` - `{object=}`: Override hues for background palette.<br/>\n   * - `dark` - `{boolean}`: Indicates if it's a dark theme.<br/>\n   * @returns {Promise<string>} A resolved promise with the new theme name.\n   */\n\n  /* @ngInject */\n  function ThemingService($rootScope, $mdUtil, $q, $log) {\n    // Allow us to be invoked via a linking function signature.\n    var applyTheme = function (scope, el) {\n      if (el === undefined) { el = scope; scope = undefined; }\n      if (scope === undefined) { scope = $rootScope; }\n      applyTheme.inherit(el, el);\n    };\n\n    Object.defineProperty(applyTheme, 'THEMES', {\n      get: function () {\n        return angular.extend({}, THEMES);\n      }\n    });\n    Object.defineProperty(applyTheme, 'PALETTES', {\n      get: function () {\n        return angular.extend({}, PALETTES);\n      }\n    });\n    Object.defineProperty(applyTheme, 'ALWAYS_WATCH', {\n      get: function () {\n        return alwaysWatchTheme;\n      }\n    });\n    applyTheme.inherit = inheritTheme;\n    applyTheme.registered = registered;\n    applyTheme.defaultTheme = function() { return defaultTheme; };\n    applyTheme.generateTheme = function(name) { generateTheme(THEMES[name], name, themeConfig.nonce); };\n    applyTheme.defineTheme = function(name, options) {\n      options = options || {};\n\n      var theme = registerTheme(name);\n\n      if (options.primary) {\n        theme.primaryPalette(options.primary, options.primaryHues);\n      }\n      if (options.accent) {\n        theme.accentPalette(options.accent, options.accentHues);\n      }\n      if (options.warn) {\n        theme.warnPalette(options.warn, options.warnHues);\n      }\n      if (options.background) {\n        theme.backgroundPalette(options.background, options.backgroundHues);\n      }\n      if (options.dark){\n        theme.dark();\n      }\n\n      this.generateTheme(name);\n\n      return $q.resolve(name);\n    };\n    applyTheme.setBrowserColor = enableBrowserColor;\n\n    return applyTheme;\n\n    /**\n     * Determine is specified theme name is a valid, registered theme\n     */\n    function registered(themeName) {\n      if (themeName === undefined || themeName === '') return true;\n      return applyTheme.THEMES[themeName] !== undefined;\n    }\n\n    /**\n     * Get theme name for the element, then update with Theme CSS class\n     */\n    function inheritTheme (el, parent) {\n      var ctrl = parent.controller('mdTheme') || el.data('$mdThemeController');\n      var scope = el.scope();\n\n      updateThemeClass(lookupThemeName());\n\n      if (ctrl) {\n        var watchTheme = alwaysWatchTheme ||\n                         ctrl.$shouldWatch ||\n                         $mdUtil.parseAttributeBoolean(el.attr('md-theme-watch'));\n\n        if (watchTheme || ctrl.isAsyncTheme) {\n          var clearNameWatcher = function () {\n            if (unwatch) {\n              unwatch();\n              unwatch = undefined;\n            }\n          };\n\n          var unwatch = ctrl.registerChanges(function(name) {\n            updateThemeClass(name);\n\n            if (!watchTheme) {\n              clearNameWatcher();\n            }\n          });\n\n          if (scope) {\n            scope.$on('$destroy', clearNameWatcher);\n          } else {\n            el.on('$destroy', clearNameWatcher);\n          }\n        }\n      }\n\n      /**\n       * Find the theme name from the parent controller or element data\n       */\n      function lookupThemeName() {\n        // As a few components (dialog) add their controllers later, we should also watch for a controller init.\n        return ctrl && ctrl.$mdTheme || (defaultTheme === 'default' ? '' : defaultTheme);\n      }\n\n      /**\n       * Remove old theme class and apply a new one\n       * NOTE: if not a valid theme name, then the current name is not changed\n       */\n      function updateThemeClass(theme) {\n        if (!theme) return;\n        if (!registered(theme)) {\n          $log.warn('Attempted to use unregistered theme \\'' + theme + '\\'. ' +\n                    'Register it with $mdThemingProvider.theme().');\n        }\n\n        var oldTheme = el.data('$mdThemeName');\n        if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');\n        el.addClass('md-' + theme + '-theme');\n        el.data('$mdThemeName', theme);\n        if (ctrl) {\n          el.data('$mdThemeController', ctrl);\n        }\n      }\n    }\n\n  }\n}\n\nfunction ThemingDirective($mdTheming, $interpolate, $parse, $mdUtil, $q, $log) {\n  return {\n    priority: 101, // has to be more than 100 to be before interpolation (issue on IE)\n    link: {\n      pre: function(scope, el, attrs) {\n        var registeredCallbacks = [];\n\n        var startSymbol = $interpolate.startSymbol();\n        var endSymbol = $interpolate.endSymbol();\n\n        var theme = attrs.mdTheme.trim();\n\n        var hasInterpolation =\n          theme.substr(0, startSymbol.length) === startSymbol &&\n          theme.lastIndexOf(endSymbol) === theme.length - endSymbol.length;\n\n        var oneTimeOperator = '::';\n        var oneTimeBind = attrs.mdTheme\n            .split(startSymbol).join('')\n            .split(endSymbol).join('')\n            .trim()\n            .substr(0, oneTimeOperator.length) === oneTimeOperator;\n\n        var getTheme = function () {\n          var interpolation = $interpolate(attrs.mdTheme)(scope);\n          return $parse(interpolation)(scope) || interpolation;\n        };\n\n        var ctrl = {\n          isAsyncTheme: angular.isFunction(getTheme()) || angular.isFunction(getTheme().then),\n          registerChanges: function (cb, context) {\n            if (context) {\n              cb = angular.bind(context, cb);\n            }\n\n            registeredCallbacks.push(cb);\n\n            return function () {\n              var index = registeredCallbacks.indexOf(cb);\n\n              if (index > -1) {\n                registeredCallbacks.splice(index, 1);\n              }\n            };\n          },\n          $setTheme: function (theme) {\n            if (!$mdTheming.registered(theme)) {\n              $log.warn('attempted to use unregistered theme \\'' + theme + '\\'');\n            }\n\n            ctrl.$mdTheme = theme;\n\n            // Iterating backwards to support unregistering during iteration\n            // http://stackoverflow.com/a/9882349/890293\n            // we don't use `reverse()` of array because it mutates the array and we don't want it\n            // to get re-indexed\n            for (var i = registeredCallbacks.length; i--;) {\n              registeredCallbacks[i](theme);\n            }\n          },\n          $shouldWatch: $mdUtil.parseAttributeBoolean(el.attr('md-theme-watch')) ||\n                        $mdTheming.ALWAYS_WATCH ||\n                        (hasInterpolation && !oneTimeBind)\n        };\n\n        el.data('$mdThemeController', ctrl);\n\n        var setParsedTheme = function (theme) {\n          if (typeof theme === 'string') {\n            return ctrl.$setTheme(theme);\n          }\n\n          $q.when(angular.isFunction(theme) ?  theme() : theme)\n            .then(function(name) {\n              ctrl.$setTheme(name);\n            });\n        };\n\n        setParsedTheme(getTheme());\n\n        var unwatch = scope.$watch(getTheme, function(theme) {\n          if (theme) {\n            setParsedTheme(theme);\n\n            if (!ctrl.$shouldWatch) {\n              unwatch();\n            }\n          }\n        });\n      }\n    }\n  };\n}\n\n/**\n * Special directive that will disable ALL runtime Theme style generation and DOM injection\n *\n * <link rel=\"stylesheet\" href=\"angular-material.min.css\">\n * <link rel=\"stylesheet\" href=\"angular-material.themes.css\">\n *\n * <body md-themes-disabled>\n *  ...\n * </body>\n *\n * Note: Using md-themes-css directive requires the developer to load external\n * theme stylesheets; e.g. custom themes from Material-Tools:\n *\n *       `angular-material.themes.css`\n *\n * Another option is to use the ThemingProvider to configure and disable the attribute\n * conversions; this would obviate the use of the `md-themes-css` directive\n *\n */\nfunction disableThemesDirective() {\n  themeConfig.disableTheming = true;\n\n  // Return a 1x-only, first-match attribute directive\n  return {\n    restrict : 'A',\n    priority : '900'\n  };\n}\n\nfunction ThemableDirective($mdTheming) {\n  return $mdTheming;\n}\n\nfunction parseRules(theme, colorType, rules) {\n  checkValidPalette(theme, colorType);\n\n  rules = rules.replace(/THEME_NAME/g, theme.name);\n  var themeNameRegex = new RegExp('\\\\.md-' + theme.name + '-theme', 'g');\n  // Matches '{{ primary-color }}', etc\n  var hueRegex = new RegExp('([\\'\"])?{{\\\\s*([a-zA-Z]+)-?(color|default)?-?(contrast)?-?((?:\\\\d\\\\.?\\\\d*)|(?:[a-zA-Z]+))?\\\\s*}}([\"\\'])?','g');\n  var simpleVariableRegex = /'?\"?{{\\s*([a-zA-Z]+)-(A?\\d+|hue-[0-3]|shadow|default)-?(contrast)?-?((?:\\d\\.?\\d*)|(?:[a-zA-Z]+))?\\s*}}'?\"?/g;\n  var defaultBgHue = theme.colors['background'].hues['default'];\n  var defaultBgContrastType = PALETTES[theme.colors['background'].name][defaultBgHue].contrastType;\n\n  // find and replace simple variables where we use a specific hue, not an entire palette\n  // eg. \"{{primary-100}}\"\n  // \\(' + THEME_COLOR_TYPES.join('\\|') + '\\)'\n  rules = rules.replace(simpleVariableRegex, function(match, colorType, hue, contrast, opacity) {\n    var regexColorType = colorType;\n    if (colorType === 'foreground') {\n      if (hue === 'shadow') {\n        return theme.foregroundShadow;\n      } else if (theme.foregroundPalette[hue]) {\n        // Use user defined palette number (ie: foreground-2)\n        return rgba(colorToRgbaArray(theme.foregroundPalette[hue]));\n      } else if (theme.foregroundPalette['1']){\n        return rgba(colorToRgbaArray(theme.foregroundPalette['1']));\n      }\n      // Default to background-default-contrast-{opacity}\n      colorType = 'background';\n      contrast = 'contrast';\n      if (!opacity && hue) {\n        // Convert references to legacy hues to opacities (i.e. foreground-4 to *-divider)\n        switch (hue) {\n          // hue-1 uses default opacity\n          case '2':\n            opacity = 'secondary';\n            break;\n          case '3':\n            opacity = 'disabled';\n            break;\n          case '4':\n            opacity = 'divider';\n        }\n      }\n      hue = 'default';\n    }\n\n    // `default` is also accepted as a hue-value, because the background palettes are\n    // using it as a name for the default hue.\n    if (hue.indexOf('hue') === 0 || hue === 'default') {\n      hue = theme.colors[colorType].hues[hue];\n    }\n\n    var colorDetails = (PALETTES[ theme.colors[colorType].name ][hue] || '');\n\n    // If user has specified a foreground color, use those\n    if (colorType === 'background' && contrast && regexColorType !== 'foreground' &&\n        colorDetails.contrastType === defaultBgContrastType) {\n      // Don't process if colorType was changed\n      switch (opacity) {\n        case 'secondary':\n        case 'icon':\n          if (theme.foregroundPalette['2']) {\n            return rgba(colorToRgbaArray(theme.foregroundPalette['2']));\n          }\n          break;\n        case 'disabled':\n        case 'hint':\n          if (theme.foregroundPalette['3']) {\n            return rgba(colorToRgbaArray(theme.foregroundPalette['3']));\n          }\n          break;\n        case 'divider':\n          if (theme.foregroundPalette['4']) {\n            return rgba(colorToRgbaArray(theme.foregroundPalette['4']));\n          }\n          break;\n        default:\n          if (theme.foregroundPalette['1']) {\n            return rgba(colorToRgbaArray(theme.foregroundPalette['1']));\n          }\n          break;\n      }\n    }\n\n    if (contrast && opacity) {\n      opacity = colorDetails.opacity[opacity] || opacity;\n    }\n\n    return rgba(colorDetails[contrast ? 'contrast' : 'value'], opacity);\n  });\n\n  var generatedRules = [];\n\n  // For each type, generate rules for each hue (ie. default, md-hue-1, md-hue-2, md-hue-3)\n  angular.forEach(['default', 'hue-1', 'hue-2', 'hue-3'], function(hueName) {\n    var newRule = rules\n      .replace(hueRegex, function(match, _, matchedColorType, hueType, contrast, opacity) {\n        var color = theme.colors[matchedColorType];\n        var palette = PALETTES[color.name];\n        var hueValue = color.hues[hueName];\n        if (contrast && opacity) {\n          opacity = palette[hueValue].opacity[opacity] || opacity;\n        }\n        return rgba(palette[hueValue][hueType === 'color' ? 'value' : 'contrast'], opacity);\n      });\n    if (hueName !== 'default') {\n      newRule = newRule.replace(themeNameRegex, '.md-' + theme.name + '-theme.md-' + hueName);\n    }\n\n    // Don't apply a selector rule to the default theme, making it easier to override\n    // styles of the base-component\n    if (theme.name === 'default') {\n      var themeRuleRegex = /((?:\\s|>|\\.|\\w|-|:|\\(|\\)|\\[|]|\"|'|=)*)\\.md-default-theme((?:\\s|>|\\.|\\w|-|:|\\(|\\)|\\[|]|\"|'|=)*)/g;\n\n      newRule = newRule.replace(themeRuleRegex, function(match, start, end) {\n        return match + ', ' + start + end;\n      });\n    }\n    generatedRules.push(newRule);\n  });\n\n  return generatedRules;\n}\n\nvar rulesByType = {};\n\n// Generate our themes at run time given the state of THEMES and PALETTES\nfunction generateAllThemes($injector, $mdTheming) {\n  var head = document.head;\n  var firstChild = head ? head.firstElementChild : null;\n  var themeCss = !themeConfig.disableTheming && $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : '';\n\n  // Append our custom registered styles to the theme stylesheet.\n  themeCss += themeConfig.registeredStyles.join('');\n\n  if (!firstChild) return;\n  if (themeCss.length === 0) return; // no rules, so no point in running this expensive task\n\n  // Expose contrast colors for palettes to ensure that text is always readable\n  angular.forEach(PALETTES, sanitizePalette);\n\n  // MD_THEME_CSS is a string generated by the build process that includes all the themeable\n  // components as templates\n\n  // Break the CSS into individual rules\n  var rules = splitCss(themeCss).map(function(rule) {\n    return rule.trim();\n  });\n\n  THEME_COLOR_TYPES.forEach(function(type) {\n    rulesByType[type] = '';\n  });\n\n  // Sort the rules based on type, allowing us to do color substitution on a per-type basis\n  rules.forEach(function(rule) {\n    // First: test that if the rule has '.md-accent', it goes into the accent set of rules\n    for (var i = 0, type; type = THEME_COLOR_TYPES[i]; i++) {\n      if (rule.indexOf('.md-' + type) > -1) {\n        return rulesByType[type] += rule;\n      }\n    }\n\n    // If no eg 'md-accent' class is found, try to just find 'accent' in the rule and guess from\n    // there\n    for (i = 0; type = THEME_COLOR_TYPES[i]; i++) {\n      if (rule.indexOf(type) > -1) {\n        return rulesByType[type] += rule;\n      }\n    }\n\n    // Default to the primary array\n    return rulesByType[DEFAULT_COLOR_TYPE] += rule;\n  });\n\n  // If themes are being generated on-demand, quit here. The user will later manually\n  // call generateTheme to do this on a theme-by-theme basis.\n  if (themeConfig.generateOnDemand) return;\n\n  angular.forEach($mdTheming.THEMES, function(theme) {\n    if (!GENERATED[theme.name] && !($mdTheming.defaultTheme() !== 'default' && theme.name === 'default')) {\n      generateTheme(theme, theme.name, themeConfig.nonce);\n    }\n  });\n\n\n  // *************************\n  // Internal functions\n  // *************************\n\n  /**\n   * The user specifies a 'default' contrast color as either light or dark, then explicitly lists\n   * which hues are the opposite contrast (eg. A100 has dark, A200 has light).\n   * @param {!object} palette to sanitize\n   */\n  function sanitizePalette(palette) {\n    var defaultContrast = palette.contrastDefaultColor;\n    var lightColors = palette.contrastLightColors || [];\n    var strongLightColors = palette.contrastStrongLightColors || [];\n    var darkColors = palette.contrastDarkColors || [];\n\n    // These colors are provided as space-separated lists\n    if (typeof lightColors === 'string') lightColors = lightColors.split(' ');\n    if (typeof strongLightColors === 'string') strongLightColors = strongLightColors.split(' ');\n    if (typeof darkColors === 'string') darkColors = darkColors.split(' ');\n\n    // Cleanup after ourselves\n    delete palette.contrastDefaultColor;\n    delete palette.contrastLightColors;\n    delete palette.contrastStrongLightColors;\n    delete palette.contrastDarkColors;\n\n    /**\n     * @param {string} hueName\n     * @return {'dark'|'light'|'strongLight'}\n     */\n    function getContrastType(hueName) {\n      if (defaultContrast === 'light' ? darkColors.indexOf(hueName) !== -1  :\n        (lightColors.indexOf(hueName) === -1 && strongLightColors.indexOf(hueName) === -1)) {\n        return 'dark';\n      }\n      if (strongLightColors.indexOf(hueName) !== -1) {\n        return 'strongLight';\n      }\n      return 'light';\n    }\n\n    /**\n     * @param {'dark'|'light'|'strongLight'} contrastType\n     * @return {[number, number, number]} [red, green, blue] array\n     */\n    function getContrastColor(contrastType) {\n      switch (contrastType) {\n        default:\n        case 'strongLight':\n          return STRONG_LIGHT_CONTRAST_COLOR;\n        case 'light':\n          return LIGHT_CONTRAST_COLOR;\n        case 'dark':\n          return DARK_CONTRAST_COLOR;\n      }\n    }\n\n    /**\n     * @param {'dark'|'light'|'strongLight'} contrastType\n     * @return {{secondary: number, divider: number, hint: number, icon: number, disabled: number}}\n     */\n    function getOpacityValues(contrastType) {\n      switch (contrastType) {\n        default:\n        case 'strongLight':\n          return STRONG_LIGHT_CONTRAST_OPACITY;\n        case 'light':\n          return LIGHT_CONTRAST_OPACITY;\n        case 'dark':\n          return DARK_CONTRAST_OPACITY;\n      }\n    }\n    // Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR }\n    angular.forEach(palette, function(hueValue, hueName) {\n      if (angular.isObject(hueValue)) return; // Already converted\n      // Map everything to rgb colors\n      var rgbValue = colorToRgbaArray(hueValue);\n      if (!rgbValue) {\n        throw new Error(\"Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.\"\n                        .replace('%1', hueValue)\n                        .replace('%2', palette.name)\n                        .replace('%3', hueName));\n      }\n\n      var contrastType = getContrastType(hueName);\n      palette[hueName] = {\n        hex: palette[hueName],\n        value: rgbValue,\n        contrastType: contrastType,\n        contrast: getContrastColor(contrastType),\n        opacity: getOpacityValues(contrastType)\n      };\n    });\n  }\n\n  /**\n   * @param {string} themeCss\n   * @returns {[]} a string representing a CSS file that is split, producing an array with a rule\n   *  at each index.\n   */\n  function splitCss(themeCss) {\n    var result = [];\n    var currentRule = '';\n    var openedCurlyBrackets = 0;\n    var closedCurlyBrackets = 0;\n\n    for (var i = 0; i < themeCss.length; i++) {\n      var character = themeCss.charAt(i);\n\n      // Check for content in quotes\n      if (character === '\\'' || character === '\"') {\n        // Append text in quotes to current rule\n        var textInQuotes = themeCss.substring(i, themeCss.indexOf(character, i + 1));\n        currentRule += textInQuotes;\n\n        // Jump to the closing quote char\n        i += textInQuotes.length;\n      } else {\n        currentRule += character;\n\n        if (character === '}') {\n          closedCurlyBrackets++;\n          if (closedCurlyBrackets === openedCurlyBrackets) {\n            closedCurlyBrackets = 0;\n            openedCurlyBrackets = 0;\n            result.push(currentRule);\n            currentRule = '';\n          }\n        } else if (character === '{') {\n          openedCurlyBrackets++;\n        }\n      }\n    }\n    // Add comments added after last valid rule.\n    if (currentRule !== '') {\n      result.push(currentRule);\n    }\n\n    return result;\n  }\n}\n\nfunction generateTheme(theme, name, nonce) {\n  var head = document.head;\n  var firstChild = head ? head.firstElementChild : null;\n\n  if (!GENERATED[name]) {\n    // For each theme, use the color palettes specified for\n    // `primary`, `warn` and `accent` to generate CSS rules.\n    THEME_COLOR_TYPES.forEach(function(colorType) {\n      var styleStrings = parseRules(theme, colorType, rulesByType[colorType]);\n      while (styleStrings.length) {\n        var styleContent = styleStrings.shift();\n        if (styleContent) {\n          var style = document.createElement('style');\n          style.setAttribute('md-theme-style', '');\n          if (nonce) {\n            style.setAttribute('nonce', nonce);\n          }\n          style.appendChild(document.createTextNode(styleContent));\n          head.insertBefore(style, firstChild);\n        }\n      }\n    });\n\n    GENERATED[theme.name] = true;\n  }\n\n}\n\n\nfunction checkValidPalette(theme, colorType) {\n  // If theme attempts to use a palette that doesnt exist, throw error\n  if (!PALETTES[ (theme.colors[colorType] || {}).name ]) {\n    throw new Error(\n      \"You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3\"\n                    .replace('%1', theme.name)\n                    .replace('%2', colorType)\n                    .replace('%3', Object.keys(PALETTES).join(', '))\n    );\n  }\n}\n\n/**\n * @param {string} clr rbg or rgba color\n * @return {number[]|undefined} [red, green, blue] array if it can be computed\n */\nfunction colorToRgbaArray(clr) {\n  if (angular.isArray(clr) && clr.length === 3) return clr;\n  if (/^rgb/.test(clr)) {\n    return clr.replace(/(^\\s*rgba?\\(|\\)\\s*$)/g, '').split(',').map(function(value, i) {\n      return i === 3 ? parseFloat(value) : parseInt(value, 10);\n    });\n  }\n  if (clr.charAt(0) === '#') clr = clr.substring(1);\n  if (!/^([a-fA-F0-9]{3}){1,2}$/g.test(clr)) return;\n\n  var dig = clr.length / 3;\n  var red = clr.substr(0, dig);\n  var grn = clr.substr(dig, dig);\n  var blu = clr.substr(dig * 2);\n  if (dig === 1) {\n    red += red;\n    grn += grn;\n    blu += blu;\n  }\n  return [parseInt(red, 16), parseInt(grn, 16), parseInt(blu, 16)];\n}\n\nfunction rgba(rgbArray, opacity) {\n  if (!rgbArray) return \"rgb('0,0,0')\";\n\n  if (rgbArray.length === 4) {\n    rgbArray = angular.copy(rgbArray);\n    opacity ? rgbArray.pop() : opacity = rgbArray.pop();\n  }\n  return opacity && (typeof opacity == 'number' || (typeof opacity == 'string' && opacity.length)) ?\n    'rgba(' + rgbArray.join(',') + ',' + opacity + ')' :\n    'rgb(' + rgbArray.join(',') + ')';\n}\n\n\n})(window.angular);\n"
  },
  {
    "path": "src/core/services/theming/theming.spec.js",
    "content": "describe('$mdThemingProvider', function() {\n\n  var themingProvider;\n  var defaultTheme;\n  var testTheme;\n  var testPalette;\n  var startAngular = inject;\n\n  beforeEach(function() {\n\n    module('material.core', function($provide) {\n      /**\n       *  material-mocks.js clears the $MD_THEME_CSS for Karma testing performance\n       *  performance optimizations. Here inject some length into our theme_css so that\n       *  palettes are parsed/generated\n       */\n      $provide.constant('$MD_THEME_CSS', '/**/');\n    });\n\n  });\n\n  function setup() {\n    module('material.core', function($mdThemingProvider) {\n      themingProvider = $mdThemingProvider;\n\n      testPalette = themingProvider._PALETTES.testPalette = themingProvider._PALETTES.otherTestPalette = {\n        '50': 'ffebee',\n        '100': 'ffcdd2',\n        '200': 'ef9a9a',\n        '300': 'e57373',\n        '400': 'ef5350',\n        '500': 'f44336',\n        '600': 'e53935',\n        '700': 'd32f2f',\n        '800': 'c62828',\n        '900': 'b71c1c',\n        'A100': 'ff8a80',\n        'A200': 'ff5252',\n        'A400': 'ff1744',\n        'A700': 'd50000',\n        'contrastDefaultColor': 'light',\n        'contrastDarkColors': ['50', '100', '200', '300', '400', 'A100'],\n        'contrastStrongLightColors': ['900']\n      };\n\n\n      defaultTheme = themingProvider.theme('default')\n        .primaryPalette('testPalette')\n        .warnPalette('testPalette')\n        .accentPalette('otherTestPalette')\n        .backgroundPalette('testPalette');\n\n      testTheme = themingProvider.theme('test');\n\n    });\n    startAngular();\n  }\n\n  describe('creating themes', function() {\n    beforeEach(setup);\n\n    it('allows registering of a theme', function() {\n      expect(testTheme.name).toBe('test');\n      expect(testTheme.dark).toBeOfType('function');\n      expect(testTheme.colors).toBeOfType('object');\n    });\n    it('defaults to light theme', function() {\n      expect(testTheme.foregroundPalette.name).toBe('dark');\n      expect(testTheme.foregroundShadow).toBeFalsy();\n    });\n\n    describe('registering a dark theme', function() {\n      it('changes the foreground color & shadow', function() {\n        testTheme.dark();\n        expect(testTheme.foregroundPalette.name).toBe('light');\n        expect(testTheme.foregroundShadow).toBeTruthy();\n      });\n      it('changes the existing hues to match the dark or light defaults, if the hues are still default', function() {\n        var darkBackground = themingProvider._DARK_DEFAULT_HUES.background;\n        var lightBackground = themingProvider._LIGHT_DEFAULT_HUES.background;\n        testTheme.dark();\n        expect(testTheme.colors.background.hues['hue-3']).toBe(darkBackground['hue-3']);\n        testTheme.dark(false);\n        expect(testTheme.colors.background.hues['hue-3']).toBe(lightBackground['hue-3']);\n        testTheme.dark();\n        expect(testTheme.colors.background.hues['hue-3']).toBe(darkBackground['hue-3']);\n\n        testTheme.backgroundPalette('testPalette', {\n          'hue-3': '50'\n        });\n        testTheme.dark(false);\n        expect(testTheme.colors.background.hues['hue-3']).toBe('50');\n      });\n    });\n\n    describe('theme extension', function() {\n      var parentTheme;\n      beforeEach(function() {\n        themingProvider.definePalette('parentPalette', angular.extend({}, testPalette));\n        parentTheme = themingProvider.theme('parent').primaryPalette('parentPalette');\n      });\n      it('allows extension by string', function() {\n        var childTheme = themingProvider.theme('child', 'parent');\n        expect(childTheme.colors.primary.name).toBe('parentPalette');\n      });\n      it('allows extension by reference', function() {\n        var childTheme = themingProvider.theme('child', parentTheme);\n        expect(childTheme.colors.primary.name).toBe('parentPalette');\n      });\n      it('extends the default theme automatically', function() {\n        var childTheme = themingProvider.theme('child');\n        expect(childTheme.colors.primary.name).toEqual(defaultTheme.colors.primary.name);\n      });\n    });\n\n    describe('providing hue map for a color', function() {\n      it('extends default hue map automatically', function() {\n        expect(testTheme.colors.primary.hues).toEqual(defaultTheme.colors.primary.hues);\n      });\n      it('allows specifying a custom hue map', function() {\n        expect(testTheme.colors.primary.hues['hue-1']).not.toBe('50');\n        testTheme.primaryPalette('testPalette', {\n          'hue-1': '50'\n        });\n        expect(testTheme.colors.primary.hues['hue-1']).toBe('50');\n      });\n      it('errors on invalid key in hue map', function() {\n        expect(function() {\n          testTheme.primaryPalette('testPalette', {\n            'invalid-key': '100'\n          });\n        }).toThrow();\n      });\n      it('errors on invalid value in hue map', function() {\n        expect(function() {\n          testTheme.primaryPalette('testPalette', {\n            'hue-1': 'invalid-value'\n          });\n        }).toThrow();\n      });\n    });\n\n  });\n\n  describe('registering palettes', function() {\n    beforeEach(setup);\n    it('requires all hues specified', function() {\n      var colors = {\n        '50': ' ', '100': ' ', '200': ' ', '300': ' ', '400': ' ',\n        '500': ' ', '600': ' ', '700': ' ', '800': ' ', '900': ' ',\n        'A100': ' ', 'A200': ' ', 'A400': ' ', 'A700': ' '\n      };\n      themingProvider.definePalette('newPalette', colors);\n      delete colors['50'];\n      expect(function() {\n        themingProvider.definePalette('newPaletteTwo', colors);\n      }).toThrow();\n    });\n    it('allows to extend an existing palette', function() {\n      themingProvider.definePalette('extended', themingProvider.extendPalette('testPalette', {\n        '50': 'newValue'\n      }));\n      expect(themingProvider._PALETTES.extended['100']).toEqual(testPalette['100']);\n      expect(themingProvider._PALETTES.extended['50']).toEqual('newValue');\n    });\n  });\n\n  describe('css template parsing', function() {\n    beforeEach(setup);\n\n    function parse(str) {\n      return themingProvider._parseRules(testTheme, 'primary', str)\n        .join('')\n        .split(/}(?!(}|'|\"|;))/)\n        .filter(function(val) { return !!val; })\n        .map(function(rule) {\n          rule += '}';\n          return {\n            content: (rule.match(/{\\s*(.*?)\\s*}/) || [])[1] || null,\n            hue: (rule.match(/md-(hue-\\d)/) || [])[1] || null,\n            type: (rule.match(/(primary)/) || [])[1] || null\n          };\n        });\n    }\n\n    it('errors if given a theme with invalid palettes', function() {\n      testTheme.primaryPalette('invalidPalette');\n      expect(function() {\n        themingProvider._parseRules(testTheme, 'primary', '').join('');\n      }).toThrow();\n    });\n\n    it('drops the default theme name from the selectors', function() {\n      expect(themingProvider._parseRules(\n        defaultTheme, 'primary', '.md-THEME_NAME-theme.md-button { }'\n      ).join('')).toContain('.md-button { }');\n    });\n\n    it('replaces THEME_NAME', function() {\n      expect(themingProvider._parseRules(\n        testTheme, 'primary', '.md-THEME_NAME-theme {}'\n      ).join('')).toContain('.md-test-theme {}');\n    });\n\n    describe('background palette', function() {\n\n      function getRgbaBackgroundHue(hue) {\n        return themingProvider._rgba(themingProvider._PALETTES.testPalette[hue].value);\n      }\n\n      it('should parse for a light theme probably', function() {\n        testTheme.dark(false);\n\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('50') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-1}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('A100') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-2}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('100') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-3}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('300') + ';');\n      });\n\n      it('should parse for a dark theme probably', function() {\n        testTheme.dark(true);\n\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('A400') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-1}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('800') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-2}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('900') + ';');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-hue-3}}\"; }')[0].content)\n          .toEqual('color: ' + getRgbaBackgroundHue('A200') + ';');\n      });\n\n    });\n\n    describe('parses foreground text and shadow', function() {\n      it('for a light theme', function() {\n        testTheme.dark(false);\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-1}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-2}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.54);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-3}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.38);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-4}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.12);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-shadow}}\"; }')[0].content)\n          .toEqual('color: ;');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-icon}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.54);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.54);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-disabled}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.38);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-hint}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.38);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-divider}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.12);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-0.05}}\"; }')[0].content)\n          .toEqual('color: rgba(0,0,0,0.05);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.7);');\n      });\n\n      it('for a dark theme', function() {\n        testTheme.dark();\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-1}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-2}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.7);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-3}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.5);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-4}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.12);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-shadow}}\"; }')[0].content)\n          .toEqual('color: 1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-icon}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.7);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-disabled}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.5);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-hint}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.5);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-divider}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.12);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-0.05}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.05);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-900-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,255,255);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-900-contrast-icon}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,1);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast-icon}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.7);');\n      });\n      it('override foreground color', function() {\n        testTheme.dark(false);\n        testTheme.foregroundPalette = {\n          '1': 'ff0000',\n          '2': '00ff00',\n          '3': '0000ff',\n          '4': 'ffff00'\n        };\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-1}}\"; }')[0].content)\n          .toEqual('color: rgb(255,0,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-2}}\"; }')[0].content)\n          .toEqual('color: rgb(0,255,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-3}}\"; }')[0].content)\n          .toEqual('color: rgb(0,0,255);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-4}}\"; }')[0].content)\n          .toEqual('color: rgb(255,255,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{foreground-shadow}}\"; }')[0].content)\n          .toEqual('color: ;');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,0,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-icon}}\"; }')[0].content)\n          .toEqual('color: rgb(0,255,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgb(0,255,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-disabled}}\"; }')[0].content)\n          .toEqual('color: rgb(0,0,255);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-hint}}\"; }')[0].content)\n          .toEqual('color: rgb(0,0,255);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-default-contrast-divider}}\"; }')[0].content)\n          .toEqual('color: rgb(255,255,0);');\n\n        // override colors of same contrast type\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-50-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,0,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-100-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,0,0);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-200-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,0,0);');\n\n        // should not override the following\n        expect(parse('.md-THEME_NAME-theme { color: \"{{background-900-contrast}}\"; }')[0].content)\n          .toEqual('color: rgb(255,255,255);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.87);');\n        expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast-secondary}}\"; }')[0].content)\n          .toEqual('color: rgba(255,255,255,0.7);');\n      });\n    });\n\n    it('parses contrast colors', function() {\n      testTheme.primaryPalette('testPalette', {\n        'default': '50'\n      });\n      expect(parse('.md-THEME_NAME-theme { color: \"{{primary-contrast}}\"; } ')[0].content)\n        .toEqual('color: rgba(0,0,0,0.87);');\n\n      testTheme.primaryPalette('testPalette', {\n        'default': '800'\n      });\n      expect(parse('{ color: \"{{primary-contrast}}\"; }')[0].content)\n        .toEqual('color: rgba(255,255,255,0.87);');\n\n      testTheme.primaryPalette('testPalette', {\n        'default': '900'\n      });\n      expect(parse('{ color: \"{{primary-contrast}}\"; }')[0].content)\n        .toEqual('color: rgb(255,255,255);');\n    });\n\n    it('generates base, non-colorType-specific, rules', function() {\n      var accent100 = themingProvider._rgba(themingProvider._PALETTES.testPalette['100'].value);\n      var result = parse('.md-THEME_NAME-theme { color: \"{{accent-100}}\"; }');\n      expect(result[0].content).toEqual('color: ' + accent100 + ';');\n      expect(result[0].hue).toBeFalsy();\n      expect(result[1].content).toEqual('color: ' + accent100 + ';');\n      expect(result[1].hue).toBe('hue-1');\n      expect(result[2].content).toEqual('color: ' + accent100 + ';');\n      expect(result[2].hue).toBe('hue-2');\n      expect(result[3].content).toEqual('color: ' + accent100 + ';');\n      expect(result[3].hue).toBe('hue-3');\n      expect(result.length).toBe(4);\n    });\n\n    it('generates colorType-specific rules for each hue', function() {\n      var primary = themingProvider._rgba(themingProvider._PALETTES.testPalette['500'].value);\n      var hue1 = themingProvider._rgba(themingProvider._PALETTES.testPalette['300'].value);\n      var hue2 = themingProvider._rgba(themingProvider._PALETTES.testPalette['800'].value);\n      var hue3 = themingProvider._rgba(themingProvider._PALETTES.testPalette.A100.value);\n      var result = parse('.md-THEME_NAME-theme.md-primary { color: \"{{primary-color}}\"; }');\n      expect(result[0]).toEqual({content: 'color: ' + primary + ';', hue: null, type: 'primary'});\n      expect(result[1]).toEqual({content: 'color: ' + hue1 + ';', hue: 'hue-1', type: 'primary'});\n      expect(result[2]).toEqual({content: 'color: ' + hue2 + ';', hue: 'hue-2', type: 'primary'});\n      expect(result[3]).toEqual({content: 'color: ' + hue3 + ';', hue: 'hue-3', type: 'primary'});\n      expect(result.length).toEqual(4);\n    });\n\n    it('should generate styles when a md-something selector has an expression for a different palette', function() {\n      // The selector has `md-primary` in the name, but the expression is for md-warn.\n      var result = parse('.md-THEME_NAME-theme.md-primary { color: \"{{warn-color}}\"; }');\n\n      // This should not leave an unevaluated expression in the output.\n      expect(result.join(' ')).not.toContain('{{');\n    });\n\n    it('generates colorType-specific rules for each hue with opacity', function() {\n      var primary = themingProvider._rgba(themingProvider._PALETTES.testPalette['500'].value, '0.3');\n      var hue1 = themingProvider._rgba(themingProvider._PALETTES.testPalette['300'].value, '0.3');\n      var hue2 = themingProvider._rgba(themingProvider._PALETTES.testPalette['800'].value, '0.3');\n      var hue3 = themingProvider._rgba(themingProvider._PALETTES.testPalette.A100.value, '0.3');\n      var result = parse('.md-THEME_NAME-theme.md-primary { color: \"{{primary-color-0.3}}\"; }');\n      expect(result[0]).toEqual({content: 'color: ' + primary + ';', hue: null, type: 'primary'});\n      expect(result[1]).toEqual({content: 'color: ' + hue1 + ';', hue: 'hue-1', type: 'primary'});\n      expect(result[2]).toEqual({content: 'color: ' + hue2 + ';', hue: 'hue-2', type: 'primary'});\n      expect(result[3]).toEqual({content: 'color: ' + hue3 + ';', hue: 'hue-3', type: 'primary'});\n      expect(result.length).toEqual(4);\n    });\n    describe('allows selecting a colorType', function() {\n      it('hue value', function() {\n        var A400 = themingProvider._rgba(themingProvider._PALETTES.testPalette.A400.value);\n        var result = parse('.md-THEME_NAME-theme.md-primary { color: {{primary-A400}}; }');\n        expect(result[0]).toEqual({content: 'color: ' + A400 + ';', hue: null, type: 'primary'});\n        expect(result[1]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-1', type: 'primary'});\n        expect(result[2]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-2', type: 'primary'});\n        expect(result[3]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-3', type: 'primary'});\n        expect(result.length).toEqual(4);\n      });\n      it('hue value with opacity', function() {\n        var A400 = themingProvider._rgba(themingProvider._PALETTES.testPalette.A400.value, '0.25');\n        var result = parse('.md-THEME_NAME-theme.md-primary { color: {{primary-A400-0.25}}; }');\n        expect(result[0]).toEqual({content: 'color: ' + A400 + ';', hue: null, type: 'primary'});\n        expect(result[1]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-1', type: 'primary'});\n        expect(result[2]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-2', type: 'primary'});\n        expect(result[3]).toEqual({content: 'color: ' + A400 + ';', hue: 'hue-3', type: 'primary'});\n        expect(result.length).toEqual(4);\n      });\n    });\n  });\n\n  describe('browser color', function () {\n    beforeEach(function () {\n      setup();\n      angular.element(document.getElementsByTagName('meta')).remove();\n    });\n\n    it('should use default primary color at the meta tag', function () {\n      var name = 'theme-color';\n      var content = '#' + themingProvider._PALETTES.testPalette['800'].hex;\n\n      expect(document.getElementsByName(name).length).toBe(0);\n\n      themingProvider.enableBrowserColor();\n\n      expect(document.getElementsByName(name).length).toBe(1);\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n    });\n\n    it('should use default primary color with hue `200`', function () {\n      var name = 'theme-color';\n\n      var hue = '200';\n\n      var content = '#' + themingProvider._PALETTES.testPalette[hue].hex;\n\n      expect(document.getElementsByName(name).length).toBe(0);\n\n      themingProvider.enableBrowserColor({ hue: hue });\n\n      expect(document.getElementsByName(name).length).toBe(1);\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n    });\n\n    it('should use red palette', function () {\n      var name = 'theme-color';\n\n      var content = themingProvider._PALETTES.red['800'].hex;\n\n      expect(document.getElementsByName(name).length).toBe(0);\n\n      themingProvider.enableBrowserColor({ palette: 'red' });\n\n      expect(document.getElementsByName(name).length).toBe(1);\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n    });\n\n    it('should use test theme', function () {\n      var name = 'theme-color';\n\n      var content = '#' + themingProvider._PALETTES.testPalette['800'].hex;\n\n      expect(document.getElementsByName(name).length).toBe(0);\n\n      themingProvider.enableBrowserColor({ theme: 'test' });\n\n      expect(document.getElementsByName(name).length).toBe(1);\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(content);\n    });\n  });\n\n  describe('configuration', function () {\n    beforeEach(function () {\n      module('material.core', function($mdThemingProvider) {\n            themingProvider = $mdThemingProvider;\n      });\n      startAngular();\n    });\n\n    it('should have access to read-only configuration', function () {\n      var config = themingProvider.configuration();\n\n      expect(config.disableTheming).toBe(false);\n      expect(config.generateOnDemand).toBe(false);\n      expect(config.registeredStyles.length).toBe(0);\n      expect(config.nonce).toBe(null);\n      expect(config.alwaysWatchTheme).toBe(false);\n\n      // Change local copies\n      config.disableTheming = true;\n      config.generateOnDemand = true;\n      config.registeredStyles.push(\"Something\");\n      config.nonce = 'myNonce';\n      config.alwaysWatchTheme = true;\n\n      var config2 = themingProvider.configuration();\n\n      // Confirm provider returned values are not altered\n      expect(config2.disableTheming).toBe(false);\n      expect(config2.generateOnDemand).toBe(false);\n      expect(config2.registeredStyles.length).toBe(0);\n      expect(config2.nonce).toBe(null);\n      expect(config2.alwaysWatchTheme).toBe(false);\n    });\n  });\n});\n\ndescribe('$mdThemeProvider with custom styles', function() {\n  it('appends the custom styles to the end of the $MD_THEME_CSS string', function() {\n    module('material.core', function($mdThemingProvider) {\n      $mdThemingProvider.registerStyles('/*test*/');\n      $mdThemingProvider.theme('register-custom-styles');\n    });\n\n    inject(function($MD_THEME_CSS) {\n      // Verify that $MD_THEME_CSS is still set to '/**/' in the test environment.\n      // Check angular-material-mocks.js for $MD_THEME_CSS latest value if this test starts to fail.\n      expect($MD_THEME_CSS).toBe('/**/');\n    });\n\n    // Find the string '/**//*test*/' in the head tag.\n    expect(document.head.innerHTML).toContain('/*test*/');\n  });\n});\n\ndescribe('$mdThemeProvider with on-demand generation', function() {\n  var $mdTheming;\n\n  function getThemeStyleElements() {\n    return document.head.querySelectorAll('style[md-theme-style]');\n  }\n\n  function cleanThemeStyleElements() {\n    angular.forEach(getThemeStyleElements(), function(style) {\n      document.head.removeChild(style);\n    });\n  }\n\n  beforeEach(module('material.core', function($provide, $mdThemingProvider) {\n    // Theming requires that there is at least one element present in the document head.\n    cleanThemeStyleElements();\n\n    // Use a single simple style rule for which we can check presence / absense.\n    $provide.constant('$MD_THEME_CSS',\n        \"sparkle.md-THEME_NAME-theme { color: '{{primary-color}}' }\");\n\n    $mdThemingProvider.theme('sweden')\n        .primaryPalette('light-blue')\n        .accentPalette('yellow');\n\n    $mdThemingProvider.theme('belarus')\n        .primaryPalette('red')\n        .accentPalette('green');\n\n    $mdThemingProvider.generateThemesOnDemand(true);\n  }));\n\n  beforeEach(inject(function(_$mdTheming_) {\n    $mdTheming = _$mdTheming_;\n  }));\n\n  it('should not add any theme styles automatically', function() {\n    var styles = getThemeStyleElements();\n    expect(styles.length).toBe(0);\n  });\n\n  it('should add themes on-demand', function() {\n    $mdTheming.generateTheme('sweden');\n\n    var styles = getThemeStyleElements();\n    // One style tag for each default hue (default, hue-1, hue-2, hue-3).\n    expect(styles.length).toBe(4);\n    expect(document.head.innerHTML).toMatch(/md-sweden-theme/);\n    expect(document.head.innerHTML).not.toMatch(/md-belarus-theme/);\n\n    $mdTheming.generateTheme('belarus');\n    styles = getThemeStyleElements();\n    expect(styles.length).toBe(8);\n    expect(document.head.innerHTML).toMatch(/md-sweden-theme/);\n    expect(document.head.innerHTML).toMatch(/md-belarus-theme/);\n  });\n});\n\ndescribe('$mdThemeProvider with a theme that ends in a newline', function() {\n  beforeEach(function() {\n    module('material.core', function($provide) {\n      // Note that it should end with a newline\n      $provide.constant('$MD_THEME_CSS', \"sparkle.md-THEME_NAME-theme { color: '{{primary-color}}' }\\n\");\n    });\n\n    inject(function($mdTheming) {});\n  });\n\n  it('should not add an extra closing bracket if the stylesheet ends with a newline', function() {\n    var style = document.head.querySelector('style[md-theme-style]');\n    expect(style.innerText).not.toContain('}}');\n    style.parentNode.removeChild(style);\n  });\n});\n\ndescribe('$mdThemeProvider with disabled themes', function() {\n\n  function getThemeStyleElements() {\n    return document.head.querySelectorAll('style[md-theme-style]');\n  }\n\n  function cleanThemeStyleElements() {\n    angular.forEach(getThemeStyleElements(), function(style) {\n      document.head.removeChild(style);\n    });\n  }\n  beforeEach(function() {\n\n    module('material.core', function($provide, $mdThemingProvider) {\n      // Use a single simple style rule for which we can check presence / absense.\n      $provide.constant('$MD_THEME_CSS', \"sparkle.md-THEME_NAME-theme { color: '{{primary-color}}' }\");\n\n      $mdThemingProvider\n        .theme('belarus')\n        .primaryPalette('red')\n        .accentPalette('green');\n\n    });\n  });\n\n  afterEach(function() {\n    cleanThemeStyleElements();\n  });\n\n  describe('can disable themes programmatically', function() {\n    beforeEach(function() {\n      cleanThemeStyleElements();\n\n      module('material.core', function($mdThemingProvider) {\n        $mdThemingProvider.disableTheming();\n      });\n    });\n\n    it('should not add any theme styles', function() {\n      var styles = getThemeStyleElements();\n      expect(styles.length).toBe(0);\n    });\n  });\n\n  describe('can disable themes declaratively', function() {\n    beforeEach(function() {\n      // Set the body attribute BEFORE the theming module is loaded\n      var el = document.body;\n          el.setAttribute('md-themes-disabled', '');\n    });\n\n    afterEach(function() {\n      var el = document.body;\n          el.removeAttribute('md-themes-disabled');\n    });\n\n    it('should not set any classnames', function() {\n      inject(function($rootScope, $compile, $mdTheming) {\n        var el = $compile('<h1>Test</h1>')($rootScope);\n        $mdTheming(el);\n        expect(el.hasClass('md-default-theme')).toBe(false);\n      });\n    });\n\n    it('should not inject any styles', function() {\n      inject(function($rootScope, $compile, $mdTheming) {\n        var el = $compile('<h1>Test</h1>')($rootScope);\n        $mdTheming(el);\n\n        var styles = getThemeStyleElements();\n        expect(styles.length).toBe(0);\n      });\n    });\n\n  });\n});\n\ndescribe('$mdThemeProvider with nonce', function() {\n  beforeEach(function() {\n\n    module('material.core', function($provide) {\n      /**\n       *  material-mocks.js clears the $MD_THEME_CSS for Karma testing performance\n       *  performance optimizations. Here inject some length into our theme_css so that\n       *  palettes are parsed/generated\n       */\n      $provide.constant('$MD_THEME_CSS', '/**/');\n    });\n  });\n\n  describe('and auto-generated themes', function() {\n    beforeEach(function() {\n      module('material.core', function($mdThemingProvider) {\n        $mdThemingProvider.generateThemesOnDemand(false);\n\n        $mdThemingProvider.theme('auto-nonce')\n            .primaryPalette('light-blue')\n            .accentPalette('yellow');\n\n        $mdThemingProvider.setNonce('1');\n      });\n      inject();\n    });\n\n    it('should add a nonce', function() {\n      var styles = document.head.querySelectorAll('style[nonce=\"1\"]');\n      expect(styles.length).toBe(4);\n    });\n  });\n\n  describe('and on-demand generated themes', function() {\n    var $mdTheming;\n\n    beforeEach(function() {\n      module('material.core', function($mdThemingProvider) {\n        $mdThemingProvider.generateThemesOnDemand(true);\n\n        $mdThemingProvider.theme('nonce')\n            .primaryPalette('light-blue')\n            .accentPalette('yellow');\n\n        $mdThemingProvider.setNonce('2');\n      });\n      inject(function(_$mdTheming_) {\n        $mdTheming = _$mdTheming_;\n      });\n    });\n\n    it('should add a nonce', function() {\n      var styles = document.head.querySelectorAll('style[nonce=\"2\"]');\n      expect(styles.length).toBe(0);\n\n      $mdTheming.generateTheme('nonce');\n      styles = document.head.querySelectorAll('style[nonce=\"2\"]');\n      expect(styles.length).toBe(4);\n    });\n  });\n});\n\ndescribe('$mdTheming service', function() {\n  var $mdThemingProvider;\n  beforeEach(module('material.core', function(_$mdThemingProvider_) {\n    $mdThemingProvider = _$mdThemingProvider_;\n  }));\n\n  var el, testHtml, compileAndLink;\n\n  beforeEach(inject(function($rootScope, $compile) {\n    compileAndLink = function(html) {\n      return $compile(html)($rootScope.$new());\n    };\n  }));\n\n  beforeEach(function() {\n    testHtml = '<h1>Test</h1>';\n    el = compileAndLink(testHtml);\n  });\n\n\n  it('supports setting a different default theme', function() {\n    $mdThemingProvider.setDefaultTheme('other');\n    inject(function($rootScope, $compile, $mdTheming) {\n      el = $compile('<h1>Test</h1>')($rootScope);\n      $mdTheming(el);\n      expect(el.hasClass('md-other-theme')).toBe(true);\n      expect(el.hasClass('md-default-theme')).toBe(false);\n    });\n  });\n\n  it('inherits the theme from parent elements', inject(function($mdTheming) {\n    el = compileAndLink([\n      '<div md-theme=\"awesome\">',\n        testHtml,\n      '</div>'\n    ].join('')).children(0);\n\n    $mdTheming(el);\n    expect(el.hasClass('md-default-theme')).toBe(false);\n    expect(el.hasClass('md-awesome-theme')).toBe(true);\n  }));\n\n  it('provides the md-themable directive', function() {\n    $mdThemingProvider.setDefaultTheme('some');\n    el = compileAndLink('<h1 md-themable></h1>');\n    expect(el.hasClass('md-some-theme')).toBe(true);\n  });\n\n  it('can inherit from explicit parents', inject(function($rootScope, $mdTheming) {\n    var child = compileAndLink('<h1 md-theme=\"dark\"></h1>');\n    var container = compileAndLink('<div md-theme=\"space\"><h1></h1></div>');\n    var inherited = container.children();\n    $mdTheming(child);\n    expect(child.hasClass('md-dark-theme')).toBe(true);\n    $mdTheming.inherit(child, inherited);\n    expect(child.hasClass('md-dark-theme')).toBe(false);\n    expect(child.hasClass('md-space-theme')).toBe(true);\n  }));\n\n  it('exposes a getter for the default theme', inject(function($mdTheming) {\n    expect($mdTheming.defaultTheme()).toBe('default');\n  }));\n\n  it('supports registering theme on the fly', inject(function ($mdTheming) {\n    expect($mdTheming.THEMES.hasOwnProperty('test')).toBeFalsy();\n\n    $mdTheming.defineTheme('test', {\n      primary: 'red',\n      warn: 'yellow'\n    });\n\n    expect($mdTheming.THEMES.hasOwnProperty('test')).toBeTruthy();\n  }));\n\n  it('supports setting palette options when registering theme on the fly', inject(function ($mdTheming) {\n    expect($mdTheming.THEMES.hasOwnProperty('testHues')).toBeFalsy();\n\n    $mdTheming.defineTheme('testHues', {\n      primary: 'red',\n      primaryHues: {\n        default: '300'\n      },\n      accent: 'blue',\n      accentHues: {\n        default: '600'\n      },\n      warn: 'yellow',\n      warnHues: {\n        default: '200'\n      },\n      background: 'amber',\n      backgroundHues: {\n        default: '800'\n      },\n    });\n\n    expect($mdTheming.THEMES.hasOwnProperty('testHues')).toBeTruthy();\n    expect($mdTheming.THEMES.testHues.colors.primary.hues.default).toBe('300');\n    expect($mdTheming.THEMES.testHues.colors.accent.hues.default).toBe('600');\n    expect($mdTheming.THEMES.testHues.colors.warn.hues.default).toBe('200');\n    expect($mdTheming.THEMES.testHues.colors.background.hues.default).toBe('800');\n  }));\n\n  it('supports changing browser color on the fly', function() {\n    var name = 'theme-color';\n    var primaryPalette = $mdThemingProvider._THEMES.default.colors.primary.name;\n    var primaryColor = $mdThemingProvider._PALETTES[primaryPalette]['800'].hex;\n    var redColor = $mdThemingProvider._PALETTES.red['800'].hex;\n\n    $mdThemingProvider.enableBrowserColor();\n\n    expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(primaryColor);\n\n    inject(function($mdTheming) {\n      $mdTheming.setBrowserColor({ palette: 'red' });\n\n      expect(angular.element(document.getElementsByName(name)[0]).attr('content')).toBe(redColor);\n    });\n  });\n});\n\ndescribe('md-theme directive', function() {\n  beforeEach(module('material.core'));\n\n  it('should watch and set mdTheme controller',\n    inject(function ($compile, $rootScope) {\n      $rootScope.themey = 'red';\n      var el = $compile('<div md-theme=\"{{themey}}\">')($rootScope);\n      $rootScope.$apply();\n      var ctrl = el.data('$mdThemeController');\n      expect(ctrl.$mdTheme).toBe('red');\n      $rootScope.$apply('themey = \"blue\"');\n      expect(ctrl.$mdTheme).toBe('blue');\n    })\n  );\n\n  it('warns when an unregistered theme is used', inject(function ($log, $compile, $rootScope) {\n    spyOn($log, 'warn');\n    $compile('<div md-theme=\"unregistered\"></div>')($rootScope);\n    $rootScope.$apply();\n    expect($log.warn).toHaveBeenCalled();\n  }));\n\n  it('does not warn when a registered theme is used', inject(function($log, $compile, $rootScope) {\n    spyOn($log, 'warn');\n    $compile('<div md-theme=\"default\"></div>')($rootScope);\n    $rootScope.$apply();\n    expect($log.warn.calls.count()).toBe(0);\n  }));\n\n  it('should accept string as a theme', inject(function($compile, $rootScope, $mdTheming) {\n    var el = $compile('<div md-theme=\"red\"></div>')($rootScope);\n    $rootScope.$apply();\n    $mdTheming(el);\n    expect(el.hasClass('md-default-theme')).toBeFalsy();\n    expect(el.hasClass('md-red-theme')).toBeTruthy();\n  }));\n\n  it('should accept interpolation string as a theme and automatically watch changes',\n    inject(function ($compile, $rootScope, $mdTheming) {\n      $rootScope.themey = 'red';\n      var el = $compile('<div md-theme=\"{{themey}}\">')($rootScope);\n      $mdTheming(el);\n      $rootScope.$apply();\n      expect(el.hasClass('md-red-theme')).toBeTruthy();\n      $rootScope.$apply('themey = \"blue\"');\n      expect(el.hasClass('md-blue-theme')).toBeTruthy();\n    })\n  );\n\n  it('should accept onetime bind interpolation string as a theme and not watch changes',\n    inject(function ($compile, $rootScope, $mdTheming) {\n      $rootScope.themey = 'red';\n      var el = $compile('<div md-theme=\"{{::themey}}\">')($rootScope);\n      $mdTheming(el);\n      $rootScope.$apply();\n      expect(el.hasClass('md-red-theme')).toBeTruthy();\n      $rootScope.$apply('themey = \"blue\"');\n      expect(el.hasClass('md-blue-theme')).toBeFalsy();\n      expect(el.hasClass('md-red-theme')).toBeTruthy();\n    })\n  );\n\n  it('should accept $q promise as a theme', inject(function($compile, $rootScope, $q, $mdTheming) {\n    $rootScope.promise = $mdTheming.defineTheme('red', { primary: 'red' });\n    var el = $compile('<div md-theme=\"promise\"></div>')($rootScope);\n    $mdTheming(el);\n    $rootScope.$apply();\n    expect(el.hasClass('md-default-theme')).toBeFalsy();\n    expect(el.hasClass('md-red-theme')).toBeTruthy();\n  }));\n\n  it('should accept a function that returns a promise as a theme',\n    inject(function ($compile, $rootScope, $q, $mdTheming) {\n      $rootScope.func = function () {\n        return $mdTheming.defineTheme('red', {primary: 'red'});\n      };\n      var el = $compile('<div md-theme=\"func\"></div>')($rootScope);\n      $mdTheming(el);\n      $rootScope.$apply();\n      expect(el.hasClass('md-default-theme')).toBeFalsy();\n      expect(el.hasClass('md-red-theme')).toBeTruthy();\n    }));\n\n  describe('$shouldWatch controller property', function () {\n    it('should set to true if there\\'s a md-theme-watch attribute',\n      inject(function ($mdTheming, $compile, $rootScope) {\n        var el = $compile('<div md-theme=\"default\" md-theme-watch></div>')($rootScope);\n        $mdTheming(el);\n        $rootScope.$apply();\n\n        expect(el.controller('mdTheme').$shouldWatch).toBeTruthy();\n      })\n    );\n\n    it('should set to true if there\\'s an interpolation',\n      inject(function ($mdTheming, $compile, $rootScope) {\n        $rootScope.theme = 'default';\n        var el = $compile('<div md-theme=\"{{theme}}\"></div>')($rootScope);\n        $mdTheming(el);\n        $rootScope.$apply();\n\n        expect(el.controller('mdTheme').$shouldWatch).toBeTruthy();\n      })\n    );\n\n    it('should set to false if there\\'s an interpolation with one way binding',\n      inject(function ($mdTheming, $compile, $rootScope) {\n        $rootScope.theme = 'default';\n        var el = $compile('<div md-theme=\"{{::theme}}\"></div>')($rootScope);\n        $mdTheming(el);\n        $rootScope.$apply();\n\n        expect(el.controller('mdTheme').$shouldWatch).toBeFalsy();\n      })\n    );\n  });\n});\n\ndescribe('md-themable directive', function() {\n  var $mdThemingProvider;\n  beforeEach(module('material.core', function(_$mdThemingProvider_) {\n    $mdThemingProvider = _$mdThemingProvider_;\n  }));\n\n  it('should inherit parent theme', inject(function($compile, $rootScope) {\n    var el = $compile('<div md-theme=\"a\"><span md-themable></span></div>')($rootScope);\n    $rootScope.$apply();\n    expect(el.children().hasClass('md-a-theme')).toBe(true);\n  }));\n\n  it('should watch parent theme with md-theme-watch', inject(function($compile, $rootScope) {\n    $rootScope.themey = 'red';\n    var el = $compile('<div md-theme=\"{{themey}}\"><span md-themable md-theme-watch></span></div>')($rootScope);\n    $rootScope.$apply();\n\n    expect(el.children().hasClass('md-red-theme')).toBe(true);\n    $rootScope.$apply('themey = \"blue\"');\n    expect(el.children().hasClass('md-blue-theme')).toBe(true);\n    expect(el.children().hasClass('md-red-theme')).toBe(false);\n  }));\n\n  it('should watch parent theme by default', inject(function($compile, $rootScope) {\n    $rootScope.themey = 'red';\n    var el = $compile('<div md-theme=\"{{themey}}\"><span md-themable></span></div>')($rootScope);\n    $rootScope.$apply();\n\n    expect(el.children().hasClass('md-red-theme')).toBe(true);\n    $rootScope.$apply('themey = \"blue\"');\n    expect(el.children().hasClass('md-blue-theme')).toBe(true);\n    expect(el.children().hasClass('md-red-theme')).toBe(false);\n  }));\n\n  it('should not apply a class for an unnested default theme', inject(function($rootScope, $compile) {\n    var el = $compile('<div md-themable></div>')($rootScope);\n    expect(el.hasClass('md-default-theme')).toBe(false);\n  }));\n\n  it('should apply a class for a nested default theme', inject(function($rootScope, $compile) {\n    var el = $compile('<div md-theme=\"default\" md-themable></div>')($rootScope);\n    expect(el.hasClass('md-default-theme')).toBe(true);\n  }));\n});\n\ndescribe('$mdThemeProvider with custom styles that include nested rules', function() {\n  it('appends the custom styles taking into account nesting', function() {\n    module('material.core', function($mdThemingProvider) {\n      $mdThemingProvider.generateThemesOnDemand(false);\n      var styles =\n          '@media (min-width: 0) and (max-width: 700px) {'\n          + '  .md-THEME_NAME-theme .layout-row {'\n          + '    background-color: \"{{primary-500}}\";'\n          + '  }'\n          + '  .md-THEME_NAME-theme .layout-column {'\n          + '    color: blue;'\n          + '    font-weight: bold;'\n          + '  }'\n          + '}';\n\n      $mdThemingProvider.registerStyles(styles);\n      $mdThemingProvider.theme('register-custom-nested-styles');\n    });\n\n    inject(function($MD_THEME_CSS) {\n      // Verify that $MD_THEME_CSS is still set to '/**/' in the test environment.\n      // Check angular-material-mocks.js for $MD_THEME_CSS latest value if this test starts to fail.\n      expect($MD_THEME_CSS).toBe('/**/');\n    });\n\n    var compiledStyles =\n        '@media (min-width: 0) and (max-width: 700px) {'\n        + '  .md-register-custom-nested-styles-theme .layout-row {'\n        + '    background-color: rgb(63,81,181);'\n        + '  }'\n        + '  .md-register-custom-nested-styles-theme .layout-column {'\n        + '    color: blue;'\n        + '    font-weight: bold;'\n        + '  }'\n        + '}';\n\n    // Find the string containing nested rules in the head tag.\n    expect(document.head.innerHTML).toContain(compiledStyles);\n  });\n});\n\ndescribe('$mdThemeProvider with custom styles that include multiple nested rules', function() {\n  it('appends the custom styles taking into account multiple nesting', function() {\n    module('material.core', function($mdThemingProvider) {\n      $mdThemingProvider.generateThemesOnDemand(false);\n      var styles =\n          '@supports (display: bar) {'\n          + '  @media (min-width: 0) and (max-width: 700px) {'\n          + '    .md-THEME_NAME-theme .layout-row {'\n          + '      background-color: \"{{primary-500}}\";'\n          + '    }'\n          + '    .md-THEME_NAME-theme .layout-column {'\n          + '      color: blue;'\n          + '      font-weight: bold;'\n          + '    }'\n          + '  }'\n          + '}';\n\n      $mdThemingProvider.registerStyles(styles);\n      $mdThemingProvider.theme('register-custom-multiple-nested-styles');\n    });\n\n    inject(function($MD_THEME_CSS) {\n      // Verify that $MD_THEME_CSS is still set to '/**/' in the test environment.\n      // Check angular-material-mocks.js for $MD_THEME_CSS latest value if this test starts to fail.\n      expect($MD_THEME_CSS).toBe('/**/');\n    });\n\n    var compiledStyles =\n        '@supports (display: bar) {'\n        + '  @media (min-width: 0) and (max-width: 700px) {'\n        + '    .md-register-custom-multiple-nested-styles-theme .layout-row {'\n        + '      background-color: rgb(63,81,181);'\n        + '    }'\n        + '    .md-register-custom-multiple-nested-styles-theme .layout-column {'\n        + '      color: blue;'\n        + '      font-weight: bold;'\n        + '    }'\n        + '  }'\n        + '}';\n\n    // Find the string containing nested rules in the head tag.\n    expect(document.head.innerHTML).toContain(compiledStyles);\n  });\n});\n"
  },
  {
    "path": "src/core/style/_mixins.scss",
    "content": "@mixin margin-selectors($before:1em, $after:1em, $start:0px, $end:0px) {\n  -webkit-margin-before: $before;\n  -webkit-margin-after: $after;\n  -webkit-margin-start: $start;\n  -webkit-margin-end: $end;\n}\n\n@mixin not-selectable($value:none) {\n  -webkit-touch-callout: $value;\n  -webkit-user-select: $value;\n  -khtml-user-select: $value;\n  -moz-user-select: $value;\n  -ms-user-select: $value;\n  user-select: $value;\n}\n\n@mixin input-placeholder-color($color) {\n  $pseudos: '::-webkit-input-placeholder', // For QQ Browser\n            ':-ms-input-placeholder', // For IE\n            '::-ms-input-placeholder', // For Edge\n            '::placeholder';\n  $firefox-pseudos: ':-moz-placeholder', '::-moz-placeholder';\n\n  // It is important to export every pseudo within its own block, because otherwise the placeholder\n  // won't be set on the most browsers.\n  @each $pseudo in $pseudos {\n    &#{$pseudo} {\n      color: unquote($color);\n    }\n  }\n  // Firefox reduces the opacity of placeholders so we need to keep them opaque to avoid applying\n  // double the transparency and causing a11y failures due to text contrast.\n  @each $pseudo in $firefox-pseudos {\n    &#{$pseudo} {\n      color: unquote($color);\n      opacity: 1;\n    }\n  }\n}\n\n@mixin pie-clearfix {\n  &:after {\n    content: '';\n    display: table;\n    clear: both;\n  }\n}\n\n@mixin md-shadow-bottom-z-1() {\n  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);\n}\n\n@mixin md-shadow-bottom-z-2() {\n  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);\n}\n\n// Mixin for a \"flat\" input that can be used for components that contain an input\n// (datepicker, autocomplete).\n@mixin md-flat-input() {\n  font-size: 14px;\n\n  box-sizing: border-box;\n  border: none;\n  box-shadow: none;\n  outline: none;\n  background: transparent;\n\n  // The \"clear X\" that IE adds to input[type=\"search\"]\n  &::-ms-clear {\n    display: none;\n  }\n}\n\n// Typography mixins\n\n@mixin md-title() {\n  font-size: $title-font-size-base;\n  font-weight: 500;\n  letter-spacing: 0.005em;\n}\n\n@mixin md-body-1() {\n  font-size: $body-font-size-base;\n  font-weight: 400;\n  letter-spacing: 0.010em;\n  line-height: rem(2);\n}\n\n@mixin md-body-2() {\n  font-size: $body-font-size-base;\n  font-weight: 500;\n  letter-spacing: 0.010em;\n  line-height: rem(2.4);\n}\n\n@mixin md-subhead() {\n  font-size: $subhead-font-size-base;\n  font-weight: 400;\n  letter-spacing: 0.010em;\n  line-height: rem(2.4);\n}\n\n@function map-to-string($map) {\n  $map-str: '{';\n  $keys: map-keys($map);\n  $len: length($keys);\n  @for $i from 1 through $len {\n    $key: nth($keys, $i);\n    $value: map-get($map, $key);\n    $map-str: $map-str + '_' + $key + '_: _' + map-get($map, $key) + '_';\n    @if $i != $len {\n      $map-str: $map-str + ',';\n    }\n  }\n  @return $map-str + '}';\n}\n\n// This is a mixin, which fixes IE11's vertical alignment issue, when using `min-height`.\n// See https://connect.microsoft.com/IE/feedback/details/816293/\n@mixin ie11-min-height-flexbug($min-height) {\n  &::before {\n    content: '';\n    min-height: $min-height;\n    visibility: hidden;\n    display: inline-block;\n  }\n}\n\n// mixin definition ; sets LTR and RTL within the same style call\n// @see https://css-tricks.com/almanac/properties/d/direction/\n\n@mixin rtl($prop, $ltr-value, $rtl-value) {\n  #{$prop}: $ltr-value;\n  [dir=rtl] & {\n    #{$prop}: $rtl-value;\n  }\n}\n\n@mixin rtl-prop($ltr-prop, $rtl-prop, $value, $reset-value) {\n  #{$ltr-prop}: $value;\n  [dir=rtl] & {\n    #{$ltr-prop}: $reset-value;\n    #{$rtl-prop}: $value;\n  }\n}\n\n// To reverse padding (top left bottom right) -> (top right bottom left)\n@function rtl-value($list) {\n  @if length($list) == 4 {\n    @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2)\n  }\n  @if length($list) == 5 {\n    @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2) nth($list, 5)\n  }\n  @return $list;\n}\n\n// Position a FAB button.\n@mixin fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) {\n  &.md-fab-#{$spot} {\n    top: $top;\n    right: $right;\n    bottom: $bottom;\n    left: $left;\n    position: absolute;\n  }\n}\n\n@mixin fab-all-positions() {\n  @include fab-position(bottom-right, auto, ($button-fab-width - $button-fab-padding)*0.5, ($button-fab-height - $button-fab-padding)*0.5, auto);\n  @include fab-position(bottom-left, auto, auto, ($button-fab-height - $button-fab-padding)*0.5, ($button-fab-width - $button-fab-padding)*0.5);\n  @include fab-position(top-right, ($button-fab-height - $button-fab-padding)*0.5, ($button-fab-width - $button-fab-padding)*0.5, auto, auto);\n  @include fab-position(top-left, ($button-fab-height - $button-fab-padding)*0.5, auto, auto, ($button-fab-width - $button-fab-padding)*0.5);\n}\n\n// This mixin allows a user to use the md-checkbox css outside of the\n// md-checkbox directive.\n// See src/components/select/select.scss for an example.\n@mixin checkbox-container(\n  $checkedSelector: '.md-checked',\n  $width: $checkbox-width,\n  $height: $checkbox-height,\n  $border-width: $checkbox-border-width,\n  $border-radius: $checkbox-border-radius) {\n  .md-container {\n    position: absolute;\n    top: 50%;\n    transform: translateY(-50%);\n\n    box-sizing: border-box;\n    display: inline-block;\n\n    width: $width;\n    height: $height;\n    @include rtl(left, 0, auto);\n    @include rtl(right, auto, 0);\n\n    &:before {\n      box-sizing: border-box;\n      background-color: transparent;\n      border-radius: 50%;\n      content: '';\n      position: absolute;\n      display: block;\n      height: auto;\n      left: 0;\n      top: 0;\n      right: 0;\n      bottom: 0;\n      transition: all 0.5s;\n      width: auto;\n    }\n\n    &:after {\n      box-sizing: border-box;\n      content: '';\n      position: absolute;\n      top: -10px;\n      right: -10px;\n      bottom: -10px;\n      left: -10px;\n    }\n\n    .md-ripple-container {\n      position: absolute;\n      display: block;\n      width: auto;\n      height: auto;\n      left: -15px;\n      top: -15px;\n      right: -15px;\n      bottom: -15px;\n    }\n  }\n\n  // unchecked\n  .md-icon {\n    box-sizing: border-box;\n    transition: 240ms;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: $width;\n    height: $height;\n    border-width: $border-width;\n    border-style: solid;\n    border-radius: $border-radius;\n  }\n\n  &#{$checkedSelector} .md-icon {\n    border-color: transparent;\n\n    &:after {\n      box-sizing: border-box;\n      transform: rotate(45deg);\n      position: absolute;\n      left: math.div($width, 3) - $border-width;\n      top: math.div($width, 9) - $border-width;\n      display: table;\n      width: math.div($width, 3);\n      height: math.div($width * 2, 3);\n      border-width: $border-width;\n      border-style: solid;\n      border-top: 0;\n      border-left: 0;\n      content: '';\n    }\n  }\n\n  // disabled\n  &[disabled] {\n    cursor: default;\n  }\n\n  &.md-indeterminate .md-icon {\n    &:after {\n      box-sizing: border-box;\n      position: absolute;\n      top: 50%;\n      left: 50%;\n      transform: translate(-50%, -50%);\n      display: table;\n      width: $width * 0.6;\n      height: $border-width;\n      border-width: $border-width;\n      border-style: solid;\n      border-top: 0;\n      border-left: 0;\n      content: '';\n    }\n  }\n}\n\n// Mixin to create a primary checkbox.\n// Used by the checkbox and select component.\n@mixin checkbox-primary($checkedSelector: '.md-checked') {\n  .md-ripple {\n    color: '{{primary-600}}';\n  }\n\n  &#{$checkedSelector} .md-ripple {\n    color: '{{background-600}}';\n  }\n\n  .md-ink-ripple {\n    color: '{{foreground-2}}';\n  }\n\n  &#{$checkedSelector} .md-ink-ripple {\n    color: '{{primary-color-0.87}}';\n  }\n\n  &:not(.md-checked) .md-icon {\n    border-color: '{{foreground-2}}';\n  }\n\n  &#{$checkedSelector} .md-icon {\n    background-color: '{{primary-color-0.87}}';\n  }\n\n  &#{$checkedSelector}.md-focused .md-container:before {\n    background-color: '{{primary-color-0.26}}';\n  }\n\n  &#{$checkedSelector} .md-icon:after {\n    border-color: '{{primary-contrast-0.87}}';\n  }\n\n  & .md-indeterminate[disabled] {\n    .md-container {\n      color: '{{foreground-3}}';\n    }\n  }\n}\n\n@mixin dense($prop, $normal, $dense) {\n  #{$prop}: $normal;\n  .md-dense > &:not(.md-dense-disabled),\n  .md-dense :not(.md-dense-disabled) &:not(.md-dense-disabled) {\n    #{$prop}: $dense;\n  }\n}\n\n@mixin dense-rtl($prop, $ltr-normal, $rtl-normal, $ltr-dense, $rtl-dense) {\n  @include rtl($prop, $ltr-normal, $rtl-normal);\n  .md-dense > &:not(.md-dense-disabled),\n  .md-dense :not(.md-dense-disabled) &:not(.md-dense-disabled) {\n    @include rtl($prop, $ltr-dense, $rtl-dense);\n  }\n}\n\n// Only use when in row layout\n@mixin when-layout-row($element) {\n  @media (max-width: $layout-breakpoint-xs - 1) {\n    .layout-row:not(.layout-xs-column),\n    .layout-xs-row {\n      & > #{$element} { @content; }\n    }\n  }\n  @media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {\n    .layout-row:not(.layout-gt-xs-column),\n    .layout-gt-xs-row,\n    .layout-sm-row {\n      &:not(.layout-sm-column) > #{$element} { @content; }\n    }\n  }\n  @media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {\n    .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column),\n    .layout-gt-xs-row:not(.layout-gt-sm-column),\n    .layout-gt-sm-row,\n    .layout-md-row {\n      &:not(.layout-md-column) > #{$element} { @content; }\n    }\n  }\n  @media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {\n    .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column),\n    .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column),\n    .layout-gt-sm-row:not(.layout-gt-md-column),\n    .layout-gt-md-row,\n    .layout-lg-row {\n      &:not(.layout-lg-column) > #{$element} { @content; }\n    }\n  }\n  @media (min-width: $layout-breakpoint-lg) {\n    .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column),\n    .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column),\n    .layout-gt-sm-row:not(.layout-gt-md-column),\n    .layout-gt-md-row,\n    .layout-gt-lg-row,\n    .layout-xl-row {\n      &:not(.layout-gt-lg-column):not(.layout-xl-column) > #{$element} { @content; }\n    }\n  }\n}\n\n// Auto insert object margin\n@mixin auto-horizontal-margin($selector) {\n  @include when-layout-row($selector) {\n    &:not(:first-child) {\n      @include rtl-prop(margin-left, margin-right, $default-horizontal-margin, 0);\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/style/_modules.scss",
    "content": "@use \"sass:math\";\n"
  },
  {
    "path": "src/core/style/_variables.scss",
    "content": "// Typography\n// ------------------------------\n$font-family: Roboto, 'Helvetica Neue', sans-serif !default;\n$font-size:   10px !default;\n\n//-- Must be defined after $font-size and before variables that depend on the function.\n@function rem($multiplier) {\n  @return $multiplier * $font-size;\n}\n\n$display-4-font-size-base: rem(11.20) !default;\n$display-3-font-size-base: rem(5.600) !default;\n$display-2-font-size-base: rem(4.500) !default;\n$display-1-font-size-base: rem(3.400) !default;\n$headline-font-size-base:  rem(2.400) !default;\n$title-font-size-base:     rem(2.000) !default;\n$subhead-font-size-base:   rem(1.600) !default;\n\n$body-font-size-base:      rem(1.400) !default;\n$caption-font-size-base:   rem(1.200) !default;\n\n// Layout\n// ------------------------------\n\n$baseline-grid:            8px !default;\n$layout-gutter-width:      ($baseline-grid * 2) !default;\n\n$layout-breakpoint-xs:     600px !default;\n$layout-breakpoint-sm:     960px !default;\n$layout-breakpoint-md:     1280px !default;\n$layout-breakpoint-lg:     1920px !default;\n\n// Icon\n$icon-size: rem(2.400) !default;\n\n// App bar variables\n$app-bar-height: 64px !default;\n\n$toast-height: $baseline-grid * 3 !default;\n$toast-margin: $baseline-grid * 1 !default;\n\n// Whiteframes\n\n$shadow-key-umbra-opacity:      0.2 !default;\n$shadow-key-penumbra-opacity:   0.14 !default;\n$shadow-ambient-shadow-opacity: 0.12 !default;\n\n// NOTE(shyndman): gulp-sass seems to be failing if I split the shadow defs across\n//    multiple lines. Ugly. Sorry.\n$whiteframe-shadow-1dp: 0px 1px 3px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 1px 1px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 1px -1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-2dp: 0px 1px 5px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 2px 2px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 1px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-3dp: 0px 1px 8px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 3px 4px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 3px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-4dp: 0px 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 4px 5px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 10px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-5dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 5px 8px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 14px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-6dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 6px 10px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 18px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-7dp: 0px 4px 5px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 7px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 16px 1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-8dp: 0px 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-9dp: 0px 5px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 9px 12px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 16px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-10dp: 0px 6px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 10px 14px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 18px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-11dp: 0px 6px 7px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 11px 15px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 20px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-12dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 12px 17px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 22px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-13dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 13px 19px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 24px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-14dp: 0px 7px 9px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 14px 21px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 26px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-15dp: 0px 8px 9px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 15px 22px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 28px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-16dp: 0px 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-17dp: 0px 8px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 17px 26px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 32px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-18dp: 0px 9px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 18px 28px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 34px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-19dp: 0px 9px 12px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 19px 29px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 36px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-20dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 20px 31px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 38px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-21dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 21px 33px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 40px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-22dp: 0px 10px 14px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 22px 35px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 42px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-23dp: 0px 11px 14px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 23px 36px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 44px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n$whiteframe-shadow-24dp: 0px 11px 15px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 24px 38px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 46px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;\n\n// Z-indexes\n//--------------------------------------------\n\n$z-index-toast: 105 !default;\n$z-index-tooltip: 100 !default;\n$z-index-menu: 100 !default;\n$z-index-calendar-pane: 100 !default;\n$z-index-select: 90 !default;\n$z-index-dialog: 80 !default;\n$z-index-bottom-sheet: 70 !default;\n$z-index-scroll-mask: 50 !default;\n$z-index-scroll-mask-bar: 65 !default;\n$z-index-sidenav: 60 !default;\n$z-index-backdrop: 50 !default;\n$z-index-fab: 20 !default;\n$z-index-progress-circular: 2 !default; // Used to fix animation bug in Chrome\n\n// Easing Curves\n//--------------------------------------------\n\n$swift-ease-out-duration: 0.4s !default;\n$swift-ease-out-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;\n$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;\n\n$swift-ease-in-duration: 0.3s !default;\n$swift-ease-in-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2) !default;\n$swift-ease-in: all $swift-ease-in-duration $swift-ease-in-timing-function !default;\n\n$swift-ease-in-out-duration: 0.5s !default;\n$swift-ease-in-out-timing-function: cubic-bezier(0.35, 0, 0.25, 1) !default;\n$swift-ease-in-out: all $swift-ease-in-out-duration $swift-ease-in-out-timing-function !default;\n\n$swift-linear-duration: 0.08s !default;\n$swift-linear-timing-function: linear !default;\n$swift-linear: all $swift-linear-duration $swift-linear-timing-function !default;\n\n$material-enter-duration: 0.3s;\n$material-enter-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);\n$material-enter: all $material-enter-duration $material-enter-timing-function;\n\n$material-leave-duration: 0.3s;\n$material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1);\n$material-leave: all $material-leave-duration $material-leave-timing-function;\n\n// Button\n$button-left-right-padding: rem(0.800) !default;\n$icon-button-height: rem(4.000) !default;\n$icon-button-width: rem(4.000) !default;\n\n// Fab Buttons (shared between buttons.scss and fab*.scss)\n$button-fab-width: rem(5.600) !default;\n$button-fab-height: rem(5.600) !default;\n$button-fab-padding: rem(1.60) !default;\n\n\n// Shared Checkbox variables\n$checkbox-width: 18px !default;\n$checkbox-height: $checkbox-width !default;\n$checkbox-border-radius: 2px !default;\n$checkbox-border-width: 2px !default;\n\n// Shared Horizontal Margin Variables\n$default-horizontal-margin: 16px !default;\n"
  },
  {
    "path": "src/core/style/core-theme.scss",
    "content": "/*  Only used with Theme processes */\n\nhtml, body {\n  &.md-THEME_NAME-theme {\n    color: '{{foreground-1}}';\n    background-color: '{{background-color}}';\n  }\n}"
  },
  {
    "path": "src/core/style/layout.scss",
    "content": "/*\n*  Responsive attributes\n*\n*  References:\n*  1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex\n*  2) https://css-tricks.com/almanac/properties/f/flex/\n*  3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/\n*  4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items\n*  5) http://godban.com.ua/projects/flexgrid\n*/\n\n@mixin flex-order-for-name($sizes:null) {\n  @if $sizes == null {\n    $sizes : '';\n\n    .flex-order {\n     order : 0;\n    }\n  }\n\n  @for $i from -20 through 20 {\n    $order : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' { $suffix : '#{$s}-#{$i}'; }\n      @else        { $suffix : '#{$i}';       }\n\n      $order : '.flex-order-#{$suffix}';\n    }\n\n    #{$order} {\n      order: #{$i};\n    }\n  }\n}\n\n@mixin offset-for-name($sizes:null) {\n  @if $sizes == null { $sizes : ''; }\n\n  @for $i from 0 through 19 {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' { $suffix : '#{$s}-#{$i * 5}'; }\n      @else        { $suffix : '#{$i * 5}';       }\n\n      $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix}, .layout-margin .flex-offset-#{$suffix}, .layout-margin .offset-#{$suffix}';\n    }\n\n    #{$offsets} {\n      @if $i != 0 { @include rtl-prop(margin-left, margin-right, #{$i * 5 + '%'}, auto); }\n      @else { @include rtl-prop(margin-left, margin-right, 0, auto); }\n    }\n  }\n\n  @each $i in 33 {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' {  $suffix : '#{$s}-#{$i}';   }\n      @else        {  $suffix : '#{$i}';         }\n\n      $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix}, .layout-margin .flex-offset-#{$suffix}, .layout-margin .offset-#{$suffix}';\n    }\n\n    #{$offsets} {\n      margin-left: calc(100% / 3);\n    }\n  }\n\n  @each $i in 66 {\n    $offsets : '';\n    $suffix : '';\n\n    @each $s in $sizes {\n      @if $s != '' {  $suffix : '#{$s}-#{$i}';   }\n      @else        {  $suffix : '#{$i}';         }\n\n      $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix}, .layout-margin .flex-offset-#{$suffix}, .layout-margin .offset-#{$suffix}';\n    }\n\n    #{$offsets} {\n      @include rtl-prop(margin-left, margin-right, calc(200% / 3), auto);\n    }\n  }\n}\n\n@mixin layout-for-name($name: null) {\n  @if $name == null { $name : '';          }\n  @if $name != ''   { $name : '-#{$name}'; }\n\n  .layout#{$name}, .layout#{$name}-column, .layout#{$name}-row {\n    box-sizing: border-box;\n    display: -webkit-box;\n    display: -webkit-flex;\n    display: -moz-box;\n    display: -ms-flexbox;\n    display: flex;\n  }\n  .layout#{$name}-column {  flex-direction: column;     }\n  .layout#{$name}-row    {  flex-direction: row;        }\n}\n\n@mixin flex-properties-for-name($name: null) {\n  $flexName: 'flex';\n  // $name would be something like xs, sm, md, lg, xl\n  @if $name != null {\n    $flexName: 'flex-#{$name}';\n    $name : '-#{$name}';\n  } @else {\n    $name : '';\n  }\n\n  .#{$flexName}             { flex: 1;         box-sizing: border-box; }  // === flex: 1 1 0%;\n\n  .#{$flexName}-grow        { flex: 1 1 100%;  box-sizing: border-box; }\n  .#{$flexName}-initial     { flex: 0 1 auto;  box-sizing: border-box; }\n  .#{$flexName}-auto        { flex: 1 1 auto;  box-sizing: border-box; }\n  .#{$flexName}-none        { flex: 0 0 auto;  box-sizing: border-box; }\n  .#{$flexName}-noshrink    { flex: 1 0 auto;  box-sizing: border-box; }\n  .#{$flexName}-nogrow      { flex: 0 1 auto;  box-sizing: border-box; }\n\n  // (1-20) * 5 = 0-100%\n  @for $i from 0 through 20 {\n    $value : #{$i * 5 + '%'};\n\n    .#{$flexName}-#{$i * 5} {\n      flex: 1 1 100%;\n      max-width: #{$value};\n      max-height: 100%;\n      box-sizing: border-box;\n    }\n\n    .layout-row > .#{$flexName}-#{$i * 5} {\n      flex: 1 1 100%;\n      max-width: #{$value};\n      max-height: 100%;\n      box-sizing: border-box;\n\n      // Required by Chrome M48+ due to http://crbug.com/546034\n      @if $i == 0 {  min-width: 0;  }\n    }\n\n    .layout-column > .#{$flexName}-#{$i * 5} {\n      flex: 1 1 100%;\n      max-width: 100%;\n      max-height: #{$value};\n      box-sizing: border-box;\n    }\n\n    @if ($name != '') {\n      .layout#{$name}-row > .#{$flexName}-#{$i * 5} {\n        flex: 1 1 100%;\n        max-width: #{$value};\n        max-height: 100%;\n        box-sizing: border-box;\n\n        // Required by Chrome M48+ due to http://crbug.com/546034\n        @if $i == 0 { min-width: 0; }\n      }\n\n      .layout#{$name}-column > .#{$flexName}-#{$i * 5} {\n        flex: 1 1 100%;\n        max-width: 100%;\n        max-height: #{$value};\n        box-sizing: border-box;\n\n        // Required by Chrome M48+ due to http://crbug.com/546034\n        @if $i == 0 { min-height: 0; }\n      }\n    }\n  }\n\n  @if ($name == '') {\n    .flex-33 { flex: 1 1 100%;  max-width: 33.33%;  max-height: 100%; box-sizing: border-box; }\n    .flex-66 { flex: 1 1 100%;  max-width: 66.66%;  max-height: 100%; box-sizing: border-box; }\n   }\n\n  .layout-row {\n    > .#{$flexName}-33 { flex: 1 1 33.33%;  max-width: 33.33%;  max-height: 100%; box-sizing: border-box; }\n    > .#{$flexName}-66 { flex: 1 1 66.66%;  max-width: 66.66%;  max-height: 100%; box-sizing: border-box; }\n  }\n\n  .layout-column {\n    > .#{$flexName}-33 { flex: 1 1 33.33%;  max-width: 100%;  max-height: 33.33%; box-sizing: border-box; }\n    > .#{$flexName}-66 { flex: 1 1 66.66%;  max-width: 100%;  max-height: 66.66%; box-sizing: border-box; }\n  }\n\n  .layout#{$name}-row {\n    > .#{$flexName}-33 { flex: 1 1 100%;  max-width: 33.33%;  max-height: 100%; box-sizing: border-box; }\n    > .#{$flexName}-66 { flex: 1 1 100%;  max-width: 66.66%;  max-height: 100%; box-sizing: border-box; }\n\n    // Required by Chrome M48+ due to http://crbug.com/546034\n    > .flex { min-width: 0; }\n  }\n\n  .layout#{$name}-column {\n    > .#{$flexName}-33 { flex: 1 1 100%;  max-width: 100%;  max-height: 33.33%; box-sizing: border-box; }\n    > .#{$flexName}-66 { flex: 1 1 100%;  max-width: 100%;  max-height: 66.66%; box-sizing: border-box; }\n\n    // Required by Chrome M48+ due to http://crbug.com/546034\n    > .flex { min-height: 0; }\n  }\n}\n\n@mixin layout-align-for-name($suffix: null) {\n\n  // Alignment attributes for layout containers' children\n  // Arrange on the Main Axis\n  // center, start, end, space-between, space-around\n  // flex-start is the default for justify-content\n  // ------------------------------\n\n  $name: 'layout-align';\n  @if $suffix != null {\n    $name: 'layout-align-#{$suffix}';\n  }\n\n  .#{$name},\n  .#{$name}-start-stretch // defaults\n  {\n    justify-content : flex-start;\n    align-content : stretch;\n    align-items: stretch;\n  }\n\n  // Main Axis Center\n  .#{$name}-start,\n  .#{$name}-start-start,\n  .#{$name}-start-center,\n  .#{$name}-start-end,\n  .#{$name}-start-stretch\n  {\n    justify-content: flex-start;\n  }\n\n  // Main Axis Center\n  .#{$name}-center,           //stretch\n  .#{$name}-center-start,\n  .#{$name}-center-center,\n  .#{$name}-center-end,\n  .#{$name}-center-stretch\n  {\n    justify-content: center;\n  }\n\n  // Main Axis End\n  .#{$name}-end, //stretch\n  .#{$name}-end-start,\n  .#{$name}-end-center,\n  .#{$name}-end-end,\n  .#{$name}-end-stretch\n  {\n    justify-content: flex-end;\n  }\n\n  // Main Axis Space Around\n  .#{$name}-space-around, //stretch\n  .#{$name}-space-around-center,\n  .#{$name}-space-around-start,\n  .#{$name}-space-around-end,\n  .#{$name}-space-around-stretch\n  {\n    justify-content: space-around;\n  }\n\n  // Main Axis Space Between\n  .#{$name}-space-between, //stretch\n  .#{$name}-space-between-center,\n  .#{$name}-space-between-start,\n  .#{$name}-space-between-end,\n  .#{$name}-space-between-stretch\n  {\n    justify-content: space-between;\n  }\n\n\n  // Arrange on the Cross Axis\n  // center, start, end\n  // stretch is the default for align-items\n  // ------------------------------\n\n  // Cross Axis Start\n  .#{$name}-start-start,\n  .#{$name}-center-start,\n  .#{$name}-end-start,\n  .#{$name}-space-between-start,\n  .#{$name}-space-around-start\n  {\n    align-items: flex-start;\n    align-content: flex-start;\n  }\n\n  // Cross Axis Center\n  .#{$name}-start-center,\n  .#{$name}-center-center,\n  .#{$name}-end-center,\n  .#{$name}-space-between-center,\n  .#{$name}-space-around-center\n  {\n    align-items: center;\n    align-content: center;\n    max-width: 100%;\n  }\n\n  // Cross Axis Center IE overflow fix\n  .#{$name}-start-center > *,\n  .#{$name}-center-center > *,\n  .#{$name}-end-center > *,\n  .#{$name}-space-between-center > *,\n  .#{$name}-space-around-center > *\n  {\n    max-width: 100%;\n    box-sizing: border-box;\n  }\n\n  // Cross Axis End\n  .#{$name}-start-end,\n  .#{$name}-center-end,\n  .#{$name}-end-end,\n  .#{$name}-space-between-end,\n  .#{$name}-space-around-end\n  {\n    align-items: flex-end;\n    align-content: flex-end;\n  }\n\n  // Cross Axis Start\n  .#{$name}-start-stretch,\n  .#{$name}-center-stretch,\n  .#{$name}-end-stretch,\n  .#{$name}-space-between-stretch,\n  .#{$name}-space-around-stretch\n  {\n    align-items: stretch;\n    align-content: stretch;\n  }\n}\n\n@mixin layout-padding-margin() {\n\n  // NOTE: these`> *` selectors should only be applied for layout=\"row\" or layout=\"column\" children !!\n  .layout-padding-sm > *,\n  .layout-padding    > .flex-sm\n  {\n    padding: $layout-gutter-width * 0.25;\n  }\n\n  .layout-padding,\n  .layout-padding-gt-sm,\n  .layout-padding-md,\n\n  // NOTE: these`> *` selectors should only be applied for layout=\"row\" or layout=\"column\" children !!\n  .layout-padding        > *,\n  .layout-padding-gt-sm  > *,\n  .layout-padding-md     > *,\n\n  .layout-padding        > .flex,\n  .layout-padding        > .flex-gt-sm,\n  .layout-padding        > .flex-md\n  {\n    padding: $layout-gutter-width * 0.5;\n  }\n\n  // NOTE: these`> *` selectors should only be applied for layout=\"row\" or layout=\"column\" children !!\n  .layout-padding-gt-md  > *,\n  .layout-padding-lg     > *,\n  .layout-padding-gt-lg  > *,\n\n  .layout-padding        > .flex-gt-md,\n  .layout-padding        > .flex-lg,\n  .layout-padding        > .flex-lg,\n  .layout-padding        > .flex-gt-lg\n  {\n    padding: math.div($layout-gutter-width, 1);\n  }\n\n  // Margin enhancements\n\n  .layout-margin-sm      > *,\n  .layout-margin         > .flex-sm\n  {\n    margin: $layout-gutter-width * 0.25;\n  }\n\n  .layout-margin,\n  .layout-margin-gt-sm,\n  .layout-margin-md,\n\n  // NOTE: these`> *` selectors should only be applied for layout=\"row\" or layout=\"column\" children !!\n  .layout-margin         > *,\n  .layout-margin-gt-sm   > *,\n  .layout-margin-md      > *,\n\n  .layout-margin         > .flex,\n  .layout-margin         > .flex-gt-sm,\n  .layout-margin         > .flex-md\n  {\n    margin: $layout-gutter-width * 0.5;\n  }\n\n  // NOTE: these`> *` selectors should only be applied for layout=\"row\" or layout=\"column\" children !!\n  .layout-margin-gt-md  > *,\n  .layout-margin-lg     > *,\n  .layout-margin-gt-lg  > *,\n\n  .layout-margin        > .flex-gt-md,\n  .layout-margin        > .flex-lg,\n  .layout-margin        > .flex-gt-lg\n  {\n    margin: math.div($layout-gutter-width, 1);\n  }\n\n  .layout-wrap {\n    flex-wrap: wrap;\n  }\n\n  .layout-nowrap {\n      flex-wrap: nowrap;\n  }\n\n  .layout-fill {\n    margin: 0;\n    width: 100%;\n    min-height: 100%;\n    height: 100%;\n  }\n}\n\n@mixin layouts_for_breakpoint($name:null) {\n    @include flex-order-for-name($name);\n    @include offset-for-name($name);\n    @include layout-align-for-name($name);\n\n    @include flex-properties-for-name($name);\n    @include layout-for-name($name);\n}\n"
  },
  {
    "path": "src/core/style/structure.scss",
    "content": "html, body {\n  height: 100%;\n  position: relative;\n}\n\nbody {\n  margin: 0;\n  padding: 0;\n}\n\n[tabindex='-1']:focus {\n  outline: none;\n}\n.inset {\n  padding: 10px;\n}\n\na.md-no-style,\nbutton.md-no-style {\n  font-weight: normal;\n  background-color: inherit;\n  text-align: left;\n  border: none;\n  padding: 0;\n  margin: 0;\n}\n\nselect,\nbutton,\ntextarea,\ninput {\n  vertical-align: baseline;\n}\n\n// Fix Android 4.0 button bugs\ninput[type=\"reset\"],\ninput[type=\"submit\"],\nhtml input[type=\"button\"],\nbutton {\n  cursor: pointer;\n  -webkit-appearance: button;\n\n  &[disabled] {\n    cursor: default;\n  }\n}\n\ntextarea {\n  vertical-align: top;\n  overflow: auto;\n}\n\ninput {\n  &[type=\"search\"] {\n    -webkit-appearance: textfield;\n    box-sizing: content-box;\n    -webkit-box-sizing: content-box;\n\n    &::-webkit-search-decoration,\n    &::-webkit-search-cancel-button {\n      -webkit-appearance: none;\n    }\n  }\n  &:-webkit-autofill {\n    text-shadow: none;\n  }\n}\n\n.md-visually-hidden {\n  border: 0;\n  clip: rect(0 0 0 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  text-transform: none;\n  width: 1px;\n}\n\n.md-shadow {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  border-radius: inherit;\n  pointer-events: none;\n}\n\n.md-shadow-bottom-z-1 {\n  @include md-shadow-bottom-z-1();\n}\n.md-shadow-bottom-z-2 {\n  @include md-shadow-bottom-z-2();\n}\n\n.md-shadow-animated.md-shadow {\n  transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n/*\n * A container inside of a rippling element (eg a button),\n * which contains all of the individual ripples\n */\n.md-ripple-container {\n  pointer-events: none;\n  position: absolute;\n  overflow: hidden;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  transition: all 0.55s $swift-ease-out-timing-function;\n}\n\n.md-ripple {\n  $sizeDuration: 0.45s * 2;\n  position: absolute;\n  transform: translate(-50%, -50%) scale(0);\n  transform-origin: 50% 50%;\n  opacity: 0;\n  border-radius: 50%;\n  &.md-ripple-placed {\n    transition: margin $sizeDuration $swift-ease-out-timing-function,\n                border $sizeDuration $swift-ease-out-timing-function,\n                width $sizeDuration $swift-ease-out-timing-function,\n                height $sizeDuration $swift-ease-out-timing-function,\n                opacity $sizeDuration $swift-ease-out-timing-function,\n                transform $sizeDuration $swift-ease-out-timing-function;\n  }\n  &.md-ripple-scaled {\n    transform: translate(-50%, -50%) scale(1);\n  }\n  &.md-ripple-active, &.md-ripple-full, &.md-ripple-visible {\n    opacity: 0.20;\n  }\n  &.md-ripple-remove {\n    animation: md-remove-ripple $sizeDuration $swift-ease-out-timing-function;\n  }\n}\n\n// Fix issue causing ripple disappear suddenly in Chrome version 51, opacity .15 is close to the opacity when a normal click mouseup\n@keyframes md-remove-ripple {\n  0% { opacity: .15; }\n  100% { opacity: 0; }\n}\n\n.md-padding {\n  padding: 8px;\n}\n\n.md-margin {\n  margin: 8px;\n}\n\n.md-scroll-mask {\n  position: absolute;\n  background-color: transparent;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: $z-index-scroll-mask;\n\n  > .md-scroll-mask-bar {\n    display: block;\n    position: absolute;\n    background-color: #fafafa;\n    right: 0;\n    top: 0;\n    bottom: 0;\n    z-index: $z-index-scroll-mask-bar;\n    box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3)\n  }\n}\n\n// For iOS allow disabling of momentum scrolling\n// @see issue #2640\n.md-no-momentum {\n  -webkit-overflow-scrolling: auto;\n}\n\n// Add a class to help reduce flicker\n// @see issue #7078 and #8649\n.md-no-flicker {\n  -webkit-filter: blur(0px);\n}\n\n@media (min-width: $layout-breakpoint-sm) {\n  .md-padding {\n    padding: 16px;\n  }\n}\n\n// Bi-directional support\n\nhtml, body {\n  &[dir=rtl], &[dir=ltr] {\n     unicode-bidi: embed\n  }\n}\n\nbdo[dir=rtl] {\n  direction: rtl;\n  unicode-bidi: bidi-override;\n}\nbdo[dir=ltr] {\n  direction: ltr;\n  unicode-bidi: bidi-override;\n}\n\n@include auto-horizontal-margin('.md-auto-horizontal-margin');"
  },
  {
    "path": "src/core/style/typography.scss",
    "content": "// Global page styles\n//\n// [2] Ensure the page always fills at least the entire height of the viewport.\n// [3] Prevent iOS text size adjust after orientation change, without disabling user zoom\n// [4] Fonts on OSX will look more consistent with other systems that do not\n// render text using sub-pixel anti-aliasing.\n\nhtml, body {\n  -webkit-tap-highlight-color: rgba(0,0,0,0);\n  -webkit-touch-callout: default;\n\n  min-height: 100%; // [2]\n\n  -webkit-text-size-adjust: 100%; // [3]\n  -ms-text-size-adjust: 100%; // [3]\n\n  -webkit-font-smoothing: antialiased; // [4]\n  -moz-osx-font-smoothing: grayscale; // [4]\n}\n\n/************\n * Headings\n ************/\n.md-display-4 {\n  font-size: $display-4-font-size-base;\n  font-weight: 300;\n  letter-spacing: -0.010em;\n  line-height: $display-4-font-size-base;\n}\n.md-display-3 {\n  font-size: $display-3-font-size-base;\n  font-weight: 400;\n  letter-spacing: -0.005em;\n  line-height: $display-3-font-size-base;\n}\n.md-display-2 {\n  font-size: $display-2-font-size-base;\n  font-weight: 400;\n  line-height: rem(6.4);\n}\n.md-display-1 {\n  font-size: $display-1-font-size-base;\n  font-weight: 400;\n  line-height: rem(4);\n}\n.md-headline {\n  font-size: $headline-font-size-base;\n  font-weight: 400;\n  line-height: rem(3.2);\n}\n.md-title {\n  @include md-title();\n}\n.md-subhead {\n  @include md-subhead();\n}\n/************\n * Body Copy\n ************/\n.md-body-1 {\n  @include md-body-1();\n}\n.md-body-2 {\n  @include md-body-2();\n}\n.md-caption {\n  font-size: $caption-font-size-base;\n  letter-spacing: 0.020em;\n}\n.md-button {\n  letter-spacing: 0.010em;\n}\n\n/************\n * Defaults\n ************/\n\nbutton,\nselect,\nhtml,\ntextarea,\ninput {\n  font-family: $font-family;\n}\n\nselect,\nbutton,\ntextarea,\ninput {\n  font-size: 100%;\n}\n"
  },
  {
    "path": "src/core/util/animation/animate.js",
    "content": "// Polyfill angular < 1.4 (provide $animateCss)\nangular\n  .module('material.core')\n  .factory('$$mdAnimate', function($q, $timeout, $mdConstant, $animateCss) {\n     // Since $$mdAnimate is injected into $mdUtil... use a wrapper function\n     // to subsequently inject $mdUtil as an argument to the AnimateDomUtils\n     return function($mdUtil) {\n       return AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss);\n     };\n   });\n\n/**\n * Factory function that requires special injections\n */\nfunction AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) {\n  var self;\n  return self = {\n    translate3d : function(target, from, to, options) {\n      return $animateCss(target, {\n        from: from,\n        to: to,\n        addClass: options.transitionInClass,\n        removeClass: options.transitionOutClass,\n        duration: options.duration\n      })\n      .start()\n      .then(function() {\n          // Resolve with reverser function...\n          return reverseTranslate;\n      });\n\n      /**\n       * Specific reversal of the request translate animation above...\n       */\n      function reverseTranslate (newFrom) {\n        return $animateCss(target, {\n           to: newFrom || from,\n           addClass: options.transitionOutClass,\n           removeClass: options.transitionInClass,\n           duration: options.duration\n        }).start();\n      }\n    },\n\n    /**\n     * Listen for transitionEnd event (with optional timeout)\n     * Announce completion or failure via promise handlers\n     */\n    waitTransitionEnd: function (element, opts) {\n      var TIMEOUT = 3000; // fallback is 3 secs\n\n      return $q(function(resolve, reject){\n        opts = opts || { };\n\n        // If there is no transition is found, resolve immediately\n        //\n        // NOTE: using $mdUtil.nextTick() causes delays/issues\n        if (noTransitionFound(opts.cachedTransitionStyles)) {\n          TIMEOUT = 0;\n        }\n\n        var timer = $timeout(finished, opts.timeout || TIMEOUT);\n        element.on($mdConstant.CSS.TRANSITIONEND, finished);\n\n        /**\n         * Upon timeout or transitionEnd, reject or resolve (respectively) this promise.\n         * NOTE: Make sure this transitionEnd didn't bubble up from a child\n         */\n        function finished(ev) {\n          if (ev && ev.target !== element[0]) return;\n\n          if (ev) $timeout.cancel(timer);\n          element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n          // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n          resolve();\n        }\n\n        /**\n         * Checks whether or not there is a transition.\n         *\n         * @param styles The cached styles to use for the calculation. If null, getComputedStyle()\n         * will be used.\n         *\n         * @returns {boolean} True if there is no transition/duration; false otherwise.\n         */\n        function noTransitionFound(styles) {\n          styles = styles || window.getComputedStyle(element[0]);\n\n          return styles.transitionDuration === '0s' ||\n            (!styles.transition && !styles.transitionProperty);\n        }\n      });\n    },\n\n    calculateTransformValues: function (element, originator) {\n      var origin = originator.element;\n      var bounds = originator.bounds;\n\n      if (origin || bounds) {\n        var originBnds = origin ? self.clientRect(origin) || currentBounds() : self.copyRect(bounds);\n        var dialogRect = self.copyRect(element[0].getBoundingClientRect());\n        var dialogCenterPt = self.centerPointFor(dialogRect);\n        var originCenterPt = self.centerPointFor(originBnds);\n\n        return {\n          centerX: originCenterPt.x - dialogCenterPt.x,\n          centerY: originCenterPt.y - dialogCenterPt.y,\n          scaleX: Math.round(100 * Math.min(0.5, originBnds.width / dialogRect.width)) / 100,\n          scaleY: Math.round(100 * Math.min(0.5, originBnds.height / dialogRect.height)) / 100\n        };\n      }\n      return {centerX: 0, centerY: 0, scaleX: 0.5, scaleY: 0.5};\n\n      /**\n       * This is a fallback if the origin information is no longer valid, then the\n       * origin bounds simply becomes the current bounds for the dialogContainer's parent.\n       * @returns {null|DOMRect}\n       */\n      function currentBounds() {\n        var container = element ? element.parent() : null;\n        var parent = container ? container.parent() : null;\n\n        return parent ? self.clientRect(parent) : null;\n      }\n    },\n\n    /**\n     * Calculate the zoom transform from dialog to origin.\n     *\n     * We use this to set the dialog position immediately;\n     * then the md-transition-in actually translates back to\n     * `translate3d(0,0,0) scale(1.0)`...\n     *\n     * NOTE: all values are rounded to the nearest integer\n     */\n    calculateZoomToOrigin: function (element, originator) {\n      var zoomTemplate = \"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )\";\n      var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate);\n\n      return buildZoom(self.calculateTransformValues(element, originator));\n    },\n\n    /**\n     * Calculate the slide transform from panel to origin.\n     * NOTE: all values are rounded to the nearest integer\n     */\n    calculateSlideToOrigin: function (element, originator) {\n      var slideTemplate = \"translate3d( {centerX}px, {centerY}px, 0 )\";\n      var buildSlide = angular.bind(null, $mdUtil.supplant, slideTemplate);\n\n      return buildSlide(self.calculateTransformValues(element, originator));\n    },\n\n    /**\n     * Enhance raw values to represent valid css stylings...\n     */\n    toCss : function(raw) {\n      var css = { };\n      var lookups = 'left top right bottom width height x y min-width min-height max-width max-height';\n\n      angular.forEach(raw, function(value,key) {\n        if (angular.isUndefined(value)) return;\n\n        if (lookups.indexOf(key) >= 0) {\n          css[key] = value + 'px';\n        } else {\n          switch (key) {\n            case 'transition':\n              convertToVendor(key, $mdConstant.CSS.TRANSITION, value);\n              break;\n            case 'transform':\n              convertToVendor(key, $mdConstant.CSS.TRANSFORM, value);\n              break;\n            case 'transformOrigin':\n              convertToVendor(key, $mdConstant.CSS.TRANSFORM_ORIGIN, value);\n              break;\n            case 'font-size':\n              css['font-size'] = value; // font sizes aren't always in px\n              break;\n          }\n        }\n      });\n\n      return css;\n\n      function convertToVendor(key, vendor, value) {\n        angular.forEach(vendor.split(' '), function (key) {\n          css[key] = value;\n        });\n      }\n    },\n\n    /**\n     * Convert the translate CSS value to key/value pair(s).\n     * @param {string} transform\n     * @param {boolean=} addTransition\n     * @param {string=} transition\n     * @return {Object} object containing CSS translate key/value pair(s)\n     */\n    toTransformCss: function (transform, addTransition, transition) {\n      var css = {};\n      angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) {\n        css[key] = transform;\n      });\n\n      if (addTransition) {\n        transition = transition || \"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important\";\n        css.transition = transition;\n      }\n\n      return css;\n    },\n\n    /**\n     * Clone the Rect and calculate the height/width if needed.\n     * @param {DOMRect} source\n     * @param {DOMRect=} destination\n     * @returns {null|DOMRect}\n     */\n    copyRect: function (source, destination) {\n      if (!source) return null;\n\n      destination = destination || {};\n\n      angular.forEach('left top right bottom width height'.split(' '), function (key) {\n        destination[key] = Math.round(source[key]);\n      });\n\n      destination.width = destination.width || (destination.right - destination.left);\n      destination.height = destination.height || (destination.bottom - destination.top);\n\n      return destination;\n    },\n\n    /**\n     * Calculate ClientRect of element; return null if hidden or zero size.\n     * @param {Element|string} element\n     * @returns {null|DOMRect}\n     */\n    clientRect: function (element) {\n      var bounds = angular.element(element)[0].getBoundingClientRect();\n      var isPositiveSizeClientRect = function (rect) {\n        return rect && (rect.width > 0) && (rect.height > 0);\n      };\n\n      // If the event origin element has zero size, it has probably been hidden.\n      return isPositiveSizeClientRect(bounds) ? self.copyRect(bounds) : null;\n    },\n\n    /**\n     * Calculate 'rounded' center point of Rect\n     * @param {DOMRect} targetRect\n     * @returns {{x: number, y: number}}\n     */\n    centerPointFor: function (targetRect) {\n      return targetRect ? {\n        x: Math.round(targetRect.left + (targetRect.width / 2)),\n        y: Math.round(targetRect.top + (targetRect.height / 2))\n      } : { x : 0, y : 0 };\n    }\n  };\n}\n\n"
  },
  {
    "path": "src/core/util/animation/animate.spec.js",
    "content": "describe('animate', function() {\n  beforeEach(module('material.core'));\n\n  var $material, $rootScope, $timeout, $$mdAnimate;\n  beforeEach(inject(function(_$material_,_$rootScope_,_$timeout_, _$$mdAnimate_, $mdUtil) {\n      $$mdAnimate = _$$mdAnimate_($mdUtil);\n      $material = _$material_;\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n  }));\n\n  describe('waitTransitionEnd', function(){\n\n    describe('should reject without an in-progress animation', function(){\n\n      it('using the default fallback timeout',inject(function() {\n        var element = build('<div>');\n        var expired = false;\n\n        $$mdAnimate\n          .waitTransitionEnd(element)\n          .catch(function() {\n            expired = true;\n          });\n        flush();\n\n        expect(expired).not.toBe(true);\n      }));\n\n      it('using custom timeout duration',inject(function() {\n        var element = build('<div>');\n        var expired = false;\n\n        $$mdAnimate\n          .waitTransitionEnd(element, {timeout:200})\n          .catch(function() {\n            expired = true;\n          });\n        flush();\n\n        expect(expired).not.toBe(true);\n      }));\n\n    });\n\n    describe('should resolve ', function(){\n\n      it('after an animation finishes',inject(function($document, $mdConstant) {\n        var expired = false;\n        var response = false;\n        var element = build('<div>');\n        var animation = { display:'absolute;', transition : 'all 1.5s ease;' };\n            animation[$mdConstant.CSS.TRANSFORM] = 'translate3d(240px, 120px, 0px);';\n\n        // Animate move the element...\n        element.css(animation);\n\n        $$mdAnimate\n          .waitTransitionEnd(element)\n          .then(\n            function() { response = true; },\n            function() { expired = true; }\n          );\n\n        $mdConstant.CSS.TRANSITIONEND.split(\" \")\n               .forEach(function(eventType){\n                  element.triggerHandler(eventType);\n               });\n        flush();\n\n        expect(expired).toBe(false);\n        expect(response).toBe(true);\n\n      }));\n\n    });\n\n    function build(template) {\n      var el;\n      inject(function($compile, $rootScope) {\n        el = angular.element(template || '<div>');\n        $compile(el)($rootScope);\n        $rootScope.$apply();\n      });\n      return el;\n    }\n  });\n\n  function flush() {\n    $rootScope.$digest();\n    $material.flushOutstandingAnimations();\n  }\n});\n"
  },
  {
    "path": "src/core/util/animation/animateCss.js",
    "content": "if (angular.version.minor >= 4) {\n  angular.module('material.core.animate', []);\n} else {\n(function() {\n  \"use strict\";\n\n  var forEach = angular.forEach;\n\n  var WEBKIT = angular.isDefined(document.documentElement.style.WebkitAppearance);\n  var TRANSITION_PROP = WEBKIT ? 'WebkitTransition' : 'transition';\n  var ANIMATION_PROP = WEBKIT ? 'WebkitAnimation' : 'animation';\n  var PREFIX = WEBKIT ? '-webkit-' : '';\n\n  var TRANSITION_EVENTS = (WEBKIT ? 'webkitTransitionEnd ' : '') + 'transitionend';\n  var ANIMATION_EVENTS = (WEBKIT ? 'webkitAnimationEnd ' : '') + 'animationend';\n\n  var $$ForceReflowFactory = ['$document', function($document) {\n    return function() {\n      return $document[0].body.clientWidth + 1;\n    };\n  }];\n\n  var $$rAFMutexFactory = ['$$rAF', function($$rAF) {\n    return function() {\n      var passed = false;\n      $$rAF(function() {\n        passed = true;\n      });\n      return function(fn) {\n        passed ? fn() : $$rAF(fn);\n      };\n    };\n  }];\n\n  var $$AnimateRunnerFactory = ['$q', '$$rAFMutex', function($q, $$rAFMutex) {\n    var INITIAL_STATE = 0;\n    var DONE_PENDING_STATE = 1;\n    var DONE_COMPLETE_STATE = 2;\n\n    function AnimateRunner(host) {\n      this.setHost(host);\n\n      this._doneCallbacks = [];\n      this._runInAnimationFrame = $$rAFMutex();\n      this._state = 0;\n    }\n\n    AnimateRunner.prototype = {\n      setHost: function(host) {\n        this.host = host || {};\n      },\n\n      done: function(fn) {\n        if (this._state === DONE_COMPLETE_STATE) {\n          fn();\n        } else {\n          this._doneCallbacks.push(fn);\n        }\n      },\n\n      progress: angular.noop,\n\n      getPromise: function() {\n        if (!this.promise) {\n          var self = this;\n          this.promise = $q(function(resolve, reject) {\n            self.done(function(status) {\n              status === false ? reject() : resolve();\n            });\n          });\n        }\n        return this.promise;\n      },\n\n      then: function(resolveHandler, rejectHandler) {\n        return this.getPromise().then(resolveHandler, rejectHandler);\n      },\n\n      'catch': function(handler) {\n        return this.getPromise()['catch'](handler);\n      },\n\n      'finally': function(handler) {\n        return this.getPromise()['finally'](handler);\n      },\n\n      pause: function() {\n        if (this.host.pause) {\n          this.host.pause();\n        }\n      },\n\n      resume: function() {\n        if (this.host.resume) {\n          this.host.resume();\n        }\n      },\n\n      end: function() {\n        if (this.host.end) {\n          this.host.end();\n        }\n        this._resolve(true);\n      },\n\n      cancel: function() {\n        if (this.host.cancel) {\n          this.host.cancel();\n        }\n        this._resolve(false);\n      },\n\n      complete: function(response) {\n        var self = this;\n        if (self._state === INITIAL_STATE) {\n          self._state = DONE_PENDING_STATE;\n          self._runInAnimationFrame(function() {\n            self._resolve(response);\n          });\n        }\n      },\n\n      _resolve: function(response) {\n        if (this._state !== DONE_COMPLETE_STATE) {\n          forEach(this._doneCallbacks, function(fn) {\n            fn(response);\n          });\n          this._doneCallbacks.length = 0;\n          this._state = DONE_COMPLETE_STATE;\n        }\n      }\n    };\n\n    // Polyfill AnimateRunner.all which is used by input animations\n    AnimateRunner.all = function(runners, callback) {\n      var count = 0;\n      var status = true;\n      forEach(runners, function(runner) {\n        runner.done(onProgress);\n      });\n\n      function onProgress(response) {\n        status = status && response;\n        if (++count === runners.length) {\n          callback(status);\n        }\n      }\n    };\n\n    return AnimateRunner;\n  }];\n\n  angular\n    .module('material.core.animate', [])\n    .factory('$$forceReflow', $$ForceReflowFactory)\n    .factory('$$AnimateRunner', $$AnimateRunnerFactory)\n    .factory('$$rAFMutex', $$rAFMutexFactory)\n    .factory('$animateCss', ['$window', '$$rAF', '$$AnimateRunner', '$$forceReflow', '$$jqLite', '$timeout', '$animate',\n                     function($window,   $$rAF,   $$AnimateRunner,   $$forceReflow,   $$jqLite,   $timeout, $animate) {\n\n      function init(element, options) {\n\n        var temporaryStyles = [];\n        var node = getDomNode(element);\n        var areAnimationsAllowed = node && $animate.enabled();\n\n        var hasCompleteStyles = false;\n        var hasCompleteClasses = false;\n\n        if (areAnimationsAllowed) {\n          if (options.transitionStyle) {\n            temporaryStyles.push([PREFIX + 'transition', options.transitionStyle]);\n          }\n\n          if (options.keyframeStyle) {\n            temporaryStyles.push([PREFIX + 'animation', options.keyframeStyle]);\n          }\n\n          if (options.delay) {\n            temporaryStyles.push([PREFIX + 'transition-delay', options.delay + 's']);\n          }\n\n          if (options.duration) {\n            temporaryStyles.push([PREFIX + 'transition-duration', options.duration + 's']);\n          }\n\n          hasCompleteStyles = options.keyframeStyle ||\n              (options.to && (options.duration > 0 || options.transitionStyle));\n          hasCompleteClasses = !!options.addClass || !!options.removeClass;\n\n          blockTransition(element, true);\n        }\n\n        var hasCompleteAnimation = areAnimationsAllowed && (hasCompleteStyles || hasCompleteClasses);\n\n        applyAnimationFromStyles(element, options);\n\n        var animationClosed = false;\n        var events, eventFn;\n\n        return {\n          close: $window.close,\n          start: function() {\n            var runner = new $$AnimateRunner();\n            waitUntilQuiet(function() {\n              blockTransition(element, false);\n              if (!hasCompleteAnimation) {\n                return close();\n              }\n\n              forEach(temporaryStyles, function(entry) {\n                var key = entry[0];\n                var value = entry[1];\n                node.style[camelCase(key)] = value;\n              });\n\n              applyClasses(element, options);\n\n              var timings = computeTimings(element);\n              if (timings.duration === 0) {\n                return close();\n              }\n\n              var moreStyles = [];\n\n              if (options.easing) {\n                if (timings.transitionDuration) {\n                  moreStyles.push([PREFIX + 'transition-timing-function', options.easing]);\n                }\n                if (timings.animationDuration) {\n                  moreStyles.push([PREFIX + 'animation-timing-function', options.easing]);\n                }\n              }\n\n              if (options.delay && timings.animationDelay) {\n                moreStyles.push([PREFIX + 'animation-delay', options.delay + 's']);\n              }\n\n              if (options.duration && timings.animationDuration) {\n                moreStyles.push([PREFIX + 'animation-duration', options.duration + 's']);\n              }\n\n              forEach(moreStyles, function(entry) {\n                var key = entry[0];\n                var value = entry[1];\n                node.style[camelCase(key)] = value;\n                temporaryStyles.push(entry);\n              });\n\n              var maxDelay = timings.delay;\n              var maxDelayTime = maxDelay * 1000;\n              var maxDuration = timings.duration;\n              var maxDurationTime = maxDuration * 1000;\n              var startTime = Date.now();\n\n              events = [];\n              if (timings.transitionDuration) {\n                events.push(TRANSITION_EVENTS);\n              }\n              if (timings.animationDuration) {\n                events.push(ANIMATION_EVENTS);\n              }\n              events = events.join(' ');\n              eventFn = function(event) {\n                event.stopPropagation();\n                var ev = event.originalEvent || event;\n                var timeStamp = ev.timeStamp || Date.now();\n                var elapsedTime = parseFloat(ev.elapsedTime.toFixed(3));\n                if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n                  close();\n                }\n              };\n              element.on(events, eventFn);\n\n              applyAnimationToStyles(element, options);\n\n              $timeout(close, maxDelayTime + maxDurationTime * 1.5, false);\n            });\n\n            return runner;\n\n            function close() {\n              if (animationClosed) return;\n              animationClosed = true;\n\n              if (events && eventFn) {\n                element.off(events, eventFn);\n              }\n              applyClasses(element, options);\n              applyAnimationStyles(element, options);\n              forEach(temporaryStyles, function(entry) {\n                node.style[camelCase(entry[0])] = '';\n              });\n              runner.complete(true);\n              return runner;\n            }\n          }\n        };\n      }\n\n      function applyClasses(element, options) {\n        if (options.addClass) {\n          $$jqLite.addClass(element, options.addClass);\n          options.addClass = null;\n        }\n        if (options.removeClass) {\n          $$jqLite.removeClass(element, options.removeClass);\n          options.removeClass = null;\n        }\n      }\n\n      function computeTimings(element) {\n        var node = getDomNode(element);\n        var cs = $window.getComputedStyle(node);\n        var tdr = parseMaxTime(cs[prop('transitionDuration')]);\n        var adr = parseMaxTime(cs[prop('animationDuration')]);\n        var tdy = parseMaxTime(cs[prop('transitionDelay')]);\n        var ady = parseMaxTime(cs[prop('animationDelay')]);\n\n        adr *= (parseInt(cs[prop('animationIterationCount')], 10) || 1);\n        var duration = Math.max(adr, tdr);\n        var delay = Math.max(ady, tdy);\n\n        return {\n          duration: duration,\n          delay: delay,\n          animationDuration: adr,\n          transitionDuration: tdr,\n          animationDelay: ady,\n          transitionDelay: tdy\n        };\n\n        function prop(key) {\n          return WEBKIT ? 'Webkit' + key.charAt(0).toUpperCase() + key.substr(1)\n                        : key;\n        }\n      }\n\n      function parseMaxTime(str) {\n        var maxValue = 0;\n        var values = (str || \"\").split(/\\s*,\\s*/);\n        forEach(values, function(value) {\n          // it's always safe to consider only second values and omit `ms` values since\n          // getComputedStyle will always handle the conversion for us\n          if (value.charAt(value.length - 1) == 's') {\n            value = value.substring(0, value.length - 1);\n          }\n          value = parseFloat(value) || 0;\n          maxValue = maxValue ? Math.max(value, maxValue) : value;\n        });\n        return maxValue;\n      }\n\n      var cancelLastRAFRequest;\n      var rafWaitQueue = [];\n      function waitUntilQuiet(callback) {\n        if (cancelLastRAFRequest) {\n          cancelLastRAFRequest(); // cancels the request\n        }\n        rafWaitQueue.push(callback);\n        cancelLastRAFRequest = $$rAF(function() {\n          cancelLastRAFRequest = null;\n\n          // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n          // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n          var pageWidth = $$forceReflow();\n\n          // we use a for loop to ensure that if the queue is changed\n          // during this looping then it will consider new requests\n          for (var i = 0; i < rafWaitQueue.length; i++) {\n            rafWaitQueue[i](pageWidth);\n          }\n          rafWaitQueue.length = 0;\n        });\n      }\n\n      function applyAnimationStyles(element, options) {\n        applyAnimationFromStyles(element, options);\n        applyAnimationToStyles(element, options);\n      }\n\n      function applyAnimationFromStyles(element, options) {\n        if (options.from) {\n          element.css(options.from);\n          options.from = null;\n        }\n      }\n\n      function applyAnimationToStyles(element, options) {\n        if (options.to) {\n          element.css(options.to);\n          options.to = null;\n        }\n      }\n\n      function getDomNode(element) {\n        for (var i = 0; i < element.length; i++) {\n          if (element[i].nodeType === 1) return element[i];\n        }\n      }\n\n      function blockTransition(element, bool) {\n        var node = getDomNode(element);\n        var key = camelCase(PREFIX + 'transition-delay');\n        node.style[key] = bool ? '-9999s' : '';\n      }\n\n      return init;\n    }]);\n\n  /**\n   * Older browsers [FF31] expect camelCase\n   * property keys.\n   * e.g.\n   *  animation-duration --> animationDuration\n   */\n  function camelCase(str) {\n    return str.replace(/-[a-z]/g, function(str) {\n      return str.charAt(1).toUpperCase();\n    });\n  }\n\n})();\n\n}\n"
  },
  {
    "path": "src/core/util/animation/animateCss.spec.js",
    "content": "describe('$animateCss', function() {\n\n  var jqLite = angular.element;\n  var forEach = angular.forEach;\n\n  var fromStyles, toStyles, addClassVal = 'to-add', removeClassVal = 'to-remove';\n  var element, ss, doneSpy;\n  var triggerAnimationStartFrame, moveAnimationClock;\n\n  beforeEach(module('material.core.animate'));\n\n  beforeEach(module(function() {\n    return function($window, $document, $$rAF, $timeout, $rootElement, $animate, $injector, $rootScope) {\n      $animate.enabled(true);\n\n      ss = createMockStyleSheet($document, $window);\n      element = jqLite('<div></div>');\n      $rootElement.append(element);\n      jqLite($document[0].body).append($rootElement);\n\n      ss.addRule('.to-add', 'transition:0.5s linear all; font-size:100px;');\n      ss.addRule('.to-remove', 'transition:0.5s linear all; border:10px solid black;');\n\n      var asyncRun = angular.noop;\n      if ($injector.has('$$animateAsyncRun')) {\n        var asyncFlush = $injector.get('$$animateAsyncRun');\n        asyncRun = function() {\n          asyncFlush.flush();\n        };\n      }\n\n      triggerAnimationStartFrame = function() {\n        $$rAF.flush();\n        asyncRun();\n        $rootScope.$digest();\n      };\n\n      doneSpy = jasmine.createSpy();\n      fromStyles = { backgroundColor: 'red' };\n      toStyles = { backgroundColor: 'blue' };\n\n      moveAnimationClock = function(duration, delay) {\n        var time = (delay || 0) + duration * 1.5;\n        $timeout.flush(time * 1000);\n        asyncRun();\n        $$rAF.flush();\n      }\n    };\n  }));\n\n  afterEach(function() {\n    ss.destroy();\n    element.remove();\n  });\n\n\n  describe('[addClass]', function() {\n    it('should not trigger an animation if the class doesn\\'t exist',\n      inject(function($animateCss) {\n\n      $animateCss(element, { addClass: 'something-fake' }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      assertHasClass(element, 'something-fake');\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should not trigger an animation if the class doesn\\'t contain a transition value or a keyframe value',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-real', 'background-color:orange');\n\n      $animateCss(element, { addClass: 'something-real' }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      assertHasClass(element, 'something-real');\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if a transition is detected on the class that is being added',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-shiny', 'transition:0.5s linear all; background-color: gold;');\n\n      $animateCss(element, { addClass: 'something-shiny' }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if a keyframe is detected on the class that is being added',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-spinny', '-webkit-animation: 0.5s rotate linear; animation: 0.5s rotate linear;');\n\n      $animateCss(element, { addClass: 'something-spinny' }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if both a transition and keyframe is detected on the class that is being added and choose the max duration value',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-shiny', 'transition:1.5s linear all; background-color: gold;');\n      ss.addRule('.something-spinny', '-webkit-animation: 0.5s rotate linear; animation: 0.5s rotate linear;');\n\n      $animateCss(element, { addClass: 'something-spinny something-shiny' }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1.5);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if a non-animatable class is added with a duration property',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-boring', 'border:20px solid red;');\n\n      $animateCss(element, {\n        addClass: 'something-boring',\n        duration: 2\n      }).start().done(doneSpy);\n      triggerAnimationStartFrame();\n\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(2);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n  });\n\n  describe('[removeClass]', function() {\n    it('should not trigger an animation if the animatable className is removed',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal);\n\n      $animateCss(element, {\n        removeClass: removeClassVal\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      assertHasClass(element, removeClassVal, true);\n    }));\n\n    it('should trigger an animation if the element contains a transition already when the class is removed',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal);\n      element.addClass('something-to-remove');\n\n      $animateCss(element, {\n        removeClass: 'something-to-remove'\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(0.5);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if the element contains a keyframe already when the class is removed',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-that-spins', '-webkit-animation: 0.5s rotate linear; animation: 0.5s rotate linear;');\n\n      element.addClass('something-that-spins');\n      element.addClass('something-to-remove');\n\n      $animateCss(element, {\n        removeClass: 'something-to-remove'\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(0.5);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should still perform an animation if an animatable class is removed, but a [duration] property is used',\n      inject(function($animateCss) {\n\n      ss.addRule('.something-that-is-hidden', 'transition:0.5s linear all; opacity:0;');\n      element.addClass('something-that-spins');\n\n      $animateCss(element, {\n        removeClass: 'something-that-is-hidden',\n        duration: 0.5\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(0.5);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n  });\n\n  describe('[transitionStyle]', function() {\n    it('should not trigger an animation if the property is the only thing property',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        transitionStyle: '3s linear all'\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply the provided porperty to the animation if there are [toStyles] used',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        transitionStyle: '3s linear all',\n        to: toStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(3);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply the provided porperty to the animation if there are [addClass] used',\n      inject(function($animateCss) {\n\n      ss.addRule('.boring-class', 'border:20px solid red;');\n\n      $animateCss(element, {\n        transitionStyle: '3s linear all',\n        addClass: 'boring-class'\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(3);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply the provided porperty to the animation if there are [removeClass] used',\n      inject(function($animateCss) {\n\n      ss.addRule('.boring-class', 'border:20px solid red;');\n      element.addClass('boring-class');\n\n      $animateCss(element, {\n        transitionStyle: '3s linear all',\n        removeClass: 'boring-class'\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(3);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n  });\n\n  describe('[from]', function() {\n    it('should not trigger an animation to run when only a [from] property is passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        from: fromStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should not trigger an animation to run when a [from] and a [duration] property are passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        from: fromStyles,\n        duration: 1\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply the styles as soon as the animation is called',\n      inject(function($animateCss) {\n\n      var animator = $animateCss(element, {\n        from: fromStyles\n      });\n\n      assertStyle(element, fromStyles);\n    }));\n  });\n\n  describe('[to]', function() {\n    it('should not trigger an animation to run when only a [to] property is passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        to: toStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation to run when both a [to] and a [duration] property are passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        to: toStyles,\n        duration: 1\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply the styles right after the next frame',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        to: toStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      assertStyle(element, toStyles);\n    }));\n  });\n\n  describe('[from] and [to]', function() {\n    it('should not trigger an animation if [duration] is not passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        from: fromStyles,\n        to: toStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if [duration] is passed in',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        from: fromStyles,\n        to: toStyles,\n        duration: 1\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if detected from the provided [addClass] class value',\n      inject(function($animateCss) {\n\n      $animateCss(element, {\n        from: fromStyles,\n        to: toStyles,\n        addClass: addClassVal\n      }).start().done(doneSpy);\n\n      assertStyle(element, fromStyles);\n      triggerAnimationStartFrame();\n\n      assertStyle(element, toStyles);\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should trigger an animation if detected from the provided [removeClass] class value',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal + ' something-else-to-remove');\n\n      $animateCss(element, {\n        from: fromStyles,\n        to: toStyles,\n        removeClass: 'something-else-to-remove'\n      }).start().done(doneSpy);\n\n      assertStyle(element, fromStyles);\n      triggerAnimationStartFrame();\n\n      assertStyle(element, toStyles);\n      expect(doneSpy).not.toHaveBeenCalled();\n      moveAnimationClock(1);\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n  });\n\n  describe('[duration]', function() {\n    it('should not apply a duration if it is the only property used',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal + ' something-else-to-remove');\n\n      $animateCss(element, {\n        duration: 2\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      expect(doneSpy).toHaveBeenCalled();\n    }));\n\n    it('should apply a duration as an inline transition-duration style',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal + ' something-else-to-remove');\n\n      $animateCss(element, {\n        duration: 2,\n        to: toStyles\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      assertStyle(element, 'transition-duration', '2s');\n    }));\n\n    it('should apply a duration as an inline animation-duration style if only keyframes are used',\n      inject(function($animateCss) {\n\n      element.addClass(removeClassVal + ' something-else-to-remove');\n\n      $animateCss(element, {\n        keyframeStyle: '1s rotate linear',\n        duration: 2\n      }).start().done(doneSpy);\n\n      triggerAnimationStartFrame();\n      assertStyle(element, 'animation-duration', '2s');\n    }));\n  });\n\n  function assertHasClass(element, className, not) {\n    expect(element.hasClass(className)).toBe(!not);\n  }\n\n  function assertStyle(element, prop, val, not) {\n    var node = element[0];\n    var webKit = '-webkit-';\n    var otherVal;\n    var otherAssertion;\n    var key;\n    if (typeof prop === 'string') {\n      var assertion = expect(node.style[camelCase(prop)] || node.style[camelCase(webKit+prop)]);\n      not ? assertion.not.toBe(val) : assertion.toBe(val);\n    } else {\n      for (key in prop) {\n        otherVal = prop[key];\n        otherAssertion = expect(node.style[camelCase(key)] || node.style[camelCase(webKit+key)]);\n        not ? otherAssertion.not.toBe(otherVal) : otherAssertion.toBe(otherVal);\n      }\n    }\n  }\n\n  function camelCase(str) {\n    return str.replace(/-[a-z]/g, function(str) {\n      return str.charAt(1).toUpperCase();\n    });\n  }\n\n});\n"
  },
  {
    "path": "src/core/util/autofocus.js",
    "content": "angular.module('material.core')\n  .directive('mdAutofocus', MdAutofocusDirective);\n\n/**\n * @ngdoc directive\n * @name mdAutofocus\n * @module material.core.util\n *\n * @description\n *\n * `[md-autofocus]` provides an optional way to identify the focused element when a `$mdDialog`,\n * `$mdBottomSheet`, `$mdMenu` or `$mdSidenav` opens or upon page load for input-like elements.\n *\n * When one of these opens, it will find the first nested element with the `[md-autofocus]`\n * attribute directive and optional expression. An expression may be specified as the directive\n * value to enable conditional activation of the autofocus.\n *\n * @usage\n *\n * ### Dialog\n * <hljs lang=\"html\">\n * <md-dialog>\n *   <form>\n *     <md-input-container>\n *       <label for=\"testInput\">Label</label>\n *       <input id=\"testInput\" type=\"text\" md-autofocus>\n *     </md-input-container>\n *   </form>\n * </md-dialog>\n * </hljs>\n *\n * ### Bottomsheet\n * <hljs lang=\"html\">\n * <md-bottom-sheet class=\"md-list md-has-header\">\n *  <md-subheader>Comment Actions</md-subheader>\n *  <md-list>\n *    <md-list-item ng-repeat=\"item in items\">\n *\n *      <md-button md-autofocus=\"$index == 2\">\n *        <md-icon md-svg-src=\"{{item.icon}}\"></md-icon>\n *        <span class=\"md-inline-list-icon-label\">{{ item.name }}</span>\n *      </md-button>\n *\n *    </md-list-item>\n *  </md-list>\n * </md-bottom-sheet>\n * </hljs>\n *\n * ### Autocomplete\n * <hljs lang=\"html\">\n *   <md-autocomplete\n *       md-autofocus\n *       md-selected-item=\"selectedItem\"\n *       md-search-text=\"searchText\"\n *       md-items=\"item in getMatches(searchText)\"\n *       md-item-text=\"item.display\">\n *     <span md-highlight-text=\"searchText\">{{item.display}}</span>\n *   </md-autocomplete>\n * </hljs>\n *\n * ### Sidenav\n * <hljs lang=\"html\">\n * <div layout=\"row\" ng-controller=\"MyController\">\n *   <md-sidenav md-component-id=\"left\" class=\"md-sidenav-left\">\n *     Left Nav!\n *   </md-sidenav>\n *\n *   <md-content>\n *     Center Content\n *     <md-button ng-click=\"openLeftMenu()\">\n *       Open Left Menu\n *     </md-button>\n *   </md-content>\n *\n *   <md-sidenav md-component-id=\"right\"\n *     md-is-locked-open=\"$mdMedia('min-width: 333px')\"\n *     class=\"md-sidenav-right\">\n *     <form>\n *       <md-input-container>\n *         <label for=\"testInput\">Test input</label>\n *         <input id=\"testInput\" type=\"text\"\n *                ng-model=\"data\" md-autofocus>\n *       </md-input-container>\n *     </form>\n *   </md-sidenav>\n * </div>\n * </hljs>\n **/\nfunction MdAutofocusDirective($parse) {\n  return {\n    restrict: 'A',\n    link: {\n      pre: preLink\n    }\n  };\n\n  function preLink(scope, element, attr) {\n    var attrExp = attr.mdAutoFocus || attr.mdAutofocus || attr.mdSidenavFocus;\n\n    // Initially update the expression by manually parsing the expression as per $watch source.\n    updateExpression($parse(attrExp)(scope));\n\n    // Only watch the expression if it is not empty.\n    if (attrExp) {\n      scope.$watch(attrExp, updateExpression);\n    }\n\n    /**\n     * Updates the autofocus class which is used to determine whether the attribute\n     * expression evaluates to true or false.\n     * @param {string|boolean} value Attribute Value\n     */\n    function updateExpression(value) {\n\n      // Rather than passing undefined to the jqLite toggle class function we explicitly set the\n      // value to true. Otherwise the class will be just toggled instead of being forced.\n      if (angular.isUndefined(value)) {\n        value = true;\n      }\n\n      element.toggleClass('md-autofocus', !!value);\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/core/util/autofocus.spec.js",
    "content": "describe('md-autofocus', function() {\n  var $rootScope, pageScope, element;\n\n  beforeEach(module('material.core'));\n  beforeEach(inject(function(_$rootScope_) {\n    $rootScope = _$rootScope_;\n  }));\n\n  describe('add/removes the proper classes', function() {\n\n    it('supports true', function() {\n      build('<input id=\"test\" type=\"text\" md-autofocus=\"true\">');\n\n      expect(element).toHaveClass('md-autofocus');\n    });\n\n    it('supports false', function() {\n      build('<input id=\"test\" type=\"text\" md-autofocus=\"false\">');\n\n      expect(element).not.toHaveClass('md-autofocus');\n    });\n\n    it('supports variables', function() {\n      build('<input id=\"test\" type=\"text\" md-autofocus=\"shouldAutoFocus\">');\n\n      // By default, we assume an undefined value for the expression is true\n      expect(element).toHaveClass('md-autofocus');\n\n      // Set the expression to false\n      pageScope.$apply('shouldAutoFocus=false');\n      expect(element).not.toHaveClass('md-autofocus');\n\n      // Set the expression to true\n      pageScope.$apply('shouldAutoFocus=true');\n      expect(element).toHaveClass('md-autofocus');\n    });\n\n    it('should properly set the class at initialization', inject(function($compile, $rootScope) {\n      pageScope = $rootScope.$new();\n      element = $compile('<input md-autofocus>')(pageScope);\n\n      expect(element).toHaveClass('md-autofocus');\n    }));\n\n    it('does not accidentally toggle the class', function() {\n      build('<input md-autofocus=\"autofocus\">');\n\n      // By default, we assume an empty value for the expression is true\n      expect(element).toHaveClass('md-autofocus');\n\n      // Trigger a second digest, to be able to set the scope binding to undefined later again.\n      pageScope.$apply('autofocus = true');\n\n      expect(element).toHaveClass('md-autofocus');\n\n      // Set the scope binding to undefined again, which can accidentally toggle the class due to\n      // the jqLite toggleClass function, which just toggles the class if the value is undefined.\n      pageScope.$apply('autofocus = undefined');\n\n      expect(element).toHaveClass('md-autofocus');\n    });\n\n    it('supports expressions', function() {\n      build('<input id=\"test\" type=\"text\" md-autofocus=\"shouldAutoFocus==1\">');\n\n      // By default, the expression should be false\n      expect(element).not.toHaveClass('md-autofocus');\n\n      // Make the expression false\n      pageScope.$apply('shouldAutoFocus=0');\n      expect(element).not.toHaveClass('md-autofocus');\n\n      // Make the expression true\n      pageScope.$apply('shouldAutoFocus=1');\n      expect(element).toHaveClass('md-autofocus');\n    });\n  });\n\n  function build(template) {\n    inject(function($compile) {\n      pageScope = $rootScope.$new();\n      element = $compile(template)(pageScope);\n\n      pageScope.$apply();\n    });\n  }\n});"
  },
  {
    "path": "src/core/util/color.js",
    "content": "/**\n * @ngdoc module\n * @name material.core.colorUtil\n * @description\n * Color Util\n */\nangular\n  .module('material.core')\n  .factory('$mdColorUtil', ColorUtilFactory);\n\nfunction ColorUtilFactory() {\n  /**\n   * Converts hex value to RGBA string\n   * @param color {string}\n   * @returns {string}\n   */\n  function hexToRgba (color) {\n    var hex   = color[ 0 ] === '#' ? color.substr(1) : color,\n      dig   = hex.length / 3,\n      red   = hex.substr(0, dig),\n      green = hex.substr(dig, dig),\n      blue  = hex.substr(dig * 2);\n    if (dig === 1) {\n      red += red;\n      green += green;\n      blue += blue;\n    }\n    return 'rgba(' + parseInt(red, 16) + ',' + parseInt(green, 16) + ',' + parseInt(blue, 16) + ',0.1)';\n  }\n\n  /**\n   * Converts rgba value to hex string\n   * @param {string} color\n   * @returns {string}\n   */\n  function rgbaToHex(color) {\n    color = color.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\n\n    var hex = (color && color.length === 4) ? \"#\" +\n    (\"0\" + parseInt(color[1],10).toString(16)).slice(-2) +\n    (\"0\" + parseInt(color[2],10).toString(16)).slice(-2) +\n    (\"0\" + parseInt(color[3],10).toString(16)).slice(-2) : '';\n\n    return hex.toUpperCase();\n  }\n\n  /**\n   * Converts an RGB color to RGBA\n   * @param {string} color\n   * @returns {string}\n   */\n  function rgbToRgba (color) {\n    return color.replace(')', ', 0.1)').replace('(', 'a(');\n  }\n\n  /**\n   * Converts an RGBA color to RGB\n   * @param {string} color\n   * @returns {string}\n   */\n  function rgbaToRgb (color) {\n    return color\n      ? color.replace('rgba', 'rgb').replace(/,[^),]+\\)/, ')')\n      : 'rgb(0,0,0)';\n  }\n\n  return {\n    rgbaToHex: rgbaToHex,\n    hexToRgba: hexToRgba,\n    rgbToRgba: rgbToRgba,\n    rgbaToRgb: rgbaToRgb\n  };\n}\n"
  },
  {
    "path": "src/core/util/constant.js",
    "content": "angular.module('material.core')\n.factory('$mdConstant', MdConstantFactory);\n\n/**\n * Factory function that creates the grab-bag $mdConstant service.\n * @ngInject\n */\nfunction MdConstantFactory() {\n\n  var prefixTestEl = document.createElement('div');\n  var vendorPrefix = getVendorPrefix(prefixTestEl);\n  var isWebkit = /webkit/i.test(vendorPrefix);\n  var SPECIAL_CHARS_REGEXP = /([:\\-_]+(.))/g;\n\n  /**\n   * @param {string} name CSS property name\n   * @return {string} the property name supported by the browser\n   */\n  function vendorProperty(name) {\n    // Add a dash between the prefix and name, to be able to transform the string into camelcase.\n    var prefixedName = vendorPrefix + '-' + name;\n    var ucPrefix = camelCase(prefixedName);\n    var lcPrefix = ucPrefix.charAt(0).toLowerCase() + ucPrefix.substring(1);\n\n    return hasStyleProperty(prefixTestEl, name)     ? name     :       // The current browser supports the un-prefixed property\n           hasStyleProperty(prefixTestEl, ucPrefix) ? ucPrefix :       // The current browser only supports the prefixed property.\n           hasStyleProperty(prefixTestEl, lcPrefix) ? lcPrefix : name; // Some browsers are only supporting the prefix in lowercase.\n  }\n\n  function hasStyleProperty(testElement, property) {\n    return angular.isDefined(testElement.style[property]);\n  }\n\n  /**\n   * @param {!string} input value to convert to camelCase\n   * @return {string} camelCased version of the input string\n   */\n  function camelCase(input) {\n    return input.replace(SPECIAL_CHARS_REGEXP, function(matches, separator, letter, offset) {\n      return offset ? letter.toUpperCase() : letter;\n    });\n  }\n\n  function getVendorPrefix(testElement) {\n    var prop, match;\n    var vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/;\n\n    for (prop in testElement.style) {\n      if (match = vendorRegex.exec(prop)) {\n        return match[0];\n      }\n    }\n  }\n\n  var self = {\n    isInputKey : function(e) { return (e.keyCode >= 31 && e.keyCode <= 90); },\n    isNumPadKey : function(e) { return (3 === e.location && e.keyCode >= 97 && e.keyCode <= 105); },\n    isMetaKey: function(e) { return (e.keyCode >= 91 && e.keyCode <= 93); },\n    isFnLockKey: function(e) { return (e.keyCode >= 112 && e.keyCode <= 145); },\n    isNavigationKey : function(e) {\n      var kc = self.KEY_CODE, NAVIGATION_KEYS =  [kc.SPACE, kc.ENTER, kc.UP_ARROW, kc.DOWN_ARROW];\n      return (NAVIGATION_KEYS.indexOf(e.keyCode) != -1);\n    },\n    hasModifierKey: function(e) {\n      return e.ctrlKey || e.metaKey || e.altKey;\n    },\n\n    /**\n     * Maximum size, in pixels, that can be explicitly set to an element. The actual value varies\n     * between browsers, but IE11 has the very lowest size at a mere 1,533,917px. Ideally we could\n     * compute this value, but Firefox always reports an element to have a size of zero if it\n     * goes over the max, meaning that we'd have to binary search for the value.\n     */\n    ELEMENT_MAX_PIXELS: 1533917,\n\n    /**\n     * Priority for a directive that should run before the directives from ngAria.\n     */\n    BEFORE_NG_ARIA: 210,\n\n    /**\n     * Common Keyboard actions and their associated keycode.\n     */\n    KEY_CODE: {\n      COMMA: 188,\n      SEMICOLON : 186,\n      ENTER: 13,\n      ESCAPE: 27,\n      SPACE: 32,\n      PAGE_UP: 33,\n      PAGE_DOWN: 34,\n      END: 35,\n      HOME: 36,\n      LEFT_ARROW : 37,\n      UP_ARROW : 38,\n      RIGHT_ARROW : 39,\n      DOWN_ARROW : 40,\n      TAB : 9,\n      BACKSPACE: 8,\n      DELETE: 46\n    },\n\n    /**\n     * Vendor prefixed CSS properties to be used to support the given functionality in older browsers\n     * as well.\n     */\n    CSS: {\n      /* Constants */\n      TRANSITIONEND: 'transitionend' + (isWebkit ? ' webkitTransitionEnd' : ''),\n      ANIMATIONEND: 'animationend' + (isWebkit ? ' webkitAnimationEnd' : ''),\n\n      TRANSFORM: vendorProperty('transform'),\n      TRANSFORM_ORIGIN: vendorProperty('transformOrigin'),\n      TRANSITION: vendorProperty('transition'),\n      TRANSITION_DURATION: vendorProperty('transitionDuration'),\n      ANIMATION_PLAY_STATE: vendorProperty('animationPlayState'),\n      ANIMATION_DURATION: vendorProperty('animationDuration'),\n      ANIMATION_NAME: vendorProperty('animationName'),\n      ANIMATION_TIMING: vendorProperty('animationTimingFunction'),\n      ANIMATION_DIRECTION: vendorProperty('animationDirection')\n    },\n\n    /**\n     * As defined in core/style/_variables.scss\n     *\n     * $layout-breakpoint-xs:     600px !default;\n     * $layout-breakpoint-sm:     960px !default;\n     * $layout-breakpoint-md:     1280px !default;\n     * $layout-breakpoint-lg:     1920px !default;\n     *\n     */\n    MEDIA: {\n      'xs'        : '(max-width: 599px)'                         ,\n      'gt-xs'     : '(min-width: 600px)'                         ,\n      'sm'        : '(min-width: 600px) and (max-width: 959px)'  ,\n      'gt-sm'     : '(min-width: 960px)'                         ,\n      'md'        : '(min-width: 960px) and (max-width: 1279px)' ,\n      'gt-md'     : '(min-width: 1280px)'                        ,\n      'lg'        : '(min-width: 1280px) and (max-width: 1919px)',\n      'gt-lg'     : '(min-width: 1920px)'                        ,\n      'xl'        : '(min-width: 1920px)'                        ,\n      'landscape' : '(orientation: landscape)'                   ,\n      'portrait'  : '(orientation: portrait)'                    ,\n      'print' : 'print'\n    },\n\n    MEDIA_PRIORITY: [\n      'xl',\n      'gt-lg',\n      'lg',\n      'gt-md',\n      'md',\n      'gt-sm',\n      'sm',\n      'gt-xs',\n      'xs',\n      'landscape',\n      'portrait',\n      'print'\n    ]\n  };\n\n  return self;\n}\n"
  },
  {
    "path": "src/core/util/iterator.js",
    "content": "  angular\n    .module('material.core')\n    .config(function($provide){\n       $provide.decorator('$mdUtil', ['$delegate', function ($delegate){\n           /**\n            * Inject the iterator facade to easily support iteration and accessors\n            * @see iterator below\n            */\n           $delegate.iterator = MdIterator;\n\n           return $delegate;\n         }\n       ]);\n     });\n\n  /**\n   * iterator is a list facade to easily support iteration and accessors/\n   *\n   * @param {any[]} items Array list which this iterator will enumerate\n   * @param {boolean=} reloop enables iterator to consider the list as an endless loop\n   * @return {{add: add, next: (function()), last: (function(): any|null), previous: (function()), count: (function(): number), hasNext: (function(*=): Array.length|*|number|boolean), inRange: (function(*): boolean), remove: remove, contains: (function(*=): *|boolean), itemAt: (function(*=): any|null), findBy: (function(*, *): *[]), hasPrevious: (function(*=): Array.length|*|number|boolean), items: (function(): *[]), indexOf: (function(*=): number), first: (function(): any|null)}}\n   * @constructor\n   */\n  function MdIterator(items, reloop) {\n    var trueFn = function() { return true; };\n\n    if (items && !angular.isArray(items)) {\n      items = Array.prototype.slice.call(items);\n    }\n\n    reloop = !!reloop;\n    var _items = items || [];\n\n    // Published API\n    return {\n      items: getItems,\n      count: count,\n\n      inRange: inRange,\n      contains: contains,\n      indexOf: indexOf,\n      itemAt: itemAt,\n\n      findBy: findBy,\n\n      add: add,\n      remove: remove,\n\n      first: first,\n      last: last,\n      next: angular.bind(null, findSubsequentItem, false),\n      previous: angular.bind(null, findSubsequentItem, true),\n\n      hasPrevious: hasPrevious,\n      hasNext: hasNext\n    };\n\n    /**\n     * Publish copy of the enumerable set\n     * @returns {Array|*}\n     */\n    function getItems() {\n      return [].concat(_items);\n    }\n\n    /**\n     * Determine length of the list\n     * @returns {Array.length|*|number}\n     */\n    function count() {\n      return _items.length;\n    }\n\n    /**\n     * Is the index specified valid\n     * @param index\n     * @returns {Array.length|*|number|boolean}\n     */\n    function inRange(index) {\n      return _items.length && (index > -1) && (index < _items.length);\n    }\n\n    /**\n     * Can the iterator proceed to the next item in the list; relative to\n     * the specified item.\n     *\n     * @param item\n     * @returns {Array.length|*|number|boolean}\n     */\n    function hasNext(item) {\n      return item ? inRange(indexOf(item) + 1) : false;\n    }\n\n    /**\n     * Can the iterator proceed to the previous item in the list; relative to\n     * the specified item.\n     *\n     * @param item\n     * @returns {Array.length|*|number|boolean}\n     */\n    function hasPrevious(item) {\n      return item ? inRange(indexOf(item) - 1) : false;\n    }\n\n    /**\n     * Get item at specified index/position\n     * @param index\n     * @returns {*}\n     */\n    function itemAt(index) {\n      return inRange(index) ? _items[index] : null;\n    }\n\n    /**\n     * Find all elements matching the key/value pair\n     * otherwise return null\n     *\n     * @param val\n     * @param key\n     *\n     * @return array\n     */\n    function findBy(key, val) {\n      return _items.filter(function(item) {\n        return item[key] === val;\n      });\n    }\n\n    /**\n     * Add item to list\n     * @param item\n     * @param index\n     * @returns {*}\n     */\n    function add(item, index) {\n      if (!item) return -1;\n\n      if (!angular.isNumber(index)) {\n        index = _items.length;\n      }\n\n      _items.splice(index, 0, item);\n\n      return indexOf(item);\n    }\n\n    /**\n     * Remove item from list...\n     * @param item\n     */\n    function remove(item) {\n      if (contains(item)){\n        _items.splice(indexOf(item), 1);\n      }\n    }\n\n    /**\n     * Get the zero-based index of the target item\n     * @param item\n     * @returns {*}\n     */\n    function indexOf(item) {\n      return _items.indexOf(item);\n    }\n\n    /**\n     * Boolean existence check\n     * @param item\n     * @returns {boolean}\n     */\n    function contains(item) {\n      return item && (indexOf(item) > -1);\n    }\n\n    /**\n     * Return first item in the list\n     * @returns {*}\n     */\n    function first() {\n      return _items.length ? _items[0] : null;\n    }\n\n    /**\n     * Return last item in the list...\n     * @returns {*}\n     */\n    function last() {\n      return _items.length ? _items[_items.length - 1] : null;\n    }\n\n    /**\n     * Find the next item. If reloop is true and at the end of the list, it will go back to the\n     * first item. If given, the `validate` callback will be used to determine whether the next item\n     * is valid. If not valid, it will try to find the next item again.\n     *\n     * @param {boolean} backwards Specifies the direction of searching (forwards/backwards)\n     * @param {*} item The item whose subsequent item we are looking for\n     * @param {Function=} validate The `validate` function\n     * @param {integer=} limit The recursion limit\n     *\n     * @returns {*} The subsequent item or null\n     */\n    function findSubsequentItem(backwards, item, validate, limit) {\n      validate = validate || trueFn;\n\n      var curIndex = indexOf(item);\n      while (true) {\n        if (!inRange(curIndex)) return null;\n\n        var nextIndex = curIndex + (backwards ? -1 : 1);\n        var foundItem = null;\n        if (inRange(nextIndex)) {\n          foundItem = _items[nextIndex];\n        } else if (reloop) {\n          foundItem = backwards ? last() : first();\n          nextIndex = indexOf(foundItem);\n        }\n\n        if ((foundItem === null) || (nextIndex === limit)) return null;\n        if (validate(foundItem)) return foundItem;\n\n        if (angular.isUndefined(limit)) limit = nextIndex;\n\n        curIndex = nextIndex;\n      }\n    }\n  }\n\n"
  },
  {
    "path": "src/core/util/iterator.spec.js",
    "content": "describe('iterator', function() {\n  beforeEach(module('material.core'));\n\n  describe('use to provide accessor API ', function () {\n\n    var list, iter;\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list);\n    }));\n\n    it('should construct properly', inject(function($mdUtil) {\n      expect(iter.count()).toEqual(11);\n\n      var iter2 = $mdUtil.iterator();\n      expect(iter2.count()).toEqual(0);\n    }));\n\n    it('should publish read-only access to the dataset', function () {\n      var ds = iter.items();\n\n      ds[0] = 'Thomas';\n\n      expect(list[0]).toEqual(13);\n    });\n\n    it('should provide indexOf() accessor', function () {\n\n      expect(iter.indexOf(13)).toBe(0);\n      expect(iter.indexOf(99)).toBe(10);\n      expect(iter.indexOf(15)).toBe(3);\n      expect(iter.indexOf(10)).toBe(-1);\n\n      expect(iter.indexOf('Max')).toBe(9);\n      expect(iter.indexOf('max')).toBe(-1);\n      expect(iter.indexOf('Marcy')).toBe(2);\n    });\n\n    it('should provide inRange() accessor', function () {\n\n      expect(iter.inRange(-1)).toBe(false);\n      expect(iter.inRange(10)).toBe(true);\n      expect(iter.inRange(11)).toBe(false);\n      expect(iter.inRange(13)).toBe(false);\n\n    });\n\n    it('should provide contains()', function () {\n\n      expect(iter.contains(16)).toBeTruthy();\n      expect(iter.contains(98)).toBeFalsy();\n      expect(iter.contains('Max')).toBe(true);\n      expect(iter.contains('max')).toBe(false);\n\n      expect(iter.itemAt(0)).toBe(13);\n      expect(iter.itemAt(10)).toBe(99);\n      expect(iter.itemAt(7)).toBe('Adam');\n      expect(iter.itemAt(2)).toBe('Marcy');\n    });\n\n    it('should provide itemAt()', function () {\n\n      expect(iter.itemAt(0)).toBe(13);\n      expect(iter.itemAt(10)).toBe(99);\n      expect(iter.itemAt(7)).toBe('Adam');\n      expect(iter.itemAt(2)).toBe('Marcy');\n\n      // Out of range\n      expect(iter.itemAt(12)).toBeNull();\n      expect(iter.itemAt(-1)).toBeNull();\n      expect(iter.itemAt(27)).toBeNull();\n    });\n\n  });\n\n  describe('use to provide mutator API ', function () {\n    var list, iter;\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list);\n    }));\n\n    it('should use add() to append or insert items properly', function () {\n\n      iter.add(\"47\");\n\n      // Original list remains the data provider\n      expect(iter.count()).toEqual(12);\n      expect(list.length).toEqual(12);\n\n      iter.add({firstName: 'Thomas', lastName: 'Burleson'});\n      expect(iter.itemAt(12).lastName).toBe('Burleson');\n\n      iter.add('Thomas', 1);\n      expect(iter.count()).toEqual(14);\n      expect(iter.itemAt(1)).toEqual('Thomas');\n\n      iter.add(null);\n      expect(iter.count()).toEqual(14);\n\n      iter.add();\n      expect(iter.count()).toEqual(14);\n\n    });\n\n    it('should remove() items properly', function () {\n\n      // Remove 1st item\n      iter.remove(13);\n      expect(iter.count()).toEqual(10);\n      expect(iter.itemAt(0)).toBe(14);\n\n      // Remove last item\n      iter.remove(99);\n      expect(iter.count()).toEqual(9);\n      expect(iter.itemAt(8)).toBe('Max');\n\n      // Remove interior item\n      iter.remove('Andrew');\n      expect(iter.count()).toEqual(8);\n      expect(iter.itemAt(3)).toBe(16);\n\n      iter.remove(null);\n      expect(iter.itemAt(3)).toBe(16);\n\n    });\n\n  });\n\n  describe('use to provide navigation API ', function () {\n    var list, iter;\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list);\n    }));\n\n    it('should use first() properly', function () {\n\n      expect(iter.first()).toBe(13);\n\n      iter.add(\"47\");\n      expect(iter.first()).toBe(13);\n\n      iter.add('Md', 0);\n      expect(iter.first()).toBe('Md');\n\n      iter.remove('Md');\n      expect(iter.first()).toBe(13);\n\n      iter.remove(iter.first());\n      expect(iter.first()).toBe(14);\n    });\n\n    it('should last() items properly', inject(function ($mdUtil) {\n\n      expect(iter.last()).toBe(99);\n\n      iter.add(\"47\");\n      expect(iter.last()).toBe(\"47\");\n\n      iter.add('Md', list.length);\n      expect(iter.last()).toBe('Md');\n\n      iter.remove('Md');\n      expect(iter.last()).toBe(\"47\");\n\n      iter.remove(iter.last());\n      iter.remove(iter.last());\n      expect(iter.last()).toBe('Max');\n\n      iter.remove(12);\n      expect(iter.last()).toBe('Max');\n      expect(iter.first()).toBe(13);\n\n      iter = $mdUtil.iterator([2, 5]);\n      iter.remove(2);\n      expect(iter.last()).toBe(iter.first());\n\n    }));\n\n    it('should use hasNext() properly', function () {\n\n      expect(iter.hasNext(iter.first())).toBe(true);\n      expect(iter.hasNext(iter.last())).toBe(false);\n      expect(iter.hasNext(99)).toBe(false);\n      expect(iter.hasNext('Andrew')).toBe(true);\n\n      iter.add(100);\n      expect(iter.hasNext(99)).toBe(true);\n      iter.remove(100);\n      expect(iter.hasNext(99)).toBe(false);\n\n    });\n\n    it('should use hasPrevious() properly', inject(function ($mdUtil) {\n\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n      expect(iter.hasPrevious(iter.last())).toBe(true);\n      expect(iter.hasPrevious(99)).toBe(true);\n      expect(iter.hasPrevious(13)).toBe(false);\n      expect(iter.hasPrevious('Andrew')).toBe(true);\n\n      iter.add(100);\n      expect(iter.hasPrevious(99)).toBe(true);\n      iter.remove(100);\n      expect(iter.hasPrevious(99)).toBe(true);\n\n      iter.remove(13);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n      iter =  $mdUtil.iterator(list = [2, 3]);\n      expect(iter.hasPrevious(iter.last())).toBe(true);\n      iter.remove(2);\n      expect(iter.hasPrevious(iter.last())).toBe(false);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n      iter.remove(iter.first());\n      expect(iter.count()).toBe(0);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n\n      expect(iter.hasPrevious(null)).toBe(false);\n    }));\n\n    it('should use next() properly', function () {\n\n      expect(iter.next(iter.first())).toBe(14);\n\n      iter.add(\"47\",0);\n      expect(iter.next(iter.first())).toBe(13);\n\n      var index = list.length - 3;\n      expect(iter.next(iter.itemAt(index))).toBe('Max');\n\n      expect(iter.next(99)).toBeNull();\n      expect(iter.next(null)).toBeNull();\n    });\n\n    it('should use previous() properly', function () {\n\n      expect(iter.previous(iter.last())).toBe('Max');\n      expect(iter.previous(iter.first())).toBeNull();\n\n      iter.add(\"47\",0);\n      expect(iter.previous(iter.itemAt(1))).toBe(\"47\");\n\n      var index = list.length - 3;\n      expect(iter.previous(iter.itemAt(index))).toBe('Adam');\n\n      expect(iter.previous(99)).toBe('Max');\n      expect(iter.previous(null)).toBeNull();\n    });\n\n  });\n\n  describe('use to provide navigation with validation ', function () {\n    var list, iter;\n    var validate = function(item) { return (item !== 14) && (item !== 'Andrew'); };\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list);\n    }));\n\n    it('should use next() properly', function () {\n\n      expect(iter.next(13,      validate)).toBe('Marcy');\n      expect(iter.next('Marcy', validate)).toBe(15);\n      expect(iter.next(15,      validate)).toBe(16);\n\n    });\n\n    it('should use previous() properly', function () {\n\n      expect(iter.previous(16,      validate)).toBe(15);\n      expect(iter.previous(15,      validate)).toBe('Marcy');\n      expect(iter.previous('Marcy', validate)).toBe(13);\n\n    });\n\n  });\n\n  describe('use to provide navigation API with relooping', function () {\n    var list, iter;\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list, true);\n    }));\n\n    it('should use first() properly', inject(function ($mdUtil) {\n      expect(iter.first()).toBe(13);\n\n      iter.add(\"47\");\n      expect(iter.first()).toBe(13);\n\n      iter.add('Md', 0);\n      expect(iter.first()).toBe('Md');\n\n      iter.remove('Md');\n      expect(iter.first()).toBe(13);\n\n      iter.remove(iter.first());\n      expect(iter.first()).toBe(14);\n\n      iter = $mdUtil.iterator([2, 5]);\n      iter.remove(5);\n      expect(iter.first()).toBe(iter.last());\n    }));\n\n    it('should last() items properly', inject(function ($mdUtil) {\n      expect(iter.last()).toBe(99);\n\n      iter.add(\"47\");\n      expect(iter.last()).toBe(\"47\");\n\n      iter.add('Md', list.length);\n      expect(iter.last()).toBe('Md');\n\n      iter.remove('Md');\n      expect(iter.last()).toBe(\"47\");\n\n      iter.remove(iter.last());\n      iter.remove(iter.last());\n      expect(iter.last()).toBe('Max');\n\n      iter.remove(12);\n      expect(iter.last()).toBe('Max');\n      expect(iter.first()).toBe(13);\n\n      iter = $mdUtil.iterator([2, 5]);\n      iter.remove(2);\n      expect(iter.last()).toBe(iter.first());\n    }));\n\n    it('should use hasNext() properly', inject(function ($mdUtil) {\n      expect(iter.hasNext(iter.first())).toBe(true);\n      expect(iter.hasNext(iter.last())).toBe(false);\n      expect(iter.hasNext(99)).toBe(false);\n      expect(iter.hasNext('Andrew')).toBe(true);\n\n      iter.add(100);\n      expect(iter.hasNext(99)).toBe(true);\n      iter.remove(100);\n      expect(iter.hasNext(99)).toBe(false);\n\n      iter = $mdUtil.iterator(list = [2, 3]);\n      expect(iter.hasNext(iter.first())).toBe(true);\n      iter.remove(3);\n      expect(iter.hasNext(iter.first())).toBe(false);\n      expect(iter.hasNext(iter.last())).toBe(false);\n\n      iter.remove(iter.last());\n      expect(iter.count()).toBe(0);\n      expect(iter.hasNext(iter.last())).toBe(false);\n\n      expect(iter.hasNext(null)).toBe(false);\n    }));\n\n    it('should use hasPrevious() properly', inject(function ($mdUtil) {\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n      expect(iter.hasPrevious(iter.last())).toBe(true);\n      expect(iter.hasPrevious(99)).toBe(true);\n      expect(iter.hasPrevious(13)).toBe(false);\n      expect(iter.hasPrevious('Andrew')).toBe(true);\n\n      iter.add(100);\n      expect(iter.hasPrevious(99)).toBe(true);\n      iter.remove(100);\n      expect(iter.hasPrevious(99)).toBe(true);\n\n      iter.remove(13);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n      iter = $mdUtil.iterator(list = [2, 3]);\n      expect(iter.hasPrevious(iter.last())).toBe(true);\n      iter.remove(2);\n      expect(iter.hasPrevious(iter.last())).toBe(false);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n      iter.remove(iter.first());\n      expect(iter.count()).toBe(0);\n      expect(iter.hasPrevious(iter.first())).toBe(false);\n\n      expect(iter.hasPrevious(null)).toBe(false);\n    }));\n\n    it('should use next() properly', function () {\n      expect(iter.next(iter.first())).toBe(14);\n\n      iter.add('47',0);\n      expect(iter.next(iter.first())).toBe(13);\n\n      var index = list.length - 3;\n      expect(iter.next(iter.itemAt(index))).toBe('Max');\n\n      expect(iter.next(99)).toBe('47');\n      expect(iter.next(null)).toBeNull();\n    });\n\n    it('should use previous() properly', function () {\n      expect(iter.previous(iter.last())).toBe('Max');\n\n      iter.add('47',0);\n      expect(iter.previous(iter.itemAt(1))).toBe(\"47\");\n\n      var index = list.length - 3;\n      expect(iter.previous(iter.itemAt(index))).toBe('Adam');\n\n      expect(iter.previous(99)).toBe('Max');\n      expect(iter.previous('47')).toBe(99);\n      expect(iter.previous(null)).toBeNull();\n    });\n  });\n\n  describe('use to provide navigation API with relooping and validation', function () {\n    var list, iter;\n    var validate1 = function (item) { return (item !== 14) && (item !== 'Andrew'); };\n    var validate2 = function () { return false; };\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [13, 14, 'Marcy', 15, 'Andrew', 16, 21, 'Adam', 37, 'Max', 99];\n      iter = $mdUtil.iterator(list, true);\n    }));\n\n    it('should use next() properly', function () {\n      expect(iter.next(13, validate1)).toBe('Marcy');\n      expect(iter.next('Marcy', validate1)).toBe(15);\n      expect(iter.next(15, validate1)).toBe(16);\n      expect(iter.next(99, validate1)).toBe(13);\n\n      expect(iter.next(iter.first(), validate2)).toBeNull();\n      expect(iter.next(iter.last(), validate2)).toBeNull();\n    });\n\n    it('should use previous() properly', function () {\n      expect(iter.previous(16, validate1)).toBe(15);\n      expect(iter.previous(15, validate1)).toBe('Marcy');\n      expect(iter.previous('Marcy', validate1)).toBe(13);\n      expect(iter.previous(13, validate1)).toBe(99);\n\n      expect(iter.previous(iter.last(), validate2)).toBeNull();\n      expect(iter.previous(iter.first(), validate2)).toBeNull();\n    });\n  });\n\n  describe('use to provide a search API ', function () {\n    var list, iter;\n\n    beforeEach(inject(function ($mdUtil) {\n      list = [\n        { gender:\"male\", name:'Thomas' },\n        { gender:\"male\", name:'Andrew' },\n        { gender:\"female\", name:'Marcy' },\n        { gender:\"female\", name:'Naomi' },\n        { gender:\"male\", name:'Adam' },\n        { gender:\"male\", name:'Max' }\n      ];\n      iter = $mdUtil.iterator(list);\n    }));\n\n    it('should use findBy() properly', function () {\n\n      // Datasets found\n      expect(iter.findBy(\"gender\",\"male\").length).toBe(4);\n      expect(iter.findBy(\"gender\",\"female\").length).toBe(2);\n\n      // Existing Record found\n      expect(iter.findBy(\"name\",\"Naomi\").length).toBe(1);\n\n      // Record not found\n      expect(iter.findBy(\"gender\",\"Ryan\").length).toBe(0);\n\n      // Property not found\n      expect(iter.findBy(\"age\",27).length).toBe(0);\n\n    });\n\n  });\n\n});\n"
  },
  {
    "path": "src/core/util/media.js",
    "content": "angular.module('material.core')\n.factory('$mdMedia', mdMediaFactory);\n\n/**\n * @ngdoc service\n * @name $mdMedia\n * @module material.core\n *\n * @description\n * `$mdMedia` is used to evaluate whether a given media query is true or false given the\n * current device's screen / window size. The media query will be re-evaluated on resize, allowing\n * you to register a watch.\n *\n * `$mdMedia` also has pre-programmed support for media queries that match the layout breakpoints:\n *\n *  <table class=\"md-api-table\">\n *    <thead>\n *    <tr>\n *      <th>Breakpoint</th>\n *      <th>mediaQuery</th>\n *    </tr>\n *    </thead>\n *    <tbody>\n *    <tr>\n *      <td>xs</td>\n *      <td>(max-width: 599px)</td>\n *    </tr>\n *    <tr>\n *      <td>gt-xs</td>\n *      <td>(min-width: 600px)</td>\n *    </tr>\n *    <tr>\n *      <td>sm</td>\n *      <td>(min-width: 600px) and (max-width: 959px)</td>\n *    </tr>\n *    <tr>\n *      <td>gt-sm</td>\n *      <td>(min-width: 960px)</td>\n *    </tr>\n *    <tr>\n *      <td>md</td>\n *      <td>(min-width: 960px) and (max-width: 1279px)</td>\n *    </tr>\n *    <tr>\n *      <td>gt-md</td>\n *      <td>(min-width: 1280px)</td>\n *    </tr>\n *    <tr>\n *      <td>lg</td>\n *      <td>(min-width: 1280px) and (max-width: 1919px)</td>\n *    </tr>\n *    <tr>\n *      <td>gt-lg</td>\n *      <td>(min-width: 1920px)</td>\n *    </tr>\n *    <tr>\n *      <td>xl</td>\n *      <td>(min-width: 1920px)</td>\n *    </tr>\n *    <tr>\n *      <td>landscape</td>\n *      <td>landscape</td>\n *    </tr>\n *    <tr>\n *      <td>portrait</td>\n *      <td>portrait</td>\n *    </tr>\n *    <tr>\n *      <td>print</td>\n *      <td>print</td>\n *    </tr>\n *    </tbody>\n *  </table>\n *\n *  See Material Design's <a href=\"https://material.google.com/layout/responsive-ui.html\">Layout - Adaptive UI</a> for more details.\n *\n *  <a href=\"https://material.io/archive/guidelines/layout/responsive-ui.html#\">\n *  <img src=\"https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B8olV15J7abPSGFxemFiQVRtb1k/layout_adaptive_breakpoints_01.png\" width=\"100%\" height=\"100%\"></img>\n *  </a>\n *\n * @returns {boolean} a boolean representing whether or not the given media query is true or false.\n *\n * @usage\n * <hljs lang=\"js\">\n * app.controller('MyController', function($mdMedia, $scope) {\n *   $scope.$watch(function() { return $mdMedia('lg'); }, function(big) {\n *     $scope.bigScreen = big;\n *   });\n *\n *   $scope.screenIsSmall = $mdMedia('sm');\n *   $scope.customQuery = $mdMedia('(min-width: 1234px)');\n *   $scope.anotherCustom = $mdMedia('max-width: 300px');\n * });\n * </hljs>\n */\n\n/* @ngInject */\nfunction mdMediaFactory($mdConstant, $rootScope, $window) {\n  var queries = {};\n  var mqls = {};\n  var results = {};\n  var normalizeCache = {};\n\n  $mdMedia.getResponsiveAttribute = getResponsiveAttribute;\n  $mdMedia.getQuery = getQuery;\n  $mdMedia.watchResponsiveAttributes = watchResponsiveAttributes;\n\n  return $mdMedia;\n\n  function $mdMedia(query) {\n    var validated = queries[query];\n    if (angular.isUndefined(validated)) {\n      validated = queries[query] = validate(query);\n    }\n\n    var result = results[validated];\n    if (angular.isUndefined(result)) {\n      result = add(validated);\n    }\n\n    return result;\n  }\n\n  function validate(query) {\n    return $mdConstant.MEDIA[query] ||\n           ((query.charAt(0) !== '(') ? ('(' + query + ')') : query);\n  }\n\n  function add(query) {\n    var result = mqls[query];\n    if (!result) {\n      result = mqls[query] = $window.matchMedia(query);\n    }\n\n    result.addListener(onQueryChange);\n    return (results[result.media] = !!result.matches);\n  }\n\n  function onQueryChange(query) {\n    $rootScope.$evalAsync(function() {\n      results[query.media] = !!query.matches;\n    });\n  }\n\n  function getQuery(name) {\n    return mqls[name];\n  }\n\n  function getResponsiveAttribute(attrs, attrName) {\n    for (var i = 0; i < $mdConstant.MEDIA_PRIORITY.length; i++) {\n      var mediaName = $mdConstant.MEDIA_PRIORITY[i];\n      if (!mqls[queries[mediaName]].matches) {\n        continue;\n      }\n\n      var normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n      if (attrs[normalizedName]) {\n        return attrs[normalizedName];\n      }\n    }\n\n    // fallback on unprefixed\n    return attrs[getNormalizedName(attrs, attrName)];\n  }\n\n  function watchResponsiveAttributes(attrNames, attrs, watchFn) {\n    var unwatchFns = [];\n    attrNames.forEach(function(attrName) {\n      var normalizedName = getNormalizedName(attrs, attrName);\n      if (angular.isDefined(attrs[normalizedName])) {\n        unwatchFns.push(\n            attrs.$observe(normalizedName, angular.bind(void 0, watchFn, null)));\n      }\n\n      for (var mediaName in $mdConstant.MEDIA) {\n        normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n        if (angular.isDefined(attrs[normalizedName])) {\n          unwatchFns.push(\n              attrs.$observe(normalizedName, angular.bind(void 0, watchFn, mediaName)));\n        }\n      }\n    });\n\n    return function unwatch() {\n      unwatchFns.forEach(function(fn) { fn(); });\n    };\n  }\n\n  // Improves performance dramatically\n  function getNormalizedName(attrs, attrName) {\n    return normalizeCache[attrName] ||\n        (normalizeCache[attrName] = attrs.$normalize(attrName));\n  }\n}\n"
  },
  {
    "path": "src/core/util/media.spec.js",
    "content": "describe('$mdMedia', function() {\n  var matchMediaResult;\n  var listeners;\n\n  function runListeners() {\n    listeners.forEach(function(cb) {\n      cb.context.matches = matchMediaResult;\n      cb.call(cb.context, cb.context);\n    });\n  }\n\n  beforeEach(module('material.core'));\n\n  beforeEach(inject(function($mdMedia, $window) {\n    matchMediaResult = false;\n    listeners = [];\n\n    spyOn($window, 'matchMedia').and.callFake(function(media) {\n      return {\n        media: media,\n        matches: matchMediaResult,\n        addListener: function(listener) {\n          listener.context = this;\n          listeners.push(listener);\n        }\n      };\n    });\n  }));\n\n  it('should look up queries in `$mdConstant.MEDIA`', inject(\n    function($mdConstant, $mdMedia, $window) {\n      $mdConstant.MEDIA.somePreset = 'someQuery';\n\n      $mdMedia('somePreset');\n      expect($window.matchMedia).toHaveBeenCalledWith('someQuery');\n\n      delete $mdConstant.MEDIA.somePreset;\n    }\n  ));\n\n  it('should validate queries', inject(function($mdMedia, $window) {\n    $mdMedia('something');\n    expect($window.matchMedia).toHaveBeenCalledWith('(something)');\n  }));\n\n  it('should return cached results if available', inject(function($mdMedia, $window) {\n    expect($window.matchMedia.calls.count()).toBe(0);\n\n    expect($mdMedia('query')).toBe(false);\n    expect($window.matchMedia.calls.count()).toBe(1);\n\n    expect($mdMedia('query')).toBe(false);\n    expect($window.matchMedia.calls.count()).toBe(1);\n  }));\n\n  it('should change result when listener is called', inject(function($mdMedia, $window, $timeout) {\n    matchMediaResult = true;\n    expect($mdMedia('query')).toBe(true);\n    expect($window.matchMedia.calls.count()).toBe(1);\n\n    expect($mdMedia('query')).toBe(true);\n    expect($window.matchMedia.calls.count()).toBe(1);\n\n    matchMediaResult = false;\n    expect($mdMedia('query')).toBe(true);\n    expect($window.matchMedia.calls.count()).toBe(1);\n\n    runListeners();\n    $timeout.flush();\n\n    expect($mdMedia('query')).toBe(false);\n  }));\n});\n"
  },
  {
    "path": "src/core/util/prefixer.js",
    "content": "angular\n  .module('material.core')\n  .config(function($provide) {\n    $provide.decorator('$mdUtil', ['$delegate', function ($delegate) {\n\n      // Inject the prefixer into our original $mdUtil service.\n      $delegate.prefixer = MdPrefixer;\n\n      return $delegate;\n    }]);\n  });\n\n/**\n * @param {string|string[]} initialAttributes\n * @param {boolean} buildSelector\n * @return {string|string[]|{buildSelector: (function(string|string[]): string),\n *   buildList: (function(string|string[]): string[]),\n *   hasAttribute: (function(JQLite|Element, string): HTMLElement),\n *   removeAttribute: (function(JQLite|Element, string): void)}}\n * @constructor\n */\nfunction MdPrefixer(initialAttributes, buildSelector) {\n  var PREFIXES = ['data', 'x'];\n\n  if (initialAttributes) {\n    // The prefixer also accepts attributes as a parameter, and immediately builds a list or selector for\n    // the specified attributes.\n    return buildSelector ? _buildSelector(initialAttributes) : _buildList(initialAttributes);\n  }\n\n  return {\n    buildList: _buildList,\n    buildSelector: _buildSelector,\n    hasAttribute: _hasAttribute,\n    removeAttribute: _removeAttribute\n  };\n\n  function _buildList(attributes) {\n    attributes = angular.isArray(attributes) ? attributes : [attributes];\n\n    attributes.forEach(function(item) {\n      PREFIXES.forEach(function(prefix) {\n        attributes.push(prefix + '-' + item);\n      });\n    });\n\n    return attributes;\n  }\n\n  function _buildSelector(attributes) {\n    attributes = angular.isArray(attributes) ? attributes : [attributes];\n\n    return _buildList(attributes)\n      .map(function(item) {\n        return '[' + item + ']';\n      })\n      .join(',');\n  }\n\n  function _hasAttribute(element, attribute) {\n    element = _getNativeElement(element);\n\n    if (!element) {\n      return false;\n    }\n\n    var prefixedAttrs = _buildList(attribute);\n\n    for (var i = 0; i < prefixedAttrs.length; i++) {\n      if (element.hasAttribute(prefixedAttrs[i])) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  function _removeAttribute(element, attribute) {\n    element = _getNativeElement(element);\n\n    if (!element) {\n      return;\n    }\n\n    _buildList(attribute).forEach(function(prefixedAttribute) {\n      element.removeAttribute(prefixedAttribute);\n    });\n  }\n\n  /**\n   * Transforms a jqLite or DOM element into a HTML element.\n   * This is useful when supporting jqLite elements and DOM elements at\n   * same time.\n   * @param element {JQLite|Element} Element to be parsed\n   * @returns {HTMLElement} Parsed HTMLElement\n   */\n  function _getNativeElement(element) {\n    element =  element[0] || element;\n\n    if (element.nodeType) {\n      return element;\n    }\n  }\n\n}\n"
  },
  {
    "path": "src/core/util/prefixer.spec.js",
    "content": "describe('prefixer', function() {\n\n  beforeEach(module('material.core'));\n\n  beforeEach(inject(function($injector) {\n    $mdUtil = $injector.get('$mdUtil');\n  }));\n\n  describe('when using an initial parameter', function() {\n\n    it('should correctly prefix a single attribute', function() {\n      expect($mdUtil.prefixer('ng-click')).toEqual(['ng-click', 'data-ng-click', 'x-ng-click']);\n    });\n\n    it('should correctly prefix multiple attributes', function() {\n      expect($mdUtil.prefixer(['ng-click', 'ng-href']))\n        .toEqual(['ng-click', 'ng-href', 'data-ng-click', 'x-ng-click', 'data-ng-href', 'x-ng-href']);\n    });\n\n    it('should correctly build a selector for a single attribute', function() {\n      expect($mdUtil.prefixer('ng-click', true)).toBe('[ng-click],[data-ng-click],[x-ng-click]');\n    });\n\n    it('should correctly build a selector for multiple attributes', function() {\n      expect($mdUtil.prefixer(['ng-click', 'ng-href'], true))\n        .toBe('[ng-click],[ng-href],[data-ng-click],[x-ng-click],[data-ng-href],[x-ng-href]');\n    });\n\n  });\n\n  describe('when using the returned object', function() {\n    var prefixer;\n\n    beforeEach(function() {\n      prefixer = $mdUtil.prefixer();\n    });\n\n    describe('and building a list', function() {\n\n      it('should correctly prefix a single attribute', function() {\n        expect(prefixer.buildList('ng-click')).toEqual(['ng-click', 'data-ng-click', 'x-ng-click']);\n      });\n\n      it('should correctly prefix multiple attributes', function() {\n        expect(prefixer.buildList(['ng-click', 'ng-href']))\n          .toEqual(['ng-click', 'ng-href', 'data-ng-click', 'x-ng-click', 'data-ng-href', 'x-ng-href']);\n      });\n\n    });\n\n    describe('and building a selector', function() {\n\n      it('should correctly build for a single attribute', function() {\n        expect(prefixer.buildSelector('ng-click')).toBe('[ng-click],[data-ng-click],[x-ng-click]');\n      });\n\n      it('should correctly build for multiple attributes', function() {\n        expect(prefixer.buildSelector(['ng-click', 'ng-href']))\n          .toBe('[ng-click],[ng-href],[data-ng-click],[x-ng-click],[data-ng-href],[x-ng-href]');\n      });\n    });\n\n    describe('and checking for an attribute', function() {\n\n      it('should correctly detect a prefixed attribute', function() {\n        var element = angular.element('<div data-ng-click=\"null\">');\n\n        expect(prefixer.hasAttribute(element, 'ng-click')).toBe(true);\n      });\n\n      it('should correctly detect an un-prefixed attribute', function() {\n        var element = angular.element('<div ng-click=\"null\">');\n\n        expect(prefixer.hasAttribute(element, 'ng-click')).toBe(true);\n      });\n\n      it('should not throw an error if element is undefined', function() {\n        // Create an empty jqLite element to test if it does throw an error.\n        var emptyElement = angular.element();\n\n        expect(function() {\n          prefixer.hasAttribute(emptyElement, 'ng-click')\n        }).not.toThrow();\n      });\n\n    });\n\n    describe('and removing an attribute', function() {\n\n      it('should remove a prefixed attribute', function() {\n        var element = angular.element('<div data-ng-click=\"null\">')[0];\n\n        prefixer.removeAttribute(element, 'ng-click');\n\n        expect(element.hasAttribute('data-ng-click')).toBeFalsy();\n      });\n\n      it('should remove an un-prefixed attribute', function() {\n        var element = angular.element('<div ng-click=\"null\">')[0];\n\n        prefixer.removeAttribute(element, 'ng-click');\n\n        expect(element.hasAttribute('ng-click')).toBeFalsy();\n      });\n\n      it('should remove prefixed and un-prefixed attributes', function() {\n        var element = angular.element('<div ng-click=\"null\" data-ng-click=\"null\">')[0];\n\n        prefixer.removeAttribute(element, 'ng-click');\n\n        expect(prefixer.hasAttribute(element, 'ng-click')).toBeFalsy();\n      });\n\n      it('should not throw an error if element is undefined', function() {\n        // Create an empty jqLite element to test if it does throw an error.\n        var emptyElement = angular.element();\n\n        expect(function() {\n          prefixer.removeAttribute(emptyElement, 'ng-click');\n        }).not.toThrow();\n      });\n\n    });\n\n  });\n\n});"
  },
  {
    "path": "src/core/util/util.js",
    "content": "/*\n * This var has to be outside the angular factory, otherwise when\n * there are multiple material apps on the same page, each app\n * will create its own instance of this array and the app's IDs\n * will not be unique.\n */\nvar nextUniqueId = 0, isIos, isAndroid, isFirefox;\n\n// Support material-tools builds.\nif (window.navigator) {\n  var userAgent = window.navigator.userAgent || window.navigator.vendor || window.opera;\n  isIos = userAgent.match(/ipad|iphone|ipod/i);\n  isAndroid = userAgent.match(/android/i);\n  isFirefox = userAgent.match(/(firefox|minefield)/i);\n}\n\n/**\n * @ngdoc module\n * @name material.core.util\n * @description\n * Util\n */\nangular\n.module('material.core')\n.factory('$mdUtil', UtilFactory);\n\n/**\n * @ngInject\n */\nfunction UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $interpolate, $log,\n                     $rootElement, $window, $$rAF) {\n  // Setup some core variables for the processTemplate method\n  var startSymbol = $interpolate.startSymbol(),\n    endSymbol = $interpolate.endSymbol(),\n    usesStandardSymbols = ((startSymbol === '{{') && (endSymbol === '}}'));\n\n  // Polyfill document.contains for IE11.\n  document.contains || (document.contains = function (node) {\n    return document.body.contains(node);\n  });\n\n  /**\n   * Checks if the target element has the requested style by key\n   * @param {DOMElement|JQLite} target Target element\n   * @param {string} key Style key\n   * @param {string=} expectedVal Optional expected value\n   * @returns {boolean} Whether the target element has the style or not\n   */\n  var hasComputedStyle = function (target, key, expectedVal) {\n    var hasValue = false;\n\n    if (target && target.length) {\n      var computedStyles = $window.getComputedStyle(target[0]);\n      hasValue = angular.isDefined(computedStyles[key]) &&\n        (expectedVal ? computedStyles[key] == expectedVal : true);\n    }\n\n    return hasValue;\n  };\n\n  function validateCssValue(value) {\n    return !value ? '0' :\n      hasPx(value) || hasPercent(value) ? value : value + 'px';\n  }\n\n  function hasPx(value) {\n    return String(value).indexOf('px') > -1;\n  }\n\n  function hasPercent(value) {\n    return String(value).indexOf('%') > -1;\n  }\n\n  var $mdUtil = {\n    dom: {},\n    isIos: isIos,\n    isAndroid: isAndroid,\n    now: window.performance && window.performance.now ?\n      angular.bind(window.performance, window.performance.now) : Date.now || function() {\n      return new Date().getTime();\n    },\n\n    /**\n     * Cross-version compatibility method to retrieve an option of a ngModel controller,\n     * which supports the breaking changes in the AngularJS snapshot (SHA 87a2ff76af5d0a9268d8eb84db5755077d27c84c).\n     * @param {!ngModel.NgModelController} ngModelCtrl\n     * @param {!string} optionName\n     * @returns {string|number|boolean|Object|undefined}\n     */\n    getModelOption: function (ngModelCtrl, optionName) {\n      if (!ngModelCtrl.$options) {\n        return;\n      }\n\n      var $options = ngModelCtrl.$options;\n\n      // The newer versions of AngularJS introduced a getOption function and made the option values\n      // no longer visible on the $options object.\n      return $options.getOption ? $options.getOption(optionName) : $options[optionName];\n    },\n\n    /**\n     * Determines the current 'dir'ectional value based on the value of 'dir'\n     * attribute of the element. If that is not defined, it will try to use\n     * a 'dir' attribute of the body or html tag.\n     *\n     * @param {Object=} attrs a hash object with key-value pairs of normalized\n     *     attribute names and their corresponding attribute values.\n     * @returns {boolean} true if the element's passed in attributes,\n     *     the document, or the body indicates RTL mode, false otherwise.\n     */\n    isRtl: function(attrs) {\n      var dir = angular.isDefined(attrs) && attrs.hasOwnProperty('dir') && attrs.dir;\n\n      switch (dir) {\n        case 'ltr':\n          return false;\n\n        case 'rtl':\n          return true;\n      }\n\n      return ($document[0].dir === 'rtl' || $document[0].body.dir === 'rtl');\n    },\n\n    /**\n     * Bi-directional accessor/mutator used to easily update an element's\n     * property based on the current 'dir'ectional value.\n     */\n    bidi: function(element, property, lValue, rValue) {\n      var ltr = !this.isRtl();\n\n      // If accessor\n      if (arguments.length == 0) return ltr ? 'ltr' : 'rtl';\n\n      // If mutator\n      var elem = angular.element(element);\n\n      if (ltr && angular.isDefined(lValue)) {\n        elem.css(property, validateCssValue(lValue));\n      }\n      else if (!ltr && angular.isDefined(rValue)) {\n        elem.css(property, validateCssValue(rValue));\n      }\n    },\n\n    bidiProperty: function (element, lProperty, rProperty, value) {\n      var ltr = !this.isRtl();\n\n      var elem = angular.element(element);\n\n      if (ltr && angular.isDefined(lProperty)) {\n        elem.css(lProperty, validateCssValue(value));\n        elem.css(rProperty, '');\n      }\n      else if (!ltr && angular.isDefined(rProperty)) {\n        elem.css(rProperty, validateCssValue(value));\n        elem.css(lProperty, '');\n      }\n    },\n\n    clientRect: function(element, offsetParent, isOffsetRect) {\n      var node = getNode(element);\n      offsetParent = getNode(offsetParent || node.offsetParent || document.body);\n      var nodeRect = node.getBoundingClientRect();\n\n      // The user can ask for an offsetRect: a rect relative to the offsetParent,\n      // or a clientRect: a rect relative to the page\n      var offsetRect = isOffsetRect ?\n        offsetParent.getBoundingClientRect() :\n        {left: 0, top: 0, width: 0, height: 0};\n      return {\n        left: nodeRect.left - offsetRect.left,\n        top: nodeRect.top - offsetRect.top,\n        width: nodeRect.width,\n        height: nodeRect.height\n      };\n    },\n    offsetRect: function(element, offsetParent) {\n      return $mdUtil.clientRect(element, offsetParent, true);\n    },\n\n    /**\n     * Annoying method to copy nodes to an array, thanks to IE.\n     * @param nodes\n     * @return {Array}\n     */\n    nodesToArray: function(nodes) {\n      var results = [], i;\n      nodes = nodes || [];\n\n      for (i = 0; i < nodes.length; ++i) {\n        results.push(nodes.item(i));\n      }\n      return results;\n    },\n\n    /**\n     * Determines the absolute position of the viewport.\n     * Useful when making client rectangles absolute.\n     * @returns {number}\n     */\n    getViewportTop: function() {\n      // If body scrolling is disabled, then use the cached viewport top value, otherwise get it\n      // fresh from the $window.\n      if ($mdUtil.disableScrollAround._count && $mdUtil.disableScrollAround._viewPortTop) {\n        return $mdUtil.disableScrollAround._viewPortTop;\n      } else {\n        return $window.scrollY || $window.pageYOffset || 0;\n      }\n    },\n\n    /**\n     * Finds the proper focus target by searching the DOM.\n     *\n     * @param {!JQLite} containerEl\n     * @param {string=} attributeVal\n     * @returns {JQLite|undefined}\n     */\n    findFocusTarget: function(containerEl, attributeVal) {\n      var AUTO_FOCUS = this.prefixer('md-autofocus', true);\n      var elToFocus;\n\n      elToFocus = scanForFocusable(containerEl, attributeVal || AUTO_FOCUS);\n\n      // Scan for fallback to 'universal' API\n      if (!elToFocus) {\n        elToFocus = scanForFocusable(containerEl, AUTO_FOCUS);\n      }\n\n      return elToFocus;\n\n      /**\n       * Can target and nested children for specified Selector (attribute)\n       * whose value may be an expression that evaluates to True/False.\n       * @param {!JQLite} target\n       * @param {!string} selector\n       * @return {JQLite|undefined}\n       */\n      function scanForFocusable(target, selector) {\n        var elFound, items = target[0].querySelectorAll(selector);\n\n        // Find the last child element with the focus attribute\n        if (items && items.length) {\n          items.length && angular.forEach(items, function(it) {\n            it = angular.element(it);\n\n            // Check the element for the md-autofocus class to ensure any associated expression\n            // evaluated to true.\n            var isFocusable = it.hasClass('md-autofocus');\n            if (isFocusable) elFound = it;\n          });\n        }\n        return elFound;\n      }\n    },\n\n    /**\n     * Disables scroll around the passed parent element.\n     * @param {Element|JQLite=} element Origin Element (not used)\n     * @param {Element|JQLite=} parent Element to disable scrolling within.\n     *   Defaults to body if none supplied.\n     * @param {Object=} options Object of options to modify functionality\n     *   - disableScrollMask Boolean of whether or not to create a scroll mask element or\n     *     use the passed parent element.\n     */\n    disableScrollAround: function(element, parent, options) {\n      options = options || {};\n\n      $mdUtil.disableScrollAround._count = Math.max(0, $mdUtil.disableScrollAround._count || 0);\n      $mdUtil.disableScrollAround._count++;\n\n      if ($mdUtil.disableScrollAround._restoreScroll) {\n        return $mdUtil.disableScrollAround._restoreScroll;\n      }\n\n      var body = $document[0].body;\n      var restoreBody = disableBodyScroll();\n      var restoreElement = disableElementScroll(parent, options);\n\n      return $mdUtil.disableScrollAround._restoreScroll = function() {\n        if (--$mdUtil.disableScrollAround._count <= 0) {\n          delete $mdUtil.disableScrollAround._viewPortTop;\n          restoreBody();\n          restoreElement();\n          delete $mdUtil.disableScrollAround._restoreScroll;\n        }\n      };\n\n      /**\n       * Creates a virtual scrolling mask to prevent touchmove, keyboard, scrollbar clicking,\n       * and wheel events.\n       * @param {!Element|!JQLite} elementToDisable\n       * @param {Object=} scrollMaskOptions Object of options to modify functionality\n       *   - disableScrollMask Boolean of whether or not to create a scroll mask element or\n       *     use the passed parent element.\n       * @returns {Function}\n       */\n      function disableElementScroll(elementToDisable, scrollMaskOptions) {\n        var scrollMask;\n        var wrappedElementToDisable = angular.element(elementToDisable || body);\n\n        if (scrollMaskOptions.disableScrollMask) {\n          scrollMask = wrappedElementToDisable;\n        } else {\n          scrollMask = angular.element(\n            '<div class=\"md-scroll-mask\">' +\n            '  <div class=\"md-scroll-mask-bar\"></div>' +\n            '</div>');\n          wrappedElementToDisable.append(scrollMask);\n        }\n\n        /**\n         * @param {Event} $event\n         */\n        function preventDefault($event) {\n          $event.preventDefault();\n        }\n\n        scrollMask.on('wheel touchmove', preventDefault);\n\n        return function restoreElementScroll() {\n          scrollMask.off('wheel touchmove', preventDefault);\n\n          if (!scrollMaskOptions.disableScrollMask && scrollMask[0].parentNode) {\n            scrollMask[0].parentNode.removeChild(scrollMask[0]);\n          }\n        };\n      }\n\n      // Converts the body to a position fixed block and translate it to the proper scroll position\n      function disableBodyScroll() {\n        var documentElement = $document[0].documentElement;\n\n        var prevDocumentStyle = documentElement.style.cssText || '';\n        var prevBodyStyle = body.style.cssText || '';\n\n        var viewportTop = $mdUtil.getViewportTop();\n        $mdUtil.disableScrollAround._viewPortTop = viewportTop;\n        var clientWidth = body.clientWidth;\n        var hasVerticalScrollbar = body.scrollHeight > body.clientHeight + 1;\n\n        // Scroll may be set on <html> element (for example by overflow-y: scroll)\n        // but Chrome is reporting the scrollTop position always on <body>.\n        // scrollElement will allow to restore the scrollTop position to proper target.\n        var scrollElement = documentElement.scrollTop > 0 ? documentElement : body;\n\n        if (hasVerticalScrollbar) {\n          angular.element(body).css({\n            position: 'fixed',\n            width: '100%',\n            top: -viewportTop + 'px'\n          });\n        }\n\n        if (body.clientWidth < clientWidth) {\n          body.style.overflow = 'hidden';\n        }\n\n        return function restoreScroll() {\n          // Reset the inline style CSS to the previous.\n          body.style.cssText = prevBodyStyle;\n          documentElement.style.cssText = prevDocumentStyle;\n\n          // The scroll position while being fixed\n          scrollElement.scrollTop = viewportTop;\n        };\n      }\n\n    },\n\n    enableScrolling: function() {\n      var restoreFn = this.disableScrollAround._restoreScroll;\n      restoreFn && restoreFn();\n    },\n\n    floatingScrollbars: function() {\n      if (this.floatingScrollbars.cached === undefined) {\n        var tempNode = angular.element('<div><div></div></div>').css({\n          width: '100%',\n          'z-index': -1,\n          position: 'absolute',\n          height: '35px',\n          'overflow-y': 'scroll'\n        });\n        tempNode.children().css('height', '60px');\n\n        $document[0].body.appendChild(tempNode[0]);\n        this.floatingScrollbars.cached =\n          (tempNode[0].offsetWidth === tempNode[0].childNodes[0].offsetWidth);\n        tempNode.remove();\n      }\n      return this.floatingScrollbars.cached;\n    },\n\n    /**\n     * Mobile safari only allows you to set focus in click event listeners.\n     * @param {Element|JQLite} element to focus\n     */\n    forceFocus: function(element) {\n      var node = element[0] || element;\n\n      document.addEventListener('click', function focusOnClick(ev) {\n        if (ev.target === node && ev.$focus) {\n          node.focus();\n          ev.stopImmediatePropagation();\n          ev.preventDefault();\n          node.removeEventListener('click', focusOnClick);\n        }\n      }, true);\n\n      var newEvent = document.createEvent('MouseEvents');\n      newEvent.initMouseEvent('click', false, true, window, {}, 0, 0, 0, 0,\n        false, false, false, false, 0, null);\n      newEvent.$material = true;\n      newEvent.$focus = true;\n      node.dispatchEvent(newEvent);\n    },\n\n    /**\n     * facade to build md-backdrop element with desired styles\n     * NOTE: Use $compile to trigger backdrop postLink function\n     */\n    createBackdrop: function(scope, addClass) {\n      return $compile($mdUtil.supplant('<md-backdrop class=\"{0}\">', [addClass]))(scope);\n    },\n\n    /**\n     * supplant() method from Crockford's `Remedial Javascript`\n     * Equivalent to use of $interpolate; without dependency on\n     * interpolation symbols and scope. Note: the '{<token>}' can\n     * be property names, property chains, or array indices.\n     */\n    supplant: function(template, values, pattern) {\n      pattern = pattern || /\\{([^{}]*)\\}/g;\n      return template.replace(pattern, function(a, b) {\n        var p = b.split('.'),\n          r = values;\n        try {\n          for (var s in p) {\n            if (p.hasOwnProperty(s)) {\n              r = r[p[s]];\n            }\n          }\n        } catch (e) {\n          r = a;\n        }\n        return (typeof r === 'string' || typeof r === 'number') ? r : a;\n      });\n    },\n\n    fakeNgModel: function() {\n      return {\n        $fake: true,\n        $setTouched: angular.noop,\n        $setViewValue: function(value) {\n          this.$viewValue = value;\n          this.$render(value);\n          this.$viewChangeListeners.forEach(function(cb) {\n            cb();\n          });\n        },\n        $isEmpty: function(value) {\n          return ('' + value).length === 0;\n        },\n        $parsers: [],\n        $formatters: [],\n        $viewChangeListeners: [],\n        $render: angular.noop\n      };\n    },\n\n    /**\n     * @param {Function} func original function to be debounced\n     * @param {number} wait number of milliseconds to delay (since last debounce reset).\n     *  Default value 10 msecs.\n     * @param {Object} scope in which to apply the function after debouncing ends\n     * @param {boolean} invokeApply should the $timeout trigger $digest() dirty checking\n     * @return {Function} A function, that, as long as it continues to be invoked, will not be\n     *  triggered. The function will be called after it stops being called for N milliseconds.\n     */\n    debounce: function(func, wait, scope, invokeApply) {\n      var timer;\n\n      return function debounced() {\n        var context = scope,\n            args = Array.prototype.slice.call(arguments);\n\n        $timeout.cancel(timer);\n        timer = $timeout(function() {\n\n          timer = undefined;\n          func.apply(context, args);\n\n        }, wait || 10, invokeApply);\n      };\n    },\n\n    /**\n     * The function will not be called unless it has been more than `delay` milliseconds since the\n     * last call.\n     * @param {Function} func original function to throttle\n     * @param {number} delay number of milliseconds to delay\n     * @return {Function} a function that can only be triggered every `delay` milliseconds.\n     */\n    throttle: function throttle(func, delay) {\n      var recent;\n      return function throttled() {\n        var context = this;\n        var args = arguments;\n        var now = $mdUtil.now();\n\n        if (!recent || (now - recent > delay)) {\n          func.apply(context, args);\n          recent = now;\n        }\n      };\n    },\n\n    /**\n     * Measures the number of milliseconds taken to run the provided callback\n     * function. Uses a high-precision timer if available.\n     */\n    time: function time(cb) {\n      var start = $mdUtil.now();\n      cb();\n      return $mdUtil.now() - start;\n    },\n\n    /**\n     * Create an implicit getter that caches its `getter()`\n     * lookup value\n     */\n    valueOnUse : function (scope, key, getter) {\n      var value = null, args = Array.prototype.slice.call(arguments);\n      var params = (args.length > 3) ? args.slice(3) : [];\n\n      Object.defineProperty(scope, key, {\n        get: function () {\n          if (value === null) value = getter.apply(scope, params);\n          return value;\n        }\n      });\n    },\n\n    /**\n     * Get a unique ID.\n     *\n     * @returns {string} an unique numeric string\n     */\n    nextUid: function() {\n      return '' + nextUniqueId++;\n    },\n\n    /**\n     * Stop watchers and events from firing on a scope without destroying it,\n     * by disconnecting it from its parent and its siblings' linked lists.\n     * @param {Object} scope to disconnect\n     */\n    disconnectScope: function disconnectScope(scope) {\n      if (!scope) return;\n\n      // we can't destroy the root scope or a scope that has been already destroyed\n      if (scope.$root === scope) return;\n      if (scope.$$destroyed) return;\n\n      var parent = scope.$parent;\n      scope.$$disconnected = true;\n\n      // See Scope.$destroy\n      if (parent.$$childHead === scope) parent.$$childHead = scope.$$nextSibling;\n      if (parent.$$childTail === scope) parent.$$childTail = scope.$$prevSibling;\n      if (scope.$$prevSibling) scope.$$prevSibling.$$nextSibling = scope.$$nextSibling;\n      if (scope.$$nextSibling) scope.$$nextSibling.$$prevSibling = scope.$$prevSibling;\n\n      scope.$$nextSibling = scope.$$prevSibling = null;\n\n    },\n\n    /**\n     * Undo the effects of disconnectScope().\n     * @param {Object} scope to reconnect\n     */\n    reconnectScope: function reconnectScope(scope) {\n      if (!scope) return;\n\n      // we can't disconnect the root node or scope already disconnected\n      if (scope.$root === scope) return;\n      if (!scope.$$disconnected) return;\n\n      var child = scope;\n\n      var parent = child.$parent;\n      child.$$disconnected = false;\n      // See Scope.$new for this logic...\n      child.$$prevSibling = parent.$$childTail;\n      if (parent.$$childHead) {\n        parent.$$childTail.$$nextSibling = child;\n        parent.$$childTail = child;\n      } else {\n        parent.$$childHead = parent.$$childTail = child;\n      }\n    },\n\n    /**\n     * Get an element's siblings matching a given tag name.\n     *\n     * @param {JQLite|angular.element|HTMLElement} element Element to start walking the DOM from\n     * @param {string} tagName HTML tag name to match against\n     * @returns {Object[]} JQLite\n     */\n    getSiblings: function getSiblings(element, tagName) {\n      var upperCasedTagName = tagName.toUpperCase();\n      if (element instanceof angular.element) {\n        element = element[0];\n      }\n      var siblings = Array.prototype.filter.call(element.parentNode.children, function(node) {\n        return element !== node && node.tagName.toUpperCase() === upperCasedTagName;\n      });\n      return siblings.map(function (sibling) {\n        return angular.element(sibling);\n      });\n    },\n\n    /**\n     * getClosest replicates jQuery.closest() to walk up the DOM tree until it finds a matching\n     * nodeName.\n     *\n     * @param {Node} el Element to start walking the DOM from\n     * @param {string|function} validateWith If a string is passed, it will be evaluated against\n     * each of the parent nodes' tag name. If a function is passed, the loop will call it with each\n     * of the parents and will use the return value to determine whether the node is a match.\n     * @param {boolean=} onlyParent Only start checking from the parent element, not `el`.\n     * @returns {Node|null} closest matching parent Node or null if not found\n     */\n    getClosest: function getClosest(el, validateWith, onlyParent) {\n      if (angular.isString(validateWith)) {\n        var tagName = validateWith.toUpperCase();\n        validateWith = function(el) {\n          return el.nodeName.toUpperCase() === tagName;\n        };\n      }\n\n      if (el instanceof angular.element) el = el[0];\n      if (onlyParent) el = el.parentNode;\n      if (!el) return null;\n\n      do {\n        if (validateWith(el)) {\n          return el;\n        }\n      } while (el = el.parentNode);\n\n      return null;\n    },\n\n    /**\n     * Build polyfill for the Node.contains feature (if needed)\n     * @param {Node} node\n     * @param {Node} child\n     * @returns {Node}\n     */\n    elementContains: function(node, child) {\n      var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains);\n      var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) {\n        // compares the positions of two nodes and returns a bitmask\n        return (node === child) || !!(this.compareDocumentPosition(arg) & 16);\n      });\n\n      return findFn(child);\n    },\n\n    /**\n     * Functional equivalent for $element.filter(‘md-bottom-sheet’)\n     * useful with interimElements where the element and its container are important...\n     *\n     * @param {JQLite} element to scan\n     * @param {string} nodeName of node to find (e.g. 'md-dialog')\n     * @param {boolean=} scanDeep optional flag to allow deep scans; defaults to 'false'.\n     * @param {boolean=} warnNotFound optional flag to enable log warnings; defaults to false\n     */\n    extractElementByName: function(element, nodeName, scanDeep, warnNotFound) {\n      var found = scanTree(element);\n      if (!found && !!warnNotFound) {\n        $log.warn($mdUtil.supplant(\"Unable to find node '{0}' in element '{1}'.\",[nodeName, element[0].outerHTML]));\n      }\n\n      return angular.element(found || element);\n\n      /**\n       * Breadth-First tree scan for element with matching `nodeName`\n       */\n      function scanTree(element) {\n        return scanLevel(element) || (scanDeep ? scanChildren(element) : null);\n      }\n\n      /**\n       * Case-insensitive scan of current elements only (do not descend).\n       */\n      function scanLevel(element) {\n        if (element) {\n          for (var i = 0, len = element.length; i < len; i++) {\n            if (element[i].nodeName.toLowerCase() === nodeName) {\n              return element[i];\n            }\n          }\n        }\n        return null;\n      }\n\n      /**\n       * Scan children of specified node\n       */\n      function scanChildren(element) {\n        var found;\n        if (element) {\n          for (var i = 0, len = element.length; i < len; i++) {\n            var target = element[i];\n            if (!found) {\n              for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {\n                found = found || scanTree([target.childNodes[j]]);\n              }\n            }\n          }\n        }\n        return found;\n      }\n\n    },\n\n    /**\n     * Give optional properties with no value a boolean true if attr provided or false otherwise\n     */\n    initOptionalProperties: function(scope, attr, defaults) {\n      defaults = defaults || {};\n      angular.forEach(scope.$$isolateBindings, function(binding, key) {\n        if (binding.optional && angular.isUndefined(scope[key])) {\n          var attrIsDefined = angular.isDefined(attr[binding.attrName]);\n          scope[key] = angular.isDefined(defaults[key]) ? defaults[key] : attrIsDefined;\n        }\n      });\n    },\n\n    /**\n     * Alternative to $timeout calls with 0 delay.\n     * nextTick() coalesces all calls within a single frame\n     * to minimize $digest thrashing\n     *\n     * @param {Function} callback function to be called after the tick\n     * @param {boolean=} digest true to call $rootScope.$digest() after callback\n     * @param {Object=} scope associated with callback. If the scope is destroyed, the callback will\n     *  be skipped.\n     * @returns {*}\n     */\n    nextTick: function(callback, digest, scope) {\n      // grab function reference for storing state details\n      var nextTick = $mdUtil.nextTick;\n      var timeout = nextTick.timeout;\n      var queue = nextTick.queue || [];\n\n      // add callback to the queue\n      queue.push({scope: scope, callback: callback});\n\n      // set default value for digest\n      if (digest == null) digest = true;\n\n      // store updated digest/queue values\n      nextTick.digest = nextTick.digest || digest;\n      nextTick.queue = queue;\n\n      // either return existing timeout or create a new one\n      return timeout || (nextTick.timeout = $timeout(processQueue, 0, false));\n\n      /**\n       * Grab a copy of the current queue\n       * Clear the queue for future use\n       * Process the existing queue\n       * Trigger digest if necessary\n       */\n      function processQueue() {\n        var queue = nextTick.queue;\n        var digest = nextTick.digest;\n\n        nextTick.queue = [];\n        nextTick.timeout = null;\n        nextTick.digest = false;\n\n        queue.forEach(function(queueItem) {\n          var skip = queueItem.scope && queueItem.scope.$$destroyed;\n          if (!skip) {\n            queueItem.callback();\n          }\n        });\n\n        if (digest) $rootScope.$digest();\n      }\n    },\n\n    /**\n     * Processes a template and replaces the start/end symbols if the application has\n     * overridden them.\n     *\n     * @param template The template to process whose start/end tags may be replaced.\n     * @returns {*}\n     */\n    processTemplate: function(template) {\n      if (usesStandardSymbols) {\n        return template;\n      } else {\n        if (!template || !angular.isString(template)) return template;\n        return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n      }\n    },\n\n    /**\n     * Scan up dom hierarchy for enabled parent;\n     */\n    getParentWithPointerEvents: function (element) {\n      var parent = element.parent();\n\n      // jqLite might return a non-null, but still empty, parent; so check for parent and length\n      while (hasComputedStyle(parent, 'pointer-events', 'none')) {\n        parent = parent.parent();\n      }\n\n      return parent;\n    },\n\n    getNearestContentElement: function (element) {\n      var current = element.parent()[0];\n      // Look for the nearest parent md-content, stopping at the rootElement.\n      while (current && current !== $rootElement[0] && current !== document.body && current.nodeName.toUpperCase() !== 'MD-CONTENT') {\n        current = current.parentNode;\n      }\n      return current;\n    },\n\n    /**\n     * Checks if the current browser is natively supporting the `sticky` position.\n     * @returns {string} supported sticky property name\n     */\n    checkStickySupport: function() {\n      var stickyProp;\n      var testEl = angular.element('<div>');\n      $document[0].body.appendChild(testEl[0]);\n\n      var stickyProps = ['sticky', '-webkit-sticky'];\n      for (var i = 0; i < stickyProps.length; ++i) {\n        testEl.css({\n          position: stickyProps[i],\n          top: 0,\n          'z-index': 2\n        });\n\n        if (testEl.css('position') == stickyProps[i]) {\n          stickyProp = stickyProps[i];\n          break;\n        }\n      }\n\n      testEl.remove();\n\n      return stickyProp;\n    },\n\n    /**\n     * Parses an attribute value, mostly a string.\n     * By default checks for negated values and returns `false´ if present.\n     * Negated values are: (native falsy) and negative strings like:\n     * `false` or `0`.\n     * @param value Attribute value which should be parsed.\n     * @param negatedCheck When set to false, won't check for negated values.\n     * @returns {boolean}\n     */\n    parseAttributeBoolean: function(value, negatedCheck) {\n      return value === '' || !!value && (negatedCheck === false || value !== 'false' && value !== '0');\n    },\n\n    hasComputedStyle: hasComputedStyle,\n\n    /**\n     * Returns true if the parent form of the element has been submitted.\n     * @param element An AngularJS or HTML5 element.\n     * @returns {boolean}\n     */\n    isParentFormSubmitted: function(element) {\n      var parent = $mdUtil.getClosest(element, 'form');\n      var form = parent ? angular.element(parent).controller('form') : null;\n\n      return form ? form.$submitted : false;\n    },\n\n    /**\n     * Animate the requested element's scrollTop to the requested scrollPosition with basic easing.\n     * @param {!Element} element The element to scroll.\n     * @param {number} scrollEnd The new/final scroll position.\n     * @param {number=} duration Duration of the scroll. Default is 1000ms.\n     */\n    animateScrollTo: function(element, scrollEnd, duration) {\n      var scrollStart = element.scrollTop;\n      var scrollChange = scrollEnd - scrollStart;\n      var scrollingDown = scrollStart < scrollEnd;\n      var startTime = $mdUtil.now();\n\n      $$rAF(scrollChunk);\n\n      function scrollChunk() {\n        var newPosition = calculateNewPosition();\n\n        element.scrollTop = newPosition;\n\n        if (scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd) {\n          $$rAF(scrollChunk);\n        }\n      }\n\n      function calculateNewPosition() {\n        var easeDuration = duration || 1000;\n        var currentTime = $mdUtil.now() - startTime;\n\n        return ease(currentTime, scrollStart, scrollChange, easeDuration);\n      }\n\n      function ease(currentTime, start, change, duration) {\n        // If the duration has passed (which can occur if our app loses focus due to $$rAF), jump\n        // straight to the proper position\n        if (currentTime > duration) {\n          return start + change;\n        }\n\n        var ts = (currentTime /= duration) * currentTime;\n        var tc = ts * currentTime;\n\n        return start + change * (-2 * tc + 3 * ts);\n      }\n    },\n\n    /**\n     * Provides an easy mechanism for removing duplicates from an array.\n     *\n     *    var myArray = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4];\n     *\n     *    $mdUtil.uniq(myArray) => [1, 2, 3, 4]\n     *\n     * @param {Array} array The array whose unique values should be returned.\n     * @returns {Array|void} A copy of the array containing only unique values.\n     */\n    uniq: function(array) {\n      if (!array) { return; }\n\n      return array.filter(function(value, index, self) {\n        return self.indexOf(value) === index;\n      });\n    },\n\n    /**\n     * Gets the inner HTML content of the given HTMLElement.\n     * Only intended for use with SVG or Symbol elements in IE11.\n     * @param {Element} element\n     * @returns {string} the inner HTML of the element passed in\n     */\n    getInnerHTML: function(element) {\n      // For SVG or Symbol elements, innerHTML returns `undefined` in IE.\n      // Reference: https://stackoverflow.com/q/28129956/633107\n      // The XMLSerializer API is supported on IE11 and is the recommended workaround.\n      var serializer = new XMLSerializer();\n\n      return Array.prototype.map.call(element.childNodes, function (child) {\n        return serializer.serializeToString(child);\n      }).join('');\n    },\n\n    /**\n     * Gets the outer HTML content of the given HTMLElement.\n     * Only intended for use with SVG or Symbol elements in IE11.\n     * @param {Element} element\n     * @returns {string} the outer HTML of the element passed in\n     */\n    getOuterHTML: function(element) {\n      // For SVG or Symbol elements, outerHTML returns `undefined` in IE.\n      // Reference: https://stackoverflow.com/q/29888050/633107\n      // The XMLSerializer API is supported on IE11 and is the recommended workaround.\n      var serializer = new XMLSerializer();\n      return serializer.serializeToString(element);\n    },\n\n    /**\n     * Support: IE 9-11 only\n     * documentMode is an IE-only property\n     * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n     */\n    msie: window.document.documentMode,\n\n    getTouchAction: function() {\n      var testEl = document.createElement('div');\n      var vendorPrefixes = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\n\n      for (var i = 0; i < vendorPrefixes.length; i++) {\n        var prefix = vendorPrefixes[i];\n        var property = prefix ? prefix + 'TouchAction' : 'touchAction';\n        if (angular.isDefined(testEl.style[property])) {\n          return property;\n        }\n      }\n    },\n\n    /**\n     * @param {Event} event the event to calculate the bubble path for\n     * @return {EventTarget[]} the set of nodes that this event could bubble up to\n     */\n    getEventPath: function(event) {\n      var path = [];\n      var currentTarget = event.target;\n      while (currentTarget) {\n        path.push(currentTarget);\n        currentTarget = currentTarget.parentElement;\n      }\n      if (path.indexOf(window) === -1 && path.indexOf(document) === -1)\n        path.push(document);\n      if (path.indexOf(window) === -1)\n        path.push(window);\n      return path;\n    },\n\n    /**\n     * Gets the string the user has entered and removes Regex identifiers\n     * @param {string} term\n     * @returns {string} sanitized string\n     */\n    sanitize: function(term) {\n      if (!term) return term;\n      return term.replace(/[\\\\^$*+?.()|{}[]/g, '\\\\$&');\n    },\n\n    /**********************************************************************************************\n     * The following functions were sourced from\n     * https://github.com/angular/components/blob/3c37e4b1c1cb74a3d0a90d173240fc730d21d9d4/src/cdk/a11y/interactivity-checker/interactivity-checker.ts\n     **********************************************************************************************/\n\n    /**\n     * Gets whether an element is disabled.\n     * @param {HTMLElement} element Element to be checked.\n     * @returns {boolean} Whether the element is disabled.\n     */\n    isDisabled: function(element) {\n      // This does not capture some cases, such as a non-form control with a disabled attribute or\n      // a form control inside of a disabled form, but should capture the most common cases.\n      return element.hasAttribute('disabled');\n    },\n\n    /**\n     * Gets whether an element is visible for the purposes of interactivity.\n     *\n     * This will capture states like `display: none` and `visibility: hidden`, but not things like\n     * being clipped by an `overflow: hidden` parent or being outside the viewport.\n     *\n     * @param {HTMLElement} element\n     * @returns {boolean} Whether the element is visible.\n     */\n    isVisible: function(element) {\n      return $mdUtil.hasGeometry(element) && getComputedStyle(element).visibility === 'visible';\n    },\n\n    /**\n     * Gets whether an element can be reached via Tab key.\n     * Assumes that the element has already been checked with isFocusable.\n     * @param {HTMLElement} element Element to be checked.\n     * @returns {boolean} Whether the element is tabbable.\n     */\n    isTabbable: function(element) {\n      var frameElement = $mdUtil.getFrameElement($mdUtil.getWindow(element));\n\n      if (frameElement) {\n        // Frame elements inherit their tabindex onto all child elements.\n        if ($mdUtil.getTabIndexValue(frameElement) === -1) {\n          return false;\n        }\n\n        // Browsers disable tabbing to an element inside of an invisible frame.\n        if (!$mdUtil.isVisible(frameElement)) {\n          return false;\n        }\n      }\n\n      var nodeName = element.nodeName.toLowerCase();\n      var tabIndexValue = $mdUtil.getTabIndexValue(element);\n\n      if (element.hasAttribute('contenteditable')) {\n        return tabIndexValue !== -1;\n      }\n\n      if (nodeName === 'iframe' || nodeName === 'object') {\n        // The frame or object's content may be tabbable depending on the content, but it's\n        // not possibly to reliably detect the content of the frames. We always consider such\n        // elements as non-tabbable.\n        return false;\n      }\n\n      // In iOS, the browser only considers some specific elements as tabbable.\n      if (isIos && !$mdUtil.isPotentiallyTabbableIOS(element)) {\n        return false;\n      }\n\n      if (nodeName === 'audio') {\n        // Audio elements without controls enabled are never tabbable, regardless\n        // of the tabindex attribute explicitly being set.\n        if (!element.hasAttribute('controls')) {\n          return false;\n        }\n        // Audio elements with controls are by default tabbable unless the\n        // tabindex attribute is set to `-1` explicitly.\n        return tabIndexValue !== -1;\n      }\n\n      if (nodeName === 'video') {\n        // For all video elements, if the tabindex attribute is set to `-1`, the video\n        // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`\n        // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The\n        // tabindex attribute is the source of truth here.\n        if (tabIndexValue === -1) {\n          return false;\n        }\n        // If the tabindex is explicitly set, and not `-1` (as per check before), the\n        // video element is always tabbable (regardless of whether it has controls or not).\n        if (tabIndexValue !== null) {\n          return true;\n        }\n        // Otherwise (when no explicit tabindex is set), a video is only tabbable if it\n        // has controls enabled. Firefox is special as videos are always tabbable regardless\n        // of whether there are controls or not.\n        return isFirefox || element.hasAttribute('controls');\n      }\n\n      return element.tabIndex >= 0;\n    },\n\n    /**\n     * Gets whether an element can be focused by the user.\n     * @param {HTMLElement} element Element to be checked.\n     * @returns {boolean} Whether the element is focusable.\n     */\n    isFocusable: function(element) {\n      // Perform checks in order of left to most expensive.\n      // Again, naive approach that does not capture many edge cases and browser quirks.\n      return $mdUtil.isPotentiallyFocusable(element) && !$mdUtil.isDisabled(element) &&\n        $mdUtil.isVisible(element);\n    },\n\n    /**\n     * Gets whether an element is potentially focusable without taking current visible/disabled\n     * state into account.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isPotentiallyFocusable: function(element) {\n      // Inputs are potentially focusable *unless* they're type=\"hidden\".\n      if ($mdUtil.isHiddenInput(element)) {\n        return false;\n      }\n\n      return $mdUtil.isNativeFormElement(element) ||\n        $mdUtil.isAnchorWithHref(element) ||\n        element.hasAttribute('contenteditable') ||\n        $mdUtil.hasValidTabIndex(element);\n    },\n\n    /**\n     * Checks whether the specified element is potentially tabbable on iOS.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isPotentiallyTabbableIOS: function(element) {\n      var nodeName = element.nodeName.toLowerCase();\n        var inputType = nodeName === 'input' && element.type;\n\n      return inputType === 'text'\n        || inputType === 'password'\n        || nodeName === 'select'\n        || nodeName === 'textarea';\n    },\n\n    /**\n     * Returns the parsed tabindex from the element attributes instead of returning the\n     * evaluated tabindex from the browsers defaults.\n     * @param {HTMLElement} element\n     * @returns {null|number}\n     */\n    getTabIndexValue: function(element) {\n      if (!$mdUtil.hasValidTabIndex(element)) {\n        return null;\n      }\n\n      // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054\n      var tabIndex = parseInt(element.getAttribute('tabindex') || '', 10);\n\n      return isNaN(tabIndex) ? -1 : tabIndex;\n    },\n\n    /**\n     * Gets whether an element has a valid tabindex.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    hasValidTabIndex: function(element) {\n      if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) {\n        return false;\n      }\n\n      var tabIndex = element.getAttribute('tabindex');\n\n      // IE11 parses tabindex=\"\" as the value \"-32768\"\n      if (tabIndex == '-32768') {\n        return false;\n      }\n\n      return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));\n    },\n\n    /**\n     * Checks whether the specified element has any geometry / rectangles.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    hasGeometry: function(element) {\n      // Use logic from jQuery to check for an invisible element.\n      // See https://github.com/jquery/jquery/blob/8969732518470a7f8e654d5bc5be0b0076cb0b87/src/css/hiddenVisibleSelectors.js#L9\n      return !!(element.offsetWidth || element.offsetHeight ||\n        (typeof element.getClientRects === 'function' && element.getClientRects().length));\n    },\n\n    /**\n     * Returns the frame element from a window object. Since browsers like MS Edge throw errors if\n     * the frameElement property is being accessed from a different host address, this property\n     * should be accessed carefully.\n     * @param {Window} window\n     * @returns {null|HTMLElement}\n     */\n    getFrameElement: function(window) {\n      try {\n        return window.frameElement;\n      } catch (error) {\n        return null;\n      }\n    },\n\n    /**\n     * Gets the parent window of a DOM node with regards of being inside of an iframe.\n     * @param {HTMLElement} node\n     * @returns {Window}\n     */\n    getWindow: function(node) {\n      // ownerDocument is null if `node` itself *is* a document.\n      return node.ownerDocument && node.ownerDocument.defaultView || window;\n    },\n\n    /**\n     * Gets whether an element's\n     * @param {Node} element\n     * @returns {boolean}\n     */\n    isNativeFormElement: function(element) {\n      var nodeName = element.nodeName.toLowerCase();\n      return nodeName === 'input' ||\n        nodeName === 'select' ||\n        nodeName === 'button' ||\n        nodeName === 'textarea';\n    },\n\n    /**\n     * Gets whether an element is an `<input type=\"hidden\">`.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isHiddenInput: function(element) {\n      return $mdUtil.isInputElement(element) && element.type == 'hidden';\n    },\n\n    /**\n     * Gets whether an element is an anchor that has an href attribute.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isAnchorWithHref: function(element) {\n      return $mdUtil.isAnchorElement(element) && element.hasAttribute('href');\n    },\n\n    /**\n     * Gets whether an element is an input element.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isInputElement: function(element) {\n      return element.nodeName.toLowerCase() == 'input';\n    },\n\n    /**\n     * Gets whether an element is an anchor element.\n     * @param {HTMLElement} element\n     * @returns {boolean}\n     */\n    isAnchorElement: function(element) {\n      return element.nodeName.toLowerCase() == 'a';\n    },\n\n    /**********************************************************************************************\n     * The following two functions were sourced from\n     * https://github.com/angular/components/blob/3c37e4b1c1cb74a3d0a90d173240fc730d21d9d4/src/cdk/a11y/focus-trap/focus-trap.ts#L268-L311\n     **********************************************************************************************/\n\n    /**\n     * Get the first tabbable element from a DOM subtree (inclusive).\n     * @param {HTMLElement} root\n     * @returns {HTMLElement|null}\n     */\n    getFirstTabbableElement: function(root) {\n      if ($mdUtil.isFocusable(root) && $mdUtil.isTabbable(root)) {\n        return root;\n      }\n\n      // Iterate in DOM order. Note that IE doesn't have `children` for SVG so we fall\n      // back to `childNodes` which includes text nodes, comments etc.\n      var children = root.children || root.childNodes;\n\n      for (var i = 0; i < children.length; i++) {\n        var tabbableChild = children[i].nodeType === $document[0].ELEMENT_NODE ?\n          $mdUtil.getFirstTabbableElement(children[i]) : null;\n\n        if (tabbableChild) {\n          return tabbableChild;\n        }\n      }\n\n      return null;\n    },\n\n    /**\n     * Get the last tabbable element from a DOM subtree (inclusive).\n     * @param {HTMLElement} root\n     * @returns {HTMLElement|null}\n     */\n    getLastTabbableElement: function(root) {\n      if ($mdUtil.isFocusable(root) && $mdUtil.isTabbable(root)) {\n        return root;\n      }\n\n      // Iterate in reverse DOM order.\n      var children = root.children || root.childNodes;\n\n      for (var i = children.length - 1; i >= 0; i--) {\n        var tabbableChild = children[i].nodeType === $document[0].ELEMENT_NODE ?\n          $mdUtil.getLastTabbableElement(children[i]) : null;\n\n        if (tabbableChild) {\n          return tabbableChild;\n        }\n      }\n\n      return null;\n    }\n  };\n\n  // Instantiate other namespace utility methods\n\n  $mdUtil.dom.animator = $$mdAnimate($mdUtil);\n\n  return $mdUtil;\n\n  function getNode(el) {\n    return el[0] || el;\n  }\n}\n\n/**\n * Since removing jQuery from the demos, some code that uses `element.focus()` is broken.\n * We need to add `element.focus()`, because it's testable unlike `element[0].focus`.\n */\nangular.element.prototype.focus = angular.element.prototype.focus || function() {\n  if (this.length) {\n    this[0].focus();\n  }\n  return this;\n};\n\nangular.element.prototype.blur = angular.element.prototype.blur || function() {\n  if (this.length) {\n    this[0].blur();\n  }\n  return this;\n};\n"
  },
  {
    "path": "src/core/util/util.spec.js",
    "content": "describe('util', function() {\n\n  describe('with no overrides', function() {\n    beforeEach(module('material.core'));\n\n    var $rootScope, $timeout, $$mdAnimate;\n    beforeEach(inject(function(_$animate_, _$rootScope_, _$timeout_) {\n      $animate = _$animate_;\n      $rootScope = _$rootScope_;\n      $timeout = _$timeout_;\n    }));\n\n    describe('now', function() {\n\n      it('returns proper time values', inject(function($mdUtil, $timeout) {\n        var t1 = $mdUtil.now();\n        expect(t1).toBeGreaterThan(0);\n      }));\n\n    });\n\n    describe('disconnect', function() {\n      var disconnectScope, reconnectScope;\n      beforeEach(inject(function($mdUtil) {\n        disconnectScope = $mdUtil.disconnectScope;\n        reconnectScope = $mdUtil.reconnectScope;\n      }));\n\n      it('disconnectScope events', inject(function($rootScope) {\n        var scope1 = $rootScope.$new();\n\n        var spy = jasmine.createSpy('eventSpy');\n        scope1.$on('event', spy);\n\n        disconnectScope(scope1);\n\n        $rootScope.$broadcast('event');\n        expect(spy).not.toHaveBeenCalled();\n\n        reconnectScope(scope1);\n\n        $rootScope.$broadcast('event');\n        expect(spy).toHaveBeenCalled();\n      }));\n\n    });\n\n    describe('supplant', function() {\n\n      it('should replace with HTML arguments', inject(function($mdUtil) {\n        var param1 = \"\", param2 = '' +\n              '<md-content>' +\n              '   <md-option ng-repeat=\"value in values\" value=\"{{value}}\">' +\n              '      {{value}}  ' +\n              '   </md-option>  ' +\n              '</md-content>    ';\n        var template = '<div class=\"md-select-menu-container\"><md-select-menu {0}>{1}</md-select-menu></div>';\n        var results = $mdUtil.supplant(template,[param1, param2]);\n        var segment = '<md-select-menu >';  // After supplant() part of the result should be...\n\n        expect(results.indexOf(segment) > -1).toBe(true);\n\n      }));\n\n    });\n\n    describe('getModelOption', function() {\n\n      it('should support the old ngModelCtrl options', inject(function($mdUtil) {\n        var ngModelCtrl = {\n          $options: {\n            trackBy: 'Test'\n          }\n        };\n\n        expect($mdUtil.getModelOption(ngModelCtrl, 'trackBy')).toBe('Test');\n      }));\n\n      it('should support the newer ngModelCtrl options', inject(function($mdUtil) {\n        var ngModelCtrl = {\n          $options: {\n            getOption: function() {\n              return 'Test';\n            }\n          }\n        };\n\n        expect($mdUtil.getModelOption(ngModelCtrl, 'trackBy')).toBe('Test');\n      }));\n\n      it('should return nothing if $options is not set', inject(function($mdUtil) {\n        expect($mdUtil.getModelOption({}, 'trackBy')).toBeFalsy();\n      }));\n\n      it('should not throw if an option is not available', inject(function($mdUtil) {\n        var ngModelCtrl = {\n          $options: {}\n        };\n\n        expect(function() {\n          $mdUtil.getModelOption(ngModelCtrl, 'Unknown');\n        }).not.toThrow();\n      }));\n\n    });\n\n    describe('findFocusTarget', function() {\n\n      it('should not find valid focus target', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div class=\"autoFocus\"><button><img></button></div>')($rootScope);\n            $rootScope.$apply();\n        var target = $mdUtil.findFocusTarget(widget);\n\n        expect(target).toBeFalsy();\n      }));\n\n      it('should find valid a valid focusTarget with \"md-autofocus\"', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div class=\"autoFocus\"><button md-autofocus><img></button></div>')($rootScope);\n            $rootScope.$apply();\n        var target = $mdUtil.findFocusTarget(widget);\n\n        expect(target[0].nodeName).toBe(\"BUTTON\");\n      }));\n\n      it('should find valid a valid focusTarget with a deep \"md-autofocus\" argument', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div class=\"autoFocus\"><md-sidenav><button md-autofocus><img></button></md-sidenav></div>')($rootScope);\n            $rootScope.$apply();\n        var target = $mdUtil.findFocusTarget(widget);\n\n        expect(target[0].nodeName).toBe(\"BUTTON\");\n      }));\n    });\n\n    describe('extractElementByname', function() {\n\n      it('should not find valid element', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div><md-button1><img></md-button1></div>')($rootScope);\n            $rootScope.$apply();\n        var target = $mdUtil.extractElementByName(widget, 'md-button');\n\n        // Returns same element\n        expect(target[0] === widget[0]).toBe(true);\n      }));\n\n      it('should not find valid element for shallow scan', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div><md-button><img></md-button></div>')($rootScope);\n        $rootScope.$apply();\n        var target = $mdUtil.extractElementByName(widget, 'md-button');\n\n        expect(target[0] !== widget[0]).toBe(false);\n      }));\n\n      it('should find valid element for deep scan', inject(function($rootScope, $compile, $mdUtil) {\n        var widget = $compile('<div><md-button><img></md-button></div>')($rootScope);\n        $rootScope.$apply();\n        var target = $mdUtil.extractElementByName(widget, 'md-button', true);\n\n        expect(target !== widget).toBe(true);\n      }));\n    });\n\n    describe('throttle', function() {\n      var delay = 500;\n      var nowMockValue;\n      var originalFn;\n      var throttledFn;\n\n      beforeEach(inject(function($mdUtil) {\n        $mdUtil.now = function() {\n          return nowMockValue;\n        };\n        originalFn = jasmine.createSpy('originalFn');\n        throttledFn = $mdUtil.throttle(originalFn, delay);\n        nowMockValue = 1;    // Not 0, to prevent `!recent` inside `throttle()` to\n                             // evaluate to true even after `recent` has been set\n      }));\n\n      it('should immediately invoke the function on first call', function() {\n        expect(originalFn).not.toHaveBeenCalled();\n        throttledFn();\n        expect(originalFn).toHaveBeenCalled();\n      });\n\n      it('should not invoke the function again before (delay + 1) milliseconds', function() {\n        throttledFn();\n        expect(originalFn.calls.count()).toBe(1);\n\n        throttledFn();\n        expect(originalFn.calls.count()).toBe(1);\n\n        nowMockValue += delay;\n        throttledFn();\n        expect(originalFn.calls.count()).toBe(1);\n\n        nowMockValue += 1;\n        throttledFn();\n        expect(originalFn.calls.count()).toBe(2);\n      });\n\n      it('should pass the context to the original function', inject(function($mdUtil) {\n        var obj = {\n          called: false,\n          fn: function() {\n            this.called = true;\n          }\n        };\n        var throttled = $mdUtil.throttle(obj.fn, delay);\n\n        expect(obj.called).toBeFalsy();\n        throttled.call(obj);\n        expect(obj.called).toBeTruthy();\n      }));\n\n      it('should pass the arguments to the original function', function() {\n        throttledFn(1, 2, 3, 'test');\n        expect(originalFn).toHaveBeenCalledWith(1, 2, 3, 'test');\n      });\n    });\n\n    describe('disableScrollAround', function() {\n\n      it('should prevent scrolling of the passed element', inject(function($mdUtil) {\n        var element = angular.element('<div style=\"height: 2000px\">');\n        document.body.appendChild(element[0]);\n\n        var enableScrolling = $mdUtil.disableScrollAround(element);\n\n        window.scrollTo(0, 1000);\n\n        expect(window.pageYOffset).toBe(0);\n\n        // Restore the scrolling.\n        enableScrolling();\n        window.scrollTo(0, 0);\n\n        element.remove();\n      }));\n\n      it('should not remove the element when being use as scroll mask', inject(function($mdUtil) {\n        var element = angular.element('<div>');\n\n        document.body.appendChild(element[0]);\n\n        var enableScrolling = $mdUtil.disableScrollAround(element, null, {\n          disableScrollMask: true\n        });\n\n        // Restore the scrolling.\n        enableScrolling();\n\n        expect(element[0].parentNode).toBeTruthy();\n\n        element.remove();\n      }));\n\n      it('should not get thrown off by the scrollbar on the <html> node',\n        inject(function($mdUtil) {\n          var element = angular.element('<div style=\"height: 2000px\">');\n\n          document.body.appendChild(element[0]);\n          document.body.style.overflowX = 'hidden';\n\n          window.scrollTo(0, 1000);\n\n          var enableScrolling = $mdUtil.disableScrollAround(element);\n\n          expect(document.body.style.overflow).not.toBe('hidden');\n\n          // Restore the scrolling.\n          enableScrolling();\n          window.scrollTo(0, 0);\n          document.body.style.overflowX = '';\n\n          element.remove();\n        })\n      );\n    });\n\n    describe('getViewportTop', function() {\n\n      it('should properly determine the top offset', inject(function($mdUtil) {\n        var viewportHeight = Math.round(window.innerHeight);\n        var element = angular.element('<div style=\"height: ' + (viewportHeight * 2) + 'px\">');\n\n        document.body.appendChild(element[0]);\n\n        // Scroll down the viewport height.\n        window.scrollTo(0, viewportHeight);\n\n        expect(getViewportTop()).toBe(viewportHeight);\n\n        // Restore the scrolling.\n        window.scrollTo(0, 0);\n\n        expect(getViewportTop()).toBe(0);\n\n        element.remove();\n\n        /*\n         * Round the viewport top offset because the test browser might be resized and\n         * could cause deviations for the test.\n         */\n        function getViewportTop() {\n          return Math.round($mdUtil.getViewportTop());\n        }\n      }));\n\n    });\n\n    describe('nextTick', function() {\n      it('should combine multiple calls into a single digest', inject(function($mdUtil, $rootScope, $timeout) {\n        var digestWatchFn = jasmine.createSpy('watchFn');\n        var callback = jasmine.createSpy('callback');\n        var timeout;\n        $rootScope.$watch(digestWatchFn);\n        expect(digestWatchFn).not.toHaveBeenCalled();\n        expect(callback).not.toHaveBeenCalled();\n        // Add a bunch of calls to prove that they are batched\n        for (var i = 0; i < 10; i++) {\n          timeout = $mdUtil.nextTick(callback);\n          expect(timeout.$$timeoutId).toBeOfType('number');\n        }\n        $timeout.flush();\n        expect(digestWatchFn).toHaveBeenCalled();\n        // $digest seems to be called one extra time here\n        expect(digestWatchFn.calls.count()).toBe(2);\n        // but callback is still called more\n        expect(callback.calls.count()).toBe(10);\n      }));\n\n      it('should return a timeout', inject(function($mdUtil) {\n        var timeout = $mdUtil.nextTick(angular.noop);\n        expect(timeout.$$timeoutId).toBeOfType('number');\n      }));\n\n      it('should return the same timeout for multiple calls', inject(function($mdUtil) {\n        var a = $mdUtil.nextTick(angular.noop),\n          b = $mdUtil.nextTick(angular.noop);\n        expect(a).toBe(b);\n      }));\n\n      it('should use scope argument and `scope.$$destroyed` to skip the callback', inject(function($mdUtil) {\n        var callback = jasmine.createSpy('callback');\n        var scope = $rootScope.$new(true);\n\n        $mdUtil.nextTick(callback, false, scope);\n        scope.$destroy();\n\n        flush(function(){\n          expect(callback).not.toHaveBeenCalled();\n        });\n      }));\n\n      it('should only skip callbacks of scopes which were destroyed', inject(function($mdUtil) {\n        var callback1 = jasmine.createSpy('callback1');\n        var callback2 = jasmine.createSpy('callback2');\n        var scope1 = $rootScope.$new(true);\n        var scope2 = $rootScope.$new(true);\n\n        $mdUtil.nextTick(callback1, false, scope1);\n        $mdUtil.nextTick(callback2, false, scope2);\n        scope1.$destroy();\n\n        flush(function() {\n          expect(callback1).not.toHaveBeenCalled();\n          expect(callback2).toHaveBeenCalled();\n        });\n      }));\n\n      it('should skip callback for destroyed scopes even if first scope registered is undefined', inject(function($mdUtil) {\n        var callback1 = jasmine.createSpy('callback1');\n        var callback2 = jasmine.createSpy('callback2');\n        var scope = $rootScope.$new(true);\n\n        $mdUtil.nextTick(callback1, false);  // no scope\n        $mdUtil.nextTick(callback2, false, scope);\n        scope.$destroy();\n\n        flush(function() {\n          expect(callback1).toHaveBeenCalled();\n          expect(callback2).not.toHaveBeenCalled();\n        });\n      }));\n\n      it('should use scope argument and `!scope.$$destroyed` to invoke the callback', inject(function($mdUtil) {\n        var callback = jasmine.createSpy('callback');\n        var scope = $rootScope.$new(true);\n\n        $mdUtil.nextTick(callback, false, scope);\n        flush(function(){\n          expect(callback).toHaveBeenCalled();\n        });\n      }));\n\n      function flush(expectation) {\n        $rootScope.$digest();\n        $timeout.flush();\n        expectation && expectation();\n      }\n    });\n\n    describe('hasComputedStyle', function () {\n      describe('with expected value', function () {\n        it('should return true for existing and matching value', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function() {\n            return { 'color': 'red' };\n          });\n\n          var elem = angular.element('<span style=\"color: red\"></span>');\n\n          expect($mdUtil.hasComputedStyle(elem, 'color', 'red')).toBe(true);\n        }));\n\n        it('should return false for existing and not matching value', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function() {\n            return { 'color': 'red' };\n          });\n\n          var elem = angular.element('<span style=\"color: red\"></span>');\n\n          expect($mdUtil.hasComputedStyle(elem, 'color', 'blue')).toBe(false);\n        }));\n      });\n\n      describe('without expected value', function () {\n        it('should return true for existing key', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function() {\n            return { 'color': 'red' };\n          });\n\n          var elem = angular.element('<span style=\"color: red\"></span>');\n\n          expect($mdUtil.hasComputedStyle(elem, 'color')).toBe(true);\n        }));\n\n        it('should return false for not existing key', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function() {\n            return { 'color': 'red' };\n          });\n\n          var elem = angular.element('<span style=\"color: red\"></span>');\n\n          expect($mdUtil.hasComputedStyle(elem, 'height')).toBe(false);\n        }));\n      });\n    });\n\n    describe('parseAttributeBoolean', function() {\n\n      it('should validate `1` string to be true', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('1')).toBe(true);\n      }));\n\n      it('should validate an empty value to be true', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('')).toBe(true);\n      }));\n\n      it('should validate `false` text to be false', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('false')).toBe(false);\n      }));\n\n      it('should validate `true` text to be true', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('true')).toBe(true);\n      }));\n\n      it('should validate a random text to be true', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('random-string')).toBe(true);\n      }));\n\n      it('should validate `0` text to be false', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('0')).toBe(false);\n      }));\n\n      it('should validate true boolean to be true', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean(true)).toBe(true);\n      }));\n\n      it('should validate false boolean to be false', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean(false)).toBe(false);\n      }));\n\n      it('should validate `false` text to be true when ignoring negative values', inject(function($mdUtil) {\n        expect($mdUtil.parseAttributeBoolean('false', false)).toBe(true);\n      }));\n    });\n\n    describe('getParentWithPointerEvents', function () {\n      describe('with wrapper with pointer events style element', function () {\n        it('should find the parent element and return it', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function(target) {\n            return target === wrapper[0] ? { 'pointer-events':'none' } : {};\n          });\n\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div style=\"pointer-events:none;\"></div>');\n          var parent = angular.element('<div></div>');\n\n          wrapper.append(elem);\n          parent.append(wrapper);\n\n          // Scan up the DOM tree to find nearest parent with point-events !== none\n          // This means we should skip the wrapper node.\n\n          expect($mdUtil.getParentWithPointerEvents(elem)[0]).toBe(parent[0]);\n        }));\n      });\n\n      describe('with wrapper without pointer events style element', function () {\n        it('should find the wrapper element and return it', inject(function($window, $mdUtil) {\n          spyOn($window, 'getComputedStyle').and.callFake(function(elem) {\n            return {};\n          });\n\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div id=\"wrapper\"></div>');\n          var parent = angular.element('<div></div>');\n\n          wrapper.append(elem);\n          parent.append(wrapper);\n\n          expect($mdUtil.getParentWithPointerEvents(elem)[0]).toBe(wrapper[0]);\n        }));\n      });\n    });\n\n    describe('getNearestContentElement', function () {\n      describe('with rootElement as parent', function () {\n        it('should find stop at the rootElement and return it', inject(function($rootElement, $mdUtil) {\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div></div>');\n\n          wrapper.append(elem);\n          $rootElement.append(wrapper);\n\n          expect($mdUtil.getNearestContentElement(elem)).toBe($rootElement[0]);\n        }));\n      });\n\n      describe('with document body as parent', function () {\n        it('should find stop at the document body and return it', inject(function($mdUtil) {\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div></div>');\n          var body = angular.element(document.body);\n\n          wrapper.append(elem);\n          body.append(wrapper);\n\n          expect($mdUtil.getNearestContentElement(elem)).toBe(body[0]);\n        }));\n      });\n\n      describe('with md-content as parent', function () {\n        it('should find stop at md-content element and return it', inject(function($mdUtil) {\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div></div>');\n          var content = angular.element('<md-content></md-content>');\n\n          wrapper.append(elem);\n          content.append(wrapper);\n\n          expect($mdUtil.getNearestContentElement(elem)).toBe(content[0]);\n        }));\n      });\n\n      describe('with no rootElement, body or md-content as parent', function () {\n        it('should return null', inject(function($mdUtil) {\n          var elem = angular.element('<span></span>');\n          var wrapper = angular.element('<div></div>');\n\n          wrapper.append(elem);\n\n          expect($mdUtil.getNearestContentElement(elem)).toBe(null);\n        }));\n      });\n    });\n  });\n\n  describe('processTemplate', function() {\n    it('should return exact template when using the default start/end symbols', inject(function($mdUtil) {\n        var output = $mdUtil.processTemplate('<some-tag>{{some-var}}</some-tag>');\n\n        expect(output).toEqual('<some-tag>{{some-var}}</some-tag>');\n      })\n    );\n  });\n\n  describe('isParentFormSubmitted', function() {\n    var formTemplate =\n      '<form>' +\n      '  <input type=\"text\" name=\"test\" ng-model=\"test\" />' +\n      '  <input type=\"submit\" />' +\n      '<form>';\n\n    it('returns false if you pass no element', inject(function($mdUtil) {\n      expect($mdUtil.isParentFormSubmitted()).toBe(false);\n    }));\n\n    it('returns false if there is no form', inject(function($mdUtil) {\n      var element = angular.element('<input />');\n\n      expect($mdUtil.isParentFormSubmitted(element)).toBe(false);\n    }));\n\n    it('returns false if the parent form is NOT submitted', inject(function($compile, $rootScope, $mdUtil) {\n      var scope = $rootScope.$new();\n      var form = $compile(formTemplate)(scope);\n\n      expect($mdUtil.isParentFormSubmitted(form.find('input'))).toBe(false);\n    }));\n\n    it('returns true if the parent form is submitted', inject(function($compile, $rootScope, $mdUtil) {\n      var scope = $rootScope.$new();\n      var form = $compile(formTemplate)(scope);\n\n      var formController = form.controller('form');\n\n      formController.$setSubmitted();\n\n      expect(formController.$submitted).toBe(true);\n      expect($mdUtil.isParentFormSubmitted(form.find('input'))).toBe(true);\n    }));\n  });\n\n  describe('with $interpolate.start/endSymbol override', function() {\n\n    describe('processTemplate', function() {\n      beforeEach(function() {\n        module(function($interpolateProvider) {\n            $interpolateProvider.startSymbol('[[');\n            $interpolateProvider.endSymbol(']]');\n        });\n        module('material.core');\n      });\n\n      it('should replace the start/end symbols', inject(function($mdUtil) {\n        var output = $mdUtil.processTemplate('<some-tag>{{some-var}}</some-tag>');\n\n        expect(output).toEqual('<some-tag>[[some-var]]</some-tag>');\n      }));\n    });\n  });\n\n  describe('getSiblings', function() {\n    var $mdUtil;\n\n    beforeEach(inject(function(_$mdUtil_) {\n      $mdUtil = _$mdUtil_;\n    }));\n\n    it('should be able to get the siblings (without source element) of a particular node type',\n      function () {\n        var parent = angular.element('<h1>');\n        var element = angular.element('<h2>');\n        var sibling = angular.element('<h2>');\n\n        parent.append(element);\n        parent.append(sibling);\n\n        var result = $mdUtil.getSiblings(element, 'h2');\n\n        expect(result).toBeTruthy();\n        expect(result.length).toBe(1);\n        // Get the first sibling and unwrap both jqLite wrappers\n        expect(result[0][0]).toBe(sibling[0]);\n\n        parent.remove();\n      });\n  });\n\n  describe('getClosest', function() {\n    var $mdUtil;\n\n    beforeEach(inject(function(_$mdUtil_) {\n      $mdUtil = _$mdUtil_;\n    }));\n\n    it('should be able to get the closest parent of a particular node type', function() {\n      var grandparent = angular.element('<h1>');\n      var parent = angular.element('<h2>');\n      var element = angular.element('<h3>');\n\n      parent.append(element);\n      grandparent.append(parent);\n\n      var result = $mdUtil.getClosest(element, 'h1');\n\n      expect(result).toBeTruthy();\n      expect(result.nodeName.toLowerCase()).toBe('h1');\n\n      grandparent.remove();\n    });\n\n    it('should be able to start from the parent of the specified node', function() {\n      var grandparent = angular.element('<div>');\n      var parent = angular.element('<span>');\n      var element = angular.element('<div>');\n\n      parent.append(element);\n      grandparent.append(parent);\n\n      var result = $mdUtil.getClosest(element, 'div', true);\n\n      expect(result).toBeTruthy();\n      expect(result).not.toBe(element[0]);\n\n      grandparent.remove();\n    });\n\n    it('should be able to take in a predicate function', function() {\n      var grandparent = angular.element('<div random-attr>');\n      var parent = angular.element('<div>');\n      var element = angular.element('<span>');\n\n      parent.append(element);\n      grandparent.append(parent);\n\n      var result = $mdUtil.getClosest(element, function(el) {\n        return el.hasAttribute('random-attr');\n      });\n\n      expect(result).toBeTruthy();\n      expect(result).toBe(grandparent[0]);\n\n      grandparent.remove();\n    });\n\n    it('should be able to handle nodes whose nodeName is lowercase', function() {\n      var parent = angular.element('<svg version=\"1.1\"></svg>');\n      var element = angular.element('<circle/>');\n\n      parent.append(element);\n      expect($mdUtil.getClosest(element, 'svg')).toBeTruthy();\n      parent.remove();\n    });\n  });\n\n  describe('uniq', function() {\n    var $mdUtil;\n\n    beforeEach(inject(function(_$mdUtil_) {\n      $mdUtil = _$mdUtil_;\n    }));\n\n    it('returns a copy of the requested array with only unique values', function() {\n      var myArray = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4];\n\n      expect($mdUtil.uniq(myArray)).toEqual([1, 2, 3, 4]);\n    });\n  });\n\n  describe('sanitize', function() {\n    var $mdUtil;\n\n    beforeEach(inject(function(_$mdUtil_) {\n      $mdUtil = _$mdUtil_;\n    }));\n\n    it('sanitizes + signs', function() {\n      var myText = '+98';\n      expect($mdUtil.sanitize(myText)).toEqual('\\\\+98');\n    });\n\n    it('sanitizes parenthesis', function() {\n      var myText = '()';\n      expect($mdUtil.sanitize(myText)).toEqual('\\\\(\\\\)');\n    });\n  });\n});\n"
  },
  {
    "path": "start-hook.sh",
    "content": "#!/bin/bash\n\ncd \"$(dirname \"$0\")\"\n\n#\n# starts a hookshot server that will `git pull` whenever\n# GitHub pings us\n#\n# See: https://github.com/Coreh/hookshot\n#\nhookshot -p 9010 \"git fetch && git reset --hard origin/master && npm install && rm -rf dist/ && gulp docs --release\"\n"
  },
  {
    "path": "test/.jshintrc",
    "content": "{\n  \"sub\": true,\n  \"multistr\": true,\n  \"-W018\": true,\n  \"expr\": true,\n  \"boss\": true,\n  \"laxbreak\": true,\n  \"esversion\": 9,\n  \"predef\": [\"angular\"]\n}\n"
  },
  {
    "path": "test/angular-material-mocks.js",
    "content": "/**\n * AngularJS-Material-Mocks\n *\n * Developers interested in running their own custom unit tests WITH angular-material.js loaded...\n * must also include this *mocks* file. Similar to `angular-mocks.js`, `angular-material-mocks.js`\n * will override and disable specific AngularJS Material performance settings:\n *\n *  - Disabled Theme CSS rule generations\n *  - Forces $mdAria.expectWithText() to be synchronous\n *  - Mocks $$rAF.throttle()\n *  - Captures flush exceptions from $$rAF\n */\n// eslint-disable-next-line no-shadow-restricted-names\n(function(window, angular, undefined) {\n\n  'use strict';\n\n  // Allow our code to know when they are running inside of a test so they can expose extra services\n  // that should NOT be exposed to the public but that should be tested.\n  //\n  // As an example, see input.js which exposes some animation-related methods.\n  window._mdMocksIncluded = true;\n\n  /**\n   * @ngdoc module\n   * @name ngMaterial-mock\n   * @packageName angular-material-mocks\n   *\n   * @description\n   * The `ngMaterial-mock` module provides support\n   */\n  angular.module('ngMaterial-mock', ['ngMock', 'ngAnimateMock', 'material.core']).config([\n    '$provide',\n    function($provide) {\n      $provide.factory('$material', [\n        '$animate', '$timeout',\n        function($animate, $timeout) {\n          return {\n            flushOutstandingAnimations: function() {\n              // this code is placed in a try-catch statement\n              // since 1.3 and 1.4 handle their animations differently\n              // and there may be situations where follow-up animations\n              // are run in one version and not the other\n              try {\n                $animate.flush();\n                // eslint-disable-next-line no-empty\n              } catch (e) {}\n            },\n            flushInterimElement: function() {\n              this.flushOutstandingAnimations();\n              $timeout.flush();\n              this.flushOutstandingAnimations();\n              $timeout.flush();\n              this.flushOutstandingAnimations();\n              $timeout.flush();\n            }\n          };\n        }\n      ]);\n\n      /**\n       * AngularJS Material dynamically generates Style tags\n       * based on themes and palettes; for each ng-app.\n       *\n       * For testing, we want to disable generation and\n       * <style> DOM injections. So we clear the huge THEME\n       * styles while testing...\n       */\n      $provide.constant('$MD_THEME_CSS', '/**/');\n\n      /**\n       * Add throttle() and wrap .flush() to catch `no callbacks present`\n       * errors\n       */\n      $provide.decorator('$$rAF', function throttleInjector($delegate) {\n        $delegate.throttle = function(cb) {\n          return function() {\n            cb.apply(this, arguments);\n          };\n        };\n\n        const ngFlush = $delegate.flush;\n        $delegate.flush = function() {\n          try {\n            ngFlush();\n            // eslint-disable-next-line no-empty\n          } catch (e) {}\n        };\n\n        return $delegate;\n      });\n\n      /**\n       * Capture $timeout.flush() errors: \"No deferred tasks to be flushed\"\n       * errors\n       */\n      $provide.decorator('$timeout', function throttleInjector($delegate) {\n        const ngFlush = $delegate.flush;\n        $delegate.flush = function() {\n          const args = Array.prototype.slice.call(arguments);\n          try {\n            ngFlush.apply($delegate, args);\n            // eslint-disable-next-line no-empty\n          } catch (e) {}\n        };\n\n        return $delegate;\n      });\n    }\n  ]);\n\n  /**\n   * Stylesheet Mocks used by `animateCss.spec.js`\n   */\n  window.createMockStyleSheet = function createMockStyleSheet(doc, wind) {\n    doc = doc ? doc[0] : window.document;\n    wind = wind || window;\n\n    const node = doc.createElement('style');\n    const head = doc.getElementsByTagName('head')[0];\n    head.appendChild(node);\n\n    const ss = doc.styleSheets[doc.styleSheets.length - 1];\n\n    return {\n      addRule: function(selector, styles) {\n        styles = addVendorPrefix(styles);\n\n        try {\n          ss.insertRule(selector + '{ ' + styles + '}', 0);\n        } catch (e) {\n          try {\n            ss.addRule(selector, styles);\n            // eslint-disable-next-line no-empty\n          } catch (e2) {}\n        }\n      },\n\n      destroy: function() {\n        head.removeChild(node);\n      }\n    };\n\n    /**\n     * Decompose styles, attached specific vendor prefixes\n     * and recompose...\n     * e.g.\n     *    'transition:0.5s linear all; font-size:100px;'\n     * becomes\n     *    '-webkit-transition:0.5s linear all; transition:0.5s linear all; font-size:100px;'\n     */\n    function addVendorPrefix(styles) {\n      const cache = {};\n\n      // Decompose into cache registry\n      styles.match(/([-A-Za-z]*)\\w:\\w*([A-Za-z0-9.\\-\\s]*)/gi).forEach(function(style) {\n        const pair = style.split(':');\n        const key = pair[0];\n\n        switch (key) {\n          case 'transition':\n          case 'transform':\n          case 'animation':\n          case 'transition-duration':\n          case 'animation-duration':\n            cache[key] = cache['-webkit-' + key] = pair[1];\n            break;\n          default:\n            cache[key] = pair[1];\n        }\n      });\n\n      // Recompose full style object (as string)\n      styles = '';\n      angular.forEach(cache, function(value, key) {\n        styles = styles + key + ':' + value + '; ';\n      });\n\n      return styles;\n    }\n  };\n})(window, window.angular);\n"
  },
  {
    "path": "test/angular-material-spec.js",
    "content": "/**\n * angular-material-spec.js\n *\n * This Jasmine configuration file is used internally for testing the\n * unit test files: \"\\angular\\material\\src\\**\\*.spec.js\".\n */\n(function() {\n\n  let enableAnimations;\n\n  beforeAll(function() {\n    /**\n     * Add special matchers used in the AngularJS-Material spec.\n     */\n    jasmine.addMatchers({\n\n      /**\n       * Asserts that an element has a given class name.\n       * Accepts any of:\n       *   {string} - A CSS selector.\n       *   {angular.JQLite} - The result of a jQuery query.\n       *   {Element} - A DOM element.\n       */\n      toHaveClass: function() {\n        return {\n          compare: function(actual, expected) {\n            const results = {pass: true};\n            const classes = expected.trim().split(/\\s+/);\n\n            for (let i = 0; i < classes.length; ++i) {\n              if (!getElement(actual).hasClass(classes[i])) {\n                results.pass = false;\n              }\n            }\n\n            const negation = !results.pass ? '' : ' not ';\n\n            results.message = '';\n            results.message += 'Expected \\'';\n            results.message += angular.mock.dump(actual);\n            results.message += '\\'' + negation + 'to have class \\'' + expected + '\\'.';\n\n            return results;\n          }\n        };\n      },\n\n      /**\n       * A helper to match the type of a given value\n       * @example expect(1).toBeOfType('number')\n       */\n      toBeOfType: function(type) {\n        return {\n          compare: function(actual, expected) {\n            const results = {pass: typeof actual == expected};\n\n            const negation = !results.pass ? '' : ' not ';\n\n            results.message = '';\n            results.message += 'Expected ';\n            results.message += angular.mock.dump(actual) + ' of type ';\n            results.message += (typeof actual);\n            results.message += negation + 'to have type \\'' + type + '\\'.';\n\n            return results;\n          }\n        };\n      },\n\n      toHaveFields: function() {\n        return {\n          compare: function(actual, expected) {\n            const results = {pass: true};\n\n            for (const key in expected) {\n              if (!(actual || {}).hasOwnProperty(key) ||\n                  !angular.equals(actual[key], expected[key])) {\n                results.pass = false;\n              }\n            }\n\n            const negation = !results.pass ? '' : ' not ';\n\n            results.message = '';\n            results.message += 'Expected ';\n            results.message += angular.mock.dump(actual) + ' of type ';\n            results.message += (typeof actual);\n            results.message += negation + 'to have fields matching \\'' + angular.mock.dump(expected);\n\n            return results;\n          }\n        };\n      },\n\n      /**\n       * Asserts that an element has keyboard focus in the DOM.\n       * Accepts any of:\n       *   {string} - A CSS selector.\n       *   {angular.JQLite} - The result of a jQuery query.\n       *   {Element} - A DOM element.\n       */\n      toBeFocused: function() {\n        return {\n          'compare': function(actual) {\n            const pass = getElement(actual)[0] === document.activeElement;\n            const not = pass ? 'not ' : '';\n            return {'pass': pass, 'message': 'Expected element ' + not + 'to have focus.'};\n          }\n        };\n      },\n\n      /**\n       * Asserts that a given selector matches one or more items.\n       * Accepts any of:\n       *   {string} - A CSS selector.\n       *   {angular.JQLite} - The result of a jQuery query.\n       *   {Element} - A DOM element.\n       */\n      toExist: function() {\n        return {\n          compare: function(actual) {\n            const el = getElement(actual);\n            const pass = el.length > 0;\n            const not = pass ? 'not ' : '';\n\n            return {\n              pass: pass,\n              message: 'Expected \"' + actual + '\" ' + not + 'to match element(s), ' +\n                  'but found ' + el.length + ' items in the DOM'\n            };\n          }\n        };\n      },\n\n      /**\n       * Asserts that a given element contains a given substring in\n       * its innerHTML property.\n       * Accepts any of:\n       *   {string} - A CSS selector.\n       *   {angular.JQLite} - The result of a jQuery query.\n       *   {Element} - A DOM element.\n       */\n      toContainHtml: function() {\n        return {\n          compare: function(actual, expected) {\n            const el = getElement(actual);\n            const html = el.html();\n            const pass = html.indexOf(expected) !== -1;\n            const not = pass ? 'not ' : '';\n\n            return {\n              pass: pass,\n              message: 'Expected element ' + not + 'to contain the html ' +\n                  '[' + expected + '] in [' + html + ']'\n            };\n          }\n        };\n      }\n    });\n\n    /**\n     * Mocks the focus method from the HTMLElement prototype for the duration\n     * of the running test.\n     *\n     * The mock will be automatically removed after the test finished.\n     *\n     * @example\n     *\n     * it('some focus test', inject(function($document)\n     * {\n     *   jasmine.mockElementFocus(this); // 'this' is the test instance\n     *\n     *   doSomething();\n     *   expect($document.activeElement).toBe(someElement[0]);\n     *\n     * }));\n     */\n    jasmine.mockElementFocus = function() {\n      const _focusFn = HTMLElement.prototype.focus;\n\n      inject(function($document) {\n        HTMLElement.prototype.focus = function() {\n          $document.activeElement = this;\n        };\n      });\n\n      // Un-mock focus after the test is done\n      afterEach(function() {\n        HTMLElement.prototype.focus = _focusFn;\n      });\n    };\n\n    /**\n     * Returns the angular element associated with a css selector or element.\n     * @param el {string|!JQLite|!Element}\n     * @returns {JQLite}\n     */\n    function getElement(el) {\n      const queryResult = angular.isString(el) ? document.querySelector(el) : el;\n      return angular.element(queryResult);\n    }\n  });\n\n  afterEach(function() {\n    enableAnimations && enableAnimations();\n    enableAnimations = null;\n  });\n\n  beforeEach(function() {\n    /**\n     * Before each test, require that the 'ngMaterial-mock' module is ready for injection\n     * NOTE: assumes that angular-material-mocks.js has been loaded.\n     */\n    module('ngAnimate');\n    module('ngMaterial-mock');\n\n    module(function() {\n      return function($mdUtil, $rootElement, $document, $animate) {\n        const DISABLE_ANIMATIONS = 'disable_animations';\n\n        // Create special animation 'stop' function used\n        // to set 0ms durations for all animations and transitions\n\n        window.disableAnimations = function disableAnimations() {\n          const body = angular.element($document[0].body);\n          const head = angular.element($document[0].getElementsByTagName('head')[0]);\n          const styleSheet = angular.element(buildStopTransitions());\n\n          $animate.enabled(false);\n\n          head.prepend(styleSheet);\n          body.addClass(DISABLE_ANIMATIONS);\n\n          // Prepare auto-restore\n          enableAnimations = function() {\n            body.removeClass(DISABLE_ANIMATIONS);\n            styleSheet.remove();\n          };\n        };\n\n        /**\n         * Build stylesheet to set all transition and animation\n         * durations' to zero.\n         */\n        function buildStopTransitions() {\n          const style = '<style> .{0} * { {1} }</style>';\n\n          return $mdUtil.supplant(style, [\n            DISABLE_ANIMATIONS,\n            'transition -webkit-transition animation -webkit-animation'.split(' ')\n                .map(function(key) {\n                  return $mdUtil.supplant('{0}: 0s none !important', [key]);\n                })\n                .join('; ')\n          ]);\n        }\n      };\n    });\n  });\n})();\n"
  },
  {
    "path": "updateVersionPicker.js",
    "content": "(function () {\n  'use strict';\n\n  const child_process = require('child_process');\n  const defaultOptions = { encoding: 'utf-8' };\n\n  exec([\n      'git checkout master',\n      'rm -rf /tmp/ngcode',\n      'git clone https://github.com/angular/code.material.angularjs.org.git --depth=1 /tmp/ngcode'\n  ]);\n\n  const docs = require('/tmp/ngcode/docs.json');\n\n  docs.versions.forEach(function (version) {\n    exec([\n      'rm -rf dist',\n      'git checkout v' + version,\n      'npm install',\n      checkout('app/js/app.js'),\n      checkout('app/css/style.css'),\n      checkout('app/img/icons'),\n      checkout('app/partials'),\n      checkout('config/template/index.template.html'),\n      'gulp docs --release',\n      'cp -r dist/docs/docs.js /tmp/ngcode/' + version,\n      'cp -r dist/docs/docs.css /tmp/ngcode/' + version,\n      'cp -r dist/docs/index.html /tmp/ngcode/' + version,\n      'cp -r dist/docs/img/icons/* /tmp/ngcode/' + version + '/img/icons',\n      'git checkout master'\n    ]);\n    function checkout (filename) {\n      return 'git checkout origin/master -- docs/' + filename;\n    }\n  });\n  exec([\n      'ls',\n      'rm -rf latest',\n      `cp -r ${docs.latest} latest`,\n      'git add -A',\n      'git commit -m \"updating version picker for old releases\"',\n      'git push'\n  ], { cwd: '/tmp/ngcode' });\n\n  // utility methods\n\n  function exec (cmd, userOptions) {\n    if (cmd instanceof Array) {\n      return cmd.map(function (cmd) { return exec(cmd, userOptions); });\n    }\n    try {\n      const options = Object.create(defaultOptions);\n      for (const key in userOptions) options[key] = userOptions[key];\n      console.log(`\\n--------\\n ${cmd}`);\n      return console.log(child_process.execSync(cmd, options).trim());\n    } catch (err) {\n      return err;\n    }\n  }\n})();\n"
  },
  {
    "path": "watch-hook.sh",
    "content": "#!/bin/bash\n\ncd \"$(dirname \"$0\")\"\n\n#\n# spawns the hook, and restarts it if it goes down\n#\n# See: https://github.com/nodejitsu/forever\n#\nforever start -c bash start-hook.sh\n"
  }
]